diff options
| author | bors <bors@rust-lang.org> | 2022-06-29 05:47:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-29 05:47:42 +0000 |
| commit | 493c960a3e6cdd2e2fbe8b6ea130fadea05f1ab0 (patch) | |
| tree | e30296c258fa15a5e111bdc182b12bc1beffa428 /src | |
| parent | 116edb6800ea1d6615578e7f65366ae65364b3d8 (diff) | |
| parent | 25fb2b47a506b1c9956d7fba14d12a5175866154 (diff) | |
| download | rust-493c960a3e6cdd2e2fbe8b6ea130fadea05f1ab0.tar.gz rust-493c960a3e6cdd2e2fbe8b6ea130fadea05f1ab0.zip | |
Auto merge of #98656 - Dylan-DPC:rollup-hhytn0c, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - #97423 (Simplify memory ordering intrinsics) - #97542 (Use typed indices in argument mismatch algorithm) - #97786 (Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths) - #98277 (Fix trait object reborrow suggestion) - #98525 (Add regression test for #79224) - #98549 (interpret: do not prune requires_caller_location stack frames quite so early) - #98603 (Some borrowck diagnostic fixes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
67 files changed, 424 insertions, 254 deletions
diff --git a/src/test/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs b/src/test/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs index e9b28504a90..47d90b1856b 100644 --- a/src/test/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs +++ b/src/test/run-make-fulldeps/atomic-lock-free/atomic_lock_free.rs @@ -3,7 +3,7 @@ #![no_core] extern "rust-intrinsic" { - fn atomic_xadd<T>(dst: *mut T, src: T) -> T; + fn atomic_xadd_seqcst<T>(dst: *mut T, src: T) -> T; } #[lang = "sized"] @@ -17,50 +17,50 @@ impl<T: ?Sized> Copy for *mut T {} #[cfg(target_has_atomic = "8")] pub unsafe fn atomic_u8(x: *mut u8) { - atomic_xadd(x, 1); - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "8")] pub unsafe fn atomic_i8(x: *mut i8) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "16")] pub unsafe fn atomic_u16(x: *mut u16) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "16")] pub unsafe fn atomic_i16(x: *mut i16) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "32")] pub unsafe fn atomic_u32(x: *mut u32) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "32")] pub unsafe fn atomic_i32(x: *mut i32) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "64")] pub unsafe fn atomic_u64(x: *mut u64) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "64")] pub unsafe fn atomic_i64(x: *mut i64) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "128")] pub unsafe fn atomic_u128(x: *mut u128) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "128")] pub unsafe fn atomic_i128(x: *mut i128) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "ptr")] pub unsafe fn atomic_usize(x: *mut usize) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } #[cfg(target_has_atomic = "ptr")] pub unsafe fn atomic_isize(x: *mut isize) { - atomic_xadd(x, 1); + atomic_xadd_seqcst(x, 1); } diff --git a/src/test/ui/argument-suggestions/basic.stderr b/src/test/ui/argument-suggestions/basic.stderr index dd4812b5b25..c495ad6b842 100644 --- a/src/test/ui/argument-suggestions/basic.stderr +++ b/src/test/ui/argument-suggestions/basic.stderr @@ -16,7 +16,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied --> $DIR/basic.rs:21:5 | LL | extra(""); - | ^^^^^ -- argument unexpected + | ^^^^^ -- argument of type `&'static str` unexpected | note: function defined here --> $DIR/basic.rs:14:4 diff --git a/src/test/ui/argument-suggestions/extra_arguments.stderr b/src/test/ui/argument-suggestions/extra_arguments.stderr index 9b63f9bcbfa..32b1e15737a 100644 --- a/src/test/ui/argument-suggestions/extra_arguments.stderr +++ b/src/test/ui/argument-suggestions/extra_arguments.stderr @@ -2,7 +2,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied --> $DIR/extra_arguments.rs:7:3 | LL | empty(""); - | ^^^^^ -- argument unexpected + | ^^^^^ -- argument of type `&'static str` unexpected | note: function defined here --> $DIR/extra_arguments.rs:1:4 @@ -18,7 +18,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied --> $DIR/extra_arguments.rs:9:3 | LL | one_arg(1, 1); - | ^^^^^^^ - argument unexpected + | ^^^^^^^ - argument of type `{integer}` unexpected | note: function defined here --> $DIR/extra_arguments.rs:2:4 @@ -34,7 +34,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied --> $DIR/extra_arguments.rs:10:3 | LL | one_arg(1, ""); - | ^^^^^^^ -- argument unexpected + | ^^^^^^^ -- argument of type `&'static str` unexpected | note: function defined here --> $DIR/extra_arguments.rs:2:4 @@ -50,9 +50,9 @@ error[E0061]: this function takes 1 argument but 3 arguments were supplied --> $DIR/extra_arguments.rs:11:3 | LL | one_arg(1, "", 1.0); - | ^^^^^^^ -- --- argument unexpected + | ^^^^^^^ -- --- argument of type `{float}` unexpected | | - | argument unexpected + | argument of type `&'static str` unexpected | note: function defined here --> $DIR/extra_arguments.rs:2:4 @@ -68,7 +68,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/extra_arguments.rs:13:3 | LL | two_arg_same(1, 1, 1); - | ^^^^^^^^^^^^ - argument unexpected + | ^^^^^^^^^^^^ - argument of type `{integer}` unexpected | note: function defined here --> $DIR/extra_arguments.rs:3:4 @@ -84,7 +84,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/extra_arguments.rs:14:3 | LL | two_arg_same(1, 1, 1.0); - | ^^^^^^^^^^^^ --- argument unexpected + | ^^^^^^^^^^^^ --- argument of type `{float}` unexpected | note: function defined here --> $DIR/extra_arguments.rs:3:4 @@ -100,7 +100,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/extra_arguments.rs:16:3 | LL | two_arg_diff(1, 1, ""); - | ^^^^^^^^^^^^ - argument of type `&str` unexpected + | ^^^^^^^^^^^^ - argument of type `{integer}` unexpected | note: function defined here --> $DIR/extra_arguments.rs:4:4 @@ -116,7 +116,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/extra_arguments.rs:17:3 | LL | two_arg_diff(1, "", ""); - | ^^^^^^^^^^^^ -- argument unexpected + | ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected | note: function defined here --> $DIR/extra_arguments.rs:4:4 @@ -132,9 +132,9 @@ error[E0061]: this function takes 2 arguments but 4 arguments were supplied --> $DIR/extra_arguments.rs:18:3 | LL | two_arg_diff(1, 1, "", ""); - | ^^^^^^^^^^^^ - -- argument unexpected + | ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected | | - | argument of type `&str` unexpected + | argument of type `{integer}` unexpected | note: function defined here --> $DIR/extra_arguments.rs:4:4 @@ -150,9 +150,9 @@ error[E0061]: this function takes 2 arguments but 4 arguments were supplied --> $DIR/extra_arguments.rs:19:3 | LL | two_arg_diff(1, "", 1, ""); - | ^^^^^^^^^^^^ - -- argument unexpected + | ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected | | - | argument unexpected + | argument of type `{integer}` unexpected | note: function defined here --> $DIR/extra_arguments.rs:4:4 @@ -168,7 +168,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/extra_arguments.rs:22:3 | LL | two_arg_same(1, 1, ""); - | ^^^^^^^^^^^^ -- argument unexpected + | ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected | note: function defined here --> $DIR/extra_arguments.rs:3:4 @@ -184,7 +184,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/extra_arguments.rs:23:3 | LL | two_arg_diff(1, 1, ""); - | ^^^^^^^^^^^^ - argument of type `&str` unexpected + | ^^^^^^^^^^^^ - argument of type `{integer}` unexpected | note: function defined here --> $DIR/extra_arguments.rs:4:4 @@ -203,7 +203,7 @@ LL | two_arg_same( | ^^^^^^^^^^^^ ... LL | "" - | -- argument unexpected + | -- argument of type `&'static str` unexpected | note: function defined here --> $DIR/extra_arguments.rs:3:4 @@ -222,7 +222,7 @@ LL | two_arg_diff( | ^^^^^^^^^^^^ LL | 1, LL | 1, - | - argument of type `&str` unexpected + | - argument of type `{integer}` unexpected | note: function defined here --> $DIR/extra_arguments.rs:4:4 diff --git a/src/test/ui/argument-suggestions/issue-97484.stderr b/src/test/ui/argument-suggestions/issue-97484.stderr index 2af24d521f3..9589e919c0a 100644 --- a/src/test/ui/argument-suggestions/issue-97484.stderr +++ b/src/test/ui/argument-suggestions/issue-97484.stderr @@ -2,21 +2,20 @@ error[E0061]: this function takes 4 arguments but 7 arguments were supplied --> $DIR/issue-97484.rs:12:5 | LL | foo(&&A, B, C, D, E, F, G); - | ^^^ - - - argument unexpected + | ^^^ - - - argument of type `F` unexpected | | | - | | argument of type `&E` unexpected - | argument of type `D` unexpected + | | argument of type `C` unexpected + | argument of type `B` unexpected | note: function defined here --> $DIR/issue-97484.rs:9:4 | LL | fn foo(a: &A, d: D, e: &E, g: G) {} | ^^^ ----- ---- ----- ---- -help: consider removing the `` - | -LL - foo(&&A, B, C, D, E, F, G); -LL + foo(&&A, B, C, D, E, F, G); +help: consider borrowing here | +LL | foo(&&A, B, C, D, &E, F, G); + | ~~ help: remove the extra arguments | LL | foo(&&A, D, /* &E */, G); diff --git a/src/test/ui/argument-suggestions/mixed_cases.stderr b/src/test/ui/argument-suggestions/mixed_cases.stderr index 3fe4473a594..a52a30d7884 100644 --- a/src/test/ui/argument-suggestions/mixed_cases.stderr +++ b/src/test/ui/argument-suggestions/mixed_cases.stderr @@ -2,7 +2,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/mixed_cases.rs:10:3 | LL | two_args(1, "", X {}); - | ^^^^^^^^ -- ---- argument unexpected + | ^^^^^^^^ -- ---- argument of type `X` unexpected | | | expected `f32`, found `&str` | @@ -20,9 +20,9 @@ error[E0061]: this function takes 3 arguments but 4 arguments were supplied --> $DIR/mixed_cases.rs:11:3 | LL | three_args(1, "", X {}, ""); - | ^^^^^^^^^^ -- ---- -- argument unexpected + | ^^^^^^^^^^ -- ---- -- argument of type `&'static str` unexpected | | | - | | argument of type `&str` unexpected + | | argument of type `X` unexpected | an argument of type `f32` is missing | note: function defined here @@ -58,7 +58,7 @@ error[E0308]: arguments to this function are incorrect --> $DIR/mixed_cases.rs:17:3 | LL | three_args(1, "", X {}); - | ^^^^^^^^^^ -- ---- argument of type `&str` unexpected + | ^^^^^^^^^^ -- ---- argument of type `X` unexpected | | | an argument of type `f32` is missing | diff --git a/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr b/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr index f1dcd34066d..f40e6585b38 100644 --- a/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr +++ b/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr @@ -4,7 +4,7 @@ error[E0277]: the trait bound `String: Copy` is not satisfied LL | Box::new(AssocNoCopy) | ^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | - = note: required for the cast to the object type `dyn Bar<Assoc = <AssocNoCopy as Thing>::Out::{opaque#0}>` + = note: required for the cast from `AssocNoCopy` to the object type `dyn Bar<Assoc = <AssocNoCopy as Thing>::Out::{opaque#0}>` error: aborting due to previous error diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr index 521907a6044..bed63a5e6df 100644 --- a/src/test/ui/associated-types/associated-types-eq-3.stderr +++ b/src/test/ui/associated-types/associated-types-eq-3.stderr @@ -41,7 +41,7 @@ note: expected this to be `Bar` | LL | type A = usize; | ^^^^^ - = note: required for the cast to the object type `dyn Foo<A = Bar>` + = note: required for the cast from `isize` to the object type `dyn Foo<A = Bar>` error: aborting due to 3 previous errors diff --git a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr index 9f1abf2a6c4..dbd9a44ed97 100644 --- a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr +++ b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr @@ -4,7 +4,7 @@ error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as Iterator>::It LL | let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter(); | ^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `u32` | - = note: required for the cast to the object type `dyn Iterator<Item = u32, Item = i32>` + = note: required for the cast from `std::vec::IntoIter<u32>` to the object type `dyn Iterator<Item = u32, Item = i32>` error: aborting due to previous error diff --git a/src/test/ui/associated-types/issue-65774-1.stderr b/src/test/ui/associated-types/issue-65774-1.stderr index e468a1b3ba4..419de689c52 100644 --- a/src/test/ui/associated-types/issue-65774-1.stderr +++ b/src/test/ui/associated-types/issue-65774-1.stderr @@ -23,7 +23,7 @@ note: required because of the requirements on the impl of `MyDisplay` for `&mut | LL | impl<'a, T: MyDisplay> MyDisplay for &'a mut T { } | ^^^^^^^^^ ^^^^^^^^^ - = note: required for the cast to the object type `dyn MyDisplay` + = note: required for the cast from `&mut T` to the object type `dyn MyDisplay` error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/issue-65774-2.stderr b/src/test/ui/associated-types/issue-65774-2.stderr index 4cef4db4698..c22302cdc26 100644 --- a/src/test/ui/associated-types/issue-65774-2.stderr +++ b/src/test/ui/associated-types/issue-65774-2.stderr @@ -18,7 +18,7 @@ LL | writer.my_write(valref) | ^^^^^^ the trait `MyDisplay` is not implemented for `T` | = help: the trait `MyDisplay` is implemented for `&'a mut T` - = note: required for the cast to the object type `dyn MyDisplay` + = note: required for the cast from `T` to the object type `dyn MyDisplay` error: aborting due to 2 previous errors diff --git a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr index e0818337d20..e5887689690 100644 --- a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr +++ b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr @@ -37,7 +37,7 @@ error[E0271]: type mismatch resolving `<impl Future<Output = u8> as Future>::Out LL | let _: &dyn Future<Output = ()> = █ | ^^^^^^ expected `()`, found `u8` | - = note: required for the cast to the object type `dyn Future<Output = ()>` + = note: required for the cast from `impl Future<Output = u8>` to the object type `dyn Future<Output = ()>` error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:12:43 @@ -53,7 +53,7 @@ error[E0271]: type mismatch resolving `<impl Future<Output = u8> as Future>::Out LL | let _: &dyn Future<Output = ()> = █ | ^^^^^^ expected `()`, found `u8` | - = note: required for the cast to the object type `dyn Future<Output = ()>` + = note: required for the cast from `impl Future<Output = u8>` to the object type `dyn Future<Output = ()>` error[E0308]: mismatched types --> $DIR/async-block-control-flow-static-semantics.rs:47:44 diff --git a/src/test/ui/async-await/issue-86507.stderr b/src/test/ui/async-await/issue-86507.stderr index 5bbc20359c6..0e21dba980d 100644 --- a/src/test/ui/async-await/issue-86507.stderr +++ b/src/test/ui/async-await/issue-86507.stderr @@ -13,7 +13,7 @@ note: captured value is not `Send` because `&` references cannot be sent unless | LL | let x = x; | ^ has type `&T` which is not `Send`, because `T` is not `Sync` - = note: required for the cast to the object type `dyn Future<Output = ()> + Send` + = note: required for the cast from `impl Future<Output = ()>` to the object type `dyn Future<Output = ()> + Send` help: consider further restricting this bound | LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T) diff --git a/src/test/ui/binop/binop-move-semantics.stderr b/src/test/ui/binop/binop-move-semantics.stderr index 2cd6d1abfdc..695b01d5ee3 100644 --- a/src/test/ui/binop/binop-move-semantics.stderr +++ b/src/test/ui/binop/binop-move-semantics.stderr @@ -63,8 +63,20 @@ LL | use_mut(n); use_imm(m); error[E0507]: cannot move out of `*m` which is behind a mutable reference --> $DIR/binop-move-semantics.rs:30:5 | -LL | *m - | ^^ move occurs because `*m` has type `T`, which does not implement the `Copy` trait +LL | *m + | -^ + | | + | _____move occurs because `*m` has type `T`, which does not implement the `Copy` trait + | | +LL | | + +LL | | *n; + | |______- `*m` moved due to usage in operator + | +note: calling this operator moves the left-hand side + --> $SRC_DIR/core/src/ops/arith.rs:LL:COL + | +LL | fn add(self, rhs: Rhs) -> Self::Output; + | ^^^^ error[E0507]: cannot move out of `*n` which is behind a shared reference --> $DIR/binop-move-semantics.rs:32:5 diff --git a/src/test/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr b/src/test/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr index 0866f54b9fa..c99c0f77982 100644 --- a/src/test/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr +++ b/src/test/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr @@ -2,7 +2,7 @@ error[E0594]: cannot assign to `**t1`, which is behind a `&` reference --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:9:5 | LL | let t1 = t0; - | -- help: consider changing this to be a mutable reference: `&mut &mut isize` + | -- consider changing this binding's type to be: `&mut &mut isize` LL | let p: &isize = &**t0; LL | **t1 = 22; | ^^^^^^^^^ `t1` is a `&` reference, so the data it refers to cannot be written diff --git a/src/test/ui/borrowck/issue-85765.rs b/src/test/ui/borrowck/issue-85765.rs index 2b1ab2f7050..1598cd5d3c8 100644 --- a/src/test/ui/borrowck/issue-85765.rs +++ b/src/test/ui/borrowck/issue-85765.rs @@ -1,7 +1,7 @@ fn main() { let mut test = Vec::new(); let rofl: &Vec<Vec<i32>> = &mut test; - //~^ HELP consider changing this to be a mutable reference + //~^ NOTE consider changing this binding's type to be rofl.push(Vec::new()); //~^ ERROR cannot borrow `*rofl` as mutable, as it is behind a `&` reference //~| NOTE `rofl` is a `&` reference, so the data it refers to cannot be borrowed as mutable @@ -15,14 +15,14 @@ fn main() { #[rustfmt::skip] let x: &usize = &mut{0}; - //~^ HELP consider changing this to be a mutable reference + //~^ NOTE consider changing this binding's type to be *x = 1; //~^ ERROR cannot assign to `*x`, which is behind a `&` reference //~| NOTE `x` is a `&` reference, so the data it refers to cannot be written #[rustfmt::skip] let y: &usize = &mut(0); - //~^ HELP consider changing this to be a mutable reference + //~^ NOTE consider changing this binding's type to be *y = 1; //~^ ERROR cannot assign to `*y`, which is behind a `&` reference //~| NOTE `y` is a `&` reference, so the data it refers to cannot be written diff --git a/src/test/ui/borrowck/issue-85765.stderr b/src/test/ui/borrowck/issue-85765.stderr index 80acaa7d21c..13033962142 100644 --- a/src/test/ui/borrowck/issue-85765.stderr +++ b/src/test/ui/borrowck/issue-85765.stderr @@ -2,7 +2,7 @@ error[E0596]: cannot borrow `*rofl` as mutable, as it is behind a `&` reference --> $DIR/issue-85765.rs:5:5 | LL | let rofl: &Vec<Vec<i32>> = &mut test; - | ---- help: consider changing this to be a mutable reference: `&mut Vec<Vec<i32>>` + | ---- consider changing this binding's type to be: `&mut Vec<Vec<i32>>` LL | LL | rofl.push(Vec::new()); | ^^^^^^^^^^^^^^^^^^^^^ `rofl` is a `&` reference, so the data it refers to cannot be borrowed as mutable @@ -20,7 +20,7 @@ error[E0594]: cannot assign to `*x`, which is behind a `&` reference --> $DIR/issue-85765.rs:19:5 | LL | let x: &usize = &mut{0}; - | - help: consider changing this to be a mutable reference: `&mut usize` + | - consider changing this binding's type to be: `&mut usize` LL | LL | *x = 1; | ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written @@ -29,7 +29,7 @@ error[E0594]: cannot assign to `*y`, which is behind a `&` reference --> $DIR/issue-85765.rs:26:5 | LL | let y: &usize = &mut(0); - | - help: consider changing this to be a mutable reference: `&mut usize` + | - consider changing this binding's type to be: `&mut usize` LL | LL | *y = 1; | ^^^^^^ `y` is a `&` reference, so the data it refers to cannot be written diff --git a/src/test/ui/borrowck/issue-91206.rs b/src/test/ui/borrowck/issue-91206.rs index 3b1fbf4b699..67407c1eae3 100644 --- a/src/test/ui/borrowck/issue-91206.rs +++ b/src/test/ui/borrowck/issue-91206.rs @@ -9,7 +9,8 @@ impl TestClient { fn main() { let client = TestClient; let inner = client.get_inner_ref(); - //~^ HELP consider changing this to be a mutable reference + //~^ NOTE consider changing this binding's type to be inner.clear(); //~^ ERROR cannot borrow `*inner` as mutable, as it is behind a `&` reference [E0596] + //~| NOTE `inner` is a `&` reference, so the data it refers to cannot be borrowed as mutable } diff --git a/src/test/ui/borrowck/issue-91206.stderr b/src/test/ui/borrowck/issue-91206.stderr index 535d247452a..12d8d27c5f0 100644 --- a/src/test/ui/borrowck/issue-91206.stderr +++ b/src/test/ui/borrowck/issue-91206.stderr @@ -2,7 +2,7 @@ error[E0596]: cannot borrow `*inner` as mutable, as it is behind a `&` reference --> $DIR/issue-91206.rs:13:5 | LL | let inner = client.get_inner_ref(); - | ----- help: consider changing this to be a mutable reference: `&mut Vec<usize>` + | ----- consider changing this binding's type to be: `&mut Vec<usize>` LL | LL | inner.clear(); | ^^^^^^^^^^^^^ `inner` is a `&` reference, so the data it refers to cannot be borrowed as mutable diff --git a/src/test/ui/borrowck/issue-92015.stderr b/src/test/ui/borrowck/issue-92015.stderr index 32a65d3b5bb..62b1183e71b 100644 --- a/src/test/ui/borrowck/issue-92015.stderr +++ b/src/test/ui/borrowck/issue-92015.stderr @@ -2,7 +2,7 @@ error[E0594]: cannot assign to `*foo`, which is behind a `&` reference --> $DIR/issue-92015.rs:6:5 | LL | let foo = Some(&0).unwrap(); - | --- help: consider changing this to be a mutable reference: `&mut i32` + | --- consider changing this binding's type to be: `&mut i32` LL | *foo = 1; | ^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written diff --git a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.rs b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.rs new file mode 100644 index 00000000000..1dcf0461879 --- /dev/null +++ b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.rs @@ -0,0 +1,16 @@ +// This is not exactly right, yet. + +// Ideally we should be suggesting `as_mut` for the first case, +// and suggesting to change `as_ref` to `as_mut` in the second. + +fn x(cb: &mut Option<&mut dyn FnMut()>) { + cb.map(|cb| cb()); + //~^ ERROR cannot move out of `*cb` which is behind a mutable reference +} + +fn x2(cb: &mut Option<&mut dyn FnMut()>) { + cb.as_ref().map(|cb| cb()); + //~^ ERROR cannot borrow `*cb` as mutable, as it is behind a `&` reference +} + +fn main() {} diff --git a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr new file mode 100644 index 00000000000..af26169c806 --- /dev/null +++ b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr @@ -0,0 +1,31 @@ +error[E0507]: cannot move out of `*cb` which is behind a mutable reference + --> $DIR/suggest-as-ref-on-mut-closure.rs:7:5 + | +LL | cb.map(|cb| cb()); + | ^^^-------------- + | | | + | | `*cb` moved due to this method call + | move occurs because `*cb` has type `Option<&mut dyn FnMut()>`, which does not implement the `Copy` trait + | +note: this function takes ownership of the receiver `self`, which moves `*cb` + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub const fn map<U, F>(self, f: F) -> Option<U> + | ^^^^ +help: consider calling `.as_ref()` to borrow the type's contents + | +LL | cb.as_ref().map(|cb| cb()); + | +++++++++ + +error[E0596]: cannot borrow `*cb` as mutable, as it is behind a `&` reference + --> $DIR/suggest-as-ref-on-mut-closure.rs:12:26 + | +LL | cb.as_ref().map(|cb| cb()); + | -- ^^ `cb` is a `&` reference, so the data it refers to cannot be borrowed as mutable + | | + | consider changing this binding's type to be: `&mut &mut dyn FnMut()` + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0507, E0596. +For more information about an error, try `rustc --explain E0507`. diff --git a/src/test/ui/coercion/coerce-issue-49593-box-never-windows.nofallback.stderr b/src/test/ui/coercion/coerce-issue-49593-box-never-windows.nofallback.stderr index 3350d1efb53..980da536034 100644 --- a/src/test/ui/coercion/coerce-issue-49593-box-never-windows.nofallback.stderr +++ b/src/test/ui/coercion/coerce-issue-49593-box-never-windows.nofallback.stderr @@ -4,7 +4,7 @@ error[E0277]: the trait bound `(): std::error::Error` is not satisfied LL | /* *mut $0 is coerced to Box<dyn Error> here */ Box::<_ /* ! */>::new(x) | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()` | - = note: required for the cast to the object type `dyn std::error::Error` + = note: required for the cast from `()` to the object type `dyn std::error::Error` error[E0277]: the trait bound `(): std::error::Error` is not satisfied --> $DIR/coerce-issue-49593-box-never-windows.rs:23:49 @@ -12,7 +12,7 @@ error[E0277]: the trait bound `(): std::error::Error` is not satisfied LL | /* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()` | - = note: required for the cast to the object type `(dyn std::error::Error + 'static)` + = note: required for the cast from `()` to the object type `(dyn std::error::Error + 'static)` error: aborting due to 2 previous errors diff --git a/src/test/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr b/src/test/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr index fcd2d7f78ff..322681b97bc 100644 --- a/src/test/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr +++ b/src/test/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr @@ -4,7 +4,7 @@ error[E0277]: the trait bound `(): std::error::Error` is not satisfied LL | /* *mut $0 is coerced to Box<dyn Error> here */ Box::<_ /* ! */>::new(x) | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()` | - = note: required for the cast to the object type `dyn std::error::Error` + = note: required for the cast from `()` to the object type `dyn std::error::Error` error[E0277]: the trait bound `(): std::error::Error` is not satisfied --> $DIR/coerce-issue-49593-box-never.rs:23:49 @@ -12,7 +12,7 @@ error[E0277]: the trait bound `(): std::error::Error` is not satisfied LL | /* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()` | - = note: required for the cast to the object type `(dyn std::error::Error + 'static)` + = note: required for the cast from `()` to the object type `(dyn std::error::Error + 'static)` error: aborting due to 2 previous errors diff --git a/src/test/ui/const-generics/defaults/trait_objects_fail.stderr b/src/test/ui/const-generics/defaults/trait_objects_fail.stderr index 60dc96f675a..da85b2059f0 100644 --- a/src/test/ui/const-generics/defaults/trait_objects_fail.stderr +++ b/src/test/ui/const-generics/defaults/trait_objects_fail.stderr @@ -7,7 +7,7 @@ LL | foo(&10_u32); | required by a bound introduced by this call | = help: the trait `Trait<2_u8>` is implemented for `u32` - = note: required for the cast to the object type `dyn Trait` + = note: required for the cast from `u32` to the object type `dyn Trait` error[E0277]: the trait bound `bool: Traitor<{_: u8}>` is not satisfied --> $DIR/trait_objects_fail.rs:28:9 @@ -18,7 +18,7 @@ LL | bar(&true); | required by a bound introduced by this call | = help: the trait `Traitor<2_u8, 3_u8>` is implemented for `bool` - = note: required for the cast to the object type `dyn Traitor<{_: u8}>` + = note: required for the cast from `bool` to the object type `dyn Traitor<{_: u8}>` error: aborting due to 2 previous errors diff --git a/src/test/ui/custom_test_frameworks/mismatch.stderr b/src/test/ui/custom_test_frameworks/mismatch.stderr index e848ddc55b7..61061ae529d 100644 --- a/src/test/ui/custom_test_frameworks/mismatch.stderr +++ b/src/test/ui/custom_test_frameworks/mismatch.stderr @@ -6,7 +6,7 @@ LL | #[test] LL | fn wrong_kind(){} | ^^^^^^^^^^^^^^^^^ the trait `Testable` is not implemented for `TestDescAndFn` | - = note: required for the cast to the object type `dyn Testable` + = note: required for the cast from `TestDescAndFn` to the object type `dyn Testable` = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/dst/dst-bad-coerce1.stderr b/src/test/ui/dst/dst-bad-coerce1.stderr index 121c76a01a5..594acff853a 100644 --- a/src/test/ui/dst/dst-bad-coerce1.stderr +++ b/src/test/ui/dst/dst-bad-coerce1.stderr @@ -15,7 +15,7 @@ error[E0277]: the trait bound `Foo: Bar` is not satisfied LL | let f3: &Fat<dyn Bar> = f2; | ^^ the trait `Bar` is not implemented for `Foo` | - = note: required for the cast to the object type `dyn Bar` + = note: required for the cast from `Foo` to the object type `dyn Bar` error[E0308]: mismatched types --> $DIR/dst-bad-coerce1.rs:28:27 @@ -34,7 +34,7 @@ error[E0277]: the trait bound `Foo: Bar` is not satisfied LL | let f3: &(dyn Bar,) = f2; | ^^ the trait `Bar` is not implemented for `Foo` | - = note: required for the cast to the object type `dyn Bar` + = note: required for the cast from `Foo` to the object type `dyn Bar` error: aborting due to 4 previous errors diff --git a/src/test/ui/dst/dst-object-from-unsized-type.stderr b/src/test/ui/dst/dst-object-from-unsized-type.stderr index 5bd47736626..e24c96ebed6 100644 --- a/src/test/ui/dst/dst-object-from-unsized-type.stderr +++ b/src/test/ui/dst/dst-object-from-unsized-type.stderr @@ -6,7 +6,7 @@ LL | fn test1<T: ?Sized + Foo>(t: &T) { LL | let u: &dyn Foo = t; | ^ doesn't have a size known at compile-time | - = note: required for the cast to the object type `dyn Foo` + = note: required for the cast from `T` to the object type `dyn Foo` help: consider removing the `?Sized` bound to make the type parameter `Sized` | LL - fn test1<T: ?Sized + Foo>(t: &T) { @@ -21,7 +21,7 @@ LL | fn test2<T: ?Sized + Foo>(t: &T) { LL | let v: &dyn Foo = t as &dyn Foo; | ^ doesn't have a size known at compile-time | - = note: required for the cast to the object type `dyn Foo` + = note: required for the cast from `T` to the object type `dyn Foo` help: consider removing the `?Sized` bound to make the type parameter `Sized` | LL - fn test2<T: ?Sized + Foo>(t: &T) { @@ -35,7 +35,7 @@ LL | let _: &[&dyn Foo] = &["hi"]; | ^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` - = note: required for the cast to the object type `dyn Foo` + = note: required for the cast from `str` to the object type `dyn Foo` error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/dst-object-from-unsized-type.rs:23:23 @@ -44,7 +44,7 @@ LL | let _: &dyn Foo = x as &dyn Foo; | ^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` - = note: required for the cast to the object type `dyn Foo` + = note: required for the cast from `[u8]` to the object type `dyn Foo` error: aborting due to 4 previous errors diff --git a/src/test/ui/error-codes/E0057.stderr b/src/test/ui/error-codes/E0057.stderr index 3697b5fcf15..2307f52c93b 100644 --- a/src/test/ui/error-codes/E0057.stderr +++ b/src/test/ui/error-codes/E0057.stderr @@ -18,7 +18,7 @@ error[E0057]: this function takes 1 argument but 2 arguments were supplied --> $DIR/E0057.rs:5:13 | LL | let c = f(2, 3); - | ^ - argument unexpected + | ^ - argument of type `{integer}` unexpected | note: closure defined here --> $DIR/E0057.rs:2:13 diff --git a/src/test/ui/generic-associated-types/issue-79422.extended.stderr b/src/test/ui/generic-associated-types/issue-79422.extended.stderr index 9478fc89792..9bcbd747168 100644 --- a/src/test/ui/generic-associated-types/issue-79422.extended.stderr +++ b/src/test/ui/generic-associated-types/issue-79422.extended.stderr @@ -27,7 +27,7 @@ LL | type VRefCont<'a> = &'a V where Self: 'a; | ^^^^^ = note: expected trait object `(dyn RefCont<'_, u8> + 'static)` found reference `&u8` - = note: required for the cast to the object type `dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>` + = note: required for the cast from `BTreeMap<u8, u8>` to the object type `dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>` error: aborting due to 2 previous errors diff --git a/src/test/ui/intrinsics/auxiliary/cci_intrinsic.rs b/src/test/ui/intrinsics/auxiliary/cci_intrinsic.rs index f65f359875b..f3b9d569ce3 100644 --- a/src/test/ui/intrinsics/auxiliary/cci_intrinsic.rs +++ b/src/test/ui/intrinsics/auxiliary/cci_intrinsic.rs @@ -2,13 +2,13 @@ pub mod rusti { extern "rust-intrinsic" { - pub fn atomic_xchg<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xchg_seqcst<T>(dst: *mut T, src: T) -> T; } } #[inline(always)] -pub fn atomic_xchg(dst: *mut isize, src: isize) -> isize { +pub fn atomic_xchg_seqcst(dst: *mut isize, src: isize) -> isize { unsafe { - rusti::atomic_xchg(dst, src) + rusti::atomic_xchg_seqcst(dst, src) } } diff --git a/src/test/ui/intrinsics/intrinsic-atomics-cc.rs b/src/test/ui/intrinsics/intrinsic-atomics-cc.rs index 52e891da9ba..ce3fa7b0c05 100644 --- a/src/test/ui/intrinsics/intrinsic-atomics-cc.rs +++ b/src/test/ui/intrinsics/intrinsic-atomics-cc.rs @@ -3,10 +3,10 @@ extern crate cci_intrinsic; -use cci_intrinsic::atomic_xchg; +use cci_intrinsic::atomic_xchg_seqcst; pub fn main() { let mut x = 1; - atomic_xchg(&mut x, 5); + atomic_xchg_seqcst(&mut x, 5); assert_eq!(x, 5); } diff --git a/src/test/ui/intrinsics/intrinsic-atomics.rs b/src/test/ui/intrinsics/intrinsic-atomics.rs index c6e48e8b5af..b17f4347be3 100644 --- a/src/test/ui/intrinsics/intrinsic-atomics.rs +++ b/src/test/ui/intrinsics/intrinsic-atomics.rs @@ -3,31 +3,31 @@ mod rusti { extern "rust-intrinsic" { - pub fn atomic_cxchg<T>(dst: *mut T, old: T, src: T) -> (T, bool); - pub fn atomic_cxchg_acq<T>(dst: *mut T, old: T, src: T) -> (T, bool); - pub fn atomic_cxchg_rel<T>(dst: *mut T, old: T, src: T) -> (T, bool); + pub fn atomic_cxchg_seqcst_seqcst<T>(dst: *mut T, old: T, src: T) -> (T, bool); + pub fn atomic_cxchg_acquire_acquire<T>(dst: *mut T, old: T, src: T) -> (T, bool); + pub fn atomic_cxchg_release_relaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool); - pub fn atomic_cxchgweak<T>(dst: *mut T, old: T, src: T) -> (T, bool); - pub fn atomic_cxchgweak_acq<T>(dst: *mut T, old: T, src: T) -> (T, bool); - pub fn atomic_cxchgweak_rel<T>(dst: *mut T, old: T, src: T) -> (T, bool); + pub fn atomic_cxchgweak_seqcst_seqcst<T>(dst: *mut T, old: T, src: T) -> (T, bool); + pub fn atomic_cxchgweak_acquire_acquire<T>(dst: *mut T, old: T, src: T) -> (T, bool); + pub fn atomic_cxchgweak_release_relaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool); - pub fn atomic_load<T>(src: *const T) -> T; - pub fn atomic_load_acq<T>(src: *const T) -> T; + pub fn atomic_load_seqcst<T>(src: *const T) -> T; + pub fn atomic_load_acquire<T>(src: *const T) -> T; - pub fn atomic_store<T>(dst: *mut T, val: T); - pub fn atomic_store_rel<T>(dst: *mut T, val: T); + pub fn atomic_store_seqcst<T>(dst: *mut T, val: T); + pub fn atomic_store_release<T>(dst: *mut T, val: T); - pub fn atomic_xchg<T>(dst: *mut T, src: T) -> T; - pub fn atomic_xchg_acq<T>(dst: *mut T, src: T) -> T; - pub fn atomic_xchg_rel<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xchg_seqcst<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xchg_acquire<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xchg_release<T>(dst: *mut T, src: T) -> T; - pub fn atomic_xadd<T>(dst: *mut T, src: T) -> T; - pub fn atomic_xadd_acq<T>(dst: *mut T, src: T) -> T; - pub fn atomic_xadd_rel<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xadd_seqcst<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xadd_acquire<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xadd_release<T>(dst: *mut T, src: T) -> T; - pub fn atomic_xsub<T>(dst: *mut T, src: T) -> T; - pub fn atomic_xsub_acq<T>(dst: *mut T, src: T) -> T; - pub fn atomic_xsub_rel<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xsub_seqcst<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xsub_acquire<T>(dst: *mut T, src: T) -> T; + pub fn atomic_xsub_release<T>(dst: *mut T, src: T) -> T; } } @@ -35,45 +35,45 @@ pub fn main() { unsafe { let mut x: Box<_> = Box::new(1); - assert_eq!(rusti::atomic_load(&*x), 1); + assert_eq!(rusti::atomic_load_seqcst(&*x), 1); *x = 5; - assert_eq!(rusti::atomic_load_acq(&*x), 5); + assert_eq!(rusti::atomic_load_acquire(&*x), 5); - rusti::atomic_store(&mut *x,3); + rusti::atomic_store_seqcst(&mut *x,3); assert_eq!(*x, 3); - rusti::atomic_store_rel(&mut *x,1); + rusti::atomic_store_release(&mut *x,1); assert_eq!(*x, 1); - assert_eq!(rusti::atomic_cxchg(&mut *x, 1, 2), (1, true)); + assert_eq!(rusti::atomic_cxchg_seqcst_seqcst(&mut *x, 1, 2), (1, true)); assert_eq!(*x, 2); - assert_eq!(rusti::atomic_cxchg_acq(&mut *x, 1, 3), (2, false)); + assert_eq!(rusti::atomic_cxchg_acquire_acquire(&mut *x, 1, 3), (2, false)); assert_eq!(*x, 2); - assert_eq!(rusti::atomic_cxchg_rel(&mut *x, 2, 1), (2, true)); + assert_eq!(rusti::atomic_cxchg_release_relaxed(&mut *x, 2, 1), (2, true)); assert_eq!(*x, 1); - assert_eq!(rusti::atomic_xchg(&mut *x, 0), 1); + assert_eq!(rusti::atomic_xchg_seqcst(&mut *x, 0), 1); assert_eq!(*x, 0); - assert_eq!(rusti::atomic_xchg_acq(&mut *x, 1), 0); + assert_eq!(rusti::atomic_xchg_acquire(&mut *x, 1), 0); assert_eq!(*x, 1); - assert_eq!(rusti::atomic_xchg_rel(&mut *x, 0), 1); + assert_eq!(rusti::atomic_xchg_release(&mut *x, 0), 1); assert_eq!(*x, 0); - assert_eq!(rusti::atomic_xadd(&mut *x, 1), 0); - assert_eq!(rusti::atomic_xadd_acq(&mut *x, 1), 1); - assert_eq!(rusti::atomic_xadd_rel(&mut *x, 1), 2); + assert_eq!(rusti::atomic_xadd_seqcst(&mut *x, 1), 0); + assert_eq!(rusti::atomic_xadd_acquire(&mut *x, 1), 1); + assert_eq!(rusti::atomic_xadd_release(&mut *x, 1), 2); assert_eq!(*x, 3); - assert_eq!(rusti::atomic_xsub(&mut *x, 1), 3); - assert_eq!(rusti::atomic_xsub_acq(&mut *x, 1), 2); - assert_eq!(rusti::atomic_xsub_rel(&mut *x, 1), 1); + assert_eq!(rusti::atomic_xsub_seqcst(&mut *x, 1), 3); + assert_eq!(rusti::atomic_xsub_acquire(&mut *x, 1), 2); + assert_eq!(rusti::atomic_xsub_release(&mut *x, 1), 1); assert_eq!(*x, 0); loop { - let res = rusti::atomic_cxchgweak(&mut *x, 0, 1); + let res = rusti::atomic_cxchgweak_seqcst_seqcst(&mut *x, 0, 1); assert_eq!(res.0, 0); if res.1 { break; @@ -82,7 +82,7 @@ pub fn main() { assert_eq!(*x, 1); loop { - let res = rusti::atomic_cxchgweak_acq(&mut *x, 1, 2); + let res = rusti::atomic_cxchgweak_acquire_acquire(&mut *x, 1, 2); assert_eq!(res.0, 1); if res.1 { break; @@ -91,7 +91,7 @@ pub fn main() { assert_eq!(*x, 2); loop { - let res = rusti::atomic_cxchgweak_rel(&mut *x, 2, 3); + let res = rusti::atomic_cxchgweak_release_relaxed(&mut *x, 2, 3); assert_eq!(res.0, 2); if res.1 { break; diff --git a/src/test/ui/intrinsics/non-integer-atomic.rs b/src/test/ui/intrinsics/non-integer-atomic.rs index 00a7f368a0f..85ea81ba679 100644 --- a/src/test/ui/intrinsics/non-integer-atomic.rs +++ b/src/test/ui/intrinsics/non-integer-atomic.rs @@ -12,81 +12,81 @@ pub type Bar = &'static Fn(); pub type Quux = [u8; 100]; pub unsafe fn test_bool_load(p: &mut bool, v: bool) { - intrinsics::atomic_load(p); - //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `bool` + intrinsics::atomic_load_seqcst(p); + //~^ ERROR `atomic_load_seqcst` intrinsic: expected basic integer type, found `bool` } pub unsafe fn test_bool_store(p: &mut bool, v: bool) { - intrinsics::atomic_store(p, v); - //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `bool` + intrinsics::atomic_store_seqcst(p, v); + //~^ ERROR `atomic_store_seqcst` intrinsic: expected basic integer type, found `bool` } pub unsafe fn test_bool_xchg(p: &mut bool, v: bool) { - intrinsics::atomic_xchg(p, v); - //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `bool` + intrinsics::atomic_xchg_seqcst(p, v); + //~^ ERROR `atomic_xchg_seqcst` intrinsic: expected basic integer type, found `bool` } pub unsafe fn test_bool_cxchg(p: &mut bool, v: bool) { - intrinsics::atomic_cxchg(p, v, v); - //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `bool` + intrinsics::atomic_cxchg_seqcst_seqcst(p, v, v); + //~^ ERROR `atomic_cxchg_seqcst_seqcst` intrinsic: expected basic integer type, found `bool` } pub unsafe fn test_Foo_load(p: &mut Foo, v: Foo) { - intrinsics::atomic_load(p); - //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `Foo` + intrinsics::atomic_load_seqcst(p); + //~^ ERROR `atomic_load_seqcst` intrinsic: expected basic integer type, found `Foo` } pub unsafe fn test_Foo_store(p: &mut Foo, v: Foo) { - intrinsics::atomic_store(p, v); - //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `Foo` + intrinsics::atomic_store_seqcst(p, v); + //~^ ERROR `atomic_store_seqcst` intrinsic: expected basic integer type, found `Foo` } pub unsafe fn test_Foo_xchg(p: &mut Foo, v: Foo) { - intrinsics::atomic_xchg(p, v); - //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `Foo` + intrinsics::atomic_xchg_seqcst(p, v); + //~^ ERROR `atomic_xchg_seqcst` intrinsic: expected basic integer type, found `Foo` } pub unsafe fn test_Foo_cxchg(p: &mut Foo, v: Foo) { - intrinsics::atomic_cxchg(p, v, v); - //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `Foo` + intrinsics::atomic_cxchg_seqcst_seqcst(p, v, v); + //~^ ERROR `atomic_cxchg_seqcst_seqcst` intrinsic: expected basic integer type, found `Foo` } pub unsafe fn test_Bar_load(p: &mut Bar, v: Bar) { - intrinsics::atomic_load(p); + intrinsics::atomic_load_seqcst(p); //~^ ERROR expected basic integer type, found `&dyn Fn()` } pub unsafe fn test_Bar_store(p: &mut Bar, v: Bar) { - intrinsics::atomic_store(p, v); + intrinsics::atomic_store_seqcst(p, v); //~^ ERROR expected basic integer type, found `&dyn Fn()` } pub unsafe fn test_Bar_xchg(p: &mut Bar, v: Bar) { - intrinsics::atomic_xchg(p, v); + intrinsics::atomic_xchg_seqcst(p, v); //~^ ERROR expected basic integer type, found `&dyn Fn()` } pub unsafe fn test_Bar_cxchg(p: &mut Bar, v: Bar) { - intrinsics::atomic_cxchg(p, v, v); + intrinsics::atomic_cxchg_seqcst_seqcst(p, v, v); //~^ ERROR expected basic integer type, found `&dyn Fn()` } pub unsafe fn test_Quux_load(p: &mut Quux, v: Quux) { - intrinsics::atomic_load(p); - //~^ ERROR `atomic_load` intrinsic: expected basic integer type, found `[u8; 100]` + intrinsics::atomic_load_seqcst(p); + //~^ ERROR `atomic_load_seqcst` intrinsic: expected basic integer type, found `[u8; 100]` } pub unsafe fn test_Quux_store(p: &mut Quux, v: Quux) { - intrinsics::atomic_store(p, v); - //~^ ERROR `atomic_store` intrinsic: expected basic integer type, found `[u8; 100]` + intrinsics::atomic_store_seqcst(p, v); + //~^ ERROR `atomic_store_seqcst` intrinsic: expected basic integer type, found `[u8; 100]` } pub unsafe fn test_Quux_xchg(p: &mut Quux, v: Quux) { - intrinsics::atomic_xchg(p, v); - //~^ ERROR `atomic_xchg` intrinsic: expected basic integer type, found `[u8; 100]` + intrinsics::atomic_xchg_seqcst(p, v); + //~^ ERROR `atomic_xchg_seqcst` intrinsic: expected basic integer type, found `[u8; 100]` } pub unsafe fn test_Quux_cxchg(p: &mut Quux, v: Quux) { - intrinsics::atomic_cxchg(p, v, v); - //~^ ERROR `atomic_cxchg` intrinsic: expected basic integer type, found `[u8; 100]` + intrinsics::atomic_cxchg_seqcst_seqcst(p, v, v); + //~^ ERROR `atomic_cxchg_seqcst_seqcst` intrinsic: expected basic integer type, found `[u8; 100]` } diff --git a/src/test/ui/intrinsics/non-integer-atomic.stderr b/src/test/ui/intrinsics/non-integer-atomic.stderr index ee485c21cd6..32791a8e8b7 100644 --- a/src/test/ui/intrinsics/non-integer-atomic.stderr +++ b/src/test/ui/intrinsics/non-integer-atomic.stderr @@ -1,98 +1,98 @@ -error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer type, found `bool` +error[E0511]: invalid monomorphization of `atomic_load_seqcst` intrinsic: expected basic integer type, found `bool` --> $DIR/non-integer-atomic.rs:15:5 | -LL | intrinsics::atomic_load(p); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_load_seqcst(p); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer type, found `bool` +error[E0511]: invalid monomorphization of `atomic_store_seqcst` intrinsic: expected basic integer type, found `bool` --> $DIR/non-integer-atomic.rs:20:5 | -LL | intrinsics::atomic_store(p, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_store_seqcst(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer type, found `bool` +error[E0511]: invalid monomorphization of `atomic_xchg_seqcst` intrinsic: expected basic integer type, found `bool` --> $DIR/non-integer-atomic.rs:25:5 | -LL | intrinsics::atomic_xchg(p, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_xchg_seqcst(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer type, found `bool` +error[E0511]: invalid monomorphization of `atomic_cxchg_seqcst_seqcst` intrinsic: expected basic integer type, found `bool` --> $DIR/non-integer-atomic.rs:30:5 | -LL | intrinsics::atomic_cxchg(p, v, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_cxchg_seqcst_seqcst(p, v, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer type, found `Foo` +error[E0511]: invalid monomorphization of `atomic_load_seqcst` intrinsic: expected basic integer type, found `Foo` --> $DIR/non-integer-atomic.rs:35:5 | -LL | intrinsics::atomic_load(p); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_load_seqcst(p); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer type, found `Foo` +error[E0511]: invalid monomorphization of `atomic_store_seqcst` intrinsic: expected basic integer type, found `Foo` --> $DIR/non-integer-atomic.rs:40:5 | -LL | intrinsics::atomic_store(p, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_store_seqcst(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer type, found `Foo` +error[E0511]: invalid monomorphization of `atomic_xchg_seqcst` intrinsic: expected basic integer type, found `Foo` --> $DIR/non-integer-atomic.rs:45:5 | -LL | intrinsics::atomic_xchg(p, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_xchg_seqcst(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer type, found `Foo` +error[E0511]: invalid monomorphization of `atomic_cxchg_seqcst_seqcst` intrinsic: expected basic integer type, found `Foo` --> $DIR/non-integer-atomic.rs:50:5 | -LL | intrinsics::atomic_cxchg(p, v, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_cxchg_seqcst_seqcst(p, v, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer type, found `&dyn Fn()` +error[E0511]: invalid monomorphization of `atomic_load_seqcst` intrinsic: expected basic integer type, found `&dyn Fn()` --> $DIR/non-integer-atomic.rs:55:5 | -LL | intrinsics::atomic_load(p); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_load_seqcst(p); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer type, found `&dyn Fn()` +error[E0511]: invalid monomorphization of `atomic_store_seqcst` intrinsic: expected basic integer type, found `&dyn Fn()` --> $DIR/non-integer-atomic.rs:60:5 | -LL | intrinsics::atomic_store(p, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_store_seqcst(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer type, found `&dyn Fn()` +error[E0511]: invalid monomorphization of `atomic_xchg_seqcst` intrinsic: expected basic integer type, found `&dyn Fn()` --> $DIR/non-integer-atomic.rs:65:5 | -LL | intrinsics::atomic_xchg(p, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_xchg_seqcst(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer type, found `&dyn Fn()` +error[E0511]: invalid monomorphization of `atomic_cxchg_seqcst_seqcst` intrinsic: expected basic integer type, found `&dyn Fn()` --> $DIR/non-integer-atomic.rs:70:5 | -LL | intrinsics::atomic_cxchg(p, v, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_cxchg_seqcst_seqcst(p, v, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer type, found `[u8; 100]` +error[E0511]: invalid monomorphization of `atomic_load_seqcst` intrinsic: expected basic integer type, found `[u8; 100]` --> $DIR/non-integer-atomic.rs:75:5 | -LL | intrinsics::atomic_load(p); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_load_seqcst(p); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer type, found `[u8; 100]` +error[E0511]: invalid monomorphization of `atomic_store_seqcst` intrinsic: expected basic integer type, found `[u8; 100]` --> $DIR/non-integer-atomic.rs:80:5 | -LL | intrinsics::atomic_store(p, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_store_seqcst(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer type, found `[u8; 100]` +error[E0511]: invalid monomorphization of `atomic_xchg_seqcst` intrinsic: expected basic integer type, found `[u8; 100]` --> $DIR/non-integer-atomic.rs:85:5 | -LL | intrinsics::atomic_xchg(p, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_xchg_seqcst(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer type, found `[u8; 100]` +error[E0511]: invalid monomorphization of `atomic_cxchg_seqcst_seqcst` intrinsic: expected basic integer type, found `[u8; 100]` --> $DIR/non-integer-atomic.rs:90:5 | -LL | intrinsics::atomic_cxchg(p, v, v); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | intrinsics::atomic_cxchg_seqcst_seqcst(p, v, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 16 previous errors diff --git a/src/test/ui/issues/issue-14366.stderr b/src/test/ui/issues/issue-14366.stderr index b96b07c91a1..10a73b245ac 100644 --- a/src/test/ui/issues/issue-14366.stderr +++ b/src/test/ui/issues/issue-14366.stderr @@ -5,7 +5,7 @@ LL | let _x = "test" as &dyn (::std::any::Any); | ^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` - = note: required for the cast to the object type `dyn Any` + = note: required for the cast from `str` to the object type `dyn Any` help: consider borrowing the value, since `&str` can be coerced into `dyn Any` | LL | let _x = &"test" as &dyn (::std::any::Any); diff --git a/src/test/ui/issues/issue-22034.stderr b/src/test/ui/issues/issue-22034.stderr index edcd21ebd6b..b32de5b24b9 100644 --- a/src/test/ui/issues/issue-22034.stderr +++ b/src/test/ui/issues/issue-22034.stderr @@ -6,7 +6,7 @@ LL | &mut *(ptr as *mut dyn Fn()) | = help: the trait `Fn<()>` is not implemented for `()` = note: wrap the `()` in a closure with no arguments: `|| { /* code */ }` - = note: required for the cast to the object type `dyn Fn()` + = note: required for the cast from `()` to the object type `dyn Fn()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-22872.stderr b/src/test/ui/issues/issue-22872.stderr index cd96646d751..a84cb7d8c59 100644 --- a/src/test/ui/issues/issue-22872.stderr +++ b/src/test/ui/issues/issue-22872.stderr @@ -10,7 +10,7 @@ note: required because of the requirements on the impl of `for<'b> Wrap<'b>` for | LL | impl<'b, P> Wrap<'b> for Wrapper<P> | ^^^^^^^^ ^^^^^^^^^^ - = note: required for the cast to the object type `dyn for<'b> Wrap<'b>` + = note: required for the cast from `Wrapper<P>` to the object type `dyn for<'b> Wrap<'b>` help: consider further restricting the associated type | LL | fn push_process<P>(process: P) where P: Process<'static>, <P as Process<'_>>::Item: Iterator { diff --git a/src/test/ui/issues/issue-26094.rs b/src/test/ui/issues/issue-26094.rs index 981c3abb4ba..df8c2f73910 100644 --- a/src/test/ui/issues/issue-26094.rs +++ b/src/test/ui/issues/issue-26094.rs @@ -1,6 +1,6 @@ macro_rules! some_macro { ($other: expr) => ({ - $other(None) //~ NOTE argument unexpected + $other(None) //~ NOTE argument of type `Option<_>` unexpected }) } diff --git a/src/test/ui/issues/issue-26094.stderr b/src/test/ui/issues/issue-26094.stderr index 1013518e1da..881a6e538ee 100644 --- a/src/test/ui/issues/issue-26094.stderr +++ b/src/test/ui/issues/issue-26094.stderr @@ -2,7 +2,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied --> $DIR/issue-26094.rs:10:17 | LL | $other(None) - | ---- argument unexpected + | ---- argument of type `Option<_>` unexpected ... LL | some_macro!(some_function); | ^^^^^^^^^^^^^ diff --git a/src/test/ui/issues/issue-4935.stderr b/src/test/ui/issues/issue-4935.stderr index b4cebe2a68b..aab19a699ac 100644 --- a/src/test/ui/issues/issue-4935.stderr +++ b/src/test/ui/issues/issue-4935.stderr @@ -2,7 +2,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied --> $DIR/issue-4935.rs:5:13 | LL | fn main() { foo(5, 6) } - | ^^^ - argument unexpected + | ^^^ - argument of type `{integer}` unexpected | note: function defined here --> $DIR/issue-4935.rs:3:4 diff --git a/src/test/ui/issues/issue-51515.rs b/src/test/ui/issues/issue-51515.rs index 54fd176de75..797c1085d51 100644 --- a/src/test/ui/issues/issue-51515.rs +++ b/src/test/ui/issues/issue-51515.rs @@ -5,8 +5,6 @@ fn main() { *foo = 32; //~^ ERROR cannot assign to `*foo`, which is behind a `&` reference let bar = foo; - //~^ HELP consider changing this to be a mutable reference - //~| SUGGESTION &mut i32 *bar = 64; //~^ ERROR cannot assign to `*bar`, which is behind a `&` reference } diff --git a/src/test/ui/issues/issue-51515.stderr b/src/test/ui/issues/issue-51515.stderr index 62bb462faa2..067bdef8b67 100644 --- a/src/test/ui/issues/issue-51515.stderr +++ b/src/test/ui/issues/issue-51515.stderr @@ -8,11 +8,10 @@ LL | *foo = 32; | ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written error[E0594]: cannot assign to `*bar`, which is behind a `&` reference - --> $DIR/issue-51515.rs:10:5 + --> $DIR/issue-51515.rs:8:5 | LL | let bar = foo; - | --- help: consider changing this to be a mutable reference: `&mut i32` -... + | --- consider changing this binding's type to be: `&mut i32` LL | *bar = 64; | ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written diff --git a/src/test/ui/issues/issue-7013.stderr b/src/test/ui/issues/issue-7013.stderr index 98ed67507b1..f6cb1cbdc11 100644 --- a/src/test/ui/issues/issue-7013.stderr +++ b/src/test/ui/issues/issue-7013.stderr @@ -11,7 +11,7 @@ note: required because it appears within the type `B` | LL | struct B { | ^ - = note: required for the cast to the object type `dyn Foo + Send` + = note: required for the cast from `B` to the object type `dyn Foo + Send` error: aborting due to previous error diff --git a/src/test/ui/kindck/kindck-impl-type-params.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr index 32759d2fa0e..902349135c5 100644 --- a/src/test/ui/kindck/kindck-impl-type-params.stderr +++ b/src/test/ui/kindck/kindck-impl-type-params.stderr @@ -9,7 +9,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T | LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {} | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable<T>` + = note: required for the cast from `S<T>` to the object type `dyn Gettable<T>` help: consider restricting type parameter `T` | LL | fn f<T: std::marker::Send>(val: T) { @@ -26,7 +26,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T | LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {} | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable<T>` + = note: required for the cast from `S<T>` to the object type `dyn Gettable<T>` help: consider restricting type parameter `T` | LL | fn f<T: std::marker::Copy>(val: T) { @@ -43,7 +43,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T | LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {} | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable<T>` + = note: required for the cast from `S<T>` to the object type `dyn Gettable<T>` help: consider restricting type parameter `T` | LL | fn g<T: std::marker::Send>(val: T) { @@ -60,7 +60,7 @@ note: required because of the requirements on the impl of `Gettable<T>` for `S<T | LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {} | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable<T>` + = note: required for the cast from `S<T>` to the object type `dyn Gettable<T>` help: consider restricting type parameter `T` | LL | fn g<T: std::marker::Copy>(val: T) { @@ -78,7 +78,7 @@ note: required because of the requirements on the impl of `Gettable<String>` for | LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {} | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable<String>` + = note: required for the cast from `S<String>` to the object type `dyn Gettable<String>` error[E0277]: the trait bound `Foo: Copy` is not satisfied --> $DIR/kindck-impl-type-params.rs:43:37 @@ -92,7 +92,7 @@ note: required because of the requirements on the impl of `Gettable<Foo>` for `S | LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {} | ^^^^^^^^^^^ ^^^^ - = note: required for the cast to the object type `dyn Gettable<Foo>` + = note: required for the cast from `S<Foo>` to the object type `dyn Gettable<Foo>` help: consider annotating `Foo` with `#[derive(Copy)]` | LL | #[derive(Copy)] diff --git a/src/test/ui/methods/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr index 77308a2c521..57662e1e265 100644 --- a/src/test/ui/methods/method-call-err-msg.stderr +++ b/src/test/ui/methods/method-call-err-msg.stderr @@ -2,7 +2,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied --> $DIR/method-call-err-msg.rs:13:7 | LL | x.zero(0) - | ^^^^ - argument unexpected + | ^^^^ - argument of type `{integer}` unexpected | note: associated function defined here --> $DIR/method-call-err-msg.rs:5:8 diff --git a/src/test/ui/mismatched_types/cast-rfc0401.stderr b/src/test/ui/mismatched_types/cast-rfc0401.stderr index e63ca6e11de..eab8e8e80c4 100644 --- a/src/test/ui/mismatched_types/cast-rfc0401.stderr +++ b/src/test/ui/mismatched_types/cast-rfc0401.stderr @@ -220,7 +220,7 @@ LL | let _ = fat_v as *const dyn Foo; | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[u8]` - = note: required for the cast to the object type `dyn Foo` + = note: required for the cast from `[u8]` to the object type `dyn Foo` help: consider borrowing the value, since `&[u8]` can be coerced into `dyn Foo` | LL | let _ = &fat_v as *const dyn Foo; @@ -233,7 +233,7 @@ LL | let _ = a as *const dyn Foo; | ^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` - = note: required for the cast to the object type `dyn Foo` + = note: required for the cast from `str` to the object type `dyn Foo` help: consider borrowing the value, since `&str` can be coerced into `dyn Foo` | LL | let _ = &a as *const dyn Foo; diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr index 4000b2ba312..cb93a7ad900 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr @@ -32,7 +32,7 @@ error[E0057]: this function takes 1 argument but 2 arguments were supplied --> $DIR/overloaded-calls-bad.rs:31:15 | LL | let ans = s("burma", "shave"); - | ^ ------- ------- argument unexpected + | ^ ------- ------- argument of type `&'static str` unexpected | | | expected `isize`, found `&str` | diff --git a/src/test/ui/never_type/fallback-closure-wrap.fallback.stderr b/src/test/ui/never_type/fallback-closure-wrap.fallback.stderr index 78d1a3caf4a..6b9635d4a60 100644 --- a/src/test/ui/never_type/fallback-closure-wrap.fallback.stderr +++ b/src/test/ui/never_type/fallback-closure-wrap.fallback.stderr @@ -10,7 +10,7 @@ LL | | }) as Box<dyn FnMut()>); | = note: expected unit type `()` found type `!` - = note: required for the cast to the object type `dyn FnMut()` + = note: required for the cast from `[closure@$DIR/fallback-closure-wrap.rs:18:40: 21:6]` to the object type `dyn FnMut()` error: aborting due to previous error diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr index 68da9f0dc88..e676d7372e8 100644 --- a/src/test/ui/span/issue-34264.stderr +++ b/src/test/ui/span/issue-34264.stderr @@ -54,7 +54,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/issue-34264.rs:7:5 | LL | foo(Some(42), 2, ""); - | ^^^ -- argument unexpected + | ^^^ -- argument of type `&'static str` unexpected | note: function defined here --> $DIR/issue-34264.rs:1:4 @@ -84,7 +84,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied --> $DIR/issue-34264.rs:10:5 | LL | bar(1, 2, 3); - | ^^^ - argument unexpected + | ^^^ - argument of type `{integer}` unexpected | note: function defined here --> $DIR/issue-34264.rs:3:4 diff --git a/src/test/ui/specialization/min_specialization/issue-79224.rs b/src/test/ui/specialization/min_specialization/issue-79224.rs new file mode 100644 index 00000000000..408732fe944 --- /dev/null +++ b/src/test/ui/specialization/min_specialization/issue-79224.rs @@ -0,0 +1,24 @@ +#![feature(min_specialization)] +use std::fmt::{self, Display}; + +pub enum Cow<'a, B: ?Sized + 'a, O = <B as ToOwned>::Owned> +where + B: ToOwned, +{ + Borrowed(&'a B), + Owned(O), +} + +impl ToString for Cow<'_, str> { + fn to_string(&self) -> String { + String::new() + } +} + +impl<B: ?Sized> Display for Cow<'_, B> { //~ ERROR: the trait bound `B: Clone` is not satisfied [E0277] + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR: the trait bound `B: Clone` is not satisfied [E0277] + write!(f, "foo") + } +} + +fn main() {} diff --git a/src/test/ui/specialization/min_specialization/issue-79224.stderr b/src/test/ui/specialization/min_specialization/issue-79224.stderr new file mode 100644 index 00000000000..44c6ec1426b --- /dev/null +++ b/src/test/ui/specialization/min_specialization/issue-79224.stderr @@ -0,0 +1,29 @@ +error[E0277]: the trait bound `B: Clone` is not satisfied + --> $DIR/issue-79224.rs:18:17 + | +LL | impl<B: ?Sized> Display for Cow<'_, B> { + | ^^^^^^^ the trait `Clone` is not implemented for `B` + | + = note: required because of the requirements on the impl of `ToOwned` for `B` +help: consider further restricting this bound + | +LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> { + | +++++++++++++++++++ + +error[E0277]: the trait bound `B: Clone` is not satisfied + --> $DIR/issue-79224.rs:19:5 + | +LL | / fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +LL | | write!(f, "foo") +LL | | } + | |_____^ the trait `Clone` is not implemented for `B` + | + = note: required because of the requirements on the impl of `ToOwned` for `B` +help: consider further restricting this bound + | +LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> { + | +++++++++++++++++++ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr b/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr index 3d367eca707..805c75f464c 100644 --- a/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr +++ b/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr @@ -2,7 +2,7 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple-errors.rs:6:34 | LL | let _: Option<(i32, bool)> = Some(1, 2); - | ^^^^ - - argument unexpected + | ^^^^ - - argument of type `{integer}` unexpected | | | expected tuple, found integer | @@ -22,7 +22,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied --> $DIR/args-instead-of-tuple-errors.rs:8:5 | LL | int_bool(1, 2); - | ^^^^^^^^ - - argument unexpected + | ^^^^^^^^ - - argument of type `{integer}` unexpected | | | expected tuple, found integer | diff --git a/src/test/ui/suggestions/derive-macro-missing-bounds.stderr b/src/test/ui/suggestions/derive-macro-missing-bounds.stderr index 501d083e2bc..4186dc7cb35 100644 --- a/src/test/ui/suggestions/derive-macro-missing-bounds.stderr +++ b/src/test/ui/suggestions/derive-macro-missing-bounds.stderr @@ -33,7 +33,7 @@ LL | impl<T: Debug + Trait> Debug for Inner<T> { | ^^^^^ ^^^^^^^^ = note: 1 redundant requirement hidden = note: required because of the requirements on the impl of `Debug` for `&c::Inner<T>` - = note: required for the cast to the object type `dyn Debug` + = note: required for the cast from `&c::Inner<T>` to the object type `dyn Debug` = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | @@ -55,7 +55,7 @@ LL | impl<T> Debug for Inner<T> where T: Debug, T: Trait { | ^^^^^ ^^^^^^^^ = note: 1 redundant requirement hidden = note: required because of the requirements on the impl of `Debug` for `&d::Inner<T>` - = note: required for the cast to the object type `dyn Debug` + = note: required for the cast from `&d::Inner<T>` to the object type `dyn Debug` = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | @@ -77,7 +77,7 @@ LL | impl<T> Debug for Inner<T> where T: Debug + Trait { | ^^^^^ ^^^^^^^^ = note: 1 redundant requirement hidden = note: required because of the requirements on the impl of `Debug` for `&e::Inner<T>` - = note: required for the cast to the object type `dyn Debug` + = note: required for the cast from `&e::Inner<T>` to the object type `dyn Debug` = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | @@ -99,7 +99,7 @@ LL | impl<T: Debug> Debug for Inner<T> where T: Trait { | ^^^^^ ^^^^^^^^ = note: 1 redundant requirement hidden = note: required because of the requirements on the impl of `Debug` for `&f::Inner<T>` - = note: required for the cast to the object type `dyn Debug` + = note: required for the cast from `&f::Inner<T>` to the object type `dyn Debug` = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider restricting type parameter `T` | diff --git a/src/test/ui/suggestions/option-content-move.stderr b/src/test/ui/suggestions/option-content-move.stderr index a9e540084e5..fccfbe1d744 100644 --- a/src/test/ui/suggestions/option-content-move.stderr +++ b/src/test/ui/suggestions/option-content-move.stderr @@ -2,23 +2,37 @@ error[E0507]: cannot move out of `selection.1` which is behind a shared referenc --> $DIR/option-content-move.rs:11:20 | LL | if selection.1.unwrap().contains(selection.0) { - | ^^^^^^^^^^^ move occurs because `selection.1` has type `Option<String>`, which does not implement the `Copy` trait + | ^^^^^^^^^^^ -------- `selection.1` moved due to this method call + | | + | move occurs because `selection.1` has type `Option<String>`, which does not implement the `Copy` trait | -help: consider borrowing the `Option`'s content +note: this function takes ownership of the receiver `self`, which moves `selection.1` + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub const fn unwrap(self) -> T { + | ^^^^ +help: consider calling `.as_ref()` to borrow the type's contents | LL | if selection.1.as_ref().unwrap().contains(selection.0) { - | +++++++++ + | +++++++++ error[E0507]: cannot move out of `selection.1` which is behind a shared reference --> $DIR/option-content-move.rs:29:20 | LL | if selection.1.unwrap().contains(selection.0) { - | ^^^^^^^^^^^ move occurs because `selection.1` has type `Result<String, String>`, which does not implement the `Copy` trait + | ^^^^^^^^^^^ -------- `selection.1` moved due to this method call + | | + | move occurs because `selection.1` has type `Result<String, String>`, which does not implement the `Copy` trait + | +note: this function takes ownership of the receiver `self`, which moves `selection.1` + --> $SRC_DIR/core/src/result.rs:LL:COL | -help: consider borrowing the `Result`'s content +LL | pub fn unwrap(self) -> T + | ^^^^ +help: consider calling `.as_ref()` to borrow the type's contents | LL | if selection.1.as_ref().unwrap().contains(selection.0) { - | +++++++++ + | +++++++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/suggest-borrow-to-dyn-object.rs b/src/test/ui/suggestions/suggest-borrow-to-dyn-object.rs new file mode 100644 index 00000000000..120fc538307 --- /dev/null +++ b/src/test/ui/suggestions/suggest-borrow-to-dyn-object.rs @@ -0,0 +1,16 @@ +use std::ffi::{OsStr, OsString}; +use std::path::Path; + +fn check(p: &dyn AsRef<Path>) { + let m = std::fs::metadata(&p); + println!("{:?}", &m); +} + +fn main() { + let s: OsString = ".".into(); + let s: &OsStr = &s; + check(s); + //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time + //~| HELP within `OsStr`, the trait `Sized` is not implemented for `[u8]` + //~| HELP consider borrowing the value, since `&OsStr` can be coerced into `dyn AsRef<Path>` +} diff --git a/src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr b/src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr new file mode 100644 index 00000000000..6b6e406130e --- /dev/null +++ b/src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr @@ -0,0 +1,19 @@ +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time + --> $DIR/suggest-borrow-to-dyn-object.rs:12:11 + | +LL | check(s); + | ----- ^ doesn't have a size known at compile-time + | | + | required by a bound introduced by this call + | + = help: within `OsStr`, the trait `Sized` is not implemented for `[u8]` + = note: required because it appears within the type `OsStr` + = note: required for the cast from `OsStr` to the object type `dyn AsRef<Path>` +help: consider borrowing the value, since `&OsStr` can be coerced into `dyn AsRef<Path>` + | +LL | check(&s); + | + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/traits/coercion-generic-bad.stderr b/src/test/ui/traits/coercion-generic-bad.stderr index b213ee635df..93d6770eb47 100644 --- a/src/test/ui/traits/coercion-generic-bad.stderr +++ b/src/test/ui/traits/coercion-generic-bad.stderr @@ -5,7 +5,7 @@ LL | let s: Box<dyn Trait<isize>> = Box::new(Struct { person: "Fred" }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<isize>` is not implemented for `Struct` | = help: the trait `Trait<&'static str>` is implemented for `Struct` - = note: required for the cast to the object type `dyn Trait<isize>` + = note: required for the cast from `Struct` to the object type `dyn Trait<isize>` error: aborting due to previous error diff --git a/src/test/ui/traits/map-types.stderr b/src/test/ui/traits/map-types.stderr index a4686edb717..f685c50b07d 100644 --- a/src/test/ui/traits/map-types.stderr +++ b/src/test/ui/traits/map-types.stderr @@ -5,7 +5,7 @@ LL | let y: Box<dyn Map<usize, isize>> = Box::new(x); | ^^^^^^^^^^^ the trait `Map<usize, isize>` is not implemented for `Box<dyn Map<isize, isize>>` | = help: the trait `Map<K, V>` is implemented for `HashMap<K, V>` - = note: required for the cast to the object type `dyn Map<usize, isize>` + = note: required for the cast from `Box<dyn Map<isize, isize>>` to the object type `dyn Map<usize, isize>` error: aborting due to previous error diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr index 44f32e0cec9..3985372119e 100644 --- a/src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr +++ b/src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr @@ -15,7 +15,7 @@ error[E0277]: the trait bound `&dyn Foo: Bar<_>` is not satisfied LL | let _ = x as &dyn Bar<_>; // Ambiguous | ^ the trait `Bar<_>` is not implemented for `&dyn Foo` | - = note: required for the cast to the object type `dyn Bar<_>` + = note: required for the cast from `&dyn Foo` to the object type `dyn Bar<_>` error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-2.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-2.stderr index 4ae4c8552c1..93c71f54eb5 100644 --- a/src/test/ui/traits/trait-upcasting/type-checking-test-2.stderr +++ b/src/test/ui/traits/trait-upcasting/type-checking-test-2.stderr @@ -15,7 +15,7 @@ error[E0277]: the trait bound `&dyn Foo<i32>: Bar<u32>` is not satisfied LL | let _ = x as &dyn Bar<u32>; // Error | ^ the trait `Bar<u32>` is not implemented for `&dyn Foo<i32>` | - = note: required for the cast to the object type `dyn Bar<u32>` + = note: required for the cast from `&dyn Foo<i32>` to the object type `dyn Bar<u32>` error[E0605]: non-primitive cast: `&dyn Foo<u32>` as `&dyn Bar<_>` --> $DIR/type-checking-test-2.rs:26:13 @@ -34,7 +34,7 @@ error[E0277]: the trait bound `&dyn Foo<u32>: Bar<_>` is not satisfied LL | let a = x as &dyn Bar<_>; // Ambiguous | ^ the trait `Bar<_>` is not implemented for `&dyn Foo<u32>` | - = note: required for the cast to the object type `dyn Bar<_>` + = note: required for the cast from `&dyn Foo<u32>` to the object type `dyn Bar<_>` error: aborting due to 4 previous errors diff --git a/src/test/ui/tuple/wrong_argument_ice-3.stderr b/src/test/ui/tuple/wrong_argument_ice-3.stderr index 667b15776ef..2733fb3149b 100644 --- a/src/test/ui/tuple/wrong_argument_ice-3.stderr +++ b/src/test/ui/tuple/wrong_argument_ice-3.stderr @@ -2,7 +2,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied --> $DIR/wrong_argument_ice-3.rs:9:16 | LL | groups.push(new_group, vec![process]); - | ^^^^ --------- ------------- argument unexpected + | ^^^^ --------- ------------- argument of type `Vec<&Process>` unexpected | | | expected tuple, found struct `Vec` | diff --git a/src/test/ui/tuple/wrong_argument_ice-4.stderr b/src/test/ui/tuple/wrong_argument_ice-4.stderr index f8dfc4cd043..3645d11842f 100644 --- a/src/test/ui/tuple/wrong_argument_ice-4.stderr +++ b/src/test/ui/tuple/wrong_argument_ice-4.stderr @@ -6,7 +6,7 @@ LL | (|| {})(|| { LL | | LL | | let b = 1; LL | | }); - | |_____- argument unexpected + | |_____- argument of type `[closure@$DIR/wrong_argument_ice-4.rs:2:13: 5:6]` unexpected | note: closure defined here --> $DIR/wrong_argument_ice-4.rs:2:6 diff --git a/src/test/ui/type/type-ascription-instead-of-initializer.stderr b/src/test/ui/type/type-ascription-instead-of-initializer.stderr index 18ed4986f89..fcac6c495c4 100644 --- a/src/test/ui/type/type-ascription-instead-of-initializer.stderr +++ b/src/test/ui/type/type-ascription-instead-of-initializer.stderr @@ -11,7 +11,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied --> $DIR/type-ascription-instead-of-initializer.rs:2:12 | LL | let x: Vec::with_capacity(10, 20); - | ^^^^^^^^^^^^^^^^^^ -- argument unexpected + | ^^^^^^^^^^^^^^^^^^ -- argument of type `{integer}` unexpected | note: associated function defined here --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL diff --git a/src/test/ui/typeck/remove-extra-argument.stderr b/src/test/ui/typeck/remove-extra-argument.stderr index 815297765c1..703032a8322 100644 --- a/src/test/ui/typeck/remove-extra-argument.stderr +++ b/src/test/ui/typeck/remove-extra-argument.stderr @@ -2,7 +2,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied --> $DIR/remove-extra-argument.rs:6:5 | LL | l(vec![], vec![]) - | ^ ------ argument unexpected + | ^ ------ argument of type `Vec<_>` unexpected | note: function defined here --> $DIR/remove-extra-argument.rs:3:4 diff --git a/src/test/ui/typeck/struct-enum-wrong-args.stderr b/src/test/ui/typeck/struct-enum-wrong-args.stderr index 2ea822df275..f72082d5301 100644 --- a/src/test/ui/typeck/struct-enum-wrong-args.stderr +++ b/src/test/ui/typeck/struct-enum-wrong-args.stderr @@ -2,7 +2,7 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:6:13 | LL | let _ = Some(3, 2); - | ^^^^ - argument unexpected + | ^^^^ - argument of type `{integer}` unexpected | note: tuple variant defined here --> $SRC_DIR/core/src/option.rs:LL:COL @@ -18,9 +18,9 @@ error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:7:13 | LL | let _ = Ok(3, 6, 2); - | ^^ - - argument unexpected + | ^^ - - argument of type `{integer}` unexpected | | - | argument unexpected + | argument of type `{integer}` unexpected | note: tuple variant defined here --> $SRC_DIR/core/src/result.rs:LL:COL @@ -68,7 +68,7 @@ error[E0061]: this struct takes 1 argument but 2 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:10:13 | LL | let _ = Wrapper(5, 2); - | ^^^^^^^ - argument unexpected + | ^^^^^^^ - argument of type `{integer}` unexpected | note: tuple struct defined here --> $DIR/struct-enum-wrong-args.rs:2:8 @@ -116,7 +116,7 @@ error[E0061]: this struct takes 2 arguments but 3 arguments were supplied --> $DIR/struct-enum-wrong-args.rs:13:13 | LL | let _ = DoubleWrapper(5, 2, 7); - | ^^^^^^^^^^^^^ - argument unexpected + | ^^^^^^^^^^^^^ - argument of type `{integer}` unexpected | note: tuple struct defined here --> $DIR/struct-enum-wrong-args.rs:3:8 diff --git a/src/test/ui/unop-move-semantics.stderr b/src/test/ui/unop-move-semantics.stderr index 14052486cbb..65d866c716e 100644 --- a/src/test/ui/unop-move-semantics.stderr +++ b/src/test/ui/unop-move-semantics.stderr @@ -46,13 +46,25 @@ error[E0507]: cannot move out of `*m` which is behind a mutable reference --> $DIR/unop-move-semantics.rs:24:6 | LL | !*m; - | ^^ move occurs because `*m` has type `T`, which does not implement the `Copy` trait + | -^^ + | || + | |move occurs because `*m` has type `T`, which does not implement the `Copy` trait + | `*m` moved due to usage in operator + | +note: calling this operator moves the left-hand side + --> $SRC_DIR/core/src/ops/bit.rs:LL:COL + | +LL | fn not(self) -> Self::Output; + | ^^^^ error[E0507]: cannot move out of `*n` which is behind a shared reference --> $DIR/unop-move-semantics.rs:26:6 | LL | !*n; - | ^^ move occurs because `*n` has type `T`, which does not implement the `Copy` trait + | -^^ + | || + | |move occurs because `*n` has type `T`, which does not implement the `Copy` trait + | `*n` moved due to usage in operator error: aborting due to 5 previous errors diff --git a/src/test/ui/unsized/unsized-fn-param.stderr b/src/test/ui/unsized/unsized-fn-param.stderr index 3eecca0fa09..b4772605432 100644 --- a/src/test/ui/unsized/unsized-fn-param.stderr +++ b/src/test/ui/unsized/unsized-fn-param.stderr @@ -5,7 +5,7 @@ LL | foo11("bar", &"baz"); | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` - = note: required for the cast to the object type `dyn AsRef<Path>` + = note: required for the cast from `str` to the object type `dyn AsRef<Path>` help: consider borrowing the value, since `&str` can be coerced into `dyn AsRef<Path>` | LL | foo11(&"bar", &"baz"); @@ -18,7 +18,7 @@ LL | foo12(&"bar", "baz"); | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` - = note: required for the cast to the object type `dyn AsRef<Path>` + = note: required for the cast from `str` to the object type `dyn AsRef<Path>` help: consider borrowing the value, since `&str` can be coerced into `dyn AsRef<Path>` | LL | foo12(&"bar", &"baz"); @@ -31,7 +31,7 @@ LL | foo21("bar", &"baz"); | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` - = note: required for the cast to the object type `dyn AsRef<str>` + = note: required for the cast from `str` to the object type `dyn AsRef<str>` help: consider borrowing the value, since `&str` can be coerced into `dyn AsRef<str>` | LL | foo21(&"bar", &"baz"); @@ -44,7 +44,7 @@ LL | foo22(&"bar", "baz"); | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` - = note: required for the cast to the object type `dyn AsRef<str>` + = note: required for the cast from `str` to the object type `dyn AsRef<str>` help: consider borrowing the value, since `&str` can be coerced into `dyn AsRef<str>` | LL | foo22(&"bar", &"baz"); |
