1
Fork 0

Consider add-prefix replacements too

This commit is contained in:
Michael Goulet 2025-02-13 03:07:18 +00:00 committed by Jubilee Young
parent b480a9214a
commit f6406dfd4e
44 changed files with 222 additions and 330 deletions

View file

@ -236,9 +236,10 @@ impl SubstitutionPart {
/// it with "abx" is, since the "c" character is lost. /// it with "abx" is, since the "c" character is lost.
pub fn is_destructive_replacement(&self, sm: &SourceMap) -> bool { pub fn is_destructive_replacement(&self, sm: &SourceMap) -> bool {
self.is_replacement(sm) self.is_replacement(sm)
&& !sm && !sm.span_to_snippet(self.span).is_ok_and(|snippet| {
.span_to_snippet(self.span) self.snippet.trim_start().starts_with(snippet.trim_start())
.is_ok_and(|snippet| self.snippet.trim_start().starts_with(snippet.trim_start())) || self.snippet.trim_end().ends_with(snippet.trim_end())
})
} }
fn replaces_meaningful_content(&self, sm: &SourceMap) -> bool { fn replaces_meaningful_content(&self, sm: &SourceMap) -> bool {

View file

@ -8,9 +8,8 @@ LL | V(x) = func_arg;
| |
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - V(x) = func_arg; LL | V(x) = &*func_arg;
LL + V(x) = &*func_arg; | ~~~~~~~~~~
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -125,9 +125,8 @@ LL | let xe3 = XE::Empty3;
| |
help: there is a variant with a similar name help: there is a variant with a similar name
| |
LL - let xe3 = XE::Empty3; LL | let xe3 = XE::XEmpty3;
LL + let xe3 = XE::XEmpty3; | ~~~~~~~
|
error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope
--> $DIR/empty-struct-braces-expr.rs:26:19 --> $DIR/empty-struct-braces-expr.rs:26:19

View file

@ -30,9 +30,8 @@ LL | use env;
| |
help: consider importing this module instead help: consider importing this module instead
| |
LL - use env; LL | use std::env;
LL + use std::env; | ~~~~~~~~
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -6,19 +6,16 @@ LL | Dog { age: x } => {}
| |
help: include the missing field in the pattern help: include the missing field in the pattern
| |
LL - Dog { age: x } => {} LL | Dog { age: x, name } => {}
LL + Dog { age: x, name } => {} | ~~~~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - Dog { age: x } => {} LL | Dog { age: x, name: _ } => {}
LL + Dog { age: x, name: _ } => {} | ~~~~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - Dog { age: x } => {} LL | Dog { age: x, .. } => {}
LL + Dog { age: x, .. } => {} | ~~~~~~
|
error[E0027]: pattern does not mention field `age` error[E0027]: pattern does not mention field `age`
--> $DIR/E0027.rs:15:9 --> $DIR/E0027.rs:15:9

View file

@ -95,9 +95,8 @@ LL | extern "rust-call" fn call(self, args: ()) -> () {}
found signature `extern "rust-call" fn(Foo, ()) -> ()` found signature `extern "rust-call" fn(Foo, ()) -> ()`
help: change the self-receiver type to match the trait help: change the self-receiver type to match the trait
| |
LL - extern "rust-call" fn call(self, args: ()) -> () {} LL | extern "rust-call" fn call(&self, args: ()) -> () {}
LL + extern "rust-call" fn call(&self, args: ()) -> () {} | ~~~~~
|
error[E0183]: manual implementations of `FnOnce` are experimental error[E0183]: manual implementations of `FnOnce` are experimental
--> $DIR/feature-gate-unboxed-closures-manual-impls.rs:18:6 --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:18:6

View file

@ -6,9 +6,8 @@ LL | println!("Hello, {}!", crate::bar::do_the_thing);
| |
help: a similar path exists help: a similar path exists
| |
LL - println!("Hello, {}!", crate::bar::do_the_thing); LL | println!("Hello, {}!", crate::foo::bar::do_the_thing);
LL + println!("Hello, {}!", crate::foo::bar::do_the_thing); | ~~~~~~~~
|
help: consider importing this module help: consider importing this module
| |
LL + use foo::bar; LL + use foo::bar;

View file

@ -6,9 +6,8 @@ LL | println!("Hello, {}!", crate::bar::do_the_thing);
| |
help: a similar path exists help: a similar path exists
| |
LL - println!("Hello, {}!", crate::bar::do_the_thing); LL | println!("Hello, {}!", crate::foo::bar::do_the_thing);
LL + println!("Hello, {}!", crate::foo::bar::do_the_thing); | ~~~~~~~~
|
help: consider importing this module help: consider importing this module
| |
LL + use foo::bar; LL + use foo::bar;

View file

@ -10,9 +10,8 @@ LL | T::A(a) | T::B(a) => a,
found enum `T` found enum `T`
help: consider dereferencing the boxed value help: consider dereferencing the boxed value
| |
LL - let y = match x { LL | let y = match *x {
LL + let y = match *x { | ~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-57741.rs:20:19 --> $DIR/issue-57741.rs:20:19
@ -26,9 +25,8 @@ LL | T::A(a) | T::B(a) => a,
found enum `T` found enum `T`
help: consider dereferencing the boxed value help: consider dereferencing the boxed value
| |
LL - let y = match x { LL | let y = match *x {
LL + let y = match *x { | ~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-57741.rs:27:9 --> $DIR/issue-57741.rs:27:9
@ -42,9 +40,8 @@ LL | S::A { a } | S::B { b: a } => a,
found enum `S` found enum `S`
help: consider dereferencing the boxed value help: consider dereferencing the boxed value
| |
LL - let y = match x { LL | let y = match *x {
LL + let y = match *x { | ~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-57741.rs:27:22 --> $DIR/issue-57741.rs:27:22
@ -58,9 +55,8 @@ LL | S::A { a } | S::B { b: a } => a,
found enum `S` found enum `S`
help: consider dereferencing the boxed value help: consider dereferencing the boxed value
| |
LL - let y = match x { LL | let y = match *x {
LL + let y = match *x { | ~~
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -8,9 +8,8 @@ LL | let Bar::Present(z) = self else {
| |
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - let Bar::Present(z) = self else { LL | let Bar::Present(z) = &**self else {
LL + let Bar::Present(z) = &**self else { | ~~~~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/let-else-deref-coercion.rs:68:13 --> $DIR/let-else-deref-coercion.rs:68:13
@ -22,9 +21,8 @@ LL | let Bar(z) = x;
| |
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - let Bar(z) = x; LL | let Bar(z) = &**x;
LL + let Bar(z) = &**x; | ~~~~
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -32,9 +32,8 @@ LL | "\●"
= help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals> = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
| |
LL - "\●" LL | r"\●"
LL + r"\●" | ~~~~~
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -12,9 +12,8 @@ LL | x.use_mut();
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider consuming the `Vec<i32>` when turning it into an `Iterator` help: consider consuming the `Vec<i32>` when turning it into an `Iterator`
| |
LL - let mut x = vec![1].iter(); LL | let mut x = vec![1].into_iter();
LL + let mut x = vec![1].into_iter(); | ~~~~~~~~~
|
help: consider using a `let` binding to create a longer lived value help: consider using a `let` binding to create a longer lived value
| |
LL ~ let binding = vec![1]; LL ~ let binding = vec![1];

View file

@ -25,9 +25,8 @@ LL | let addr_32bit = &x as *const u8 as u32;
= help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_provenance()` instead = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_provenance()` instead
help: use `.addr()` to obtain the address of a pointer help: use `.addr()` to obtain the address of a pointer
| |
LL - let addr_32bit = &x as *const u8 as u32; LL | let addr_32bit = (&x as *const u8).addr() as u32;
LL + let addr_32bit = (&x as *const u8).addr() as u32; | + ~~~~~~~~~~~~~~~
|
error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `usize` error: under strict provenance it is considered bad style to cast pointer `*const u8` to integer `usize`
--> $DIR/lint-strict-provenance-lossy-casts.rs:14:20 --> $DIR/lint-strict-provenance-lossy-casts.rs:14:20

View file

@ -11,9 +11,8 @@ LL | #![deny(unused_variables)]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
help: if this is intentional, prefix it with an underscore help: if this is intentional, prefix it with an underscore
| |
LL - E::A(x) | E::B(x) => {} LL | E::A(_x) | E::B(_x) => {}
LL + E::A(_x) | E::B(_x) => {} | ~~ ~~
|
error: unused variable: `x` error: unused variable: `x`
--> $DIR/issue-56685.rs:25:14 --> $DIR/issue-56685.rs:25:14
@ -23,9 +22,8 @@ LL | F::A(x, y) | F::B(x, y) => { y },
| |
help: if this is intentional, prefix it with an underscore help: if this is intentional, prefix it with an underscore
| |
LL - F::A(x, y) | F::B(x, y) => { y }, LL | F::A(_x, y) | F::B(_x, y) => { y },
LL + F::A(_x, y) | F::B(_x, y) => { y }, | ~~ ~~
|
error: unused variable: `a` error: unused variable: `a`
--> $DIR/issue-56685.rs:27:14 --> $DIR/issue-56685.rs:27:14
@ -47,9 +45,8 @@ LL | let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
| |
help: if this is intentional, prefix it with an underscore help: if this is intentional, prefix it with an underscore
| |
LL - let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) { LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
LL + let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { | ~~ ~~
|
error: unused variable: `x` error: unused variable: `x`
--> $DIR/issue-56685.rs:39:20 --> $DIR/issue-56685.rs:39:20
@ -59,9 +56,8 @@ LL | while let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
| |
help: if this is intentional, prefix it with an underscore help: if this is intentional, prefix it with an underscore
| |
LL - while let F::A(x, y) | F::B(x, y) = F::A(1, 2) { LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
LL + while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { | ~~ ~~
|
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View file

@ -8,9 +8,8 @@ LL | fn drop(self) {}
found signature `fn(Foo)` found signature `fn(Foo)`
help: change the self-receiver type to match the trait help: change the self-receiver type to match the trait
| |
LL - fn drop(self) {} LL | fn drop(&mut self) {}
LL + fn drop(&mut self) {} | ~~~~~~~~~
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -10,9 +10,8 @@ LL | check(m1::S);
= note: can't use a type alias as a constructor = note: can't use a type alias as a constructor
help: a tuple struct with a similar name exists help: a tuple struct with a similar name exists
| |
LL - check(m1::S); LL | check(m1::TS);
LL + check(m1::TS); | ~~
|
help: consider importing one of these constants instead help: consider importing one of these constants instead
| |
LL + use m2::S; LL + use m2::S;
@ -39,9 +38,8 @@ LL | pub struct TS();
= note: can't use a type alias as a constructor = note: can't use a type alias as a constructor
help: a tuple struct with a similar name exists help: a tuple struct with a similar name exists
| |
LL - check(xm1::S); LL | check(xm1::TS);
LL + check(xm1::TS); | ~~
|
help: consider importing one of these constants instead help: consider importing one of these constants instead
| |
LL + use m2::S; LL + use m2::S;
@ -66,9 +64,8 @@ LL | check(m7::V);
= note: can't use a type alias as a constructor = note: can't use a type alias as a constructor
help: a tuple variant with a similar name exists help: a tuple variant with a similar name exists
| |
LL - check(m7::V); LL | check(m7::TV);
LL + check(m7::TV); | ~~
|
help: consider importing one of these constants instead help: consider importing one of these constants instead
| |
LL + use m8::V; LL + use m8::V;
@ -95,9 +92,8 @@ LL | TV(),
= note: can't use a type alias as a constructor = note: can't use a type alias as a constructor
help: a tuple variant with a similar name exists help: a tuple variant with a similar name exists
| |
LL - check(xm7::V); LL | check(xm7::TV);
LL + check(xm7::TV); | ~~
|
help: consider importing one of these constants instead help: consider importing one of these constants instead
| |
LL + use m8::V; LL + use m8::V;

View file

@ -9,9 +9,8 @@ LL | x.owned();
| |
help: there is a method `to_owned` with a similar name help: there is a method `to_owned` with a similar name
| |
LL - x.owned(); LL | x.to_owned();
LL + x.to_owned(); | ~~~~~~~~
|
error[E0599]: no method named `owned` found for mutable reference `&mut dyn Foo` in the current scope error[E0599]: no method named `owned` found for mutable reference `&mut dyn Foo` in the current scope
--> $DIR/object-pointer-types.rs:17:7 --> $DIR/object-pointer-types.rs:17:7

View file

@ -6,9 +6,8 @@ LL | ''';
| |
help: escape the character help: escape the character
| |
LL - '''; LL | '\'';
LL + '\''; | ~~
|
error: character constant must be escaped: `\n` error: character constant must be escaped: `\n`
--> $DIR/bad-char-literals.rs:10:6 --> $DIR/bad-char-literals.rs:10:6

View file

@ -7,9 +7,8 @@ LL | let bad = "ab\[c";
= help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals> = help: for more information, visit <https://doc.rust-lang.org/reference/tokens.html#literals>
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
| |
LL - let bad = "ab\[c"; LL | let bad = r"ab\[c";
LL + let bad = r"ab\[c"; | ~~~~~~~~
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -39,9 +39,8 @@ LL | b''';
| |
help: escape the character help: escape the character
| |
LL - b'''; LL | b'\'';
LL + b'\''; | ~~
|
error: non-ASCII character in byte literal error: non-ASCII character in byte literal
--> $DIR/byte-literals.rs:10:7 --> $DIR/byte-literals.rs:10:7

View file

@ -54,9 +54,8 @@ LL | mut n = 0;
| |
help: missing keyword help: missing keyword
| |
LL - mut n = 0; LL | let mut n = 0;
LL + let mut n = 0; | ~~~~~~~
|
error: invalid variable declaration error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:16:5 --> $DIR/issue-65257-invalid-var-decl-recovery.rs:16:5
@ -66,9 +65,8 @@ LL | mut var;
| |
help: missing keyword help: missing keyword
| |
LL - mut var; LL | let mut var;
LL + let mut var; | ~~~~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:20:33 --> $DIR/issue-65257-invalid-var-decl-recovery.rs:20:33

View file

@ -47,9 +47,8 @@ LL | qux: Foo::Baz if true => {}
| |
help: maybe write a path separator here help: maybe write a path separator here
| |
LL - qux: Foo::Baz if true => {} LL | qux::Foo::Baz if true => {}
LL + qux::Foo::Baz if true => {} | ~~
|
error: expected one of `@` or `|`, found `:` error: expected one of `@` or `|`, found `:`
--> $DIR/issue-87086-colon-path-sep.rs:40:15 --> $DIR/issue-87086-colon-path-sep.rs:40:15
@ -74,9 +73,8 @@ LL | ref qux: Foo::Baz => {}
| |
help: maybe write a path separator here help: maybe write a path separator here
| |
LL - ref qux: Foo::Baz => {} LL | ref qux::Foo::Baz => {}
LL + ref qux::Foo::Baz => {} | ~~
|
error: expected one of `@` or `|`, found `:` error: expected one of `@` or `|`, found `:`
--> $DIR/issue-87086-colon-path-sep.rs:58:16 --> $DIR/issue-87086-colon-path-sep.rs:58:16
@ -88,9 +86,8 @@ LL | mut qux: Foo::Baz => {}
| |
help: maybe write a path separator here help: maybe write a path separator here
| |
LL - mut qux: Foo::Baz => {} LL | mut qux::Foo::Baz => {}
LL + mut qux::Foo::Baz => {} | ~~
|
error: expected one of `@` or `|`, found `:` error: expected one of `@` or `|`, found `:`
--> $DIR/issue-87086-colon-path-sep.rs:69:12 --> $DIR/issue-87086-colon-path-sep.rs:69:12

View file

@ -8,9 +8,8 @@ LL | x: i32 => x,
| |
help: maybe write a path separator here help: maybe write a path separator here
| |
LL - x: i32 => x, LL | x::i32 => x,
LL + x::i32 => x, | ~~
|
error: expected one of `...`, `..=`, `..`, or `|`, found `:` error: expected one of `...`, `..=`, `..`, or `|`, found `:`
--> $DIR/type-ascription-in-pattern.rs:12:11 --> $DIR/type-ascription-in-pattern.rs:12:11
@ -38,9 +37,8 @@ LL | x: i32 => (),
| |
help: maybe write a path separator here help: maybe write a path separator here
| |
LL - x: i32 => (), LL | x::i32 => (),
LL + x::i32 => (), | ~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/type-ascription-in-pattern.rs:3:19 --> $DIR/type-ascription-in-pattern.rs:3:19

View file

@ -17,19 +17,16 @@ LL | let HiddenStruct { one } = HiddenStruct::default();
| |
help: include the missing field in the pattern and ignore the inaccessible fields help: include the missing field in the pattern and ignore the inaccessible fields
| |
LL - let HiddenStruct { one } = HiddenStruct::default(); LL | let HiddenStruct { one, two, .. } = HiddenStruct::default();
LL + let HiddenStruct { one, two, .. } = HiddenStruct::default(); | ~~~~~~~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - let HiddenStruct { one } = HiddenStruct::default(); LL | let HiddenStruct { one, two: _, .. } = HiddenStruct::default();
LL + let HiddenStruct { one, two: _, .. } = HiddenStruct::default(); | ~~~~~~~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - let HiddenStruct { one } = HiddenStruct::default(); LL | let HiddenStruct { one, .. } = HiddenStruct::default();
LL + let HiddenStruct { one, .. } = HiddenStruct::default(); | ~~~~~~
|
error[E0027]: pattern does not mention field `two` error[E0027]: pattern does not mention field `two`
--> $DIR/doc-hidden-fields.rs:21:9 --> $DIR/doc-hidden-fields.rs:21:9
@ -39,19 +36,16 @@ LL | let HiddenStruct { one, hide } = HiddenStruct::default();
| |
help: include the missing field in the pattern help: include the missing field in the pattern
| |
LL - let HiddenStruct { one, hide } = HiddenStruct::default(); LL | let HiddenStruct { one, hide, two } = HiddenStruct::default();
LL + let HiddenStruct { one, hide, two } = HiddenStruct::default(); | ~~~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - let HiddenStruct { one, hide } = HiddenStruct::default(); LL | let HiddenStruct { one, hide, two: _ } = HiddenStruct::default();
LL + let HiddenStruct { one, hide, two: _ } = HiddenStruct::default(); | ~~~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - let HiddenStruct { one, hide } = HiddenStruct::default(); LL | let HiddenStruct { one, hide, .. } = HiddenStruct::default();
LL + let HiddenStruct { one, hide, .. } = HiddenStruct::default(); | ~~~~~~
|
error[E0027]: pattern does not mention field `im_hidden` error[E0027]: pattern does not mention field `im_hidden`
--> $DIR/doc-hidden-fields.rs:24:9 --> $DIR/doc-hidden-fields.rs:24:9
@ -61,19 +55,16 @@ LL | let InCrate { a, b } = InCrate { a: 0, b: false, im_hidden: 0 };
| |
help: include the missing field in the pattern help: include the missing field in the pattern
| |
LL - let InCrate { a, b } = InCrate { a: 0, b: false, im_hidden: 0 }; LL | let InCrate { a, b, im_hidden } = InCrate { a: 0, b: false, im_hidden: 0 };
LL + let InCrate { a, b, im_hidden } = InCrate { a: 0, b: false, im_hidden: 0 }; | ~~~~~~~~~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - let InCrate { a, b } = InCrate { a: 0, b: false, im_hidden: 0 }; LL | let InCrate { a, b, im_hidden: _ } = InCrate { a: 0, b: false, im_hidden: 0 };
LL + let InCrate { a, b, im_hidden: _ } = InCrate { a: 0, b: false, im_hidden: 0 }; | ~~~~~~~~~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - let InCrate { a, b } = InCrate { a: 0, b: false, im_hidden: 0 }; LL | let InCrate { a, b, .. } = InCrate { a: 0, b: false, im_hidden: 0 };
LL + let InCrate { a, b, .. } = InCrate { a: 0, b: false, im_hidden: 0 }; | ~~~~~~
|
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -6,19 +6,16 @@ LL | let UnstableStruct { stable } = UnstableStruct::default();
| |
help: include the missing field in the pattern and ignore the inaccessible fields help: include the missing field in the pattern and ignore the inaccessible fields
| |
LL - let UnstableStruct { stable } = UnstableStruct::default(); LL | let UnstableStruct { stable, stable2, .. } = UnstableStruct::default();
LL + let UnstableStruct { stable, stable2, .. } = UnstableStruct::default(); | ~~~~~~~~~~~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - let UnstableStruct { stable } = UnstableStruct::default(); LL | let UnstableStruct { stable, stable2: _, .. } = UnstableStruct::default();
LL + let UnstableStruct { stable, stable2: _, .. } = UnstableStruct::default(); | ~~~~~~~~~~~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - let UnstableStruct { stable } = UnstableStruct::default(); LL | let UnstableStruct { stable, .. } = UnstableStruct::default();
LL + let UnstableStruct { stable, .. } = UnstableStruct::default(); | ~~~~~~
|
error: pattern requires `..` due to inaccessible fields error: pattern requires `..` due to inaccessible fields
--> $DIR/stable-gated-fields.rs:11:9 --> $DIR/stable-gated-fields.rs:11:9

View file

@ -9,9 +9,8 @@ LL | let _ = std::collections::HashMap();
| |
help: you might have meant to use an associated function to build this type help: you might have meant to use an associated function to build this type
| |
LL - let _ = std::collections::HashMap(); LL | let _ = std::collections::HashMap::new();
LL + let _ = std::collections::HashMap::new(); | ~~~~~~~
|
LL - let _ = std::collections::HashMap(); LL - let _ = std::collections::HashMap();
LL + let _ = std::collections::HashMap::with_capacity(_); LL + let _ = std::collections::HashMap::with_capacity(_);
| |
@ -23,9 +22,8 @@ LL + let _ = std::collections::HashMap::with_capacity_and_hasher(_, _);
| |
help: consider using the `Default` trait help: consider using the `Default` trait
| |
LL - let _ = std::collections::HashMap(); LL | let _ = <std::collections::HashMap as std::default::Default>::default();
LL + let _ = <std::collections::HashMap as std::default::Default>::default(); | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
error[E0423]: cannot initialize a tuple struct which contains private fields error[E0423]: cannot initialize a tuple struct which contains private fields
--> $DIR/suggest-box-new.rs:8:19 --> $DIR/suggest-box-new.rs:8:19

View file

@ -10,9 +10,8 @@ LL | pub (a) fn afn() {}
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
help: make this visible only to module `a` with `in` help: make this visible only to module `a` with `in`
| |
LL - pub (a) fn afn() {} LL | pub (in a) fn afn() {}
LL + pub (in a) fn afn() {} | ~~~~
|
error[E0704]: incorrect visibility restriction error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:4:6 --> $DIR/pub-restricted.rs:4:6
@ -26,9 +25,8 @@ LL | pub (b) fn bfn() {}
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
help: make this visible only to module `b` with `in` help: make this visible only to module `b` with `in`
| |
LL - pub (b) fn bfn() {} LL | pub (in b) fn bfn() {}
LL + pub (in b) fn bfn() {} | ~~~~
|
error[E0704]: incorrect visibility restriction error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:5:6 --> $DIR/pub-restricted.rs:5:6
@ -42,9 +40,8 @@ LL | pub (crate::a) fn cfn() {}
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
help: make this visible only to module `crate::a` with `in` help: make this visible only to module `crate::a` with `in`
| |
LL - pub (crate::a) fn cfn() {} LL | pub (in crate::a) fn cfn() {}
LL + pub (in crate::a) fn cfn() {} | ~~~~~~~~~~~
|
error[E0704]: incorrect visibility restriction error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:22:14 --> $DIR/pub-restricted.rs:22:14
@ -58,9 +55,8 @@ LL | pub (a) invalid: usize,
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
help: make this visible only to module `a` with `in` help: make this visible only to module `a` with `in`
| |
LL - pub (a) invalid: usize, LL | pub (in a) invalid: usize,
LL + pub (in a) invalid: usize, | ~~~~
|
error[E0704]: incorrect visibility restriction error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:31:6 --> $DIR/pub-restricted.rs:31:6
@ -74,9 +70,8 @@ LL | pub (xyz) fn xyz() {}
`pub(in path::to::module)`: visible only on the specified path `pub(in path::to::module)`: visible only on the specified path
help: make this visible only to module `xyz` with `in` help: make this visible only to module `xyz` with `in`
| |
LL - pub (xyz) fn xyz() {} LL | pub (in xyz) fn xyz() {}
LL + pub (in xyz) fn xyz() {} | ~~~~~~
|
error[E0742]: visibilities can only be restricted to ancestor modules error[E0742]: visibilities can only be restricted to ancestor modules
--> $DIR/pub-restricted.rs:23:17 --> $DIR/pub-restricted.rs:23:17

View file

@ -73,9 +73,8 @@ LL | _ => {}
| |
help: you might have meant to pattern match against the value of constant `ARCH` instead of introducing a new catch-all binding help: you might have meant to pattern match against the value of constant `ARCH` instead of introducing a new catch-all binding
| |
LL - ARCH => {} LL | std::env::consts::ARCH => {}
LL + std::env::consts::ARCH => {} | ~~~~~~~~~~~~~~~~~~~~~~
|
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View file

@ -34,9 +34,8 @@ LL | (A, B) | (ref B, c) | (c, A) => ()
| |
help: if you meant to match on unit variant `E::A`, use the full path in the pattern help: if you meant to match on unit variant `E::A`, use the full path in the pattern
| |
LL - (A, B) | (ref B, c) | (c, A) => () LL | (E::A, B) | (ref B, c) | (c, A) => ()
LL + (E::A, B) | (ref B, c) | (c, A) => () | ~~~~
|
error[E0408]: variable `B` is not bound in all patterns error[E0408]: variable `B` is not bound in all patterns
--> $DIR/resolve-inconsistent-names.rs:19:31 --> $DIR/resolve-inconsistent-names.rs:19:31
@ -65,9 +64,8 @@ LL | (CONST1, _) | (_, Const2) => ()
| |
help: if you meant to match on constant `m::Const2`, use the full path in the pattern help: if you meant to match on constant `m::Const2`, use the full path in the pattern
| |
LL - (CONST1, _) | (_, Const2) => () LL | (CONST1, _) | (_, m::Const2) => ()
LL + (CONST1, _) | (_, m::Const2) => () | ~~~~~~~~~
|
error[E0408]: variable `CONST1` is not bound in all patterns error[E0408]: variable `CONST1` is not bound in all patterns
--> $DIR/resolve-inconsistent-names.rs:31:23 --> $DIR/resolve-inconsistent-names.rs:31:23

View file

@ -58,9 +58,8 @@ LL | let NormalStruct { first_field, second_field } = ns;
| |
help: add `..` at the end of the field list to ignore all other fields help: add `..` at the end of the field list to ignore all other fields
| |
LL - let NormalStruct { first_field, second_field } = ns; LL | let NormalStruct { first_field, second_field , .. } = ns;
LL + let NormalStruct { first_field, second_field , .. } = ns; | ~~~~~~
|
error[E0423]: cannot initialize a tuple struct which contains private fields error[E0423]: cannot initialize a tuple struct which contains private fields
--> $DIR/struct.rs:20:14 --> $DIR/struct.rs:20:14
@ -76,9 +75,8 @@ LL | let TupleStruct { 0: first_field, 1: second_field } = ts;
| |
help: add `..` at the end of the field list to ignore all other fields help: add `..` at the end of the field list to ignore all other fields
| |
LL - let TupleStruct { 0: first_field, 1: second_field } = ts; LL | let TupleStruct { 0: first_field, 1: second_field , .. } = ts;
LL + let TupleStruct { 0: first_field, 1: second_field , .. } = ts; | ~~~~~~
|
error[E0638]: `..` required with struct marked as non-exhaustive error[E0638]: `..` required with struct marked as non-exhaustive
--> $DIR/struct.rs:35:9 --> $DIR/struct.rs:35:9
@ -88,9 +86,8 @@ LL | let UnitStruct { } = us;
| |
help: add `..` at the end of the field list to ignore all other fields help: add `..` at the end of the field list to ignore all other fields
| |
LL - let UnitStruct { } = us; LL | let UnitStruct { .. } = us;
LL + let UnitStruct { .. } = us; | ~~~~
|
error: aborting due to 9 previous errors error: aborting due to 9 previous errors

View file

@ -82,9 +82,8 @@ LL | NonExhaustiveVariants::Struct { field } => ""
| |
help: add `..` at the end of the field list to ignore all other fields help: add `..` at the end of the field list to ignore all other fields
| |
LL - NonExhaustiveVariants::Struct { field } => "" LL | NonExhaustiveVariants::Struct { field , .. } => ""
LL + NonExhaustiveVariants::Struct { field , .. } => "" | ~~~~~~
|
error[E0638]: `..` required with variant marked as non-exhaustive error[E0638]: `..` required with variant marked as non-exhaustive
--> $DIR/variant.rs:30:12 --> $DIR/variant.rs:30:12
@ -94,9 +93,8 @@ LL | if let NonExhaustiveVariants::Struct { field } = variant_struct {
| |
help: add `..` at the end of the field list to ignore all other fields help: add `..` at the end of the field list to ignore all other fields
| |
LL - if let NonExhaustiveVariants::Struct { field } = variant_struct { LL | if let NonExhaustiveVariants::Struct { field , .. } = variant_struct {
LL + if let NonExhaustiveVariants::Struct { field , .. } = variant_struct { | ~~~~~~
|
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View file

@ -6,9 +6,8 @@ LL | use alloc;
| |
help: consider importing this module instead help: consider importing this module instead
| |
LL - use alloc; LL | use std::alloc;
LL + use std::alloc; | ~~~~~~~~~~
|
error: aborting due to 1 previous error error: aborting due to 1 previous error

View file

@ -34,9 +34,8 @@ LL + use crate::foo::Bar;
| |
help: there is a method `foobar` with a similar name help: there is a method `foobar` with a similar name
| |
LL - x.bar(); LL | x.foobar();
LL + x.foobar(); | ~~~~~~
|
error[E0599]: no method named `baz` found for type `u32` in the current scope error[E0599]: no method named `baz` found for type `u32` in the current scope
--> $DIR/trait-import-suggestions.rs:29:7 --> $DIR/trait-import-suggestions.rs:29:7

View file

@ -24,19 +24,16 @@ LL | let A { x, y } = self.d;
| |
help: include the missing fields in the pattern help: include the missing fields in the pattern
| |
LL - let A { x, y } = self.d; LL | let A { x, y, b, c } = self.d;
LL + let A { x, y, b, c } = self.d; | ~~~~~~~~
|
help: if you don't care about these missing fields, you can explicitly ignore them help: if you don't care about these missing fields, you can explicitly ignore them
| |
LL - let A { x, y } = self.d; LL | let A { x, y, b: _, c: _ } = self.d;
LL + let A { x, y, b: _, c: _ } = self.d; | ~~~~~~~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - let A { x, y } = self.d; LL | let A { x, y, .. } = self.d;
LL + let A { x, y, .. } = self.d; | ~~~~~~
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -30,19 +30,16 @@ LL | if let E::S { 0: a } = x {
| |
help: include the missing field in the pattern help: include the missing field in the pattern
| |
LL - if let E::S { 0: a } = x { LL | if let E::S { 0: a, 1: _ } = x {
LL + if let E::S { 0: a, 1: _ } = x { | ~~~~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - if let E::S { 0: a } = x { LL | if let E::S { 0: a, 1: _ } = x {
LL + if let E::S { 0: a, 1: _ } = x { | ~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - if let E::S { 0: a } = x { LL | if let E::S { 0: a, .. } = x {
LL + if let E::S { 0: a, .. } = x { | ~~~~~~
|
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -15,19 +15,16 @@ LL | Foo::Bar { a, aa: 1, c } => (),
| |
help: include the missing field in the pattern help: include the missing field in the pattern
| |
LL - Foo::Bar { a, aa: 1, c } => (), LL | Foo::Bar { a, aa: 1, c, b } => (),
LL + Foo::Bar { a, aa: 1, c, b } => (), | ~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - Foo::Bar { a, aa: 1, c } => (), LL | Foo::Bar { a, aa: 1, c, b: _ } => (),
LL + Foo::Bar { a, aa: 1, c, b: _ } => (), | ~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - Foo::Bar { a, aa: 1, c } => (), LL | Foo::Bar { a, aa: 1, c, .. } => (),
LL + Foo::Bar { a, aa: 1, c, .. } => (), | ~~~~~~
|
error[E0026]: variant `Foo::Baz` does not have a field named `bb` error[E0026]: variant `Foo::Baz` does not have a field named `bb`
--> $DIR/suggest-replacing-field-when-specifying-same-type.rs:13:20 --> $DIR/suggest-replacing-field-when-specifying-same-type.rs:13:20
@ -46,19 +43,16 @@ LL | Foo::Baz { bb: 1.0 } => (),
| |
help: include the missing field in the pattern help: include the missing field in the pattern
| |
LL - Foo::Baz { bb: 1.0 } => (), LL | Foo::Baz { bb: 1.0, a } => (),
LL + Foo::Baz { bb: 1.0, a } => (), | ~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - Foo::Baz { bb: 1.0 } => (), LL | Foo::Baz { bb: 1.0, a: _ } => (),
LL + Foo::Baz { bb: 1.0, a: _ } => (), | ~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - Foo::Baz { bb: 1.0 } => (), LL | Foo::Baz { bb: 1.0, .. } => (),
LL + Foo::Baz { bb: 1.0, .. } => (), | ~~~~~~
|
error[E0026]: variant `Foo::Bar` does not have a field named `aa` error[E0026]: variant `Foo::Bar` does not have a field named `aa`
--> $DIR/suggest-replacing-field-when-specifying-same-type.rs:20:23 --> $DIR/suggest-replacing-field-when-specifying-same-type.rs:20:23
@ -74,19 +68,16 @@ LL | Foo::Bar { a, aa: "", c } => (),
| |
help: include the missing field in the pattern help: include the missing field in the pattern
| |
LL - Foo::Bar { a, aa: "", c } => (), LL | Foo::Bar { a, aa: "", c, b } => (),
LL + Foo::Bar { a, aa: "", c, b } => (), | ~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - Foo::Bar { a, aa: "", c } => (), LL | Foo::Bar { a, aa: "", c, b: _ } => (),
LL + Foo::Bar { a, aa: "", c, b: _ } => (), | ~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - Foo::Bar { a, aa: "", c } => (), LL | Foo::Bar { a, aa: "", c, .. } => (),
LL + Foo::Bar { a, aa: "", c, .. } => (), | ~~~~~~
|
error[E0026]: variant `Foo::Baz` does not have a field named `bb` error[E0026]: variant `Foo::Baz` does not have a field named `bb`
--> $DIR/suggest-replacing-field-when-specifying-same-type.rs:23:20 --> $DIR/suggest-replacing-field-when-specifying-same-type.rs:23:20
@ -102,19 +93,16 @@ LL | Foo::Baz { bb: "" } => (),
| |
help: include the missing field in the pattern help: include the missing field in the pattern
| |
LL - Foo::Baz { bb: "" } => (), LL | Foo::Baz { bb: "", a } => (),
LL + Foo::Baz { bb: "", a } => (), | ~~~~~
|
help: if you don't care about this missing field, you can explicitly ignore it help: if you don't care about this missing field, you can explicitly ignore it
| |
LL - Foo::Baz { bb: "" } => (), LL | Foo::Baz { bb: "", a: _ } => (),
LL + Foo::Baz { bb: "", a: _ } => (), | ~~~~~~~~
|
help: or always ignore missing fields here help: or always ignore missing fields here
| |
LL - Foo::Baz { bb: "" } => (), LL | Foo::Baz { bb: "", .. } => (),
LL + Foo::Baz { bb: "", .. } => (), | ~~~~~~
|
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View file

@ -11,9 +11,8 @@ LL | Some(_) => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match x { LL | match *x {
LL + match *x { | ~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:9:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:9:9
@ -28,9 +27,8 @@ LL | None => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match x { LL | match *x {
LL + match *x { | ~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:16:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:16:9
@ -79,9 +77,8 @@ LL | Some(_) => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match y { LL | match *y {
LL + match *y { | ~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:28:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:28:9
@ -96,9 +93,8 @@ LL | None => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match y { LL | match *y {
LL + match *y { | ~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:36:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:36:9
@ -147,9 +143,8 @@ LL | Some(_) => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match z_const { LL | match &**z_const {
LL + match &**z_const { | ~~~~~~~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:48:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:48:9
@ -164,9 +159,8 @@ LL | None => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match z_const { LL | match &**z_const {
LL + match &**z_const { | ~~~~~~~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:57:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:57:9
@ -181,9 +175,8 @@ LL | Some(_) => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match z_mut { LL | match &**z_mut {
LL + match &**z_mut { | ~~~~~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:59:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:59:9
@ -198,9 +191,8 @@ LL | None => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match z_mut { LL | match &**z_mut {
LL + match &**z_mut { | ~~~~~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:68:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:68:9
@ -215,9 +207,8 @@ LL | Some(_) => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match y_mut { LL | match &**y_mut {
LL + match &**y_mut { | ~~~~~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:70:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:70:9
@ -232,9 +223,8 @@ LL | None => {}
found enum `Option<_>` found enum `Option<_>`
help: consider dereferencing to access the inner value using the Deref trait help: consider dereferencing to access the inner value using the Deref trait
| |
LL - match y_mut { LL | match &**y_mut {
LL + match &**y_mut { | ~~~~~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/suggest-deref-in-match-issue-132784.rs:79:9 --> $DIR/suggest-deref-in-match-issue-132784.rs:79:9

View file

@ -8,9 +8,8 @@ LL | let _x: u8 = 'X';
| |
help: if you meant to write a byte literal, prefix with `b` help: if you meant to write a byte literal, prefix with `b`
| |
LL - let _x: u8 = 'X'; LL | let _x: u8 = b'X';
LL + let _x: u8 = b'X'; | ~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/type-mismatch-byte-literal.rs:11:9 --> $DIR/type-mismatch-byte-literal.rs:11:9
@ -27,9 +26,8 @@ LL | fn foo(_t: u8) {}
| ^^^ ------ | ^^^ ------
help: if you meant to write a byte literal, prefix with `b` help: if you meant to write a byte literal, prefix with `b`
| |
LL - foo('#'); LL | foo(b'#');
LL + foo(b'#'); | ~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/type-mismatch-byte-literal.rs:15:18 --> $DIR/type-mismatch-byte-literal.rs:15:18
@ -41,9 +39,8 @@ LL | let _a: u8 = '\x20';
| |
help: if you meant to write a byte literal, prefix with `b` help: if you meant to write a byte literal, prefix with `b`
| |
LL - let _a: u8 = '\x20'; LL | let _a: u8 = b'\x20';
LL + let _a: u8 = b'\x20'; | ~~~~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/type-mismatch-byte-literal.rs:20:9 --> $DIR/type-mismatch-byte-literal.rs:20:9

View file

@ -12,9 +12,8 @@ LL | use test as y;
| |
help: consider importing this module instead help: consider importing this module instead
| |
LL - use test as y; LL | use test::test as y;
LL + use test::test as y; | ~~~~~~~~~~~~~~~
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -14,9 +14,8 @@ LL + struct Foo<T> where T: Bar, T: Bar<Baz = String> {
| |
help: a trait with a similar name exists help: a trait with a similar name exists
| |
LL - struct Foo<T> where T: Bar, <T as Bar>::Baz: String { LL | struct Foo<T> where T: Bar, <T as Bar>::Baz: ToString {
LL + struct Foo<T> where T: Bar, <T as Bar>::Baz: ToString { | ~~~~~~~~
|
error[E0404]: expected trait, found struct `String` error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:9:54 --> $DIR/assoc_type_bound_with_struct.rs:9:54
@ -34,9 +33,8 @@ LL + struct Qux<'a, T> where T: Bar, &'a T: Bar<Baz = String> {
| |
help: a trait with a similar name exists help: a trait with a similar name exists
| |
LL - struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: String { LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: ToString {
LL + struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: ToString { | ~~~~~~~~
|
error[E0404]: expected trait, found struct `String` error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:13:45 --> $DIR/assoc_type_bound_with_struct.rs:13:45
@ -54,9 +52,8 @@ LL + fn foo<T: Bar>(_: T) where T: Bar<Baz = String> {
| |
help: a trait with a similar name exists help: a trait with a similar name exists
| |
LL - fn foo<T: Bar>(_: T) where <T as Bar>::Baz: String { LL | fn foo<T: Bar>(_: T) where <T as Bar>::Baz: ToString {
LL + fn foo<T: Bar>(_: T) where <T as Bar>::Baz: ToString { | ~~~~~~~~
|
error[E0404]: expected trait, found struct `String` error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:16:57 --> $DIR/assoc_type_bound_with_struct.rs:16:57
@ -74,9 +71,8 @@ LL + fn qux<'a, T: Bar>(_: &'a T) where &'a T: Bar<Baz = String> {
| |
help: a trait with a similar name exists help: a trait with a similar name exists
| |
LL - fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String { LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: ToString {
LL + fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: ToString { | ~~~~~~~~
|
error[E0405]: cannot find trait `Unresolved` in this scope error[E0405]: cannot find trait `Unresolved` in this scope
--> $DIR/assoc_type_bound_with_struct.rs:19:31 --> $DIR/assoc_type_bound_with_struct.rs:19:31

View file

@ -19,9 +19,8 @@ LL | let _ = format!("{xyza}");
| ++++++++ + | ++++++++ +
help: if this is intentional, prefix it with an underscore help: if this is intentional, prefix it with an underscore
| |
LL - fn foo(xyza: &str) { LL | fn foo(_xyza: &str) {
LL + fn foo(_xyza: &str) { | ~~~~~
|
error: unused variable: `xyza` error: unused variable: `xyza`
--> $DIR/issue-100584.rs:7:9 --> $DIR/issue-100584.rs:7:9
@ -38,9 +37,8 @@ LL | let _ = format!("aaa{xyza}bbb");
| ++++++++ + | ++++++++ +
help: if this is intentional, prefix it with an underscore help: if this is intentional, prefix it with an underscore
| |
LL - fn foo3(xyza: &str) { LL | fn foo3(_xyza: &str) {
LL + fn foo3(_xyza: &str) { | ~~~~~
|
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -6,9 +6,8 @@ LL | const BAD_NESTING4: pattern_type!(u8 is 'a'..='a') = todo!();
| |
help: if you meant to write a byte literal, prefix with `b` help: if you meant to write a byte literal, prefix with `b`
| |
LL - const BAD_NESTING4: pattern_type!(u8 is 'a'..='a') = todo!(); LL | const BAD_NESTING4: pattern_type!(u8 is b'a'..='a') = todo!();
LL + const BAD_NESTING4: pattern_type!(u8 is b'a'..='a') = todo!(); | ~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/pattern_type_mismatch.rs:8:47 --> $DIR/pattern_type_mismatch.rs:8:47
@ -18,9 +17,8 @@ LL | const BAD_NESTING4: pattern_type!(u8 is 'a'..='a') = todo!();
| |
help: if you meant to write a byte literal, prefix with `b` help: if you meant to write a byte literal, prefix with `b`
| |
LL - const BAD_NESTING4: pattern_type!(u8 is 'a'..='a') = todo!(); LL | const BAD_NESTING4: pattern_type!(u8 is 'a'..=b'a') = todo!();
LL + const BAD_NESTING4: pattern_type!(u8 is 'a'..=b'a') = todo!(); | ~~~~
|
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/pattern_type_mismatch.rs:12:43 --> $DIR/pattern_type_mismatch.rs:12:43

View file

@ -13,9 +13,8 @@ LL | fn values(&self) -> Self::Values;
found signature `fn(Option<_>)` found signature `fn(Option<_>)`
help: change the self-receiver type to match the trait help: change the self-receiver type to match the trait
| |
LL - fn values(self) -> Self::Values { LL | fn values(&self) -> Self::Values {
LL + fn values(&self) -> Self::Values { | ~~~~~
|
error[E0631]: type mismatch in function arguments error[E0631]: type mismatch in function arguments
--> $DIR/mismatched-map-under-self.rs:12:18 --> $DIR/mismatched-map-under-self.rs:12:18

View file

@ -6,9 +6,8 @@ LL | use Trait;
| |
help: consider importing this trait instead help: consider importing this trait instead
| |
LL - use Trait; LL | use a::Trait;
LL + use a::Trait; | ~~~~~~~~
|
error[E0405]: cannot find trait `Trait` in this scope error[E0405]: cannot find trait `Trait` in this scope
--> $DIR/unresolved-candidates.rs:10:10 --> $DIR/unresolved-candidates.rs:10:10