Tweak output for 'add line' suggestion

This commit is contained in:
Esteban Küber 2023-03-18 02:18:39 +00:00
parent 4087deaccd
commit 5b40aa5eb4
166 changed files with 634 additions and 294 deletions

View File

@ -1832,6 +1832,12 @@ impl EmitterWriter {
}
let show_code_change = if has_deletion && !is_multiline {
DisplaySuggestion::Diff
} else if let [part] = &parts[..]
&& part.snippet.ends_with('\n')
&& part.snippet.trim() == complete.trim()
{
// We are adding a line(s) of code before code that was already there.
DisplaySuggestion::Add
} else if (parts.len() != 1 || parts[0].snippet.trim() != complete.trim())
&& !is_multiline
{
@ -1879,7 +1885,9 @@ impl EmitterWriter {
row_num += line_end - line_start;
}
let mut unhighlighted_lines = Vec::new();
let mut last_pos = 0;
for (line_pos, (line, highlight_parts)) in lines.by_ref().zip(highlights).enumerate() {
last_pos = line_pos;
debug!(%line_pos, %line, ?highlight_parts);
// Remember lines that are not highlighted to hide them if needed
@ -1963,13 +1971,39 @@ impl EmitterWriter {
is_multiline,
)
}
if let DisplaySuggestion::Add = show_code_change {
// The suggestion adds an entire line of code, ending on a newline, so we'll also
// print the *following* line, to provide context of what we're advicing people to
// do. Otherwise you would only see contextless code that can be confused for
// already existing code, despite the colors and UI elements.
let file_lines = sm
.span_to_lines(span.primary_span().unwrap().shrink_to_hi())
.expect("span_to_lines failed when emitting suggestion");
let line_num = sm.lookup_char_pos(parts[0].span.lo()).line;
if let Some(line) = file_lines.file.get_line(line_num - 1) {
let line = normalize_whitespace(&line);
self.draw_code_line(
&mut buffer,
&mut row_num,
&[],
line_num + last_pos + 1,
&line,
DisplaySuggestion::None,
max_line_num_len,
&file_lines,
is_multiline,
)
}
}
// This offset and the ones below need to be signed to account for replacement code
// that is shorter than the original code.
let mut offsets: Vec<(usize, isize)> = Vec::new();
// Only show an underline in the suggestions if the suggestion is not the
// entirety of the code being shown and the displayed code is not multiline.
if let DisplaySuggestion::Diff | DisplaySuggestion::Underline = show_code_change {
if let DisplaySuggestion::Diff | DisplaySuggestion::Underline | DisplaySuggestion::Add =
show_code_change
{
draw_col_separator_no_space(&mut buffer, row_num, max_line_num_len + 1);
for part in parts {
let span_start_pos = sm.lookup_char_pos(part.span.lo()).col_display;
@ -2247,6 +2281,10 @@ impl EmitterWriter {
}
}
buffer.append(*row_num, &normalize_whitespace(line_to_add), Style::NoStyle);
} else if let DisplaySuggestion::Add = show_code_change {
buffer.puts(*row_num, 0, &self.maybe_anonymized(line_num), Style::LineNumber);
buffer.puts(*row_num, max_line_num_len + 1, "+ ", Style::Addition);
buffer.append(*row_num, &normalize_whitespace(line_to_add), Style::NoStyle);
} else {
buffer.puts(*row_num, 0, &self.maybe_anonymized(line_num), Style::LineNumber);
draw_col_separator(buffer, *row_num, max_line_num_len + 1);
@ -2281,6 +2319,7 @@ enum DisplaySuggestion {
Underline,
Diff,
None,
Add,
}
impl FileWithAnnotatedLines {

View File

@ -6,11 +6,14 @@ LL | _n: PhantomData,
|
help: consider importing one of these items
|
LL | use core::marker::PhantomData;
LL + use core::marker::PhantomData;
LL | trait TypeVal<T> {
|
LL | use serde::__private::PhantomData;
LL + use serde::__private::PhantomData;
LL | trait TypeVal<T> {
|
LL | use std::marker::PhantomData;
LL + use std::marker::PhantomData;
LL | trait TypeVal<T> {
|
error[E0412]: cannot find type `VAL` in this scope

View File

@ -14,7 +14,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct FooDefault<'a> {
|
error: this `impl` can be derived
@ -30,7 +31,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct TupleDefault(bool, i32, u64);
|
error: this `impl` can be derived
@ -46,7 +48,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct StrDefault<'a>(&'a str);
|
error: this `impl` can be derived
@ -62,7 +65,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct Y(u32);
|
error: this `impl` can be derived
@ -78,7 +82,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct WithoutSelfCurly {
|
error: this `impl` can be derived
@ -94,7 +99,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct WithoutSelfParan(bool);
|
error: this `impl` can be derived
@ -110,7 +116,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | pub struct RepeatDefault1 {
|
error: this `impl` can be derived
@ -126,7 +133,8 @@ LL | | }
= help: remove the manual implementation...
help: ...and instead derive it...
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | pub enum SimpleEnum {
|
help: ...and mark the default variant
|

View File

@ -14,6 +14,7 @@ LL + fn default() -> Self {
LL + Self::new()
LL + }
LL + }
LL | impl Foo {
|
error: you should consider adding a `Default` implementation for `Bar`
@ -31,6 +32,7 @@ LL + fn default() -> Self {
LL + Self::new()
LL + }
LL + }
LL | impl Bar {
|
error: you should consider adding a `Default` implementation for `LtKo<'c>`
@ -48,6 +50,7 @@ LL + fn default() -> Self {
LL + Self::new()
LL + }
LL + }
LL | impl<'c> LtKo<'c> {
|
error: you should consider adding a `Default` implementation for `NewNotEqualToDerive`
@ -65,6 +68,7 @@ LL + fn default() -> Self {
LL + Self::new()
LL + }
LL + }
LL | impl NewNotEqualToDerive {
|
error: you should consider adding a `Default` implementation for `FooGenerics<T>`
@ -82,6 +86,7 @@ LL + fn default() -> Self {
LL + Self::new()
LL + }
LL + }
LL | impl<T> FooGenerics<T> {
|
error: you should consider adding a `Default` implementation for `BarGenerics<T>`
@ -99,6 +104,7 @@ LL + fn default() -> Self {
LL + Self::new()
LL + }
LL + }
LL | impl<T: Copy> BarGenerics<T> {
|
error: you should consider adding a `Default` implementation for `Foo<T>`

View File

@ -7,7 +7,8 @@ LL | let headers = [Header{value: &[]}; 128];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Header<'_>` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | pub struct Header<'a> {
|
error[E0277]: the trait bound `Header<'_>: Copy` is not satisfied
@ -19,7 +20,8 @@ LL | let headers = [Header{value: &[0]}; 128];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Header<'_>` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | pub struct Header<'a> {
|
error: aborting due to 2 previous errors

View File

@ -11,7 +11,8 @@ LL | type Ty: Clone = NotClone;
| ^^^^^ required by this bound in `Tr::Ty`
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct NotClone;
|
error[E0277]: the trait bound `NotClone: Clone` is not satisfied
@ -30,7 +31,8 @@ LL | type Ty = NotClone;
| -- required by a bound in this associated type
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct NotClone;
|
error[E0277]: the trait bound `T: Clone` is not satisfied

View File

@ -157,7 +157,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialEq<_>`
help: consider annotating `A` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct A;
|
error[E0369]: binary operation `!=` cannot be applied to type `A`
@ -175,7 +176,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialEq<_>`
help: consider annotating `A` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct A;
|
error[E0369]: binary operation `<` cannot be applied to type `A`
@ -193,7 +195,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
LL | #[derive(PartialEq, PartialOrd)]
LL + #[derive(PartialEq, PartialOrd)]
LL | struct A;
|
error[E0369]: binary operation `<=` cannot be applied to type `A`
@ -211,7 +214,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
LL | #[derive(PartialEq, PartialOrd)]
LL + #[derive(PartialEq, PartialOrd)]
LL | struct A;
|
error[E0369]: binary operation `>` cannot be applied to type `A`
@ -229,7 +233,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
LL | #[derive(PartialEq, PartialOrd)]
LL + #[derive(PartialEq, PartialOrd)]
LL | struct A;
|
error[E0369]: binary operation `>=` cannot be applied to type `A`
@ -247,7 +252,8 @@ LL | struct A;
| ^^^^^^^^ must implement `PartialOrd<_>`
help: consider annotating `A` with `#[derive(PartialEq, PartialOrd)]`
|
LL | #[derive(PartialEq, PartialOrd)]
LL + #[derive(PartialEq, PartialOrd)]
LL | struct A;
|
error: aborting due to 15 previous errors

View File

@ -19,7 +19,8 @@ LL | let _j = i.clone();
candidate #1: `Clone`
help: consider annotating `R` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct R {
|
error: aborting due to previous error

View File

@ -7,7 +7,8 @@ LL | s.the_fn();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use Lib::TheTrait;
LL + use Lib::TheTrait;
LL | use Lib::TheStruct;
|
error: aborting due to previous error

View File

@ -7,7 +7,8 @@ LL | s.the_fn();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use coherence_inherent_cc_lib::TheTrait;
LL + use coherence_inherent_cc_lib::TheTrait;
LL | use coherence_inherent_cc_lib::TheStruct;
|
error: aborting due to previous error

View File

@ -8,6 +8,7 @@ LL | If<{ FRAC <= 32 }>: True,
help: consider enabling this feature
--> $DIR/issue-94287.rs:1:1
|
LL + #![feature(generic_const_exprs)]
LL | #![feature(generic_const_exprs)]
|

View File

@ -6,13 +6,17 @@ LL | let mut iter = IntoIter::new(self);
|
help: consider importing one of these items
|
LL | use std::array::IntoIter;
LL + use std::array::IntoIter;
LL | pub struct ConstCheck<const CHECK: bool>;
|
LL | use std::collections::binary_heap::IntoIter;
LL + use std::collections::binary_heap::IntoIter;
LL | pub struct ConstCheck<const CHECK: bool>;
|
LL | use std::collections::btree_map::IntoIter;
LL + use std::collections::btree_map::IntoIter;
LL | pub struct ConstCheck<const CHECK: bool>;
|
LL | use std::collections::btree_set::IntoIter;
LL + use std::collections::btree_set::IntoIter;
LL | pub struct ConstCheck<const CHECK: bool>;
|
and 8 other candidates

View File

@ -10,7 +10,8 @@ LL | let _: [Option<Bar>; 2] = [no_copy(); 2];
= help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information
help: consider annotating `Bar` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | struct Bar;
|
error: aborting due to previous error

View File

@ -8,7 +8,8 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Bar` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | struct Bar;
|
error[E0277]: the trait bound `Bar: Copy` is not satisfied
@ -21,7 +22,8 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Bar` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | struct Bar;
|
error: aborting due to 2 previous errors

View File

@ -8,7 +8,8 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Bar` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | struct Bar;
|
error[E0277]: the trait bound `Bar: Copy` is not satisfied
@ -21,7 +22,8 @@ LL | let arr: [Option<Bar>; 2] = [x; 2];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Bar` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | struct Bar;
|
error: aborting due to 2 previous errors

View File

@ -22,11 +22,13 @@ LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
help: if it is not part of the public API, make this function unstably const
|
LL | #[rustc_const_unstable(feature = "...", issue = "...")]
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
|
LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
LL + #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
LL | const fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
error: `foo2_gated` is not yet stable as a const fn

View File

@ -22,11 +22,13 @@ LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
help: if it is not part of the public API, make this function unstably const
|
LL | #[rustc_const_unstable(feature = "...", issue = "...")]
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
|
LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
LL + #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 }
|
error: `foo2_gated` is not yet stable as a const fn

View File

@ -6,7 +6,8 @@ LL | let mut map = HashMap::new();
|
help: consider importing this struct
|
LL | use std::collections::HashMap;
LL + use std::collections::HashMap;
LL | use std::io::prelude::*;
|
error: aborting due to previous error

View File

@ -23,7 +23,8 @@ LL | #[derive(Clone)]
candidate #1: `Clone`
help: consider annotating `NotClone` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct NotClone;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ LL | x: Error
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
LL + #[derive(Debug)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ LL | Error
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
LL + #[derive(Debug)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ LL | x: Error
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
LL + #[derive(Debug)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ LL | Error
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
LL + #[derive(Debug)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Default)]`
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Default)]`
|
LL | #[derive(Default)]
LL + #[derive(Default)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL | #[derive(Eq)]
LL + #[derive(Eq)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL | #[derive(Eq)]
LL + #[derive(Eq)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL | #[derive(Eq)]
LL + #[derive(Eq)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ note: required by a bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Eq)]`
|
LL | #[derive(Eq)]
LL + #[derive(Eq)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL | #[derive(Hash)]
LL + #[derive(Hash)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL | #[derive(Hash)]
LL + #[derive(Hash)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL | #[derive(Hash)]
LL + #[derive(Hash)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Hash)]`
|
LL | #[derive(Hash)]
LL + #[derive(Hash)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL | #[derive(Ord)]
LL + #[derive(Ord)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL | #[derive(Ord)]
LL + #[derive(Ord)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | x: Error
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL | #[derive(Ord)]
LL + #[derive(Ord)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ LL | Error
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(Ord)]`
|
LL | #[derive(Ord)]
LL + #[derive(Ord)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -15,7 +15,8 @@ LL | struct Error;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -15,7 +15,8 @@ LL | struct Error;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -15,7 +15,8 @@ LL | struct Error;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -15,7 +15,8 @@ LL | struct Error;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -11,7 +11,8 @@ LL | x: Error
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL | #[derive(PartialOrd)]
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -11,7 +11,8 @@ LL | Error
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL | #[derive(PartialOrd)]
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -11,7 +11,8 @@ LL | x: Error
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL | #[derive(PartialOrd)]
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -11,7 +11,8 @@ LL | Error
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Error` with `#[derive(PartialOrd)]`
|
LL | #[derive(PartialOrd)]
LL + #[derive(PartialOrd)]
LL | struct Error;
|
error: aborting due to previous error

View File

@ -15,7 +15,8 @@ LL | struct NoCloneOrEq;
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `NoCloneOrEq` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct NoCloneOrEq;
|
error[E0277]: the trait bound `NoCloneOrEq: Clone` is not satisfied
@ -30,7 +31,8 @@ LL | x: NoCloneOrEq
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `NoCloneOrEq` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct NoCloneOrEq;
|
error: aborting due to 2 previous errors

View File

@ -25,7 +25,8 @@ LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
| ^^^^^ unsatisfied trait bound introduced in this `derive` macro
help: consider annotating `NonCopy` with `#[derive(Clone, Copy)]`
|
LL | #[derive(Clone, Copy)]
LL + #[derive(Clone, Copy)]
LL | struct NonCopy;
|
error: aborting due to previous error

View File

@ -11,7 +11,8 @@ LL | foo.extend_from_slice(bar);
`NoDerives: Clone`
help: consider annotating `NoDerives` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | pub struct NoDerives;
|
error[E0599]: the method `extend_from_slice` exists for mutable reference `&mut Vec<SomeDerives>`, but its trait bounds were not satisfied
@ -27,7 +28,8 @@ LL | foo.extend_from_slice(bar);
`SomeDerives: Clone`
help: consider annotating `SomeDerives` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | pub struct SomeDerives;
|
error[E0599]: the method `use_clone` exists for struct `Object<NoDerives, SomeDerives>`, but its trait bounds were not satisfied
@ -51,7 +53,8 @@ LL | impl<T: Clone, A: Default> Object<T, A> {
| unsatisfied trait bound introduced here
help: consider annotating `NoDerives` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | pub struct NoDerives;
|
error: aborting due to 3 previous errors

View File

@ -18,7 +18,8 @@ LL | hs.insert(Value(0));
`Value: Hash`
help: consider annotating `Value` with `#[derive(Eq, Hash, PartialEq)]`
|
LL | #[derive(Eq, Hash, PartialEq)]
LL + #[derive(Eq, Hash, PartialEq)]
LL | struct Value(u32);
|
error[E0599]: the method `use_eq` exists for struct `Object<NoDerives>`, but its trait bounds were not satisfied
@ -48,7 +49,8 @@ LL | impl<T: Eq> Object<T> {
which is required by `NoDerives: Eq`
help: consider annotating `NoDerives` with `#[derive(Eq, PartialEq)]`
|
LL | #[derive(Eq, PartialEq)]
LL + #[derive(Eq, PartialEq)]
LL | pub struct NoDerives;
|
error[E0599]: the method `use_ord` exists for struct `Object<NoDerives>`, but its trait bounds were not satisfied
@ -84,7 +86,8 @@ LL | impl<T: Ord> Object<T> {
which is required by `NoDerives: Ord`
help: consider annotating `NoDerives` with `#[derive(Eq, Ord, PartialEq, PartialOrd)]`
|
LL | #[derive(Eq, Ord, PartialEq, PartialOrd)]
LL + #[derive(Eq, Ord, PartialEq, PartialOrd)]
LL | pub struct NoDerives;
|
error[E0599]: the method `use_ord_and_partial_ord` exists for struct `Object<NoDerives>`, but its trait bounds were not satisfied
@ -123,7 +126,8 @@ LL | impl<T: Ord + PartialOrd> Object<T> {
which is required by `NoDerives: PartialOrd`
help: consider annotating `NoDerives` with `#[derive(Eq, Ord, PartialEq, PartialOrd)]`
|
LL | #[derive(Eq, Ord, PartialEq, PartialOrd)]
LL + #[derive(Eq, Ord, PartialEq, PartialOrd)]
LL | pub struct NoDerives;
|
error: aborting due to 4 previous errors

View File

@ -24,13 +24,17 @@ LL | fn setup() -> Set { Set }
|
help: consider importing one of these items
|
LL | use AffixHeart::Set;
LL + use AffixHeart::Set;
LL | enum PutDown { Set }
|
LL | use CauseToBe::Set;
LL + use CauseToBe::Set;
LL | enum PutDown { Set }
|
LL | use Determine::Set;
LL + use Determine::Set;
LL | enum PutDown { Set }
|
LL | use PutDown::Set;
LL + use PutDown::Set;
LL | enum PutDown { Set }
|
and 3 other candidates

View File

@ -14,7 +14,8 @@ LL | fn foo<T: PartialEq>(_: T) {}
| ^^^^^^^^^ required by this bound in `foo`
help: consider annotating `S` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct S;
|
error: aborting due to previous error

View File

@ -29,7 +29,8 @@ LL | println!("{x} {x:?} {x}");
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `DisplayOnly` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
LL + #[derive(Debug)]
LL | struct DisplayOnly;
|
error[E0277]: `DisplayOnly` doesn't implement `Debug`
@ -43,7 +44,8 @@ LL | println!("{x} {x:?} {x}", x = DisplayOnly);
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `DisplayOnly` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
LL + #[derive(Debug)]
LL | struct DisplayOnly;
|
error: aborting due to 4 previous errors

View File

@ -110,7 +110,8 @@ LL | fn check_copy<T: Copy>(_x: &T) {}
| ^^^^ required by this bound in `check_copy`
help: consider annotating `NonClone` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | struct NonClone;
|
error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
@ -134,7 +135,8 @@ LL | fn check_clone<T: Clone>(_x: &T) {}
| ^^^^^ required by this bound in `check_clone`
help: consider annotating `NonClone` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct NonClone;
|
error: aborting due to 6 previous errors

View File

@ -12,7 +12,8 @@ LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family2::Member`
help: consider annotating `Foo` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct Foo;
|
error: aborting due to previous error

View File

@ -22,7 +22,8 @@ LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family::Member`
help: consider annotating `Foo` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | struct Foo;
|
error: aborting due to previous error; 1 warning emitted

View File

@ -13,7 +13,8 @@ LL | g();
| ~
help: consider importing this function
|
LL | use foo::f;
LL + use foo::f;
LL | mod foo {
|
error[E0425]: cannot find function `g` in this scope
@ -39,7 +40,8 @@ LL | f();
| ~
help: consider importing this function
|
LL | use bar::g;
LL + use bar::g;
LL | mod foo {
|
error[E0425]: cannot find function `f` in this scope

View File

@ -10,7 +10,8 @@ LL | Vec::new();
= note: this error originates in the macro `::bar::m` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this struct
|
LL | use std::vec::Vec;
LL + use std::vec::Vec;
LL | pub macro m() { Vec::<i32>::new(); ().clone() }
|
error[E0599]: no method named `clone` found for unit type `()` in the current scope
@ -26,7 +27,8 @@ LL | ().clone()
= note: this error originates in the macro `::bar::m` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use std::clone::Clone;
LL + use std::clone::Clone;
LL | pub macro m() { Vec::<i32>::new(); ().clone() }
|
error: aborting due to 2 previous errors

View File

@ -14,7 +14,8 @@ LL | pub macro m() { ().f() }
= note: this error originates in the macro `::baz::m` (in Nightly builds, run with -Z macro-backtrace for more info)
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use foo::T;
LL + use foo::T;
LL | use foo::*;
|
error: aborting due to previous error

View File

@ -7,13 +7,17 @@ LL | 1u32.method();
= help: items from traits can only be used if the trait is in scope
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
|
LL | use foo::Bar;
LL + use foo::Bar;
LL | extern crate no_method_suggested_traits;
|
LL | use no_method_suggested_traits::Reexported;
LL + use no_method_suggested_traits::Reexported;
LL | extern crate no_method_suggested_traits;
|
LL | use no_method_suggested_traits::foo::PubPub;
LL + use no_method_suggested_traits::foo::PubPub;
LL | extern crate no_method_suggested_traits;
|
LL | use no_method_suggested_traits::qux::PrivPub;
LL + use no_method_suggested_traits::qux::PrivPub;
LL | extern crate no_method_suggested_traits;
|
error[E0599]: no method named `method` found for struct `Rc<&mut Box<&u32>>` in the current scope
@ -25,13 +29,17 @@ LL | std::rc::Rc::new(&mut Box::new(&1u32)).method();
= help: items from traits can only be used if the trait is in scope
help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
|
LL | use foo::Bar;
LL + use foo::Bar;
LL | extern crate no_method_suggested_traits;
|
LL | use no_method_suggested_traits::Reexported;
LL + use no_method_suggested_traits::Reexported;
LL | extern crate no_method_suggested_traits;
|
LL | use no_method_suggested_traits::foo::PubPub;
LL + use no_method_suggested_traits::foo::PubPub;
LL | extern crate no_method_suggested_traits;
|
LL | use no_method_suggested_traits::qux::PrivPub;
LL + use no_method_suggested_traits::qux::PrivPub;
LL | extern crate no_method_suggested_traits;
|
error[E0599]: no method named `method` found for type `char` in the current scope
@ -46,7 +54,8 @@ LL | 'a'.method();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use foo::Bar;
LL + use foo::Bar;
LL | extern crate no_method_suggested_traits;
|
error[E0599]: no method named `method` found for struct `Rc<&mut Box<&char>>` in the current scope
@ -58,7 +67,8 @@ LL | std::rc::Rc::new(&mut Box::new(&'a')).method();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use foo::Bar;
LL + use foo::Bar;
LL | extern crate no_method_suggested_traits;
|
error[E0599]: no method named `method` found for type `i32` in the current scope
@ -75,7 +85,8 @@ LL | fn method(&self) {}
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use no_method_suggested_traits::foo::PubPub;
LL + use no_method_suggested_traits::foo::PubPub;
LL | extern crate no_method_suggested_traits;
|
error[E0599]: no method named `method` found for struct `Rc<&mut Box<&i32>>` in the current scope
@ -87,7 +98,8 @@ LL | std::rc::Rc::new(&mut Box::new(&1i32)).method();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use no_method_suggested_traits::foo::PubPub;
LL + use no_method_suggested_traits::foo::PubPub;
LL | extern crate no_method_suggested_traits;
|
error[E0599]: no method named `method` found for struct `Foo` in the current scope

View File

@ -6,7 +6,8 @@ LL | fn wants_debug(g: impl Debug) { }
|
help: consider importing this trait instead
|
LL | use std::fmt::Debug;
LL + use std::fmt::Debug;
LL | use std::fmt::Display;
|
error[E0404]: expected trait, found derive macro `Debug`
@ -17,7 +18,8 @@ LL | fn wants_display(g: impl Debug) { }
|
help: consider importing this trait instead
|
LL | use std::fmt::Debug;
LL + use std::fmt::Debug;
LL | use std::fmt::Display;
|
error: aborting due to 2 previous errors

View File

@ -60,7 +60,8 @@ LL | import();
|
help: consider importing this function
|
LL | use other::import;
LL + use other::import;
LL | use bar::*;
|
error[E0412]: cannot find type `A` in this scope

View File

@ -12,7 +12,8 @@ LL | baz();
|
help: consider importing this function instead
|
LL | use bar::baz;
LL + use bar::baz;
LL | use foo::f::{self};
|
error: aborting due to 2 previous errors

View File

@ -18,7 +18,8 @@ LL | foo();
|
help: consider importing this function instead
|
LL | use foo::foo;
LL + use foo::foo;
LL | use m1::*;
|
error: aborting due to 2 previous errors

View File

@ -6,7 +6,8 @@ LL | fn sub() -> isize { foo(); 1 }
|
help: consider importing this function
|
LL | use foo::foo;
LL + use foo::foo;
LL | use a::b::*;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ LL | pub trait Tr { fn method(&self); }
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use overlapping_pub_trait_source::m::Tr;
LL + use overlapping_pub_trait_source::m::Tr;
LL | extern crate overlapping_pub_trait_source;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ LL | pub trait Tr { fn method(&self); }
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use unnamed_pub_trait_source::prelude::*; // trait Tr
LL + use unnamed_pub_trait_source::prelude::*; // trait Tr
LL | extern crate unnamed_pub_trait_source;
|
error: aborting due to previous error

View File

@ -6,11 +6,13 @@ LL | 1.0 + 1.0
|
help: if it is not part of the public API, make this function unstably const
|
LL | #[rustc_const_unstable(feature = "...", issue = "...")]
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
LL | pub const fn foo() -> f32 {
|
help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
|
LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
LL + #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
LL | pub const fn foo() -> f32 {
|
error: aborting due to previous error

View File

@ -7,7 +7,8 @@ LL | b.foo();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use a::A;
LL + use a::A;
LL | use b::B;
|
error: aborting due to previous error

View File

@ -24,13 +24,17 @@ LL | fn new() -> Result<foo::MyEnum, String> {
|
help: consider importing one of these items instead
|
LL | use std::fmt::Result;
LL + use std::fmt::Result;
LL | use foo::MyEnum::Result;
|
LL | use std::io::Result;
LL + use std::io::Result;
LL | use foo::MyEnum::Result;
|
LL | use std::result::Result;
LL + use std::result::Result;
LL | use foo::MyEnum::Result;
|
LL | use std::thread::Result;
LL + use std::thread::Result;
LL | use foo::MyEnum::Result;
|
error[E0573]: expected type, found variant `Result`
@ -41,13 +45,17 @@ LL | fn new() -> Result<foo::MyEnum, String> {
|
help: consider importing one of these items instead
|
LL | use std::fmt::Result;
LL + use std::fmt::Result;
LL | use foo::MyEnum::Result;
|
LL | use std::io::Result;
LL + use std::io::Result;
LL | use foo::MyEnum::Result;
|
LL | use std::result::Result;
LL + use std::result::Result;
LL | use foo::MyEnum::Result;
|
LL | use std::thread::Result;
LL + use std::thread::Result;
LL | use foo::MyEnum::Result;
|
error[E0573]: expected type, found variant `NoResult`

View File

@ -8,7 +8,8 @@ note: required by a bound in `slice::<impl [T]>::sort`
--> $SRC_DIR/alloc/src/slice.rs:LL:COL
help: consider annotating `X` with `#[derive(Ord)]`
|
LL | #[derive(Ord)]
LL + #[derive(Ord)]
LL | struct X { x: i32 }
|
error: aborting due to previous error

View File

@ -9,7 +9,8 @@ LL | struct Foo(Bar);
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Bar` with `#[derive(Hash)]`
|
LL | #[derive(Hash)]
LL + #[derive(Hash)]
LL | struct Bar;
|
error: aborting due to previous error

View File

@ -9,7 +9,8 @@ LL | arg.wait();
|
help: another candidate was found in the following trait, perhaps add a `use` for it:
|
LL | use private::Future;
LL + use private::Future;
LL | mod private {
|
error: aborting due to previous error

View File

@ -6,7 +6,8 @@ LL | struct Foo<T: ?Hash> { }
|
help: consider importing this trait instead
|
LL | use std::hash::Hash;
LL + use std::hash::Hash;
LL | struct Foo<T: ?Hash> { }
|
warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default; only `?Sized` is supported

View File

@ -7,7 +7,8 @@ LL | Command::new("echo").arg("hello").exec();
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use std::os::unix::process::CommandExt;
LL + use std::os::unix::process::CommandExt;
LL | use std::process::Command;
|
error: aborting due to previous error

View File

@ -12,7 +12,8 @@ LL | fn trait_method(&self) {
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use reexported_trait::Trait;
LL + use reexported_trait::Trait;
LL | fn main() {
|
error[E0599]: no method named `trait_method_b` found for struct `FooStruct` in the current scope
@ -29,7 +30,8 @@ LL | fn trait_method_b(&self) {
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use reexported_trait::TraitBRename;
LL + use reexported_trait::TraitBRename;
LL | fn main() {
|
error: aborting due to 2 previous errors

View File

@ -13,7 +13,8 @@ LL | enum A {
| ^^^^^^ must implement `PartialEq<_>`
help: consider annotating `A` with `#[derive(PartialEq)]`
|
LL | #[derive(PartialEq)]
LL + #[derive(PartialEq)]
LL | enum A {
|
error: aborting due to previous error

View File

@ -6,7 +6,8 @@ LL | _n: PhantomData,
|
help: consider importing this struct
|
LL | use std::marker::PhantomData;
LL + use std::marker::PhantomData;
LL | fn main() {
|
error[E0412]: cannot find type `VAL` in this scope

View File

@ -107,7 +107,8 @@ LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
= note: required for the cast from `S<Foo>` to the object type `dyn Gettable<Foo>`
help: consider annotating `Foo` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | struct Foo; // does not impl Copy
|
error: aborting due to 6 previous errors

View File

@ -6,7 +6,8 @@ LL | static FOO: (dyn AsRef<OsStr>, u8) = ("hello", 42);
|
help: consider importing this struct
|
LL | use std::ffi::OsStr;
LL + use std::ffi::OsStr;
LL | static FOO: (dyn AsRef<OsStr>, u8) = ("hello", 42);
|
error[E0412]: cannot find type `Path` in this scope
@ -17,7 +18,8 @@ LL | const BAR: (&Path, [u8], usize) = ("hello", [], 42);
|
help: consider importing this struct
|
LL | use std::path::Path;
LL + use std::path::Path;
LL | static FOO: (dyn AsRef<OsStr>, u8) = ("hello", 42);
|
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time

View File

@ -7,7 +7,8 @@ LL | #[issue_100199::struct_with_bound]
= note: this error originates in the attribute macro `issue_100199::struct_with_bound` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this trait
|
LL | use traits::MyTrait;
LL + use traits::MyTrait;
LL | #[issue_100199::struct_with_bound]
|
error: aborting due to previous error

View File

@ -6,7 +6,8 @@ LL | a::bar();
|
help: consider importing this function
|
LL | use b::bar;
LL + use b::bar;
LL | macro_rules! test { ($nm:ident,
|
help: if you import `bar`, refer to it directly
|

View File

@ -27,7 +27,8 @@ note: required by a bound in `Copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Test1` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct Test1;
|
error[E0277]: the trait bound `Test2: Clone` is not satisfied
@ -41,7 +42,8 @@ note: required by a bound in `Copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Test2` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct Test2;
|
error: aborting due to 5 previous errors

View File

@ -10,7 +10,8 @@ note: required by a bound in `Result::<T, E>::unwrap`
--> $SRC_DIR/core/src/result.rs:LL:COL
help: consider annotating `Foo` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
LL + #[derive(Debug)]
LL | struct Foo;
|
error: aborting due to previous error

View File

@ -10,7 +10,8 @@ error[E0277]: `Dummy` doesn't implement `Debug`
help: consider annotating `Dummy` with `#[derive(Debug)]`
--> $DIR/auxiliary/dummy_lib.rs:2:1
|
2 | #[derive(Debug)]
2 + #[derive(Debug)]
3 | #[path = "auxiliary/dummy_lib.rs"]
|
error: aborting due to previous error

View File

@ -14,9 +14,11 @@ LL | check(m1::TS);
| ~~
help: consider importing one of these items instead
|
LL | use m2::S;
LL + use m2::S;
LL | use namespace_mix::*;
|
LL | use xm2::S;
LL + use xm2::S;
LL | use namespace_mix::*;
|
help: if you import `S`, refer to it directly
|
@ -42,9 +44,11 @@ LL | check(xm1::TS);
| ~~
help: consider importing one of these items instead
|
LL | use m2::S;
LL + use m2::S;
LL | use namespace_mix::*;
|
LL | use xm2::S;
LL + use xm2::S;
LL | use namespace_mix::*;
|
help: if you import `S`, refer to it directly
|
@ -68,9 +72,11 @@ LL | check(m7::TV);
| ~~
help: consider importing one of these items instead
|
LL | use m8::V;
LL + use m8::V;
LL | use namespace_mix::*;
|
LL | use xm8::V;
LL + use xm8::V;
LL | use namespace_mix::*;
|
help: if you import `V`, refer to it directly
|
@ -96,9 +102,11 @@ LL | check(xm7::TV);
| ~~
help: consider importing one of these items instead
|
LL | use m8::V;
LL + use m8::V;
LL | use namespace_mix::*;
|
LL | use xm8::V;
LL + use xm8::V;
LL | use namespace_mix::*;
|
help: if you import `V`, refer to it directly
|

View File

@ -14,7 +14,8 @@ LL | let hello = move || {
| ^^^^^^^
help: consider annotating `S` with `#[derive(Clone)]`
|
LL | #[derive(Clone)]
LL + #[derive(Clone)]
LL | struct S(i32);
|
error: aborting due to previous error

View File

@ -9,7 +9,8 @@ LL | println!("{:?} {:?}", Foo, Bar);
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `Foo` with `#[derive(Debug)]`
|
LL | #[derive(Debug)]
LL + #[derive(Debug)]
LL | struct Foo;
|
error[E0277]: `Bar` doesn't implement `Debug`

View File

@ -12,7 +12,8 @@ LL | println!("{}", circular_modules_main::hi_str());
|
help: consider importing this function
|
LL | use hi_str;
LL + use hi_str;
LL | #[path = "circular_modules_main.rs"]
|
help: if you import `hi_str`, refer to it directly
|

View File

@ -13,7 +13,8 @@ LL | Baz();
| ~~~
help: consider importing this function instead
|
LL | use foo2::Bar;
LL + use foo2::Bar;
LL | pub mod foo1 {
|
error[E0425]: cannot find function, tuple struct or tuple variant `Bar` in this scope
@ -31,7 +32,8 @@ LL | Baz();
| ~~~
help: consider importing this function
|
LL | use foo2::Bar;
LL + use foo2::Bar;
LL | pub mod foo1 {
|
error[E0412]: cannot find type `Bar` in this scope
@ -49,7 +51,8 @@ LL | let _x: Box<Baz>;
| ~~~
help: consider importing this trait
|
LL | use foo1::Bar;
LL + use foo1::Bar;
LL | pub mod foo1 {
|
error[E0747]: constant provided when a type was expected

View File

@ -6,7 +6,8 @@ LL | Bar();
|
help: consider importing this function instead
|
LL | use foo2::Bar;
LL + use foo2::Bar;
LL | pub mod foo1 {
|
error[E0423]: expected function, tuple struct or tuple variant, found trait `Bar`
@ -24,7 +25,8 @@ LL | Baz();
| ~~~
help: consider importing this function instead
|
LL | use foo2::Bar;
LL + use foo2::Bar;
LL | pub mod foo1 {
|
error[E0573]: expected type, found function `Bar`
@ -39,7 +41,8 @@ LL | let _x = Bar();
| ~
help: consider importing this trait instead
|
LL | use foo1::Bar;
LL + use foo1::Bar;
LL | pub mod foo1 {
|
error[E0603]: trait `Bar` is private

View File

@ -6,7 +6,8 @@ LL | Command::new("git");
|
help: consider importing this struct
|
LL | use std::process::Command;
LL + use std::process::Command;
LL | #[amputate_span::drop_first_token]
|
error[E0433]: failed to resolve: use of undeclared type `Command`
@ -17,7 +18,8 @@ LL | Command::new("git");
|
help: consider importing this struct
|
LL | use std::process::Command;
LL + use std::process::Command;
LL | #[amputate_span::drop_first_token]
|
error: aborting due to 2 previous errors

View File

@ -50,7 +50,8 @@ LL | type A = Y;
|
help: consider importing this struct
|
LL | use Y;
LL + use Y;
LL | pub struct X;
|
error[E0412]: cannot find type `X` in this scope
@ -61,7 +62,8 @@ LL | type A = X;
|
help: consider importing this struct
|
LL | use m::X;
LL + use m::X;
LL | #[macro_use]
|
error: aborting due to 7 previous errors

View File

@ -7,7 +7,8 @@ LL | let _ = [ a; 5 ];
= note: the `Copy` trait is required because this value will be copied for each element of the array
help: consider annotating `Foo` with `#[derive(Copy)]`
|
LL | #[derive(Copy)]
LL + #[derive(Copy)]
LL | struct Foo {
|
error: aborting due to previous error

View File

@ -6,7 +6,8 @@ LL | Foo;
|
help: consider importing this unit struct
|
LL | use crate::bar::Foo;
LL + use crate::bar::Foo;
LL | mod bar {
|
error: aborting due to previous error

View File

@ -6,7 +6,8 @@ LL | let _ = namespaced_enums::A;
|
help: consider importing this unit variant
|
LL | use namespaced_enums::Foo::A;
LL + use namespaced_enums::Foo::A;
LL | extern crate namespaced_enums;
|
help: if you import `A`, refer to it directly
|
@ -22,7 +23,8 @@ LL | let _ = namespaced_enums::B(10);
|
help: consider importing this tuple variant
|
LL | use namespaced_enums::Foo::B;
LL + use namespaced_enums::Foo::B;
LL | extern crate namespaced_enums;
|
help: if you import `B`, refer to it directly
|
@ -38,7 +40,8 @@ LL | let _ = namespaced_enums::C { a: 10 };
|
help: consider importing this variant
|
LL | use namespaced_enums::Foo::C;
LL + use namespaced_enums::Foo::C;
LL | extern crate namespaced_enums;
|
help: if you import `C`, refer to it directly
|

View File

@ -6,7 +6,8 @@ LL | let _ = size_of::<usize>();
|
help: consider importing this function
|
LL | use std::mem::size_of;
LL + use std::mem::size_of;
LL | fn main() {
|
error[E0425]: cannot find function `fabsf64` in this scope
@ -17,7 +18,8 @@ LL | let _ = fabsf64(1.0);
|
help: consider importing this function
|
LL | use std::intrinsics::fabsf64;
LL + use std::intrinsics::fabsf64;
LL | fn main() {
|
error: aborting due to 2 previous errors

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