1
Fork 0

Trim suggestion parts to the subset that is purely additive

This commit is contained in:
Michael Goulet 2025-02-13 03:21:25 +00:00 committed by Jubilee Young
parent f6406dfd4e
commit 6d71251cf9
148 changed files with 321 additions and 304 deletions

View file

@ -1976,9 +1976,11 @@ impl HumanEmitter {
Some(Style::HeaderMsg),
);
let other_suggestions = suggestions.len().saturating_sub(MAX_SUGGESTIONS);
let mut row_num = 2;
for (i, (complete, parts, highlights, _)) in
suggestions.iter().enumerate().take(MAX_SUGGESTIONS)
suggestions.into_iter().enumerate().take(MAX_SUGGESTIONS)
{
debug!(?complete, ?parts, ?highlights);
@ -2168,7 +2170,7 @@ impl HumanEmitter {
self.draw_code_line(
&mut buffer,
&mut row_num,
highlight_parts,
&highlight_parts,
line_pos + line_start,
line,
show_code_change,
@ -2214,7 +2216,12 @@ impl HumanEmitter {
if let DisplaySuggestion::Diff | DisplaySuggestion::Underline | DisplaySuggestion::Add =
show_code_change
{
for part in parts {
for mut part in parts {
// If this is a replacement of, e.g. `"a"` into `"ab"`, adjust the
// suggestion and snippet to look as if we just suggested to add
// `"b"`, which is typically much easier for the user to understand.
part.trim_trivial_replacements(sm);
let snippet = if let Ok(snippet) = sm.span_to_snippet(part.span) {
snippet
} else {
@ -2377,9 +2384,12 @@ impl HumanEmitter {
row_num = row + 1;
}
}
if suggestions.len() > MAX_SUGGESTIONS {
let others = suggestions.len() - MAX_SUGGESTIONS;
let msg = format!("and {} other candidate{}", others, pluralize!(others));
if other_suggestions > 0 {
let msg = format!(
"and {} other candidate{}",
other_suggestions,
pluralize!(other_suggestions)
);
buffer.puts(row_num, max_line_num_len + 3, &msg, Style::NoStyle);
}

View file

@ -246,6 +246,24 @@ impl SubstitutionPart {
sm.span_to_snippet(self.span)
.map_or(!self.span.is_empty(), |snippet| !snippet.trim().is_empty())
}
/// Try to turn a replacement into an addition when the span that is being
/// overwritten matches either the prefix or suffix of the replacement.
fn trim_trivial_replacements(&mut self, sm: &SourceMap) {
if self.snippet.is_empty() {
return;
}
let Ok(snippet) = sm.span_to_snippet(self.span) else {
return;
};
if self.snippet.starts_with(&snippet) {
self.span = self.span.shrink_to_hi();
self.snippet = self.snippet[snippet.len()..].to_string();
} else if self.snippet.ends_with(&snippet) {
self.span = self.span.shrink_to_lo();
self.snippet = self.snippet[..self.snippet.len() - snippet.len()].to_string();
}
}
}
impl CodeSuggestion {

View file

@ -8,8 +8,7 @@ LL | true
= help: to override `-D warnings` add `#[allow(clippy::implicit_return)]`
help: add `return` as shown
|
LL - true
LL + return true
LL | return true
|
error: missing `return` statement
@ -20,9 +19,8 @@ LL | if true { true } else { false }
|
help: add `return` as shown
|
LL - if true { true } else { false }
LL + if true { return true } else { false }
|
LL | if true { return true } else { false }
| ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:19:29
@ -32,9 +30,8 @@ LL | if true { true } else { false }
|
help: add `return` as shown
|
LL - if true { true } else { false }
LL + if true { true } else { return false }
|
LL | if true { true } else { return false }
| ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:25:17
@ -44,9 +41,8 @@ LL | true => false,
|
help: add `return` as shown
|
LL - true => false,
LL + true => return false,
|
LL | true => return false,
| ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:26:20
@ -56,9 +52,8 @@ LL | false => { true },
|
help: add `return` as shown
|
LL - false => { true },
LL + false => { return true },
|
LL | false => { return true },
| ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:39:9
@ -104,9 +99,8 @@ LL | let _ = || { true };
|
help: add `return` as shown
|
LL - let _ = || { true };
LL + let _ = || { return true };
|
LL | let _ = || { return true };
| ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:73:16
@ -116,9 +110,8 @@ LL | let _ = || true;
|
help: add `return` as shown
|
LL - let _ = || true;
LL + let _ = || return true;
|
LL | let _ = || return true;
| ++++++
error: missing `return` statement
--> tests/ui/implicit_return.rs:81:5
@ -128,8 +121,7 @@ LL | format!("test {}", "test")
|
help: add `return` as shown
|
LL - format!("test {}", "test")
LL + return format!("test {}", "test")
LL | return format!("test {}", "test")
|
error: missing `return` statement
@ -140,8 +132,7 @@ LL | m!(true, false)
|
help: add `return` as shown
|
LL - m!(true, false)
LL + return m!(true, false)
LL | return m!(true, false)
|
error: missing `return` statement
@ -191,8 +182,7 @@ LL | true
|
help: add `return` as shown
|
LL - true
LL + return true
LL | return true
|
error: aborting due to 16 previous errors

View file

@ -68,9 +68,8 @@ LL | MAX;
|
help: use the associated constant instead
|
LL - MAX;
LL + u32::MAX;
|
LL | u32::MAX;
| +++++
error: usage of a legacy numeric method
--> tests/ui/legacy_numeric_constants.rs:49:10

View file

@ -135,7 +135,7 @@ LL | type Baz = T;
help: consider further restricting type parameter `T` with trait `Clone`
|
LL | Self::Baz: Clone, T: std::clone::Clone
| ~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++
error: aborting due to 8 previous errors

View file

@ -135,7 +135,7 @@ LL | type Baz = T;
help: consider further restricting type parameter `T` with trait `Clone`
|
LL | Self::Baz: Clone, T: std::clone::Clone
| ~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++
error: aborting due to 8 previous errors

View file

@ -14,7 +14,7 @@ LL | impl<T: NotNull> IntoNullable for T {
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
|
LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>, <Col as Expression>::SqlType: NotNull
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
--> $DIR/issue-38821.rs:40:1
@ -38,7 +38,7 @@ LL | impl<T: NotNull> IntoNullable for T {
help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
|
LL | Expr: Expression<SqlType=<Col::SqlType as IntoNullable>::Nullable>, <Col as Expression>::SqlType: NotNull
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied
--> $DIR/issue-38821.rs:23:10

View file

@ -13,7 +13,7 @@ LL | type Size: Add<Output = Self::Size>;
help: consider further restricting the associated type
|
LL | T: SubEncoder, <T as SubEncoder>::ActualSize: Add
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++++++++++++++++
error: aborting due to 1 previous error

View file

@ -13,7 +13,7 @@ LL | type Size: Add<Output = Self::Size>;
help: consider further restricting the associated type
|
LL | T: SubEncoder, <T as SubEncoder>::ActualSize: Add
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++++++++++++++++
error: aborting due to 1 previous error

View file

@ -36,7 +36,7 @@ LL | x.inser();
help: there is a method `insert` with a similar name
|
LL | x.insert();
| ~~~~~~
| +
error[E0599]: no method named `foo` found for struct `rustc_confusables_across_crate::BTreeSet` in the current scope
--> $DIR/rustc_confusables.rs:15:7

View file

@ -39,7 +39,7 @@ LL | let mut x = VecDeque::new();
help: you might have meant to use `push_back`
|
LL | x.push_back(1);
| ~~~~~~~~~
| +++++
error[E0599]: no method named `length` found for struct `Vec<{integer}>` in the current scope
--> $DIR/rustc_confusables_std_cases.rs:15:7
@ -98,7 +98,7 @@ note: method defined here
help: you might have meant to use `push_str`
|
LL | String::new().push_str("");
| ~~~~~~~~
| ++++
error[E0599]: no method named `append` found for struct `String` in the current scope
--> $DIR/rustc_confusables_std_cases.rs:24:19

View file

@ -9,7 +9,7 @@ LL | self.layers.iter().fold(0, |result, mut layer| result + layer.proce
help: you may want to use `iter_mut` here
|
LL | self.layers.iter_mut().fold(0, |result, mut layer| result + layer.process())
| ~~~~~~~~
| ++++
error: aborting due to 1 previous error

View file

@ -9,7 +9,7 @@ LL | vec.iter().flat_map(|container| container.things()).cloned().co
help: you may want to use `iter_mut` here
|
LL | vec.iter_mut().flat_map(|container| container.things()).cloned().collect::<Vec<PathBuf>>();
| ~~~~~~~~
| ++++
error: aborting due to 1 previous error

View file

@ -9,7 +9,7 @@ LL | v.iter().for_each(|a| a.double());
help: you may want to use `iter_mut` here
|
LL | v.iter_mut().for_each(|a| a.double());
| ~~~~~~~~
| ++++
error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference
--> $DIR/issue-62387-suggest-iter-mut.rs:25:39
@ -22,7 +22,7 @@ LL | v.iter().rev().rev().for_each(|a| a.double());
help: you may want to use `iter_mut` here
|
LL | v.iter_mut().rev().rev().for_each(|a| a.double());
| ~~~~~~~~
| ++++
error: aborting due to 2 previous errors

View file

@ -64,7 +64,7 @@ LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize
help: a trait with a similar name exists
|
LL | self , ... , self , self , ... ) where Fn : FnOnce ( & 'a & 'b usize ) {
| ~~
| +
help: you might be missing a type parameter
|
LL | fn ordering4 < 'a , 'b, F > ( a : , self , self , self ,

View file

@ -17,7 +17,7 @@ LL | cbor_map! { #[cfg(test)] 4};
help: you must specify a concrete type for this numeric value, like `i32`
|
LL | cbor_map! { #[cfg(test)] 4_i32};
| ~~~~~
| ++++
error: aborting due to 2 previous errors

View file

@ -18,7 +18,7 @@ LL | #[cfg(featur = "foo")]
help: there is a config with a similar name and value
|
LL | #[cfg(feature = "foo")]
| ~~~~~~~
| +
warning: unexpected `cfg` condition name: `featur`
--> $DIR/diagnotics.rs:17:7

View file

@ -20,7 +20,7 @@ LL | #[cfg(featur = "foo")]
help: there is a config with a similar name and value
|
LL | #[cfg(feature = "foo")]
| ~~~~~~~
| +
warning: unexpected `cfg` condition name: `featur`
--> $DIR/diagnotics.rs:17:7

View file

@ -109,7 +109,7 @@ LL | let PAT = v1;
help: introduce a variable instead
|
LL | let PAT_var = v1;
| ~~~~~~~
| ++++
error: aborting due to 7 previous errors

View file

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

View file

@ -16,7 +16,7 @@ LL | _func: F,
help: a trait with a similar name exists
|
LL | _func: Fn,
| ~~
| +
help: you might be missing a type parameter
|
LL | struct Map2<Segment2, F> {

View file

@ -9,7 +9,7 @@ LL | fn poll(self, _: &mut Context<'_>) -> Poll<()> {
help: change the self-receiver type to match the trait
|
LL | fn poll(self: Pin<&mut MyFuture>, _: &mut Context<'_>) -> Poll<()> {
| ~~~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++
error[E0053]: method `foo` has an incompatible type for trait
--> $DIR/bad-self-type.rs:22:18

View file

@ -15,7 +15,7 @@ LL | [(); N + 1]:,
help: try adding a `where` bound
|
LL | [(); M + 1]:, [(); N + 1]:
| ~~~~~~~~~~~~~~
| ++++++++++++
error: aborting due to 1 previous error

View file

@ -15,7 +15,7 @@ LL | [(); N + 1]:,
help: try adding a `where` bound
|
LL | [(); both(N + 1, M + 1)]:, [(); N + 1]:
| ~~~~~~~~~~~~~~
| ++++++++++++
error: aborting due to 1 previous error

View file

@ -17,7 +17,7 @@ LL | fn assert_impl<T: Trait>() {}
help: try adding a `where` bound
|
LL | EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:17:5
@ -52,7 +52,7 @@ LL | fn assert_impl<T: Trait>() {}
help: try adding a `where` bound
|
LL | EvaluatableU128<{N as u128}>:, [(); { O as u128 } as usize]: {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:20:5
@ -115,7 +115,7 @@ LL | fn assert_impl<T: Trait>() {}
help: try adding a `where` bound
|
LL | EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:35:5
@ -150,7 +150,7 @@ LL | fn assert_impl<T: Trait>() {}
help: try adding a `where` bound
|
LL | EvaluatableU128<{N as _}>:, [(); { O as u128 } as usize]: {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:38:5

View file

@ -7,7 +7,7 @@ LL | bar::<{ T::ASSOC }>();
help: try adding a `where` bound
|
LL | fn foo<T: Trait, U: Trait>() where [(); U::ASSOC]:, [(); { T::ASSOC }]: {
| ~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++
error: aborting due to 1 previous error

View file

@ -27,7 +27,7 @@ LL | foo::<_, L>([(); L + 1 + L]);
help: try adding a `where` bound
|
LL | [(); (L - 1) + 1 + L]:, [(); L + 1 + L]:
| ~~~~~~~~~~~~~~~~~~
| ++++++++++++++++
error: unconstrained generic constant
--> $DIR/issue_114151.rs:17:17

View file

@ -16,7 +16,7 @@ LL | foo::<_, L>([(); L + 1 + L]);
help: try adding a `where` bound
|
LL | [(); (L - 1) + 1 + L]:, [(); L + 1 + L]:
| ~~~~~~~~~~~~~~~~~~
| ++++++++++++++++
error: aborting due to 2 previous errors

View file

@ -10,7 +10,7 @@ LL | let f: F = async { 1 };
help: a trait with a similar name exists
|
LL | let f: Fn = async { 1 };
| ~~
| +
help: you might be missing a type parameter
|
LL | fn f<T, F>(

View file

@ -13,7 +13,7 @@ LL | let a = 4;
help: introduce a variable instead
|
LL | let a_var = 4;
| ~~~~~
| ++++
error[E0005]: refutable pattern in local binding
--> $DIR/const-pattern-irrefutable.rs:28:9
@ -48,7 +48,7 @@ LL | let d = (4, 4);
help: introduce a variable instead
|
LL | let d_var = (4, 4);
| ~~~~~
| ++++
error[E0005]: refutable pattern in local binding
--> $DIR/const-pattern-irrefutable.rs:36:9
@ -70,7 +70,7 @@ LL | struct S {
help: introduce a variable instead
|
LL | let e_var = S {
| ~~~~~
| ++++
error: aborting due to 4 previous errors

View file

@ -11,7 +11,7 @@ LL | const CRATE: Crate = Crate { fiel: () };
help: a field with a similar name exists
|
LL | const CRATE: Crate = Crate { field: () };
| ~~~~~
| +
error[E0609]: no field `field` on type `Compound`
--> $DIR/dont-suggest-hygienic-fields.rs:24:16

View file

@ -12,7 +12,7 @@ LL | struct DropMe<T: Copy>(T);
help: consider further restricting type parameter `T` with trait `Copy`
|
LL | [T; 1]: Copy, T: std::marker::Copy // But `[T; 1]: Copy` does not imply `T: Copy`
| ~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/explicit-drop-bounds.rs:32:18
@ -28,7 +28,7 @@ LL | struct DropMe<T: Copy>(T);
help: consider further restricting type parameter `T` with trait `Copy`
|
LL | [T; 1]: Copy, T: std::marker::Copy // But `[T; 1]: Copy` does not imply `T: Copy`
| ~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++
error: aborting due to 2 previous errors

View file

@ -68,7 +68,7 @@ LL | fn wants_write(_: impl Write) {}
help: consider changing this borrow's mutability
|
LL | wants_write(&mut [0u8][..]);
| ~~~~
| +++
error: aborting due to 4 previous errors

View file

@ -15,7 +15,7 @@ LL | pub struct XEmpty2;
help: use struct literal syntax instead
|
LL | let e1 = Empty1 {};
| ~~~~~~~~~
| ++
help: a unit struct with a similar name exists
|
LL - let e1 = Empty1;
@ -38,7 +38,7 @@ LL | pub struct XEmpty2;
help: use struct literal syntax instead
|
LL | let xe1 = XEmpty1 {};
| ~~~~~~~~~~
| ++
help: a unit struct with a similar name exists
|
LL - let xe1 = XEmpty1;
@ -126,7 +126,7 @@ LL | let xe3 = XE::Empty3;
help: there is a variant with a similar name
|
LL | let xe3 = XE::XEmpty3;
| ~~~~~~~
| +
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

View file

@ -47,7 +47,7 @@ LL | XEmpty5(),
help: use the tuple variant pattern syntax instead
|
LL | XE::XEmpty5() => (),
| ~~~~~~~~~~~~~
| ++
help: a unit variant with a similar name exists
|
LL - XE::XEmpty5 => (),

View file

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

View file

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

View file

@ -12,7 +12,7 @@ LL + extern fn none_fn(x: bool) -> i32 { <body> }
help: if you meant to declare an externally defined function, use an `extern` block
|
LL | extern { fn none_fn(x: bool) -> i32; }
| ~~~~~~~~ +
| + +
error: free function without a body
--> $DIR/not-in-block.rs:6:1
@ -28,7 +28,7 @@ LL + extern "C" fn c_fn(x: bool) -> i32 { <body> }
help: if you meant to declare an externally defined function, use an `extern` block
|
LL | extern "C" { fn c_fn(x: bool) -> i32; }
| ~~~~~~~~~~~~ +
| + +
error: aborting due to 2 previous errors

View file

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

View file

@ -52,7 +52,7 @@ LL | format_args!("{}", 0xffff_ffff); // treat unsuffixed literals as i32
help: to use as a negative number (decimal `-1`), consider using the type `u32` for the literal and cast it to `i32`
|
LL | format_args!("{}", 0xffff_ffffu32 as i32); // treat unsuffixed literals as i32
| ~~~~~~~~~~~~~~~~~~~~~
| ++++++++++
error: aborting due to 5 previous errors

View file

@ -18,7 +18,7 @@ LL + use no_method_suggested_traits::qux::PrivPub;
help: there is a method `method2` with a similar name
|
LL | 1u32.method2();
| ~~~~~~~
| +
error[E0599]: no method named `method` found for struct `Rc<&mut Box<&u32>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:26:44
@ -40,7 +40,7 @@ LL + use no_method_suggested_traits::qux::PrivPub;
help: there is a method `method2` with a similar name
|
LL | std::rc::Rc::new(&mut Box::new(&1u32)).method2();
| ~~~~~~~
| +
error[E0599]: no method named `method` found for type `char` in the current scope
--> $DIR/no-method-suggested-traits.rs:30:9
@ -59,7 +59,7 @@ LL + use foo::Bar;
help: there is a method `method2` with a similar name
|
LL | 'a'.method2();
| ~~~~~~~
| +
error[E0599]: no method named `method` found for struct `Rc<&mut Box<&char>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:32:43
@ -75,7 +75,7 @@ LL + use foo::Bar;
help: there is a method `method2` with a similar name
|
LL | std::rc::Rc::new(&mut Box::new(&'a')).method2();
| ~~~~~~~
| +
error[E0599]: no method named `method` found for type `i32` in the current scope
--> $DIR/no-method-suggested-traits.rs:35:10
@ -96,7 +96,7 @@ LL + use no_method_suggested_traits::foo::PubPub;
help: there is a method `method3` with a similar name
|
LL | 1i32.method3();
| ~~~~~~~
| +
error[E0599]: no method named `method` found for struct `Rc<&mut Box<&i32>>` in the current scope
--> $DIR/no-method-suggested-traits.rs:37:44
@ -112,7 +112,7 @@ LL + use no_method_suggested_traits::foo::PubPub;
help: there is a method `method3` with a similar name
|
LL | std::rc::Rc::new(&mut Box::new(&1i32)).method3();
| ~~~~~~~
| +
error[E0599]: no method named `method` found for struct `Foo` in the current scope
--> $DIR/no-method-suggested-traits.rs:40:9

View file

@ -38,7 +38,7 @@ LL | | }
help: you might have meant to use the following enum variant
|
LL | B::B1;
| ~~~~~
| ++++
error[E0425]: cannot find value `C` in this scope
--> $DIR/glob-resolve1.rs:29:5

View file

@ -33,7 +33,7 @@ LL | use foo::{self};
help: you can use `as` to change the binding name of the import
|
LL | use foo::{self as other_foo};
| ~~~~~~~~~~~~~~~~~
| ++++++++++++
error[E0255]: the name `foo` is defined multiple times
--> $DIR/import-self.rs:12:5

View file

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

View file

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

View file

@ -12,7 +12,7 @@ LL | Foo::Bar => {}
help: use the tuple variant pattern syntax instead
|
LL | Foo::Bar(_) => {}
| ~~~~~~~~~~~
| +++
help: a unit variant with a similar name exists
|
LL - Foo::Bar => {}

View file

@ -7,7 +7,7 @@ LL | 3.f()
help: you must specify a concrete type for this numeric value, like `i32`
|
LL | 3_i32.f()
| ~~~~~
| ++++
error: aborting due to 1 previous error

View file

@ -7,7 +7,7 @@ LL | let a = (1.0).pow(1.0);
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | let a = (1.0_f32).pow(1.0);
| ~~~~~~~
| ++++
error: aborting due to 1 previous error

View file

@ -15,7 +15,7 @@ LL | S(Either::Right(_)) => {}
help: you might have meant to use field `0` whose type is `Either<usize, usize>`
|
LL | match S(Either::Left(5)).0 {
| ~~~~~~~~~~~~~~~~~~~~
| ++
error: aborting due to 1 previous error

View file

@ -17,7 +17,7 @@ LL + use reexported_trait::Trait;
help: there is a method `trait_method_b` with a similar name
|
LL | reexported_trait::FooStruct.trait_method_b();
| ~~~~~~~~~~~~~~
| ++
error[E0599]: no method named `trait_method_b` found for struct `FooStruct` in the current scope
--> $DIR/issue-56175.rs:7:33

View file

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

View file

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

View file

@ -33,7 +33,7 @@ LL | "\●"
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
LL | r"\●"
| ~~~~~
| +
error: aborting due to 4 previous errors

View file

@ -13,7 +13,7 @@ LL | x.use_mut();
help: consider consuming the `Vec<i32>` when turning it into an `Iterator`
|
LL | let mut x = vec![1].into_iter();
| ~~~~~~~~~
| +++++
help: consider using a `let` binding to create a longer lived value
|
LL ~ let binding = vec![1];

View file

@ -12,7 +12,7 @@ LL | #![deny(let_underscore_drop)]
help: consider binding to an unused variable to avoid immediately dropping the value
|
LL | let _unused = foo();
| ~~~~~~~
| ++++++
help: consider immediately dropping the value
|
LL - let _ = foo();

View file

@ -29,7 +29,7 @@ LL | let _ = field;
help: consider binding to an unused variable to avoid immediately dropping the value
|
LL | let _unused = field;
| ~~~~~~~
| ++++++
help: consider immediately dropping the value
|
LL - let _ = field;

View file

@ -12,7 +12,7 @@ LL | #![warn(let_underscore_drop)]
help: consider binding to an unused variable to avoid immediately dropping the value
|
LL | let _unused = NontrivialDrop;
| ~~~~~~~
| ++++++
help: consider immediately dropping the value
|
LL - let _ = NontrivialDrop;

View file

@ -8,7 +8,7 @@ LL | let _ = data.lock().unwrap();
help: consider binding to an unused variable to avoid immediately dropping the value
|
LL | let _unused = data.lock().unwrap();
| ~~~~~~~
| ++++++
help: consider immediately dropping the value
|
LL - let _ = data.lock().unwrap();
@ -24,7 +24,7 @@ LL | let _ = data.lock();
help: consider binding to an unused variable to avoid immediately dropping the value
|
LL | let _unused = data.lock();
| ~~~~~~~
| ++++++
help: consider immediately dropping the value
|
LL - let _ = data.lock();
@ -41,7 +41,7 @@ LL | let (_, _) = (data.lock(), 1);
help: consider binding to an unused variable to avoid immediately dropping the value
|
LL | let (_unused, _) = (data.lock(), 1);
| ~~~~~~~
| ++++++
error: non-binding let on a synchronization lock
--> $DIR/let_underscore_lock.rs:16:26
@ -53,7 +53,7 @@ LL | let (_a, Struct { a: _ }) = (0, Struct { a: data.lock() });
help: consider binding to an unused variable to avoid immediately dropping the value
|
LL | let (_a, Struct { a: _unused }) = (0, Struct { a: data.lock() });
| ~~~~~~~
| ++++++
error: non-binding let on a synchronization lock
--> $DIR/let_underscore_lock.rs:18:6

View file

@ -26,7 +26,7 @@ LL | let addr_32bit = &x as *const u8 as u32;
help: use `.addr()` to obtain the address of a pointer
|
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`
--> $DIR/lint-strict-provenance-lossy-casts.rs:14:20

View file

@ -10,7 +10,7 @@ LL | let _y = &X;
help: use `&raw const` instead to create a raw pointer
|
LL | let _y = &raw const X;
| ~~~~~~~~~~
| +++++++++
warning: creating a mutable reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:42:18
@ -46,7 +46,7 @@ LL | let (_b, _c) = (&X, &Y);
help: use `&raw const` instead to create a raw pointer
|
LL | let (_b, _c) = (&raw const X, &Y);
| ~~~~~~~~~~
| +++++++++
warning: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:54:29
@ -59,7 +59,7 @@ LL | let (_b, _c) = (&X, &Y);
help: use `&raw const` instead to create a raw pointer
|
LL | let (_b, _c) = (&X, &raw const Y);
| ~~~~~~~~~~
| +++++++++
warning: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:60:13
@ -72,7 +72,7 @@ LL | foo(&X);
help: use `&raw const` instead to create a raw pointer
|
LL | foo(&raw const X);
| ~~~~~~~~~~
| +++++++++
warning: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:66:17
@ -103,7 +103,7 @@ LL | let _v = &A.value;
help: use `&raw const` instead to create a raw pointer
|
LL | let _v = &raw const A.value;
| ~~~~~~~~~~
| +++++++++
warning: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:80:18
@ -116,7 +116,7 @@ LL | let _s = &A.s.value;
help: use `&raw const` instead to create a raw pointer
|
LL | let _s = &raw const A.s.value;
| ~~~~~~~~~~
| +++++++++
warning: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:84:22

View file

@ -10,7 +10,7 @@ LL | let _y = &X;
help: use `&raw const` instead to create a raw pointer
|
LL | let _y = &raw const X;
| ~~~~~~~~~~
| +++++++++
error: creating a mutable reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:42:18
@ -46,7 +46,7 @@ LL | let (_b, _c) = (&X, &Y);
help: use `&raw const` instead to create a raw pointer
|
LL | let (_b, _c) = (&raw const X, &Y);
| ~~~~~~~~~~
| +++++++++
error: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:54:29
@ -59,7 +59,7 @@ LL | let (_b, _c) = (&X, &Y);
help: use `&raw const` instead to create a raw pointer
|
LL | let (_b, _c) = (&X, &raw const Y);
| ~~~~~~~~~~
| +++++++++
error: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:60:13
@ -72,7 +72,7 @@ LL | foo(&X);
help: use `&raw const` instead to create a raw pointer
|
LL | foo(&raw const X);
| ~~~~~~~~~~
| +++++++++
error: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:66:17
@ -103,7 +103,7 @@ LL | let _v = &A.value;
help: use `&raw const` instead to create a raw pointer
|
LL | let _v = &raw const A.value;
| ~~~~~~~~~~
| +++++++++
error: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:80:18
@ -116,7 +116,7 @@ LL | let _s = &A.s.value;
help: use `&raw const` instead to create a raw pointer
|
LL | let _s = &raw const A.s.value;
| ~~~~~~~~~~
| +++++++++
error: creating a shared reference to mutable static is discouraged
--> $DIR/static-mut-refs.rs:84:22

View file

@ -67,7 +67,7 @@ LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000;
help: to use as a negative number (decimal `-170141183460469231731687303715884105728`), consider using the type `u128` for the literal and cast it to `i128`
|
LL | let fail: i128 = 0x8000_0000_0000_0000_0000_0000_0000_0000u128 as i128;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++
warning: literal out of range for `i32`
--> $DIR/type-overflow.rs:27:16
@ -117,7 +117,7 @@ LL | let fail = 0x8FFF_FFFF_FFFF_FFFE;
help: to use as a negative number (decimal `-2`), consider using the type `u32` for the literal and cast it to `i32`
|
LL | let fail = 0x8FFF_FFFF_FFFF_FFFEu32 as i32;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++
warning: literal out of range for `i8`
--> $DIR/type-overflow.rs:46:17

View file

@ -13,7 +13,7 @@ LL | #![deny(unused)]
help: try ignoring the field
|
LL | A { i, j: _ } | B { i, j: _ } => {
| ~~~~ ~~~~
| +++ +++
error: unused variable: `j`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:30:16
@ -36,7 +36,7 @@ LL | Some(A { i, j } | B { i, j }) => {
help: try ignoring the field
|
LL | Some(A { i, j: _ } | B { i, j: _ }) => {
| ~~~~ ~~~~
| +++ +++
error: unused variable: `j`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:52:21

View file

@ -14,7 +14,7 @@ LL | #![warn(edition_2024_expr_fragment_specifier)]
help: to keep the existing behavior, use the `expr_2021` fragment specifier
|
LL | ($e:expr_2021) => {
| ~~~~~~~~~
| +++++
warning: the `expr` fragment specifier will accept more expressions in the 2024 edition
--> $DIR/expr_2021_cargo_fix_edition.rs:11:11
@ -27,7 +27,7 @@ LL | ($($i:expr)*) => { };
help: to keep the existing behavior, use the `expr_2021` fragment specifier
|
LL | ($($i:expr_2021)*) => { };
| ~~~~~~~~~
| +++++
warning: 2 warnings emitted

View file

@ -44,7 +44,7 @@ LL | real_method_stmt!();
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()
| ~~~~~~~
| ++++
error[E0599]: no method named `fake` found for type `{integer}` in the current scope
--> $DIR/macro-backtrace-invalid-internals.rs:23:13
@ -92,7 +92,7 @@ LL | let _ = real_method_expr!();
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()
| ~~~~~~~
| ++++
error: aborting due to 8 previous errors

View file

@ -12,7 +12,7 @@ LL | #![deny(unused_variables)]
help: if this is intentional, prefix it with an underscore
|
LL | E::A(_x) | E::B(_x) => {}
| ~~ ~~
| + +
error: unused variable: `x`
--> $DIR/issue-56685.rs:25:14
@ -23,7 +23,7 @@ LL | F::A(x, y) | F::B(x, y) => { y },
help: if this is intentional, prefix it with an underscore
|
LL | F::A(_x, y) | F::B(_x, y) => { y },
| ~~ ~~
| + +
error: unused variable: `a`
--> $DIR/issue-56685.rs:27:14
@ -46,7 +46,7 @@ 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
|
LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
| ~~ ~~
| + +
error: unused variable: `x`
--> $DIR/issue-56685.rs:39:20
@ -57,7 +57,7 @@ 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
|
LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
| ~~ ~~
| + +
error: aborting due to 6 previous errors

View file

@ -182,7 +182,7 @@ LL | let _res: i32 = ..6.take(2).sum();
help: you must specify a concrete type for this numeric value, like `i32`
|
LL | let _res: i32 = ..6_i32.take(2).sum();
| ~~~~~
| ++++
error: aborting due to 18 previous errors

View file

@ -7,7 +7,7 @@ LL | let x = 2.0.neg();
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | let x = 2.0_f32.neg();
| ~~~~~~~
| ++++
error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
--> $DIR/method-on-ambiguous-numeric-type.rs:17:15

View file

@ -12,7 +12,7 @@ LL | let x: i32 = 3;
help: introduce a variable instead
|
LL | let x_var: i32 = 3;
| ~~~~~
| ++++
error[E0005]: refutable pattern in local binding
--> $DIR/issue-112269.rs:7:9
@ -28,7 +28,7 @@ LL | let y = 4;
help: introduce a variable instead
|
LL | let y_var = 4;
| ~~~~~
| ++++
error: aborting due to 2 previous errors

View file

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

View file

@ -196,7 +196,7 @@ LL | [t, t];
help: consider further restricting type parameter `T` with trait `Copy`
|
LL | T:, T: Copy
| ~~~~~~~~~
| +++++++
error: aborting due to 11 previous errors

View file

@ -11,7 +11,7 @@ LL | check(m1::S);
help: a tuple struct with a similar name exists
|
LL | check(m1::TS);
| ~~
| +
help: consider importing one of these constants instead
|
LL + use m2::S;
@ -39,7 +39,7 @@ LL | pub struct TS();
help: a tuple struct with a similar name exists
|
LL | check(xm1::TS);
| ~~
| +
help: consider importing one of these constants instead
|
LL + use m2::S;
@ -65,7 +65,7 @@ LL | check(m7::V);
help: a tuple variant with a similar name exists
|
LL | check(m7::TV);
| ~~
| +
help: consider importing one of these constants instead
|
LL + use m8::V;
@ -93,7 +93,7 @@ LL | TV(),
help: a tuple variant with a similar name exists
|
LL | check(xm7::TV);
| ~~
| +
help: consider importing one of these constants instead
|
LL + use m8::V;

View file

@ -34,7 +34,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
help: consider adding an explicit lifetime bound
|
LL | T: Iterator, <T as Iterator>::Item: 'a
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++
note: external requirements
--> $DIR/projection-no-regions-closure.rs:34:23
@ -96,7 +96,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
help: consider adding an explicit lifetime bound
|
LL | T: 'b + Iterator, <T as Iterator>::Item: 'a
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++
note: external requirements
--> $DIR/projection-no-regions-closure.rs:52:23

View file

@ -10,7 +10,7 @@ LL | Box::new(x.next())
help: consider adding an explicit lifetime bound
|
LL | T: Iterator, <T as Iterator>::Item: 'a
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++
error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
--> $DIR/projection-no-regions-fn.rs:28:5
@ -24,7 +24,7 @@ LL | Box::new(x.next())
help: consider adding an explicit lifetime bound
|
LL | T: 'b + Iterator, <T as Iterator>::Item: 'a
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| +++++++++++++++++++++++++
error: aborting due to 2 previous errors

View file

@ -35,7 +35,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
help: consider adding an explicit lifetime bound
|
LL | T: Anything<'b, 'c>, <T as Anything<'b/#0, 'c/#1>>::AssocType: 'a
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++++++++++++++++++++++++++
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:48:29
@ -74,7 +74,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
help: consider adding an explicit lifetime bound
|
LL | 'a: 'a, <T as Anything<'b/#1, 'c/#2>>::AssocType: 'a
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++++++++++++++++++++++++++
note: external requirements
--> $DIR/projection-two-region-trait-bound-closure.rs:61:29

View file

@ -10,7 +10,7 @@ LL | bar::<T::Output>()
help: consider adding an explicit lifetime bound
|
LL | <T as MyTrait<'a>>::Output: 'b, <T as MyTrait<'a>>::Output: 'a
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++++++++++++
error: aborting due to 1 previous error

View file

@ -10,7 +10,7 @@ LL | bar::<<T as MyTrait<'a>>::Output>()
help: consider adding an explicit lifetime bound
|
LL | <T as MyTrait<'b>>::Output: 'a, <T as MyTrait<'a>>::Output: 'a
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ++++++++++++++++++++++++++++++
error: aborting due to 1 previous error

View file

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

View file

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

View file

@ -8,7 +8,7 @@ LL | let bad = "ab\[c";
help: if you meant to write a literal backslash (perhaps escaping in a regular expression), consider a raw string literal
|
LL | let bad = r"ab\[c";
| ~~~~~~~~
| +
error: aborting due to 1 previous error

View file

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

View file

@ -12,7 +12,7 @@ LL | }
help: if you meant to call a macro, try
|
LL | f!();
| ~~
| +
error: aborting due to 1 previous error

View file

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

View file

@ -9,7 +9,7 @@ LL | Foo:Bar => {}
help: maybe write a path separator here
|
LL | Foo::Bar => {}
| ~~
| +
error: expected one of `!`, `(`, `...`, `..=`, `..`, `::`, `{`, or `|`, found `:`
--> $DIR/issue-87086-colon-path-sep.rs:23:17
@ -22,7 +22,7 @@ LL | qux::Foo:Bar => {}
help: maybe write a path separator here
|
LL | qux::Foo::Bar => {}
| ~~
| +
error: expected one of `@` or `|`, found `:`
--> $DIR/issue-87086-colon-path-sep.rs:29:12
@ -35,7 +35,7 @@ LL | qux:Foo::Baz => {}
help: maybe write a path separator here
|
LL | qux::Foo::Baz => {}
| ~~
| +
error: expected one of `@` or `|`, found `:`
--> $DIR/issue-87086-colon-path-sep.rs:35:12
@ -61,7 +61,7 @@ LL | if let Foo:Bar = f() {
help: maybe write a path separator here
|
LL | if let Foo::Bar = f() {
| ~~
| +
error: expected one of `@` or `|`, found `:`
--> $DIR/issue-87086-colon-path-sep.rs:49:16
@ -100,7 +100,7 @@ LL | Foo:Bar::Baz => {}
help: maybe write a path separator here
|
LL | Foo::Bar::Baz => {}
| ~~
| +
error: expected one of `@` or `|`, found `:`
--> $DIR/issue-87086-colon-path-sep.rs:75:12
@ -113,7 +113,7 @@ LL | Foo:Bar => {}
help: maybe write a path separator here
|
LL | Foo::Bar => {}
| ~~
| +
warning: irrefutable `if let` pattern
--> $DIR/issue-87086-colon-path-sep.rs:40:8

View file

@ -7,7 +7,7 @@ LL | main();
help: if you meant to call a macro, try
|
LL | main!();
| ~~~~~
| +
error: aborting due to 1 previous error

View file

@ -7,7 +7,7 @@ LL | cons A: u8 = 10;
help: there is a keyword `const` with a similar name
|
LL | const A: u8 = 10;
| ~~~~~
| +
error: aborting due to 1 previous error

View file

@ -8,7 +8,7 @@ LL | let x = Tr<A, A:>;
help: maybe write a path separator here
|
LL | let x = Tr<A, A::>;
| ~~
| +
error: aborting due to 1 previous error

View file

@ -8,7 +8,7 @@ LL | use std::process:Command;
help: use double colon
|
LL | use std::process::Command;
| ~~
| +
error: expected `::`, found `:`
--> $DIR/use-colon-as-mod-sep.rs:5:8
@ -20,7 +20,7 @@ LL | use std:fs::File;
help: use double colon
|
LL | use std::fs::File;
| ~~
| +
error: expected `::`, found `:`
--> $DIR/use-colon-as-mod-sep.rs:7:8
@ -32,7 +32,7 @@ LL | use std:collections:HashMap;
help: use double colon
|
LL | use std::collections:HashMap;
| ~~
| +
error: expected `::`, found `:`
--> $DIR/use-colon-as-mod-sep.rs:7:20
@ -44,7 +44,7 @@ LL | use std:collections:HashMap;
help: use double colon
|
LL | use std:collections::HashMap;
| ~~
| +
error: aborting due to 4 previous errors

View file

@ -122,7 +122,7 @@ LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
help: use the tuple variant pattern syntax instead
|
LL | E1::Z1() => {}
| ~~~~~~~~
| ++
help: a unit variant with a similar name exists
|
LL - E1::Z1 => {}

View file

@ -156,7 +156,7 @@ LL | E1::Z1 => {}
help: use the tuple variant pattern syntax instead
|
LL | E1::Z1() => {}
| ~~~~~~~~
| ++
help: a unit variant with a similar name exists
|
LL - E1::Z1 => {}

View file

@ -7,7 +7,7 @@ LL | b.make_ascii_uppercase();
help: consider changing this to be mutable
|
LL | let &(mut b) = a;
| ~~~~~ +
| ++++ +
error: aborting due to 1 previous error

View file

@ -7,7 +7,7 @@ LL | mutate(&mut x);
help: consider changing this to be mutable
|
LL | fn foo(&(mut x): &i32) {
| ~~~~~ +
| ++++ +
error: aborting due to 1 previous error

View file

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

View file

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

View file

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

View file

@ -7,7 +7,7 @@ LL | pub S (foo) bar
help: if you meant to call a macro, try
|
LL | pub S! (foo) bar
| ~~
| +
error: aborting due to 1 previous error

View file

@ -11,7 +11,7 @@ LL | pub (a) fn afn() {}
help: make this visible only to module `a` with `in`
|
LL | pub (in a) fn afn() {}
| ~~~~
| ++
error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:4:6
@ -26,7 +26,7 @@ LL | pub (b) fn bfn() {}
help: make this visible only to module `b` with `in`
|
LL | pub (in b) fn bfn() {}
| ~~~~
| ++
error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:5:6
@ -41,7 +41,7 @@ LL | pub (crate::a) fn cfn() {}
help: make this visible only to module `crate::a` with `in`
|
LL | pub (in crate::a) fn cfn() {}
| ~~~~~~~~~~~
| ++
error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:22:14
@ -56,7 +56,7 @@ LL | pub (a) invalid: usize,
help: make this visible only to module `a` with `in`
|
LL | pub (in a) invalid: usize,
| ~~~~
| ++
error[E0704]: incorrect visibility restriction
--> $DIR/pub-restricted.rs:31:6
@ -71,7 +71,7 @@ LL | pub (xyz) fn xyz() {}
help: make this visible only to module `xyz` with `in`
|
LL | pub (in xyz) fn xyz() {}
| ~~~~~~
| ++
error[E0742]: visibilities can only be restricted to ancestor modules
--> $DIR/pub-restricted.rs:23:17

View file

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

View file

@ -10,7 +10,7 @@ LL | handle: Handle
help: use struct literal syntax instead
|
LL | handle: Handle {}
| ~~~~~~~~~
| ++
help: a local variable with a similar name exists
|
LL - handle: Handle

View file

@ -19,7 +19,7 @@ LL | T::Baa: std::fmt::Debug,
help: consider further restricting type parameter `T` with trait `Foo`
|
LL | T::Baa: std::fmt::Debug, T: Foo
| ~~~~~~~~
| ++++++
help: ...and changing the associated type name
|
LL - T::Baa: std::fmt::Debug,

Some files were not shown because too many files have changed in this diff Show more