diff options
Diffstat (limited to 'src/test/ui/span')
21 files changed, 164 insertions, 785 deletions
diff --git a/src/test/ui/span/E0072.stderr b/src/test/ui/span/E0072.stderr index 882ed577c..20f2e0df0 100644 --- a/src/test/ui/span/E0072.stderr +++ b/src/test/ui/span/E0072.stderr @@ -2,12 +2,12 @@ error[E0072]: recursive type `ListNode` has infinite size --> $DIR/E0072.rs:1:1 | LL | struct ListNode { - | ^^^^^^^^^^^^^^^ recursive type has infinite size + | ^^^^^^^^^^^^^^^ LL | head: u8, LL | tail: Option<ListNode>, - | ---------------- recursive without indirection + | -------- recursive without indirection | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | LL | tail: Option<Box<ListNode>>, | ++++ + diff --git a/src/test/ui/span/E0204.stderr b/src/test/ui/span/E0204.stderr index 257584843..0b2166eed 100644 --- a/src/test/ui/span/E0204.stderr +++ b/src/test/ui/span/E0204.stderr @@ -1,11 +1,11 @@ error[E0204]: the trait `Copy` may not be implemented for this type - --> $DIR/E0204.rs:5:6 + --> $DIR/E0204.rs:5:15 | LL | foo: Vec<u32>, | ------------- this field does not implement `Copy` ... LL | impl Copy for Foo { } - | ^^^^ + | ^^^ error[E0204]: the trait `Copy` may not be implemented for this type --> $DIR/E0204.rs:7:10 @@ -19,13 +19,13 @@ LL | ty: &'a mut bool, = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0204]: the trait `Copy` may not be implemented for this type - --> $DIR/E0204.rs:17:6 + --> $DIR/E0204.rs:17:15 | LL | Bar { x: Vec<u32> }, | ----------- this field does not implement `Copy` ... LL | impl Copy for EFoo { } - | ^^^^ + | ^^^^ error[E0204]: the trait `Copy` may not be implemented for this type --> $DIR/E0204.rs:19:10 diff --git a/src/test/ui/span/E0493.rs b/src/test/ui/span/E0493.rs index ad4100205..625da25a7 100644 --- a/src/test/ui/span/E0493.rs +++ b/src/test/ui/span/E0493.rs @@ -15,7 +15,7 @@ impl Drop for Bar { } const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1; -//~^ destructors cannot be evaluated at compile-time +//~^ ERROR destructor of fn main() { } diff --git a/src/test/ui/span/E0493.stderr b/src/test/ui/span/E0493.stderr index 29d1b0009..9db627562 100644 --- a/src/test/ui/span/E0493.stderr +++ b/src/test/ui/span/E0493.stderr @@ -1,10 +1,10 @@ -error[E0493]: destructors cannot be evaluated at compile-time +error[E0493]: destructor of `(Foo, Foo)` cannot be evaluated at compile-time --> $DIR/E0493.rs:17:17 | LL | const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - value is dropped here | | - | constants cannot evaluate destructors + | the destructor for this type cannot be evaluated in constants error: aborting due to previous error diff --git a/src/test/ui/span/E0535.stderr b/src/test/ui/span/E0535.stderr index f52c3f9f2..b1411bc43 100644 --- a/src/test/ui/span/E0535.stderr +++ b/src/test/ui/span/E0535.stderr @@ -3,6 +3,8 @@ error[E0535]: invalid argument | LL | #[inline(unknown)] | ^^^^^^^ + | + = help: valid inline arguments are `always` and `never` error: aborting due to previous error diff --git a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs index b280c8ab6..4559da91e 100644 --- a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs +++ b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs @@ -12,7 +12,7 @@ impl A { trait C{async fn new(val: T) {} //~ ERROR `async fn` is not permitted in Rust 2015 //~^ ERROR functions in traits cannot be declared `async` -//~^^ ERROR cannot find type `T` in this scope -//~^^^ WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures] +//~| ERROR cannot find type `T` in this scope +//~| WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures] //~ ERROR this file contains an unclosed delimiter diff --git a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr index 50de23229..df1cafdb7 100644 --- a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr +++ b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr @@ -25,16 +25,27 @@ LL | trait C{async fn new(val: T) {} = help: pass `--edition 2021` to `rustc` = note: for more on editions, read https://doc.rust-lang.org/edition-guide +error[E0412]: cannot find type `T` in this scope + --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:27 + | +LL | pub struct A {} + | ------------ similarly named struct `A` defined here +... +LL | trait C{async fn new(val: T) {} + | ^ help: a struct with a similar name exists: `A` + error[E0706]: functions in traits cannot be declared `async` --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:9 | LL | trait C{async fn new(val: T) {} - | -----^^^^^^^^^^^^^^^^^^ + | -----^^^^^^^^^^^^^^^ | | | `async` because of this | = note: `async` trait functions are not currently supported = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait + = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information + = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable error[E0423]: expected function, found module `crate` --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:9:5 @@ -42,15 +53,6 @@ error[E0423]: expected function, found module `crate` LL | crate(move || {} ).await | ^^^^^ not a function -error[E0412]: cannot find type `T` in this scope - --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:27 - | -LL | pub struct A {} - | ------------ similarly named struct `A` defined here -... -LL | trait C{async fn new(val: T) {} - | ^ help: a struct with a similar name exists: `A` - warning: changes to closure capture in Rust 2021 will affect drop order --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:6:57 | @@ -65,8 +67,8 @@ LL | | crate(move || {} ).await LL | | } | |_____^ | - = note: requested on the command line with `-W rust-2021-incompatible-closure-captures` = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html> + = note: requested on the command line with `-W rust-2021-incompatible-closure-captures` help: add a dummy let to cause `path` to be fully captured | LL | async fn create(path: impl AsRef<std::path::Path>) { let _ = &path; diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr index e676d7372..15179954a 100644 --- a/src/test/ui/span/issue-34264.stderr +++ b/src/test/ui/span/issue-34264.stderr @@ -64,7 +64,7 @@ LL | fn foo(Option<i32>, String) {} help: remove the extra argument | LL | foo(Some(42), 2); - | ~~~~~~~~~~~~~~~~ + | ~~~~~~~~~~~~~ error[E0308]: mismatched types --> $DIR/issue-34264.rs:8:13 @@ -78,7 +78,7 @@ note: function defined here --> $DIR/issue-34264.rs:3:4 | LL | fn bar(x, y: usize) {} - | ^^^ - -------- + | ^^^ -------- error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/issue-34264.rs:10:5 @@ -94,7 +94,7 @@ LL | fn bar(x, y: usize) {} help: remove the extra argument | LL | bar(1, 2); - | ~~~~~~~~~ + | ~~~~~~ error: aborting due to 6 previous errors diff --git a/src/test/ui/span/issue-35987.stderr b/src/test/ui/span/issue-35987.stderr index 2bc3ff4c3..d8fddc800 100644 --- a/src/test/ui/span/issue-35987.stderr +++ b/src/test/ui/span/issue-35987.stderr @@ -2,7 +2,9 @@ error[E0404]: expected trait, found type parameter `Add` --> $DIR/issue-35987.rs:5:21 | LL | impl<T: Clone, Add> Add for Foo<T> { - | ^^^ not a trait + | --- ^^^ not a trait + | | + | found this type parameter | help: consider importing this trait instead | diff --git a/src/test/ui/span/issue-36530.rs b/src/test/ui/span/issue-36530.rs deleted file mode 100644 index 70e04bf7e..000000000 --- a/src/test/ui/span/issue-36530.rs +++ /dev/null @@ -1,12 +0,0 @@ -// gate-test-custom_inner_attributes - -#![feature(register_attr)] - -#![register_attr(foo)] - -#[foo] -mod foo { - #![foo] //~ ERROR custom inner attributes are unstable -} - -fn main() {} diff --git a/src/test/ui/span/issue-36530.stderr b/src/test/ui/span/issue-36530.stderr deleted file mode 100644 index a998d7217..000000000 --- a/src/test/ui/span/issue-36530.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: custom inner attributes are unstable - --> $DIR/issue-36530.rs:9:8 - | -LL | #![foo] - | ^^^ - | - = note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information - = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/span/issue-7575.rs b/src/test/ui/span/issue-7575.rs deleted file mode 100644 index eddd158ae..000000000 --- a/src/test/ui/span/issue-7575.rs +++ /dev/null @@ -1,75 +0,0 @@ -// Test the mechanism for warning about possible missing `self` declarations. -trait CtxtFn { - fn f8(self, _: usize) -> usize; - fn f9(_: usize) -> usize; -} - -trait OtherTrait { - fn f9(_: usize) -> usize; -} - -// Note: this trait is not implemented, but we can't really tell -// whether or not an impl would match anyhow without a self -// declaration to match against, so we wind up prisizeing it as a -// candidate. This seems not unreasonable -- perhaps the user meant to -// implement it, after all. -trait UnusedTrait { - fn f9(_: usize) -> usize; -} - -impl CtxtFn for usize { - fn f8(self, i: usize) -> usize { - i * 4 - } - - fn f9(i: usize) -> usize { - i * 4 - } -} - -impl OtherTrait for usize { - fn f9(i: usize) -> usize { - i * 8 - } -} - -struct Myisize(isize); - -impl Myisize { - fn fff(i: isize) -> isize { - i - } -} - -trait ManyImplTrait { - fn is_str() -> bool { - false - } -} - -impl ManyImplTrait for String { - fn is_str() -> bool { - true - } -} - -impl ManyImplTrait for usize {} -impl ManyImplTrait for isize {} -impl ManyImplTrait for char {} -impl ManyImplTrait for Myisize {} - -fn no_param_bound(u: usize, m: Myisize) -> usize { - u.f8(42) + u.f9(342) + m.fff(42) - //~^ ERROR no method named `f9` found - //~| ERROR no method named `fff` found - - -} - -fn param_bound<T: ManyImplTrait>(t: T) -> bool { - t.is_str() - //~^ ERROR no method named `is_str` found -} - -fn main() { -} diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr deleted file mode 100644 index 4f30edb3f..000000000 --- a/src/test/ui/span/issue-7575.stderr +++ /dev/null @@ -1,82 +0,0 @@ -error[E0599]: no method named `f9` found for type `usize` in the current scope - --> $DIR/issue-7575.rs:62:18 - | -LL | u.f8(42) + u.f9(342) + m.fff(42) - | ^^ this is an associated function, not a method - | - = note: found the following associated functions; to be used as methods, functions must have a `self` parameter -note: candidate #1 is defined in the trait `CtxtFn` - --> $DIR/issue-7575.rs:4:5 - | -LL | fn f9(_: usize) -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -note: candidate #2 is defined in the trait `OtherTrait` - --> $DIR/issue-7575.rs:8:5 - | -LL | fn f9(_: usize) -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -note: candidate #3 is defined in the trait `UnusedTrait` - --> $DIR/issue-7575.rs:17:5 - | -LL | fn f9(_: usize) -> usize; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - = help: items from traits can only be used if the trait is implemented and in scope - = note: the following traits define an item `f9`, perhaps you need to implement one of them: - candidate #1: `CtxtFn` - candidate #2: `OtherTrait` - candidate #3: `UnusedTrait` -help: disambiguate the associated function for candidate #1 - | -LL | u.f8(42) + <usize as CtxtFn>::f9(u, 342) + m.fff(42) - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -help: disambiguate the associated function for candidate #2 - | -LL | u.f8(42) + <usize as OtherTrait>::f9(u, 342) + m.fff(42) - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -help: disambiguate the associated function for candidate #3 - | -LL | u.f8(42) + <usize as UnusedTrait>::f9(u, 342) + m.fff(42) - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0599]: no method named `fff` found for struct `Myisize` in the current scope - --> $DIR/issue-7575.rs:62:30 - | -LL | struct Myisize(isize); - | -------------- method `fff` not found for this struct -... -LL | u.f8(42) + u.f9(342) + m.fff(42) - | --^^^ - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `Myisize::fff` - | - = note: found the following associated functions; to be used as methods, functions must have a `self` parameter -note: the candidate is defined in an impl for the type `Myisize` - --> $DIR/issue-7575.rs:39:5 - | -LL | fn fff(i: isize) -> isize { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0599]: no method named `is_str` found for type parameter `T` in the current scope - --> $DIR/issue-7575.rs:70:7 - | -LL | fn param_bound<T: ManyImplTrait>(t: T) -> bool { - | - method `is_str` not found for this type parameter -LL | t.is_str() - | ^^^^^^ this is an associated function, not a method - | - = note: found the following associated functions; to be used as methods, functions must have a `self` parameter -note: the candidate is defined in the trait `ManyImplTrait` - --> $DIR/issue-7575.rs:45:5 - | -LL | fn is_str() -> bool { - | ^^^^^^^^^^^^^^^^^^^ - = help: items from traits can only be used if the type parameter is bounded by the trait -help: disambiguate the associated function for the candidate - | -LL | <T as ManyImplTrait>::is_str(t) - | - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/span/lint-unused-unsafe-thir.rs b/src/test/ui/span/lint-unused-unsafe-thir.rs index 95a537ed2..adb72c26b 100644 --- a/src/test/ui/span/lint-unused-unsafe-thir.rs +++ b/src/test/ui/span/lint-unused-unsafe-thir.rs @@ -22,7 +22,7 @@ fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block fn bad2() { unsafe { bad1() } } //~ ERROR: unnecessary `unsafe` block unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block fn bad4() { unsafe { callback(||{}) } } //~ ERROR: unnecessary `unsafe` block -unsafe fn bad5() { unsafe { unsf() } } //~ ERROR: unnecessary `unsafe` block +unsafe fn bad5() { unsafe { unsf() } } fn bad6() { unsafe { // don't put the warning here unsafe { //~ ERROR: unnecessary `unsafe` block @@ -31,7 +31,7 @@ fn bad6() { } } unsafe fn bad7() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { unsafe { //~ ERROR: unnecessary `unsafe` block unsf() } diff --git a/src/test/ui/span/lint-unused-unsafe-thir.stderr b/src/test/ui/span/lint-unused-unsafe-thir.stderr index 6654910c5..3bcbb7597 100644 --- a/src/test/ui/span/lint-unused-unsafe-thir.stderr +++ b/src/test/ui/span/lint-unused-unsafe-thir.stderr @@ -31,14 +31,6 @@ LL | fn bad4() { unsafe { callback(||{}) } } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe-thir.rs:25:20 - | -LL | unsafe fn bad5() { unsafe { unsf() } } - | ---------------- ^^^^^^ unnecessary `unsafe` block - | | - | because it's nested under this `unsafe` fn - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe-thir.rs:28:9 | LL | unsafe { // don't put the warning here @@ -54,13 +46,5 @@ LL | unsafe { LL | unsafe { | ^^^^^^ unnecessary `unsafe` block -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe-thir.rs:34:5 - | -LL | unsafe fn bad7() { - | ---------------- because it's nested under this `unsafe` fn -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: aborting due to 8 previous errors +error: aborting due to 6 previous errors diff --git a/src/test/ui/span/lint-unused-unsafe.mir.stderr b/src/test/ui/span/lint-unused-unsafe.mir.stderr index 850550a1d..d8412908c 100644 --- a/src/test/ui/span/lint-unused-unsafe.mir.stderr +++ b/src/test/ui/span/lint-unused-unsafe.mir.stderr @@ -29,17 +29,6 @@ LL | fn bad4() { unsafe { callback(||{}) } } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:30:20 - | -LL | unsafe fn bad5() { unsafe { unsf() } } - | ---------------- ^^^^^^ unnecessary `unsafe` block - | | - | because it's nested under this `unsafe` fn - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - = note: `#[allow(unsafe_op_in_unsafe_fn)]` on by default - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:32:5 | LL | unsafe { @@ -52,17 +41,6 @@ LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:40:9 - | -LL | unsafe fn bad7() { - | ---------------- because it's nested under this `unsafe` fn -LL | unsafe { -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:74:9 | LL | unsafe { @@ -273,90 +251,31 @@ LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:197:13 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -LL | unsafe { -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:194:13 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:198:13 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:199:13 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:205:9 - | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:203:13 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:207:13 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -... +LL | unsafe { + | ------ because it's nested under this `unsafe` block +LL | unsf(); LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:208:13 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | unsafe { + | ------ because it's nested under this `unsafe` block ... LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:209:13 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | unsafe { + | ------ because it's nested under this `unsafe` block ... LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:220:17 @@ -398,19 +317,12 @@ LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:254:9 + --> $DIR/lint-unused-unsafe.rs:255:13 | -LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() { - | ----------------------------------------------- because it's nested under this `unsafe` fn LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:252:13 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ------ because it's nested under this `unsafe` block +LL | unsafe { + | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:268:13 @@ -631,90 +543,31 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:409:24 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -LL | let _ = || unsafe { -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:406:13 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:410:24 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:411:24 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:417:20 - | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:415:13 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:419:24 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -... +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block +LL | unsf(); LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:420:24 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:421:24 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:432:28 @@ -756,19 +609,12 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:466:20 + --> $DIR/lint-unused-unsafe.rs:467:24 | -LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() { - | ----------------------------------------------- because it's nested under this `unsafe` fn LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:464:13 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ------ because it's nested under this `unsafe` block +LL | let _ = || unsafe { + | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:480:24 @@ -989,90 +835,31 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:622:24 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -LL | let _ = || unsafe { -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:619:13 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:623:24 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:624:24 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:630:20 - | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:628:13 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:632:24 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -... +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block +LL | let _ = || unsf(); LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:633:24 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:634:24 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:645:28 @@ -1114,19 +901,12 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:679:20 + --> $DIR/lint-unused-unsafe.rs:680:24 | -LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() { - | ----------------------------------------------- because it's nested under this `unsafe` fn LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:677:13 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ------ because it's nested under this `unsafe` block +LL | let _ = || unsafe { + | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:693:24 @@ -1257,90 +1037,31 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:784:28 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -LL | let _ = || unsafe { -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:781:17 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:785:28 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:786:28 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:792:24 - | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:790:17 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:794:28 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -... +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block +LL | unsf(); LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:795:28 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:796:28 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:807:32 @@ -1382,19 +1103,12 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:841:24 + --> $DIR/lint-unused-unsafe.rs:842:28 | -LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() { - | ----------------------------------------------- because it's nested under this `unsafe` fn LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:839:17 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ------ because it's nested under this `unsafe` block +LL | let _ = || unsafe { + | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:855:28 @@ -1525,90 +1239,31 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:942:28 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -LL | let _ = || unsafe { -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:939:17 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:943:28 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:944:28 - | -LL | unsafe fn granularity_2() { - | ------------------------- because it's nested under this `unsafe` fn -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:950:24 - | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:948:17 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:952:28 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn -... +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block +LL | unsf(); LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:953:28 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:954:28 | -LL | unsafe fn top_level_used_2() { - | ---------------------------- because it's nested under this `unsafe` fn +LL | let _ = || unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:965:32 @@ -1650,19 +1305,12 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:999:24 + --> $DIR/lint-unused-unsafe.rs:1000:28 | -LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() { - | ----------------------------------------------- because it's nested under this `unsafe` fn LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:997:17 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ + | ------ because it's nested under this `unsafe` block +LL | let _ = || unsafe { + | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:1013:28 @@ -1673,21 +1321,6 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1044:9 - | -LL | unsafe fn multiple_unsafe_op_in_unsafe_fn_allows() { - | -------------------------------------------------- because it's nested under this `unsafe` fn -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:1045:21 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:1059:29 | LL | let _ = async { unsafe { @@ -1727,86 +1360,31 @@ LL | let _ = async { unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1074:33 - | -LL | async unsafe fn async_blocks() { - | ------------------------------ because it's nested under this `unsafe` fn -... -LL | let _ = async { unsafe { let _ = async { unsf() }; }}; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:1071:17 - | -LL | #[allow(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1075:33 - | -LL | async unsafe fn async_blocks() { - | ------------------------------ because it's nested under this `unsafe` fn -... -LL | let _ = async { unsafe { let _ = async { unsf() }; }}; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1076:33 - | -LL | async unsafe fn async_blocks() { - | ------------------------------ because it's nested under this `unsafe` fn -... -LL | let _ = async { unsafe { let _ = async { unsf() }; }}; - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1078:29 - | -LL | async unsafe fn async_blocks() { - | ------------------------------ because it's nested under this `unsafe` fn -... -LL | let _ = async { unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` - -error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:1080:33 | -LL | async unsafe fn async_blocks() { - | ------------------------------ because it's nested under this `unsafe` fn -... +LL | let _ = async { unsafe { + | ------ because it's nested under this `unsafe` block +LL | let _ = async { unsf() }; LL | let _ = async { unsafe { let _ = async { unsf() }; }}; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:1081:33 | -LL | async unsafe fn async_blocks() { - | ------------------------------ because it's nested under this `unsafe` fn +LL | let _ = async { unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = async { unsafe { let _ = async { unsf() }; }}; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:1082:33 | -LL | async unsafe fn async_blocks() { - | ------------------------------ because it's nested under this `unsafe` fn +LL | let _ = async { unsafe { + | ------ because it's nested under this `unsafe` block ... LL | let _ = async { unsafe { let _ = async { unsf() }; }}; | ^^^^^^ unnecessary `unsafe` block - | - = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn` error: unnecessary `unsafe` block --> $DIR/lint-unused-unsafe.rs:1092:22 @@ -1820,5 +1398,5 @@ error: unnecessary `unsafe` block LL | let _x: [(); unsafe { unsafe { size() } }] = []; | ^^^^^^ unnecessary `unsafe` block -error: aborting due to 201 previous errors +error: aborting due to 174 previous errors diff --git a/src/test/ui/span/lint-unused-unsafe.rs b/src/test/ui/span/lint-unused-unsafe.rs index f8d1dff35..5d042768b 100644 --- a/src/test/ui/span/lint-unused-unsafe.rs +++ b/src/test/ui/span/lint-unused-unsafe.rs @@ -27,7 +27,7 @@ fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block fn bad2() { unsafe { bad1() } } //~ ERROR: unnecessary `unsafe` block unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block fn bad4() { unsafe { callback(||{}) } } //~ ERROR: unnecessary `unsafe` block -unsafe fn bad5() { unsafe { unsf() } } //~ ERROR: unnecessary `unsafe` block +unsafe fn bad5() { unsafe { unsf() } } fn bad6() { unsafe { //~ ERROR: unnecessary `unsafe` block unsafe { // don't put the warning here @@ -37,7 +37,7 @@ fn bad6() { } unsafe fn bad7() { unsafe { //~ ERROR: unnecessary `unsafe` block - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { unsf() } } @@ -194,15 +194,15 @@ mod additional_tests { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { unsafe { //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block - unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block + unsafe { unsf() } + unsafe { unsf() } + unsafe { unsf() } } } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn top_level_used_2() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { unsf(); unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block @@ -251,8 +251,8 @@ mod additional_tests { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { - unsafe { //~ ERROR: unnecessary `unsafe` block - unsafe { + unsafe { + unsafe { //~ ERROR: unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { unsf(); @@ -406,15 +406,15 @@ mod additional_tests_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; + let _ = || unsafe { unsf() }; + let _ = || unsafe { unsf() }; }; } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn top_level_used_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf(); let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block @@ -463,8 +463,8 @@ mod additional_tests_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { + let _ = || unsafe { + let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { unsf(); @@ -619,15 +619,15 @@ mod additional_tests_even_more_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); }; + let _ = || unsafe { let _ = || unsf(); }; + let _ = || unsafe { let _ = || unsf(); }; }; } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn top_level_used_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { let _ = || unsf(); let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block @@ -676,8 +676,8 @@ mod additional_tests_even_more_closures { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { + let _ = || unsafe { + let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { let _ = || unsf(); @@ -781,15 +781,15 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; + let _ = || unsafe { unsf() }; + let _ = || unsafe { unsf() }; }; } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn top_level_used_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf(); let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block @@ -838,8 +838,8 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { + let _ = || unsafe { + let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { unsf(); @@ -939,15 +939,15 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granularity_2() { let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf() }; + let _ = || unsafe { unsf() }; + let _ = || unsafe { unsf() }; }; } #[allow(unsafe_op_in_unsafe_fn)] unsafe fn top_level_used_2() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = || unsafe { unsf(); let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block @@ -996,8 +996,8 @@ mod item_likes { #[allow(unsafe_op_in_unsafe_fn)] unsafe fn granular_disallow_op_in_unsafe_fn_3() { - let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = || unsafe { + let _ = || unsafe { + let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block #[deny(unsafe_op_in_unsafe_fn)] { unsf(); @@ -1041,7 +1041,7 @@ mod additional_tests_extra { #[warn(unsafe_op_in_unsafe_fn)] unsafe fn multiple_unsafe_op_in_unsafe_fn_allows() { - unsafe { //~ ERROR: unnecessary `unsafe` block + unsafe { #[allow(unsafe_op_in_unsafe_fn)] { unsf(); @@ -1071,11 +1071,11 @@ mod additional_tests_extra { #[allow(unsafe_op_in_unsafe_fn)] { let _ = async { unsafe { //~ ERROR: unnecessary `unsafe` block - let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block - let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block - let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block + let _ = async { unsafe { let _ = async { unsf() }; }}; + let _ = async { unsafe { let _ = async { unsf() }; }}; + let _ = async { unsafe { let _ = async { unsf() }; }}; }}; - let _ = async { unsafe { //~ ERROR: unnecessary `unsafe` block + let _ = async { unsafe { let _ = async { unsf() }; let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block diff --git a/src/test/ui/span/missing-unit-argument.stderr b/src/test/ui/span/missing-unit-argument.stderr index e68260e4a..b76a3ab30 100644 --- a/src/test/ui/span/missing-unit-argument.stderr +++ b/src/test/ui/span/missing-unit-argument.stderr @@ -12,7 +12,7 @@ LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), help: provide the argument | LL | let _: Result<(), String> = Ok(()); - | ~~~~~~ + | ~~~~ error[E0061]: this function takes 2 arguments but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:12:5 @@ -28,7 +28,7 @@ LL | fn foo(():(), ():()) {} help: provide the arguments | LL | foo((), ()); - | ~~~~~~~~~~~ + | ~~~~~~~~ error[E0061]: this function takes 2 arguments but 1 argument was supplied --> $DIR/missing-unit-argument.rs:13:5 @@ -44,7 +44,7 @@ LL | fn foo(():(), ():()) {} help: provide the argument | LL | foo((), ()); - | ~~~~~~~~~~~ + | ~~~~~~~~ error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:14:5 @@ -60,7 +60,7 @@ LL | fn bar(():()) {} help: provide the argument | LL | bar(()); - | ~~~~~~~ + | ~~~~ error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:15:7 @@ -72,11 +72,11 @@ note: associated function defined here --> $DIR/missing-unit-argument.rs:6:8 | LL | fn baz(self, (): ()) { } - | ^^^ ---- ------ + | ^^^ ------ help: provide the argument | LL | S.baz(()); - | ~~~~~~~ + | ~~~~ error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/missing-unit-argument.rs:16:7 @@ -88,11 +88,11 @@ note: associated function defined here --> $DIR/missing-unit-argument.rs:7:8 | LL | fn generic<T>(self, _: T) { } - | ^^^^^^^ ---- ---- + | ^^^^^^^ ---- help: provide the argument | LL | S.generic::<()>(()); - | ~~~~~~~~~~~~~~~~~ + | ~~~~ error: aborting due to 6 previous errors diff --git a/src/test/ui/span/multiline-span-E0072.stderr b/src/test/ui/span/multiline-span-E0072.stderr index 79b13f45f..fc2f6e662 100644 --- a/src/test/ui/span/multiline-span-E0072.stderr +++ b/src/test/ui/span/multiline-span-E0072.stderr @@ -3,12 +3,12 @@ error[E0072]: recursive type `ListNode` has infinite size | LL | / struct LL | | ListNode - | |________^ recursive type has infinite size + | |________^ ... LL | tail: Option<ListNode>, - | ---------------- recursive without indirection + | -------- recursive without indirection | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | LL | tail: Option<Box<ListNode>>, | ++++ + diff --git a/src/test/ui/span/recursive-type-field.rs b/src/test/ui/span/recursive-type-field.rs index 58ea81b83..bd4c43534 100644 --- a/src/test/ui/span/recursive-type-field.rs +++ b/src/test/ui/span/recursive-type-field.rs @@ -1,11 +1,11 @@ use std::rc::Rc; -struct Foo<'a> { //~ ERROR recursive type +struct Foo<'a> { //~ ERROR recursive types `Foo` and `Bar` have infinite size bar: Bar<'a>, b: Rc<Bar<'a>>, } -struct Bar<'a> { //~ ERROR recursive type +struct Bar<'a> { y: (Foo<'a>, Foo<'a>), z: Option<Bar<'a>>, a: &'a Foo<'a>, diff --git a/src/test/ui/span/recursive-type-field.stderr b/src/test/ui/span/recursive-type-field.stderr index 08e97e750..10af4c36b 100644 --- a/src/test/ui/span/recursive-type-field.stderr +++ b/src/test/ui/span/recursive-type-field.stderr @@ -1,35 +1,27 @@ -error[E0072]: recursive type `Foo` has infinite size +error[E0072]: recursive types `Foo` and `Bar` have infinite size --> $DIR/recursive-type-field.rs:3:1 | LL | struct Foo<'a> { - | ^^^^^^^^^^^^^^ recursive type has infinite size + | ^^^^^^^^^^^^^^ LL | bar: Bar<'a>, | ------- recursive without indirection +... +LL | struct Bar<'a> { + | ^^^^^^^^^^^^^^ +LL | y: (Foo<'a>, Foo<'a>), + | ------- ------- recursive without indirection + | | + | recursive without indirection | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable - | -LL | bar: Box<Bar<'a>>, - | ++++ + - -error[E0072]: recursive type `Bar` has infinite size - --> $DIR/recursive-type-field.rs:8:1 +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | +LL ~ bar: Box<Bar<'a>>, +LL | b: Rc<Bar<'a>>, + ... LL | struct Bar<'a> { - | ^^^^^^^^^^^^^^ recursive type has infinite size -LL | y: (Foo<'a>, Foo<'a>), - | ------------------ recursive without indirection -LL | z: Option<Bar<'a>>, - | --------------- recursive without indirection -... -LL | d: [Bar<'a>; 1], - | ------------ recursive without indirection -LL | e: Foo<'a>, - | ------- recursive without indirection -LL | x: Bar<'a>, - | ------- recursive without indirection +LL ~ y: (Box<Foo<'a>>, Box<Foo<'a>>), | - = help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable -error: aborting due to 2 previous errors +error: aborting due to previous error For more information about this error, try `rustc --explain E0072`. |