diff --git a/compiler/rustc_middle/src/ty/error.rs b/compiler/rustc_middle/src/ty/error.rs index c8a700c4e280d..dfcf4f7136688 100644 --- a/compiler/rustc_middle/src/ty/error.rs +++ b/compiler/rustc_middle/src/ty/error.rs @@ -303,7 +303,7 @@ impl<'tcx> Ty<'tcx> { if tymut_string != "_" && (ty.is_simple_text() || tymut_string.len() < "mutable reference".len()) { - format!("`&{}`", tymut_string).into() + format!("`{}`", self).into() } else { // Unknown type name, it's long or has type arguments match mutbl { diff --git a/tests/ui/argument-suggestions/invalid_arguments.stderr b/tests/ui/argument-suggestions/invalid_arguments.stderr index 303f086957853..50e911373bc5c 100644 --- a/tests/ui/argument-suggestions/invalid_arguments.stderr +++ b/tests/ui/argument-suggestions/invalid_arguments.stderr @@ -16,7 +16,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:16:19 | LL | two_arg_same(1, ""); - | ------------ ^^ expected `i32`, found `&str` + | ------------ ^^ expected `i32`, found `&'static str` | | | arguments to this function are incorrect | @@ -30,7 +30,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:17:16 | LL | two_arg_same("", 1); - | ------------ ^^ expected `i32`, found `&str` + | ------------ ^^ expected `i32`, found `&'static str` | | | arguments to this function are incorrect | @@ -44,9 +44,9 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:18:3 | LL | two_arg_same("", ""); - | ^^^^^^^^^^^^ -- -- expected `i32`, found `&str` + | ^^^^^^^^^^^^ -- -- expected `i32`, found `&'static str` | | - | expected `i32`, found `&str` + | expected `i32`, found `&'static str` | note: function defined here --> $DIR/invalid_arguments.rs:6:4 @@ -58,7 +58,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:19:19 | LL | two_arg_diff(1, ""); - | ------------ ^^ expected `f32`, found `&str` + | ------------ ^^ expected `f32`, found `&'static str` | | | arguments to this function are incorrect | @@ -72,7 +72,7 @@ error[E0308]: mismatched types --> $DIR/invalid_arguments.rs:20:16 | LL | two_arg_diff("", 1.0); - | ------------ ^^ expected `i32`, found `&str` + | ------------ ^^ expected `i32`, found `&'static str` | | | arguments to this function are incorrect | @@ -86,9 +86,9 @@ error[E0308]: arguments to this function are incorrect --> $DIR/invalid_arguments.rs:21:3 | LL | two_arg_diff("", ""); - | ^^^^^^^^^^^^ -- -- expected `f32`, found `&str` + | ^^^^^^^^^^^^ -- -- expected `f32`, found `&'static str` | | - | expected `i32`, found `&str` + | expected `i32`, found `&'static str` | note: function defined here --> $DIR/invalid_arguments.rs:7:4 diff --git a/tests/ui/argument-suggestions/issue-96638.stderr b/tests/ui/argument-suggestions/issue-96638.stderr index 4d18b97c98be1..e939a42f9e382 100644 --- a/tests/ui/argument-suggestions/issue-96638.stderr +++ b/tests/ui/argument-suggestions/issue-96638.stderr @@ -2,7 +2,7 @@ error[E0061]: this function takes 3 arguments but 2 arguments were supplied --> $DIR/issue-96638.rs:8:5 | LL | f(&x, ""); - | ^ -- -- expected `usize`, found `&str` + | ^ -- -- expected `usize`, found `&'static str` | | | an argument of type `usize` is missing | diff --git a/tests/ui/argument-suggestions/mixed_cases.stderr b/tests/ui/argument-suggestions/mixed_cases.stderr index 8c525db1ac66c..ce77666676e8d 100644 --- a/tests/ui/argument-suggestions/mixed_cases.stderr +++ b/tests/ui/argument-suggestions/mixed_cases.stderr @@ -4,7 +4,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied LL | two_args(1, "", X {}); | ^^^^^^^^ -- ---- argument of type `X` unexpected | | - | expected `f32`, found `&str` + | expected `f32`, found `&'static str` | note: function defined here --> $DIR/mixed_cases.rs:5:4 diff --git a/tests/ui/associated-consts/associated-const-generic-obligations.stderr b/tests/ui/associated-consts/associated-const-generic-obligations.stderr index f45fa0ad55cd1..d45868151b166 100644 --- a/tests/ui/associated-consts/associated-const-generic-obligations.stderr +++ b/tests/ui/associated-consts/associated-const-generic-obligations.stderr @@ -2,7 +2,7 @@ error[E0326]: implemented const `FROM` has an incompatible type for trait --> $DIR/associated-const-generic-obligations.rs:14:17 | LL | const FROM: &'static str = "foo"; - | ^^^^^^^^^^^^ expected associated type, found `&str` + | ^^^^^^^^^^^^ expected associated type, found `&'static str` | note: type in trait --> $DIR/associated-const-generic-obligations.rs:10:17 diff --git a/tests/ui/associated-type-bounds/elision.stderr b/tests/ui/associated-type-bounds/elision.stderr index ea30246274965..0e97f028ece73 100644 --- a/tests/ui/associated-type-bounds/elision.stderr +++ b/tests/ui/associated-type-bounds/elision.stderr @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/elision.rs:5:79 | LL | fn f(x: &mut dyn Iterator>) -> Option<&'_ ()> { x.next() } - | ----------------------------- -------------- ^^^^^^^^ expected `&()`, found type parameter `impl Iterator` + | ----------------------------- -------------- ^^^^^^^^ expected `&'static ()`, found type parameter `impl Iterator` | | | | | expected `Option<&'static ()>` because of return type | this type parameter diff --git a/tests/ui/closures/closure-return-type-mismatch.stderr b/tests/ui/closures/closure-return-type-mismatch.stderr index 3a89d30a05d20..1748b10c3a7af 100644 --- a/tests/ui/closures/closure-return-type-mismatch.stderr +++ b/tests/ui/closures/closure-return-type-mismatch.stderr @@ -14,7 +14,7 @@ error[E0308]: mismatched types --> $DIR/closure-return-type-mismatch.rs:12:20 | LL | return "hello" - | ^^^^^^^ expected `bool`, found `&str` + | ^^^^^^^ expected `bool`, found `&'static str` error: aborting due to 2 previous errors diff --git a/tests/ui/codemap_tests/tab.stderr b/tests/ui/codemap_tests/tab.stderr index c3f19d20d3952..5d0ea297e9c79 100644 --- a/tests/ui/codemap_tests/tab.stderr +++ b/tests/ui/codemap_tests/tab.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types LL | fn foo() { | - help: try adding a return type: `-> &'static str` LL | "bar boo" - | ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `&str` + | ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `&'static str` error: aborting due to 2 previous errors diff --git a/tests/ui/consts/issue-69310-array-size-lit-wrong-ty.stderr b/tests/ui/consts/issue-69310-array-size-lit-wrong-ty.stderr index 7078b4bd7be1d..fa84a0301f409 100644 --- a/tests/ui/consts/issue-69310-array-size-lit-wrong-ty.stderr +++ b/tests/ui/consts/issue-69310-array-size-lit-wrong-ty.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/issue-69310-array-size-lit-wrong-ty.rs:11:15 | LL | const B: [(); b"a"] = [()]; - | ^^^^ expected `usize`, found `&[u8; 1]` + | ^^^^ expected `usize`, found `&'static [u8; 1]` error: aborting due to 2 previous errors diff --git a/tests/ui/deref-patterns/gate.stderr b/tests/ui/deref-patterns/gate.stderr index 993468b5e826b..3a88956220fe5 100644 --- a/tests/ui/deref-patterns/gate.stderr +++ b/tests/ui/deref-patterns/gate.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match String::new() { | ------------- this expression has type `String` LL | "" | _ => {} - | ^^ expected struct `String`, found `&str` + | ^^ expected struct `String`, found `&'static str` error: aborting due to previous error diff --git a/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr b/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr index 6ded03e45b55e..e7d3c56b62717 100644 --- a/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr +++ b/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/brackets-to-braces-single-element.rs:1:24 | LL | const A: [&str; 1] = { "hello" }; - | ^^^^^^^ expected array `[&'static str; 1]`, found `&str` + | ^^^^^^^ expected array `[&'static str; 1]`, found `&'static str` | help: to create an array, use square brackets instead of curly braces | diff --git a/tests/ui/inference/char-as-str-multi.stderr b/tests/ui/inference/char-as-str-multi.stderr index 297ca2b548f71..e305697727d5f 100644 --- a/tests/ui/inference/char-as-str-multi.stderr +++ b/tests/ui/inference/char-as-str-multi.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/char-as-str-multi.rs:5:19 | LL | let _: char = "foo"; - | ---- ^^^^^ expected `char`, found `&str` + | ---- ^^^^^ expected `char`, found `&'static str` | | | expected due to this @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/char-as-str-multi.rs:6:19 | LL | let _: char = ""; - | ---- ^^ expected `char`, found `&str` + | ---- ^^ expected `char`, found `&'static str` | | | expected due to this diff --git a/tests/ui/inference/char-as-str-single.stderr b/tests/ui/inference/char-as-str-single.stderr index 3375ec6ac32ca..c006525148f3e 100644 --- a/tests/ui/inference/char-as-str-single.stderr +++ b/tests/ui/inference/char-as-str-single.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/char-as-str-single.rs:9:19 | LL | let _: char = "a"; - | ---- ^^^ expected `char`, found `&str` + | ---- ^^^ expected `char`, found `&'static str` | | | expected due to this | @@ -15,7 +15,7 @@ error[E0308]: mismatched types --> $DIR/char-as-str-single.rs:10:19 | LL | let _: char = "人"; - | ---- ^^^^ expected `char`, found `&str` + | ---- ^^^^ expected `char`, found `&'static str` | | | expected due to this | @@ -28,7 +28,7 @@ error[E0308]: mismatched types --> $DIR/char-as-str-single.rs:11:19 | LL | let _: char = "'"; - | ---- ^^^ expected `char`, found `&str` + | ---- ^^^ expected `char`, found `&'static str` | | | expected due to this | diff --git a/tests/ui/issues/issue-20225.stderr b/tests/ui/issues/issue-20225.stderr index 5822160107cce..b1c15672051d2 100644 --- a/tests/ui/issues/issue-20225.stderr +++ b/tests/ui/issues/issue-20225.stderr @@ -6,7 +6,7 @@ LL | impl<'a, T> Fn<(&'a T,)> for Foo { LL | extern "rust-call" fn call(&self, (_,): (T,)) {} | ^^^^ | | - | expected `&T`, found type parameter `T` + | expected `&'a T`, found type parameter `T` | help: change the parameter type to match the trait: `(&'a T,)` | = note: expected signature `extern "rust-call" fn(&Foo, (&'a T,))` @@ -20,7 +20,7 @@ LL | impl<'a, T> FnMut<(&'a T,)> for Foo { LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} | ^^^^ | | - | expected `&T`, found type parameter `T` + | expected `&'a T`, found type parameter `T` | help: change the parameter type to match the trait: `(&'a T,)` | = note: expected signature `extern "rust-call" fn(&mut Foo, (&'a T,))` @@ -35,7 +35,7 @@ LL | impl<'a, T> FnOnce<(&'a T,)> for Foo { LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} | ^^^^ | | - | expected `&T`, found type parameter `T` + | expected `&'a T`, found type parameter `T` | help: change the parameter type to match the trait: `(&'a T,)` | = note: expected signature `extern "rust-call" fn(Foo, (&'a T,))` diff --git a/tests/ui/issues/issue-41742.stderr b/tests/ui/issues/issue-41742.stderr index 61a0ae5fa91a7..20f13d7e10e99 100644 --- a/tests/ui/issues/issue-41742.stderr +++ b/tests/ui/issues/issue-41742.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-41742.rs:24:7 | LL | H["?"].f(); - | ^^^ expected `u32`, found `&str` + | ^^^ expected `u32`, found `&'static str` error: aborting due to previous error diff --git a/tests/ui/issues/issue-7061.stderr b/tests/ui/issues/issue-7061.stderr index 27034378d3fc9..6b6441dbd0511 100644 --- a/tests/ui/issues/issue-7061.stderr +++ b/tests/ui/issues/issue-7061.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-7061.rs:4:46 | LL | fn foo(&'a mut self) -> Box { self } - | -------------- ^^^^ expected struct `Box`, found `&mut BarStruct` + | -------------- ^^^^ expected struct `Box`, found `&'a mut BarStruct` | | | expected `Box` because of return type | diff --git a/tests/ui/lexer/lex-bad-char-literals-6.stderr b/tests/ui/lexer/lex-bad-char-literals-6.stderr index 2fe30304a50d6..a0af949c14eb0 100644 --- a/tests/ui/lexer/lex-bad-char-literals-6.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-6.stderr @@ -35,7 +35,7 @@ error[E0308]: mismatched types --> $DIR/lex-bad-char-literals-6.rs:13:20 | LL | let a: usize = ""; - | ----- ^^ expected `usize`, found `&str` + | ----- ^^ expected `usize`, found `&'static str` | | | expected due to this diff --git a/tests/ui/lifetimes/issue-26638.stderr b/tests/ui/lifetimes/issue-26638.stderr index 98d39d614d0e9..f26bc74af0392 100644 --- a/tests/ui/lifetimes/issue-26638.stderr +++ b/tests/ui/lifetimes/issue-26638.stderr @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/issue-26638.rs:1:69 | LL | fn parse_type(iter: Box+'static>) -> &str { iter.next() } - | ---- ^^^^^^^^^^^ expected `&str`, found enum `Option` + | ---- ^^^^^^^^^^^ expected `&'static str`, found enum `Option` | | | expected `&'static str` because of return type | diff --git a/tests/ui/loops/loop-break-value.stderr b/tests/ui/loops/loop-break-value.stderr index ccb27c3507076..5505641502be3 100644 --- a/tests/ui/loops/loop-break-value.stderr +++ b/tests/ui/loops/loop-break-value.stderr @@ -149,13 +149,13 @@ error[E0308]: mismatched types --> $DIR/loop-break-value.rs:16:15 | LL | break "asdf"; - | ^^^^^^ expected `i32`, found `&str` + | ^^^^^^ expected `i32`, found `&'static str` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:21:31 | LL | break 'outer_loop "nope"; - | ^^^^^^ expected `i32`, found `&str` + | ^^^^^^ expected `i32`, found `&'static str` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:73:26 diff --git a/tests/ui/match/match-arm-resolving-to-never.stderr b/tests/ui/match/match-arm-resolving-to-never.stderr index 686fbd0baa3ce..36deba4ad7790 100644 --- a/tests/ui/match/match-arm-resolving-to-never.stderr +++ b/tests/ui/match/match-arm-resolving-to-never.stderr @@ -9,7 +9,7 @@ LL | | E::D => 4, LL | | E::E => unimplemented!(""), | | ------------------ this and all prior arms are found to be of type `{integer}` LL | | E::F => "", - | | ^^ expected integer, found `&str` + | | ^^ expected integer, found `&'static str` LL | | }; | |_____- `match` arms have incompatible types diff --git a/tests/ui/match/single-line.stderr b/tests/ui/match/single-line.stderr index ec3b76e3f4d5e..6f3f992aef742 100644 --- a/tests/ui/match/single-line.stderr +++ b/tests/ui/match/single-line.stderr @@ -2,7 +2,7 @@ error[E0308]: `match` arms have incompatible types --> $DIR/single-line.rs:2:52 | LL | let _ = match Some(42) { Some(x) => x, None => "" }; - | -------------- - ^^ expected integer, found `&str` + | -------------- - ^^ expected integer, found `&'static str` | | | | | this is found to be of type `{integer}` | `match` arms have incompatible types diff --git a/tests/ui/methods/issues/issue-61525.stderr b/tests/ui/methods/issues/issue-61525.stderr index 3e73b950a14e0..6123de118f27c 100644 --- a/tests/ui/methods/issues/issue-61525.stderr +++ b/tests/ui/methods/issues/issue-61525.stderr @@ -21,7 +21,7 @@ error[E0308]: mismatched types --> $DIR/issue-61525.rs:14:33 | LL | 1.query::("") - | --------------------- ^^ expected trait object `dyn ToString`, found `&str` + | --------------------- ^^ expected trait object `dyn ToString`, found `&'static str` | | | arguments to this method are incorrect | diff --git a/tests/ui/mismatched_types/normalize-fn-sig.stderr b/tests/ui/mismatched_types/normalize-fn-sig.stderr index 6c55f29c5d153..3ec916f55ae5e 100644 --- a/tests/ui/mismatched_types/normalize-fn-sig.stderr +++ b/tests/ui/mismatched_types/normalize-fn-sig.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/normalize-fn-sig.rs:14:22 | LL | needs_i32_ref_fn(foo::<()>); - | ---------------- ^^^^^^^^^ expected `&i32`, found `i32` + | ---------------- ^^^^^^^^^ expected `&'static i32`, found `i32` | | | arguments to this function are incorrect | diff --git a/tests/ui/mismatched_types/overloaded-calls-bad.stderr b/tests/ui/mismatched_types/overloaded-calls-bad.stderr index 3a895acbdb5dd..4ad3f2fcb2d67 100644 --- a/tests/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/tests/ui/mismatched_types/overloaded-calls-bad.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/overloaded-calls-bad.rs:33:17 | LL | let ans = s("what"); - | - ^^^^^^ expected `isize`, found `&str` + | - ^^^^^^ expected `isize`, found `&'static str` | | | arguments to this function are incorrect | @@ -34,7 +34,7 @@ error[E0057]: this function takes 1 argument but 2 arguments were supplied LL | let ans = s("burma", "shave"); | ^ ------- ------- argument of type `&'static str` unexpected | | - | expected `isize`, found `&str` + | expected `isize`, found `&'static str` | note: implementation defined here --> $DIR/overloaded-calls-bad.rs:10:1 @@ -50,7 +50,7 @@ error[E0308]: mismatched types --> $DIR/overloaded-calls-bad.rs:40:7 | LL | F(""); - | - ^^ expected `i32`, found `&str` + | - ^^ expected `i32`, found `&'static str` | | | arguments to this struct are incorrect | diff --git a/tests/ui/never_type/call-fn-never-arg-wrong-type.stderr b/tests/ui/never_type/call-fn-never-arg-wrong-type.stderr index fa3db33c9606f..f93cd6c74176c 100644 --- a/tests/ui/never_type/call-fn-never-arg-wrong-type.stderr +++ b/tests/ui/never_type/call-fn-never-arg-wrong-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/call-fn-never-arg-wrong-type.rs:10:9 | LL | foo("wow"); - | --- ^^^^^ expected `!`, found `&str` + | --- ^^^^^ expected `!`, found `&'static str` | | | arguments to this function are incorrect | diff --git a/tests/ui/never_type/never-assign-wrong-type.stderr b/tests/ui/never_type/never-assign-wrong-type.stderr index ce34d9483247f..a8f2df2cb52cf 100644 --- a/tests/ui/never_type/never-assign-wrong-type.stderr +++ b/tests/ui/never_type/never-assign-wrong-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/never-assign-wrong-type.rs:7:16 | LL | let x: ! = "hello"; - | - ^^^^^^^ expected `!`, found `&str` + | - ^^^^^^^ expected `!`, found `&'static str` | | | expected due to this | diff --git a/tests/ui/parser/fn-arg-doc-comment.rs b/tests/ui/parser/fn-arg-doc-comment.rs index 21d753ad03725..f70f6ced8cbce 100644 --- a/tests/ui/parser/fn-arg-doc-comment.rs +++ b/tests/ui/parser/fn-arg-doc-comment.rs @@ -21,10 +21,10 @@ fn main() { // verify that the parser recovered and properly typechecked the args f("", ""); //~^ ERROR arguments to this function are incorrect - //~| NOTE expected `u8`, found `&str` - //~| NOTE expected `u8`, found `&str` + //~| NOTE expected `u8`, found `&'static str` + //~| NOTE expected `u8`, found `&'static str` bar(""); //~^ ERROR mismatched types //~| NOTE arguments to this function are incorrect - //~| NOTE expected `i32`, found `&str` + //~| NOTE expected `i32`, found `&'static str` } diff --git a/tests/ui/parser/fn-arg-doc-comment.stderr b/tests/ui/parser/fn-arg-doc-comment.stderr index c8d7e2efe799d..957cee3484334 100644 --- a/tests/ui/parser/fn-arg-doc-comment.stderr +++ b/tests/ui/parser/fn-arg-doc-comment.stderr @@ -20,9 +20,9 @@ error[E0308]: arguments to this function are incorrect --> $DIR/fn-arg-doc-comment.rs:22:5 | LL | f("", ""); - | ^ -- -- expected `u8`, found `&str` + | ^ -- -- expected `u8`, found `&'static str` | | - | expected `u8`, found `&str` + | expected `u8`, found `&'static str` | note: function defined here --> $DIR/fn-arg-doc-comment.rs:1:8 @@ -46,7 +46,7 @@ error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:26:9 | LL | bar(""); - | --- ^^ expected `i32`, found `&str` + | --- ^^ expected `i32`, found `&'static str` | | | arguments to this function are incorrect | diff --git a/tests/ui/parser/numeric-lifetime.stderr b/tests/ui/parser/numeric-lifetime.stderr index 7c1bcb7263171..bf8990f57ac66 100644 --- a/tests/ui/parser/numeric-lifetime.stderr +++ b/tests/ui/parser/numeric-lifetime.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/numeric-lifetime.rs:6:20 | LL | let x: usize = ""; - | ----- ^^ expected `usize`, found `&str` + | ----- ^^ expected `usize`, found `&'static str` | | | expected due to this diff --git a/tests/ui/parser/recover-tuple.stderr b/tests/ui/parser/recover-tuple.stderr index 88891b54bb20c..3463a8ff4d3d5 100644 --- a/tests/ui/parser/recover-tuple.stderr +++ b/tests/ui/parser/recover-tuple.stderr @@ -8,7 +8,7 @@ error[E0308]: mismatched types --> $DIR/recover-tuple.rs:6:20 | LL | let y: usize = ""; - | ----- ^^ expected `usize`, found `&str` + | ----- ^^ expected `usize`, found `&'static str` | | | expected due to this diff --git a/tests/ui/proc-macro/attribute-spans-preserved.stderr b/tests/ui/proc-macro/attribute-spans-preserved.stderr index 193482a42ab72..8903bc77ba0df 100644 --- a/tests/ui/proc-macro/attribute-spans-preserved.stderr +++ b/tests/ui/proc-macro/attribute-spans-preserved.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/attribute-spans-preserved.rs:7:23 | LL | #[ foo ( let y: u32 = "z"; ) ] - | --- ^^^ expected `u32`, found `&str` + | --- ^^^ expected `u32`, found `&'static str` | | | expected due to this @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/attribute-spans-preserved.rs:8:23 | LL | #[ bar { let x: u32 = "y"; } ] - | --- ^^^ expected `u32`, found `&str` + | --- ^^^ expected `u32`, found `&'static str` | | | expected due to this diff --git a/tests/ui/proc-macro/attribute-with-error.stderr b/tests/ui/proc-macro/attribute-with-error.stderr index 7f3a7e670b9b7..01e2aa8c5dc5e 100644 --- a/tests/ui/proc-macro/attribute-with-error.stderr +++ b/tests/ui/proc-macro/attribute-with-error.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:10:18 | LL | let a: i32 = "foo"; - | --- ^^^^^ expected `i32`, found `&str` + | --- ^^^^^ expected `i32`, found `&'static str` | | | expected due to this @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:12:18 | LL | let b: i32 = "f'oo"; - | --- ^^^^^^ expected `i32`, found `&str` + | --- ^^^^^^ expected `i32`, found `&'static str` | | | expected due to this @@ -18,7 +18,7 @@ error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:25:22 | LL | let a: i32 = "foo"; - | --- ^^^^^ expected `i32`, found `&str` + | --- ^^^^^ expected `i32`, found `&'static str` | | | expected due to this @@ -26,7 +26,7 @@ error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:35:22 | LL | let a: i32 = "foo"; - | --- ^^^^^ expected `i32`, found `&str` + | --- ^^^^^ expected `i32`, found `&'static str` | | | expected due to this diff --git a/tests/ui/proc-macro/issue-75801.stderr b/tests/ui/proc-macro/issue-75801.stderr index ee0a9bd7783e6..2e9f0b653275c 100644 --- a/tests/ui/proc-macro/issue-75801.stderr +++ b/tests/ui/proc-macro/issue-75801.stderr @@ -5,7 +5,7 @@ LL | let _bar: u32 = $arg; | --- expected due to this ... LL | foo!("baz"); - | ^^^^^ expected `u32`, found `&str` + | ^^^^^ expected `u32`, found `&'static str` error: aborting due to previous error diff --git a/tests/ui/proc-macro/nested-item-spans.stderr b/tests/ui/proc-macro/nested-item-spans.stderr index 44b338fa62215..fe0a3c9456e98 100644 --- a/tests/ui/proc-macro/nested-item-spans.stderr +++ b/tests/ui/proc-macro/nested-item-spans.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/nested-item-spans.rs:9:22 | LL | let x: u32 = "x"; - | --- ^^^ expected `u32`, found `&str` + | --- ^^^ expected `u32`, found `&'static str` | | | expected due to this @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/nested-item-spans.rs:18:22 | LL | let x: u32 = "x"; - | --- ^^^ expected `u32`, found `&str` + | --- ^^^ expected `u32`, found `&'static str` | | | expected due to this diff --git a/tests/ui/proc-macro/span-preservation.stderr b/tests/ui/proc-macro/span-preservation.stderr index 66c68be2f09de..2dbaa3ba231dc 100644 --- a/tests/ui/proc-macro/span-preservation.stderr +++ b/tests/ui/proc-macro/span-preservation.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/span-preservation.rs:11:20 | LL | let x: usize = "hello"; - | ----- ^^^^^^^ expected `usize`, found `&str` + | ----- ^^^^^^^ expected `usize`, found `&'static str` | | | expected due to this diff --git a/tests/ui/repeat-expr/repeat_count.rs b/tests/ui/repeat-expr/repeat_count.rs index 96abff4ab413f..83150bff396fe 100644 --- a/tests/ui/repeat-expr/repeat_count.rs +++ b/tests/ui/repeat-expr/repeat_count.rs @@ -15,7 +15,7 @@ fn main() { //~| expected `usize`, found floating-point number let e = [0; "foo"]; //~^ ERROR mismatched types - //~| expected `usize`, found `&str` + //~| expected `usize`, found `&'static str` let f = [0; -4_isize]; //~^ ERROR mismatched types //~| expected `usize`, found `isize` diff --git a/tests/ui/repeat-expr/repeat_count.stderr b/tests/ui/repeat-expr/repeat_count.stderr index e222c141f8b6a..bb077237746a3 100644 --- a/tests/ui/repeat-expr/repeat_count.stderr +++ b/tests/ui/repeat-expr/repeat_count.stderr @@ -28,7 +28,7 @@ error[E0308]: mismatched types --> $DIR/repeat_count.rs:16:17 | LL | let e = [0; "foo"]; - | ^^^^^ expected `usize`, found `&str` + | ^^^^^ expected `usize`, found `&'static str` error[E0308]: mismatched types --> $DIR/repeat_count.rs:31:17 diff --git a/tests/ui/return/return-from-diverging.stderr b/tests/ui/return/return-from-diverging.stderr index 0c1fb4d9c593a..1d5531241dea8 100644 --- a/tests/ui/return/return-from-diverging.stderr +++ b/tests/ui/return/return-from-diverging.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn fail() -> ! { | - expected `!` because of return type LL | return "wow"; - | ^^^^^ expected `!`, found `&str` + | ^^^^^ expected `!`, found `&'static str` | = note: expected type `!` found reference `&'static str` diff --git a/tests/ui/return/return-impl-trait-bad.stderr b/tests/ui/return/return-impl-trait-bad.stderr index 237b85ee66a10..c2ca10c2ab5f2 100644 --- a/tests/ui/return/return-impl-trait-bad.stderr +++ b/tests/ui/return/return-impl-trait-bad.stderr @@ -6,7 +6,7 @@ LL | fn bad_echo(_t: T) -> T { | | | this type parameter LL | "this should not suggest impl Trait" - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&str` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&'static str` | = note: expected type parameter `T` found reference `&'static str` @@ -19,7 +19,7 @@ LL | fn bad_echo_2(_t: T) -> T { | | | this type parameter LL | "this will not suggest it, because that would probably be wrong" - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&str` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&'static str` | = note: expected type parameter `T` found reference `&'static str` @@ -33,7 +33,7 @@ LL | fn other_bounds_bad() -> T | this type parameter ... LL | "don't suggest this, because Option places additional constraints" - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&str` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&'static str` | = note: expected type parameter `T` found reference `&'static str` @@ -49,7 +49,7 @@ LL | fn used_in_trait() -> T | this type parameter ... LL | "don't suggest this, because the generic param is used in the bound." - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&str` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `T`, found `&'static str` | = note: expected type parameter `T` found reference `&'static str` diff --git a/tests/ui/span/issue-34264.stderr b/tests/ui/span/issue-34264.stderr index 15179954adcd9..8518b79a7c78c 100644 --- a/tests/ui/span/issue-34264.stderr +++ b/tests/ui/span/issue-34264.stderr @@ -70,7 +70,7 @@ error[E0308]: mismatched types --> $DIR/issue-34264.rs:8:13 | LL | bar("", ""); - | --- ^^ expected `usize`, found `&str` + | --- ^^ expected `usize`, found `&'static str` | | | arguments to this function are incorrect | diff --git a/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr b/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr index 9588eedc98b4a..9f833b0556c90 100644 --- a/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr +++ b/tests/ui/suggestions/recover-from-semicolon-trailing-item.stderr @@ -38,7 +38,7 @@ error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:14:9 | LL | foo(""); - | --- ^^ expected `usize`, found `&str` + | --- ^^ expected `usize`, found `&'static str` | | | arguments to this function are incorrect | diff --git a/tests/ui/tuple/add-tuple-within-arguments.stderr b/tests/ui/tuple/add-tuple-within-arguments.stderr index 2e20a4cca0845..bf9d709238267 100644 --- a/tests/ui/tuple/add-tuple-within-arguments.stderr +++ b/tests/ui/tuple/add-tuple-within-arguments.stderr @@ -18,7 +18,7 @@ error[E0308]: mismatched types --> $DIR/add-tuple-within-arguments.rs:8:15 | LL | bar("hi", "hi", "hi"); - | --- ^^^^ expected tuple, found `&str` + | --- ^^^^ expected tuple, found `&'static str` | | | arguments to this function are incorrect | diff --git a/tests/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr b/tests/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr index fbfa0ccf1e8d9..0cbe4dc99e8b9 100644 --- a/tests/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr +++ b/tests/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr @@ -15,7 +15,7 @@ LL | pub type Boo = impl ::std::fmt::Debug; LL | fn bomp() -> boo::Boo { | -------- expected `Boo` because of return type LL | "" - | ^^ expected opaque type, found `&str` + | ^^ expected opaque type, found `&'static str` | = note: expected opaque type `Boo` found reference `&'static str` diff --git a/tests/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr b/tests/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr index ae03a5b3e37bf..7d498134a399a 100644 --- a/tests/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr +++ b/tests/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr @@ -21,7 +21,7 @@ LL | pub type Boo = impl ::std::fmt::Debug; LL | fn bomp() -> boo::Boo { | -------- expected `Boo` because of return type LL | "" - | ^^ expected opaque type, found `&str` + | ^^ expected opaque type, found `&'static str` | = note: expected opaque type `Boo` found reference `&'static str` diff --git a/tests/ui/type/type-shadow.stderr b/tests/ui/type/type-shadow.stderr index 25b4bff4d9aaa..b988ebb0851a5 100644 --- a/tests/ui/type/type-shadow.stderr +++ b/tests/ui/type/type-shadow.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-shadow.rs:6:20 | LL | let y: Y = "hello"; - | - ^^^^^^^ expected `isize`, found `&str` + | - ^^^^^^^ expected `isize`, found `&'static str` | | | expected due to this diff --git a/tests/ui/typeck/bad-type-in-vec-push.stderr b/tests/ui/typeck/bad-type-in-vec-push.stderr index e4c99ec8e701f..036c852d10938 100644 --- a/tests/ui/typeck/bad-type-in-vec-push.stderr +++ b/tests/ui/typeck/bad-type-in-vec-push.stderr @@ -17,7 +17,7 @@ error[E0308]: mismatched types --> $DIR/bad-type-in-vec-push.rs:18:12 | LL | x.push(""); - | ---- ^^ expected integer, found `&str` + | ---- ^^ expected integer, found `&'static str` | | | arguments to this method are incorrect | diff --git a/tests/ui/typeck/conversion-methods.stderr b/tests/ui/typeck/conversion-methods.stderr index 091502bdda34a..c72fa523796c5 100644 --- a/tests/ui/typeck/conversion-methods.stderr +++ b/tests/ui/typeck/conversion-methods.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let _tis_an_instants_play: String = "'Tis a fond Ambush—"; | ------ ^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()` | | | - | | expected struct `String`, found `&str` + | | expected struct `String`, found `&'static str` | expected due to this error[E0308]: mismatched types