diff options
| author | bors <bors@rust-lang.org> | 2020-12-30 09:51:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-12-30 09:51:42 +0000 |
| commit | d107a87d34c1fc3521aaab7a2576ffbaf59cb2cb (patch) | |
| tree | a4ea1c022cc428edb66f77ac2661f5eb2e3aa227 /src/test | |
| parent | b9c403be11bef38638b38012be80444ad3f09dde (diff) | |
| parent | 3812909919bd8a2a65b825acbb27f9f7748f626d (diff) | |
Auto merge of #80503 - JohnTitor:rollup-b26vglu, r=JohnTitor
Rollup of 13 pull requests Successful merges: - #79812 (Lint on redundant trailing semicolon after item) - #80348 (remove redundant clones (clippy::redundant_clone)) - #80358 (Edit rustc_span documentation) - #80457 (Add missing commas to `rustc_ast_pretty::pp` docs) - #80461 (Add llvm-libunwind change to bootstrap CHANGELOG) - #80464 (Use Option::map_or instead of open coding it) - #80465 (Fix typo in ffi-pure.md) - #80467 (More uses of the matches! macro) - #80469 (Fix small typo in time comment) - #80472 (Use sans-serif font for the "all items" page links) - #80477 (Make forget intrinsic safe) - #80482 (don't clone copy types) - #80487 (don't redundantly repeat field names) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
4 files changed, 32 insertions, 22 deletions
diff --git a/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff index e9cc72f2138..096bba64c0b 100644 --- a/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff +++ b/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff @@ -4,27 +4,21 @@ fn forget(_1: T) -> () { debug t => _1; // in scope 0 at $DIR/lower_intrinsics.rs:18:18: 18:19 let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:18:24: 18:24 - let _2: (); // in scope 0 at $DIR/lower_intrinsics.rs:19:14: 19:41 - let mut _3: T; // in scope 0 at $DIR/lower_intrinsics.rs:19:39: 19:40 - scope 1 { - } + let mut _2: T; // in scope 0 at $DIR/lower_intrinsics.rs:19:30: 19:31 bb0: { - StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:19:5: 19:43 - StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:19:39: 19:40 - _3 = move _1; // scope 1 at $DIR/lower_intrinsics.rs:19:39: 19:40 -- _2 = std::intrinsics::forget::<T>(move _3) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:19:14: 19:41 + StorageLive(_2); // scope 0 at $DIR/lower_intrinsics.rs:19:30: 19:31 + _2 = move _1; // scope 0 at $DIR/lower_intrinsics.rs:19:30: 19:31 +- _0 = std::intrinsics::forget::<T>(move _2) -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:19:5: 19:32 - // mir::Constant -- // + span: $DIR/lower_intrinsics.rs:19:14: 19:38 -- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(T) {std::intrinsics::forget::<T>}, val: Value(Scalar(<ZST>)) } -+ _2 = const (); // scope 1 at $DIR/lower_intrinsics.rs:19:14: 19:41 -+ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:19:14: 19:41 +- // + span: $DIR/lower_intrinsics.rs:19:5: 19:29 +- // + literal: Const { ty: extern "rust-intrinsic" fn(T) {std::intrinsics::forget::<T>}, val: Value(Scalar(<ZST>)) } ++ _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:19:5: 19:32 ++ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:19:5: 19:32 } bb1: { - StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:19:40: 19:41 - StorageDead(_2); // scope 0 at $DIR/lower_intrinsics.rs:19:43: 19:44 - _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:18:24: 20:2 + StorageDead(_2); // scope 0 at $DIR/lower_intrinsics.rs:19:31: 19:32 goto -> bb2; // scope 0 at $DIR/lower_intrinsics.rs:20:1: 20:2 } diff --git a/src/test/mir-opt/lower_intrinsics.rs b/src/test/mir-opt/lower_intrinsics.rs index 8d28354a5f1..d9891465dab 100644 --- a/src/test/mir-opt/lower_intrinsics.rs +++ b/src/test/mir-opt/lower_intrinsics.rs @@ -16,7 +16,7 @@ pub fn size_of<T>() -> usize { // EMIT_MIR lower_intrinsics.forget.LowerIntrinsics.diff pub fn forget<T>(t: T) { - unsafe { core::intrinsics::forget(t) }; + core::intrinsics::forget(t) } // EMIT_MIR lower_intrinsics.unreachable.LowerIntrinsics.diff diff --git a/src/test/ui/lint/redundant-semicolon/item-stmt-semi.rs b/src/test/ui/lint/redundant-semicolon/item-stmt-semi.rs index 4592bc31a39..8c79630b7fd 100644 --- a/src/test/ui/lint/redundant-semicolon/item-stmt-semi.rs +++ b/src/test/ui/lint/redundant-semicolon/item-stmt-semi.rs @@ -1,10 +1,6 @@ -// check-pass -// This test should stop compiling -// we decide to enable this lint for item statements. - #![deny(redundant_semicolons)] fn main() { - fn inner() {}; - struct Bar {}; + fn inner() {}; //~ ERROR unnecessary + struct Bar {}; //~ ERROR unnecessary } diff --git a/src/test/ui/lint/redundant-semicolon/item-stmt-semi.stderr b/src/test/ui/lint/redundant-semicolon/item-stmt-semi.stderr new file mode 100644 index 00000000000..451b152cbe5 --- /dev/null +++ b/src/test/ui/lint/redundant-semicolon/item-stmt-semi.stderr @@ -0,0 +1,20 @@ +error: unnecessary trailing semicolon + --> $DIR/item-stmt-semi.rs:4:18 + | +LL | fn inner() {}; + | ^ help: remove this semicolon + | +note: the lint level is defined here + --> $DIR/item-stmt-semi.rs:1:9 + | +LL | #![deny(redundant_semicolons)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unnecessary trailing semicolon + --> $DIR/item-stmt-semi.rs:5:18 + | +LL | struct Bar {}; + | ^ help: remove this semicolon + +error: aborting due to 2 previous errors + |
