Rollup merge of #65773 - estebank:sugg-whitespace, r=Centril

Increase spacing for suggestions in diagnostics

Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.

r? @Centril
This commit is contained in:
Mazdak Farrokhzad 2019-10-26 14:17:45 +02:00 committed by GitHub
commit 0aa7c6f96b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
227 changed files with 744 additions and 14 deletions

View File

@ -1583,27 +1583,26 @@ impl EmitterWriter {
Ok(())
}
fn emit_messages_default(&mut self,
level: &Level,
message: &[(String, Style)],
code: &Option<DiagnosticId>,
span: &MultiSpan,
children: &[SubDiagnostic],
suggestions: &[CodeSuggestion]) {
fn emit_messages_default(
&mut self,
level: &Level,
message: &[(String, Style)],
code: &Option<DiagnosticId>,
span: &MultiSpan,
children: &[SubDiagnostic],
suggestions: &[CodeSuggestion],
) {
let max_line_num_len = if self.ui_testing {
ANONYMIZED_LINE_NUM.len()
} else {
self.get_max_line_num(span, children).to_string().len()
};
match self.emit_message_default(span,
message,
code,
level,
max_line_num_len,
false) {
match self.emit_message_default(span, message, code, level, max_line_num_len, false) {
Ok(()) => {
if !children.is_empty() {
if !children.is_empty() || suggestions.iter().any(|s| {
s.style != SuggestionStyle::CompletelyHidden
}) {
let mut buffer = StyledBuffer::new();
if !self.short_message {
draw_col_separator_no_space(&mut buffer, 0, max_line_num_len + 1);

View File

@ -23,6 +23,7 @@ error: `ambiguous` is both a struct and a function
|
LL | /// [ambiguous] is ambiguous.
| ^^^^^^^^^ ambiguous link
|
help: to link to the struct, prefix with the item type
|
LL | /// [struct@ambiguous] is ambiguous.
@ -37,6 +38,7 @@ error: `multi_conflict` is a struct, a function, and a macro
|
LL | /// [`multi_conflict`] is a three-way conflict.
| ^^^^^^^^^^^^^^^^ ambiguous link
|
help: to link to the struct, prefix with the item type
|
LL | /// [`struct@multi_conflict`] is a three-way conflict.
@ -55,6 +57,7 @@ error: `type_and_value` is both a module and a constant
|
LL | /// Ambiguous [type_and_value].
| ^^^^^^^^^^^^^^ ambiguous link
|
help: to link to the module, prefix with the item type
|
LL | /// Ambiguous [module@type_and_value].
@ -69,6 +72,7 @@ error: `foo::bar` is both an enum and a function
|
LL | /// Ambiguous non-implied shortcut link [`foo::bar`].
| ^^^^^^^^^^ ambiguous link
|
help: to link to the enum, prefix with the item type
|
LL | /// Ambiguous non-implied shortcut link [`enum@foo::bar`].

View File

@ -24,6 +24,7 @@ LL | /// ```
LL | | /// \__________pkt->size___________/ \_result->size_/ \__pkt->size__/
LL | | /// ```
| |_______^
|
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
@ -34,6 +35,7 @@ error: unknown start of token: `
|
3 | | ^^^^^^ did you mean `baz::foobar`?
| ^
|
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
|
3 | | ^^^^^^ did you mean 'baz::foobar`?
@ -44,6 +46,7 @@ error: unknown start of token: `
|
3 | | ^^^^^^ did you mean `baz::foobar`?
| ^
|
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
|
3 | | ^^^^^^ did you mean `baz::foobar'?
@ -59,6 +62,7 @@ LL | | /// LL | use foobar::Baz;
LL | | /// | ^^^^^^ did you mean `baz::foobar`?
LL | | /// ```
| |_______^
|
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
@ -78,6 +82,7 @@ LL | /// ```
LL | | /// \_
LL | | /// ```
| |_______^
|
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
@ -117,6 +122,7 @@ error: unknown start of token: `
|
1 | ```
| ^
|
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
|
1 | '``
@ -127,6 +133,7 @@ error: unknown start of token: `
|
1 | ```
| ^
|
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
|
1 | `'`
@ -137,6 +144,7 @@ error: unknown start of token: `
|
1 | ```
| ^
|
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
|
1 | ``'
@ -196,6 +204,7 @@ LL | | ///
LL | | ///
LL | | /// ```
| |_______^
|
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
@ -236,6 +245,7 @@ error: unknown start of token: `
|
1 | ```
| ^
|
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
|
1 | '``
@ -264,6 +274,7 @@ error: unknown start of token: `
|
3 | | ^^^^^^ did you mean `baz::foobar`?
| ^
|
help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not
|
3 | | ^^^^^^ did you mean 'baz::foobar`?

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | f1(2i32, 4i32);
| ^^^^ expected u32, found i32
|
help: change the type of the numeric literal from `i32` to `u32`
|
LL | f1(2i32, 4u32);
@ -43,6 +44,7 @@ error[E0308]: mismatched types
|
LL | let _: i32 = f2(2i32);
| ^^^^^^^^ expected i32, found u32
|
help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
|
LL | let _: i32 = f2(2i32).try_into().unwrap();

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `await`
|
LL | pub mod await {
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
@ -13,6 +14,7 @@ error: expected identifier, found keyword `await`
|
LL | pub struct await;
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
@ -23,6 +25,7 @@ error: expected identifier, found keyword `await`
|
LL | use self::outer_mod::await::await;
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
@ -33,6 +36,7 @@ error: expected identifier, found keyword `await`
|
LL | use self::outer_mod::await::await;
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
@ -43,6 +47,7 @@ error: expected identifier, found keyword `await`
|
LL | struct Foo { await: () }
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | struct Foo { r#await: () }
@ -53,6 +58,7 @@ error: expected identifier, found keyword `await`
|
LL | impl Foo { fn await() {} }
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | impl Foo { fn r#await() {} }
@ -63,6 +69,7 @@ error: expected identifier, found keyword `await`
|
LL | macro_rules! await {
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await {

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `await`
|
LL | pub mod await {
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
@ -13,6 +14,7 @@ error: expected identifier, found keyword `await`
|
LL | pub struct await;
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
@ -23,6 +25,7 @@ error: expected identifier, found keyword `await`
|
LL | use self::outer_mod::await::await;
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
@ -33,6 +36,7 @@ error: expected identifier, found keyword `await`
|
LL | use self::outer_mod::await::await;
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
@ -43,6 +47,7 @@ error: expected identifier, found keyword `await`
|
LL | macro_rules! await { () => {}; }
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await { () => {}; }

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `async`
|
LL | pub const async fn x() {}
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | pub const r#async fn x() {}

View File

@ -3,6 +3,7 @@ error: crate name using dashes are not valid in `extern crate` statements
|
LL | extern crate krate-name-here;
| ^^^^^^^^^^^^^^^ dash-separated idents are not valid
|
help: if the original crate name uses dashes you need to use underscores in the code
|
LL | extern crate krate_name_here;

View File

@ -33,6 +33,7 @@ LL | &mut [_a,
| |
| data moved here
| move occurs because `_a` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
help: consider removing the `&mut`
|
LL | [_a,
@ -64,6 +65,7 @@ LL | _b] => {}
| |
| data moved here
| move occurs because `_b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
help: consider removing the `&mut`
|
LL | [

View File

@ -9,6 +9,7 @@ error[E0425]: cannot find function `sleep` in this scope
|
LL | sleep();
| ^^^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use std::thread::sleep;

View File

@ -6,6 +6,7 @@ LL | struct Obj<F> where F: FnMut() -> u32 {
...
LL | o.closure();
| ^^^^^^^ field, not a method
|
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (o.closure)();

View File

@ -6,6 +6,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
...
LL | o_closure.closure();
| ^^^^^^^ field, not a method
|
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (o_closure.closure)();
@ -30,6 +31,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
...
LL | o_func.closure();
| ^^^^^^^ field, not a method
|
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (o_func.closure)();
@ -43,6 +45,7 @@ LL | struct BoxedObj {
...
LL | boxed_fn.boxed_closure();
| ^^^^^^^^^^^^^ field, not a method
|
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
|
LL | (boxed_fn.boxed_closure)();
@ -56,6 +59,7 @@ LL | struct BoxedObj {
...
LL | boxed_closure.boxed_closure();
| ^^^^^^^^^^^^^ field, not a method
|
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
|
LL | (boxed_closure.boxed_closure)();
@ -69,6 +73,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
...
LL | w.wrap.closure();
| ^^^^^^^ field, not a method
|
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (w.wrap.closure)();
@ -93,6 +98,7 @@ LL | struct Obj<F> where F: FnOnce() -> u32 {
...
LL | check_expression().closure();
| ^^^^^^^ field, not a method
|
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (check_expression().closure)();
@ -106,6 +112,7 @@ LL | struct FuncContainer {
...
LL | (*self.container).f1(1);
| ^^ field, not a method
|
help: to call the function stored in `f1`, surround the field access with parentheses
|
LL | ((*self.container).f1)(1);
@ -119,6 +126,7 @@ LL | struct FuncContainer {
...
LL | (*self.container).f2(1);
| ^^ field, not a method
|
help: to call the function stored in `f2`, surround the field access with parentheses
|
LL | ((*self.container).f2)(1);
@ -132,6 +140,7 @@ LL | struct FuncContainer {
...
LL | (*self.container).f3(1);
| ^^ field, not a method
|
help: to call the function stored in `f3`, surround the field access with parentheses
|
LL | ((*self.container).f3)(1);

View File

@ -6,6 +6,7 @@ LL | struct Example {
...
LL | demo.example(1);
| ^^^^^^^ field, not a method
|
help: to call the function stored in `example`, surround the field access with parentheses
|
LL | (demo.example)(1);

View File

@ -3,6 +3,7 @@ error[E0599]: no method named `closure` found for type `&Obj<[closure@$DIR/issue
|
LL | p.closure();
| ^^^^^^^ field, not a method
|
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (p.closure)();
@ -13,6 +14,7 @@ error[E0599]: no method named `fn_ptr` found for type `&&Obj<[closure@$DIR/issue
|
LL | q.fn_ptr();
| ^^^^^^ field, not a method
|
help: to call the function stored in `fn_ptr`, surround the field access with parentheses
|
LL | (q.fn_ptr)();
@ -23,6 +25,7 @@ error[E0599]: no method named `c_fn_ptr` found for type `&D` in the current scop
|
LL | s.c_fn_ptr();
| ^^^^^^^^ field, not a method
|
help: to call the function stored in `c_fn_ptr`, surround the field access with parentheses
|
LL | (s.c_fn_ptr)();

View File

@ -9,6 +9,7 @@ LL | | A = F,
LL | | B = T,
LL | | }
| |_- in this macro invocation
|
help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit
|
LL | $( $v = $s::V.try_into().unwrap(), )*

View File

@ -3,6 +3,7 @@ error[E0425]: cannot find value `Foo` in this scope
|
LL | Foo;
| ^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use crate::bar::Foo;

View File

@ -3,6 +3,7 @@ error: malformed `deprecated` attribute input
|
LL | #[deprecated = b"test"]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL | #[deprecated]

View File

@ -3,6 +3,7 @@ error: chained comparison operators require parentheses
|
LL | (0..13).collect<Vec<i32>>();
| ^^^^^
|
help: use `::<...>` instead of `<...>` to specify type arguments
|
LL | (0..13).collect::<Vec<i32>>();
@ -13,6 +14,7 @@ error: chained comparison operators require parentheses
|
LL | Vec<i32>::new();
| ^^^^^
|
help: use `::<...>` instead of `<...>` to specify type arguments
|
LL | Vec::<i32>::new();
@ -23,6 +25,7 @@ error: chained comparison operators require parentheses
|
LL | (0..13).collect<Vec<i32>();
| ^^^^^
|
help: use `::<...>` instead of `<...>` to specify type arguments
|
LL | (0..13).collect::<Vec<i32>();

View File

@ -3,6 +3,7 @@ error[E0423]: expected function, found enum `Option`
|
LL | let x = Option(1);
| ^^^^^^
|
help: try using one of the enum's variants
|
LL | let x = std::option::Option::None(1);
@ -15,6 +16,7 @@ error[E0532]: expected tuple struct/variant, found enum `Option`
|
LL | if let Option(_) = x {
| ^^^^^^
|
help: try using one of the enum's variants
|
LL | if let std::option::Option::None(_) = x {
@ -27,6 +29,7 @@ error[E0532]: expected tuple struct/variant, found enum `Example`
|
LL | if let Example(_) = y {
| ^^^^^^^
|
help: try using one of the enum's variants
|
LL | if let Example::Ex(_) = y {
@ -45,6 +48,7 @@ error[E0423]: expected function, found enum `ManyVariants`
|
LL | let z = ManyVariants();
| ^^^^^^^^^^^^
|
help: try using one of the enum's variants
|
LL | let z = ManyVariants::One();

View File

@ -3,6 +3,7 @@ error: unexpected `,` in pattern
|
LL | while let b1, b2, b3 = reading_frame.next().expect("there should be a start codon") {
| ^
|
help: try adding parentheses to match on a tuple..
|
LL | while let (b1, b2, b3) = reading_frame.next().expect("there should be a start codon") {
@ -17,6 +18,7 @@ error: unexpected `,` in pattern
|
LL | if let b1, b2, b3 = reading_frame.next().unwrap() {
| ^
|
help: try adding parentheses to match on a tuple..
|
LL | if let (b1, b2, b3) = reading_frame.next().unwrap() {
@ -31,6 +33,7 @@ error: unexpected `,` in pattern
|
LL | Nucleotide::Adenine, Nucleotide::Cytosine, _ => true
| ^
|
help: try adding parentheses to match on a tuple..
|
LL | (Nucleotide::Adenine, Nucleotide::Cytosine, _) => true
@ -45,6 +48,7 @@ error: unexpected `,` in pattern
|
LL | for x, _barr_body in women.iter().map(|woman| woman.allosomes.clone()) {
| ^
|
help: try adding parentheses to match on a tuple..
|
LL | for (x, _barr_body) in women.iter().map(|woman| woman.allosomes.clone()) {
@ -59,6 +63,7 @@ error: unexpected `,` in pattern
|
LL | for x, y @ Allosome::Y(_) in men.iter().map(|man| man.allosomes.clone()) {
| ^
|
help: try adding parentheses to match on a tuple..
|
LL | for (x, y @ Allosome::Y(_)) in men.iter().map(|man| man.allosomes.clone()) {
@ -73,6 +78,7 @@ error: unexpected `,` in pattern
|
LL | let women, men: (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()
| ^
|
help: try adding parentheses to match on a tuple..
|
LL | let (women, men): (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()

View File

@ -9,6 +9,7 @@ error: unknown start of token: \u{2212}
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e11; // m³⋅kg⁻¹⋅s⁻²
| ^
|
help: Unicode character '' (Minus Sign) looks like '-' (Minus/Hyphen), but it is not
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e-11; // m³⋅kg⁻¹⋅s⁻²

View File

@ -3,6 +3,7 @@ error[E0412]: cannot find type `Set` in this scope
|
LL | fn setup() -> Set { Set }
| ^^^ not found in this scope
|
help: there is an enum variant `AffixHeart::Set` and 7 others; try using the variant's enum
|
LL | fn setup() -> AffixHeart { Set }
@ -20,6 +21,7 @@ error[E0425]: cannot find value `Set` in this scope
|
LL | fn setup() -> Set { Set }
| ^^^ not found in this scope
|
help: possible candidates are found in other modules, you can import them into scope
|
LL | use AffixHeart::Set;

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | OhNo = 0_u8,
| ^^^^ expected i8, found u8
|
help: change the type of the numeric literal from `u8` to `i8`
|
LL | OhNo = 0_i8,
@ -13,6 +14,7 @@ error[E0308]: mismatched types
|
LL | OhNo = 0_i8,
| ^^^^ expected u8, found i8
|
help: change the type of the numeric literal from `i8` to `u8`
|
LL | OhNo = 0_u8,
@ -23,6 +25,7 @@ error[E0308]: mismatched types
|
LL | OhNo = 0_u16,
| ^^^^^ expected i16, found u16
|
help: change the type of the numeric literal from `u16` to `i16`
|
LL | OhNo = 0_i16,
@ -33,6 +36,7 @@ error[E0308]: mismatched types
|
LL | OhNo = 0_i16,
| ^^^^^ expected u16, found i16
|
help: change the type of the numeric literal from `i16` to `u16`
|
LL | OhNo = 0_u16,
@ -43,6 +47,7 @@ error[E0308]: mismatched types
|
LL | OhNo = 0_u32,
| ^^^^^ expected i32, found u32
|
help: change the type of the numeric literal from `u32` to `i32`
|
LL | OhNo = 0_i32,
@ -53,6 +58,7 @@ error[E0308]: mismatched types
|
LL | OhNo = 0_i32,
| ^^^^^ expected u32, found i32
|
help: change the type of the numeric literal from `i32` to `u32`
|
LL | OhNo = 0_u32,
@ -63,6 +69,7 @@ error[E0308]: mismatched types
|
LL | OhNo = 0_u64,
| ^^^^^ expected i64, found u64
|
help: change the type of the numeric literal from `u64` to `i64`
|
LL | OhNo = 0_i64,
@ -73,6 +80,7 @@ error[E0308]: mismatched types
|
LL | OhNo = 0_i64,
| ^^^^^ expected u64, found i64
|
help: change the type of the numeric literal from `i64` to `u64`
|
LL | OhNo = 0_u64,

View File

@ -3,6 +3,7 @@ error: unexpected token: `...`
|
LL | let _redemptive = 1...21;
| ^^^
|
help: use `..` for an exclusive range
|
LL | let _redemptive = 1..21;

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `async`
|
LL | let mut async = 1;
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut r#async = 1;
@ -13,6 +14,7 @@ error: expected identifier, found keyword `async`
|
LL | module::async();
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | module::r#async();

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `async`
|
LL | let mut async = 1;
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut r#async = 1;
@ -13,6 +14,7 @@ error: expected identifier, found keyword `async`
|
LL | module::async();
| ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | module::r#async();

View File

@ -19,6 +19,7 @@ LL | let e4 = E::Empty4();
| ^^^^^^^^^--
| |
| call expression requires function
|
help: `E::Empty4` is a unit variant, you need to write it without the parenthesis
|
LL | let e4 = E::Empty4;
@ -39,6 +40,7 @@ LL | let xe4 = XE::XEmpty4();
| ^^^^^^^^^^^--
| |
| call expression requires function
|
help: `XE::XEmpty4` is a unit variant, you need to write it without the parenthesis
|
LL | let xe4 = XE::XEmpty4;

View File

@ -33,6 +33,7 @@ LL | Orange((String, String)),
...
LL | Fruit::Orange(a, b) => {},
| ^^^^^^^^^^^^^^^^^^^ expected 1 field, found 2
|
help: missing parenthesis
|
LL | Fruit::Orange((a, b)) => {},
@ -46,6 +47,7 @@ LL | Banana(()),
...
LL | Fruit::Banana() => {},
| ^^^^^^^^^^^^^^^ expected 1 field, found 0
|
help: missing parenthesis
|
LL | Fruit::Banana(()) => {},

View File

@ -3,6 +3,7 @@ error: struct literals are not allowed here
|
LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
| ^^^^^^^^^^^^^^^^
|
help: surround the struct literal with parentheses
|
LL | if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); }
@ -19,6 +20,7 @@ error: struct literals are not allowed here
|
LL | for _ in std::ops::Range { start: 0, end: 10 } {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: surround the struct literal with parentheses
|
LL | for _ in (std::ops::Range { start: 0, end: 10 }) {}

View File

@ -33,6 +33,7 @@ error[E0617]: can't pass `unsafe extern "C" fn(*const i8, ...) {printf}` to vari
|
LL | printf(::std::ptr::null(), printf);
| ^^^^^^
|
help: cast the value to `unsafe extern "C" fn(*const i8, ...)`
|
LL | printf(::std::ptr::null(), printf as unsafe extern "C" fn(*const i8, ...));

View File

@ -8,6 +8,7 @@ LL | X::Entry();
| ^^^^^^^^--
| |
| call expression requires function
|
help: `X::Entry` is a unit variant, you need to write it without the parenthesis
|
LL | X::Entry;

View File

@ -3,6 +3,7 @@ error[E0642]: patterns aren't allowed in methods without bodies
|
LL | fn foo((x, y): (i32, i32));
| ^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL | fn foo(_: (i32, i32));
@ -13,6 +14,7 @@ error[E0642]: patterns aren't allowed in methods without bodies
|
LL | fn bar((x, y): (i32, i32)) {}
| ^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL | fn bar(_: (i32, i32)) {}
@ -23,6 +25,7 @@ error[E0642]: patterns aren't allowed in methods without bodies
|
LL | fn method(S { .. }: S) {}
| ^^^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL | fn method(_: S) {}

View File

@ -21,6 +21,7 @@ error: malformed `macro_use` attribute input
|
LL | #[macro_use = "2700"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL | #[macro_use] struct S;

View File

@ -15,6 +15,7 @@ error[E0308]: mismatched types
|
LL | let y: f32 = 1f64;
| ^^^^ expected f32, found f64
|
help: change the type of the numeric literal from `f64` to `f32`
|
LL | let y: f32 = 1f32;

View File

@ -5,6 +5,7 @@ LL | let x = f == g;
| - ^^ - fn() {main::g}
| |
| fn() {main::f}
|
help: you might have forgotten to call this function
|
LL | let x = f() == g;

View File

@ -3,6 +3,7 @@ error[E0425]: cannot find function `fpriv` in this scope
|
LL | fpriv();
| ^^^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use bar::fpriv;
@ -13,6 +14,7 @@ error[E0425]: cannot find function `epriv` in this scope
|
LL | epriv();
| ^^^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use bar::epriv;
@ -29,6 +31,7 @@ error[E0425]: cannot find value `C` in this scope
|
LL | C;
| ^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use bar::C;
@ -45,6 +48,7 @@ error[E0412]: cannot find type `A` in this scope
|
LL | foo::<A>();
| ^
|
help: an enum with a similar name exists
|
LL | foo::<B>();
@ -59,6 +63,7 @@ error[E0412]: cannot find type `C` in this scope
|
LL | foo::<C>();
| ^
|
help: an enum with a similar name exists
|
LL | foo::<B>();
@ -73,6 +78,7 @@ error[E0412]: cannot find type `D` in this scope
|
LL | foo::<D>();
| ^
|
help: an enum with a similar name exists
|
LL | foo::<B>();

View File

@ -3,6 +3,7 @@ error: format argument must be a string literal
|
LL | format_args!({ #[derive(Clone)] struct S; });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: you might be missing a string literal to format with
|
LL | format_args!("{}", { #[derive(Clone)] struct S; });

View File

@ -3,6 +3,7 @@ error[E0425]: cannot find function `f` in this scope
|
LL | f();
| ^ not found in this scope
|
help: possible candidates are found in other modules, you can import them into scope
|
LL | use foo::f;
@ -24,6 +25,7 @@ LL | | g();
LL | | f();
LL | | }
| |_____- in this macro invocation
|
help: possible candidates are found in other modules, you can import them into scope
|
LL | use bar::g;

View File

@ -9,6 +9,7 @@ error: format argument must be a string literal
|
LL | format_args!(|| {});
| ^^^^^
|
help: you might be missing a string literal to format with
|
LL | format_args!("{}", || {});

View File

@ -6,6 +6,7 @@ LL | fn foo(&self, _: &impl Debug);
...
LL | fn foo<U: Debug>(&self, _: &U) { }
| ^ expected `impl Trait`, found generic parameter
|
help: try removing the generic parameter and using `impl Trait` instead
|
LL | fn foo(&self, _: &impl Debug) { }
@ -19,6 +20,7 @@ LL | fn bar<U: Debug>(&self, _: &U);
...
LL | fn bar(&self, _: &impl Debug) { }
| ^^^^^^^^^^ expected generic parameter, found `impl Trait`
|
help: try changing the `impl Trait` argument to a generic parameter
|
LL | fn bar<U: Debug>(&self, _: &U) { }

View File

@ -3,6 +3,7 @@ error: lifetime may not live long enough
|
LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
| -- lifetime `'a` defined here ^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
|
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint
|
LL | type E<'a, 'b> = impl Sized; + 'a

View File

@ -5,6 +5,7 @@ LL | fn elided(x: &i32) -> impl Copy { x }
| - ^^^^^^^^^ opaque type requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a constraint
|
LL | fn elided(x: &i32) -> impl Copy + '_ { x }
@ -17,6 +18,7 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
| -- ^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
| |
| lifetime `'a` defined here
|
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }

View File

@ -5,6 +5,7 @@ LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
| - ^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'1` must outlive `'static`
| |
| let's call the lifetime of this reference `'1`
|
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a constraint
|
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
@ -17,6 +18,7 @@ LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
| -- ^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
| |
| lifetime `'a` defined here
|
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint
|
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {

View File

@ -3,6 +3,7 @@ error[E0404]: expected trait, found derive macro `Debug`
|
LL | fn wants_debug(g: impl Debug) { }
| ^^^^^ not a trait
|
help: possible better candidate is found in another module, you can import it into scope
|
LL | use std::fmt::Debug;
@ -13,6 +14,7 @@ error[E0404]: expected trait, found derive macro `Debug`
|
LL | fn wants_display(g: impl Debug) { }
| ^^^^^ not a trait
|
help: possible better candidate is found in another module, you can import it into scope
|
LL | use std::fmt::Debug;

View File

@ -12,6 +12,7 @@ error[E0308]: mismatched types
|
LL | bar::<isize>(i); // i should not be re-coerced back to an isize
| ^ expected isize, found usize
|
help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit
|
LL | bar::<isize>(i.try_into().unwrap()); // i should not be re-coerced back to an isize

View File

@ -3,6 +3,7 @@ error[E0282]: type annotations needed for the closure `fn((), ()) -> std::result
|
LL | Err(a)?;
| ^^^^^^^ cannot infer type
|
help: give this closure an explicit return type without `_` placeholders
|
LL | let x = |a: (), b: ()| -> std::result::Result<(), _> {

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | id_i8(a16);
| ^^^ expected i8, found i16
|
help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(a16.try_into().unwrap());
@ -13,6 +14,7 @@ error[E0308]: mismatched types
|
LL | id_i8(a32);
| ^^^ expected i8, found i32
|
help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(a32.try_into().unwrap());
@ -23,6 +25,7 @@ error[E0308]: mismatched types
|
LL | id_i8(a64);
| ^^^ expected i8, found i64
|
help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(a64.try_into().unwrap());
@ -42,6 +45,7 @@ error[E0308]: mismatched types
|
LL | id_i16(a32);
| ^^^ expected i16, found i32
|
help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit
|
LL | id_i16(a32.try_into().unwrap());
@ -52,6 +56,7 @@ error[E0308]: mismatched types
|
LL | id_i16(a64);
| ^^^ expected i16, found i64
|
help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit
|
LL | id_i16(a64.try_into().unwrap());
@ -80,6 +85,7 @@ error[E0308]: mismatched types
|
LL | id_i32(a64);
| ^^^ expected i32, found i64
|
help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit
|
LL | id_i32(a64.try_into().unwrap());
@ -117,6 +123,7 @@ error[E0308]: mismatched types
|
LL | id_i8(c16);
| ^^^ expected i8, found i16
|
help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(c16.try_into().unwrap());
@ -127,6 +134,7 @@ error[E0308]: mismatched types
|
LL | id_i8(c32);
| ^^^ expected i8, found i32
|
help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(c32.try_into().unwrap());
@ -137,6 +145,7 @@ error[E0308]: mismatched types
|
LL | id_i8(c64);
| ^^^ expected i8, found i64
|
help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(c64.try_into().unwrap());
@ -156,6 +165,7 @@ error[E0308]: mismatched types
|
LL | id_i16(c32);
| ^^^ expected i16, found i32
|
help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit
|
LL | id_i16(c32.try_into().unwrap());
@ -166,6 +176,7 @@ error[E0308]: mismatched types
|
LL | id_i16(c64);
| ^^^ expected i16, found i64
|
help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit
|
LL | id_i16(c64.try_into().unwrap());
@ -194,6 +205,7 @@ error[E0308]: mismatched types
|
LL | id_i32(c64);
| ^^^ expected i32, found i64
|
help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit
|
LL | id_i32(c64.try_into().unwrap());
@ -231,6 +243,7 @@ error[E0308]: mismatched types
|
LL | id_u8(b16);
| ^^^ expected u8, found u16
|
help: you can convert an `u16` to `u8` and panic if the converted value wouldn't fit
|
LL | id_u8(b16.try_into().unwrap());
@ -241,6 +254,7 @@ error[E0308]: mismatched types
|
LL | id_u8(b32);
| ^^^ expected u8, found u32
|
help: you can convert an `u32` to `u8` and panic if the converted value wouldn't fit
|
LL | id_u8(b32.try_into().unwrap());
@ -251,6 +265,7 @@ error[E0308]: mismatched types
|
LL | id_u8(b64);
| ^^^ expected u8, found u64
|
help: you can convert an `u64` to `u8` and panic if the converted value wouldn't fit
|
LL | id_u8(b64.try_into().unwrap());
@ -270,6 +285,7 @@ error[E0308]: mismatched types
|
LL | id_u16(b32);
| ^^^ expected u16, found u32
|
help: you can convert an `u32` to `u16` and panic if the converted value wouldn't fit
|
LL | id_u16(b32.try_into().unwrap());
@ -280,6 +296,7 @@ error[E0308]: mismatched types
|
LL | id_u16(b64);
| ^^^ expected u16, found u64
|
help: you can convert an `u64` to `u16` and panic if the converted value wouldn't fit
|
LL | id_u16(b64.try_into().unwrap());
@ -308,6 +325,7 @@ error[E0308]: mismatched types
|
LL | id_u32(b64);
| ^^^ expected u32, found u64
|
help: you can convert an `u64` to `u32` and panic if the converted value wouldn't fit
|
LL | id_u32(b64.try_into().unwrap());

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | foo(1*(1 as isize));
| ^^^^^^^^^^^^^^ expected i16, found isize
|
help: you can convert an `isize` to `i16` and panic if the converted value wouldn't fit
|
LL | foo((1*(1 as isize)).try_into().unwrap());
@ -13,6 +14,7 @@ error[E0308]: mismatched types
|
LL | bar(1*(1 as usize));
| ^^^^^^^^^^^^^^ expected u32, found usize
|
help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit
|
LL | bar((1*(1 as usize)).try_into().unwrap());

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | let x: u32 = 20i32;
| ^^^^^ expected u32, found i32
|
help: change the type of the numeric literal from `i32` to `u32`
|
LL | let x: u32 = 20u32;

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | println!("{}", foo(10i32));
| ^^^^^ expected u32, found i32
|
help: change the type of the numeric literal from `i32` to `u32`
|
LL | println!("{}", foo(10u32));

View File

@ -3,6 +3,7 @@ error[E0573]: expected type, found variant `NoResult`
|
LL | fn new() -> NoResult<MyEnum, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try using the variant's enum
|
LL | fn new() -> foo::MyEnum {
@ -17,6 +18,7 @@ error[E0573]: expected type, found variant `Result`
|
LL | fn new() -> Result<foo::MyEnum, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type
|
help: possible better candidates are found in other modules, you can import them into scope
|
LL | use std::fmt::Result;
@ -34,6 +36,7 @@ error[E0573]: expected type, found variant `Result`
|
LL | fn new() -> Result<foo::MyEnum, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type
|
help: possible better candidates are found in other modules, you can import them into scope
|
LL | use std::fmt::Result;
@ -51,6 +54,7 @@ error[E0573]: expected type, found variant `NoResult`
|
LL | fn newer() -> NoResult<foo::MyEnum, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try using the variant's enum
|
LL | fn newer() -> foo::MyEnum {

View File

@ -50,6 +50,7 @@ LL | <
| ^ not interpreted as comparison
LL | 4);
| - interpreted as generic arguments
|
help: try comparing the cast value
|
LL | println!("{}", (a
@ -64,6 +65,7 @@ LL | <
| ^ not interpreted as comparison
LL | 5);
| - interpreted as generic arguments
|
help: try comparing the cast value
|
LL | println!("{}", (a

View File

@ -3,6 +3,7 @@ error[E0599]: no associated item named `MIN` found for type `u8` in the current
|
LL | const FOO: [u32; u8::MIN as usize] = [];
| ^^^ associated item not found in `u8`
|
help: you are looking for the module in `std`, not the primitive type
|
LL | const FOO: [u32; std::u8::MIN as usize] = [];

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | X = Trait::Number,
| ^^^^^^^^^^^^^ expected isize, found i32
|
help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit
|
LL | X = Trait::Number.try_into().unwrap(),

View File

@ -3,6 +3,7 @@ error[E0412]: cannot find type `Foo` in this scope
|
LL | inner: Foo<T>
| ^^^ not found in this scope
|
help: there is an enum variant `Baz::Foo`; try using the variant's enum
|
LL | inner: Baz
@ -13,6 +14,7 @@ error[E0412]: cannot find type `Foo` in this scope
|
LL | Foo(Foo<T>)
| ^^^ not found in this scope
|
help: there is an enum variant `Baz::Foo`; try using the variant's enum
|
LL | Foo(Baz)

View File

@ -3,6 +3,7 @@ error[E0412]: cannot find type `Apple` in this scope
|
LL | fn should_return_fruit() -> Apple {
| ^^^^^ not found in this scope
|
help: there is an enum variant `Fruit::Apple`; try using the variant's enum
|
LL | fn should_return_fruit() -> Fruit {
@ -13,6 +14,7 @@ error[E0425]: cannot find function `Apple` in this scope
|
LL | Apple(5)
| ^^^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use Fruit::Apple;
@ -32,6 +34,7 @@ error[E0425]: cannot find function `Apple` in this scope
|
LL | Apple(5)
| ^^^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use Fruit::Apple;
@ -51,6 +54,7 @@ error[E0412]: cannot find type `Variant3` in this scope
|
LL | fn bar() -> Variant3 {
| ^^^^^^^^ not found in this scope
|
help: there is an enum variant `x::Enum::Variant3`; try using the variant's enum
|
LL | fn bar() -> x::Enum {

View File

@ -3,6 +3,7 @@ error: the `wait` method cannot be invoked on a trait object
|
LL | arg.wait();
| ^^^^
|
help: another candidate was found in the following trait, perhaps add a `use` for it:
|
LL | use private::Future;

View File

@ -3,6 +3,7 @@ error[E0404]: expected trait, found derive macro `Hash`
|
LL | struct Foo<T: ?Hash> { }
| ^^^^ not a trait
|
help: possible better candidate is found in another module, you can import it into scope
|
LL | use std::hash::Hash;

View File

@ -9,6 +9,7 @@ error[E0423]: expected function, found module `baz`
|
LL | baz();
| ^^^ not a function
|
help: possible better candidate is found in another module, you can import it into scope
|
LL | use bar::baz;

View File

@ -3,6 +3,7 @@ error[E0689]: can't call method `f` on ambiguous numeric type `{integer}`
|
LL | 3.f()
| ^
|
help: you must specify a concrete type for this numeric value, like `i32`
|
LL | 3_i32.f()

View File

@ -9,6 +9,7 @@ error[E0425]: cannot find function `B` in this scope
|
LL | B(());
| ^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use foo::B;

View File

@ -3,6 +3,7 @@ error[E0412]: cannot find type `Bar` in this scope
|
LL | fn sub() -> Bar { 1 }
| ^^^ not found in this scope
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use a::b::Bar;
@ -13,6 +14,7 @@ error[E0423]: expected function, found module `foo`
|
LL | foo();
| ^^^ not a function
|
help: possible better candidates are found in other modules, you can import them into scope
|
LL | use foo::foo;

View File

@ -3,6 +3,7 @@ error[E0425]: cannot find function `foo` in this scope
|
LL | fn sub() -> isize { foo(); 1 }
| ^^^ not found in this scope
|
help: possible candidates are found in other modules, you can import them into scope
|
LL | use foo::foo;

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `true`
|
LL | foo!(true);
| ^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | foo!(r#true);

View File

@ -6,6 +6,7 @@ LL | let _a = b + ", World!";
| | |
| | `+` cannot be used to concatenate two `&str` strings
| &str
|
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _a = b.to_owned() + ", World!";

View File

@ -6,6 +6,7 @@ LL | println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
| | |
| | `+` cannot be used to concatenate two `&str` strings
| &str
|
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";

View File

@ -6,6 +6,7 @@ LL | let Point { .., y, } = p;
| | |
| | expected `}`
| `..` must be at the end and cannot have a trailing comma
|
help: move the `..` to the end of the field list
|
LL | let Point { y, .. } = p;
@ -19,6 +20,7 @@ LL | let Point { .., y } = p;
| | |
| | expected `}`
| `..` must be at the end and cannot have a trailing comma
|
help: move the `..` to the end of the field list
|
LL | let Point { y , .. } = p;

View File

@ -3,6 +3,7 @@ error[E0642]: patterns aren't allowed in methods without bodies
|
LL | fn foo([a, b]: [i32; 2]) {}
| ^^^^^^
|
help: give this argument a name or use an underscore to ignore it
|
LL | fn foo(_: [i32; 2]) {}

View File

@ -3,6 +3,7 @@ error[E0425]: cannot find value `LOG10_2` in module `std::f64`
|
LL | const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize;
| ^^^^^^^ not found in `std::f64`
|
help: possible candidates are found in other modules, you can import them into scope
|
LL | use std::f32::consts::LOG10_2;

View File

@ -3,6 +3,7 @@ error[E0689]: can't call method `pow` on ambiguous numeric type `{float}`
|
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);

View File

@ -5,6 +5,7 @@ LL | let x = |ref x: isize| { x += 1; };
| -^^^^^
| |
| cannot use `+=` on type `&isize`
|
help: `+=` can be used on 'isize', you can dereference `x`
|
LL | let x = |ref x: isize| { *x += 1; };

View File

@ -19,6 +19,7 @@ error: unused variable: `x`
|
LL | F::A(x, y) | F::B(x, y) => { y },
| ^ ^
|
help: consider prefixing with an underscore
|
LL | F::A(_x, y) | F::B(_x, y) => { y },
@ -41,6 +42,7 @@ error: unused variable: `x`
|
LL | let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
| ^ ^
|
help: consider prefixing with an underscore
|
LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
@ -51,6 +53,7 @@ error: unused variable: `x`
|
LL | while let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
| ^ ^
|
help: consider prefixing with an underscore
|
LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `for`
|
LL | m::for();
| ^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | m::r#for();

View File

@ -3,6 +3,7 @@ error: negative trait bounds are not supported
|
LL | impl<A: !Valid> Conj<A>{}
| ^^^^^^^^ negative trait bounds are not supported
|
= help: remove the trait bound
error: aborting due to previous error

View File

@ -41,6 +41,7 @@ LL | foo > foo;
| --- ^ --- fn() -> i32 {foo}
| |
| fn() -> i32 {foo}
|
help: you might have forgotten to call this function
|
LL | foo() > foo;

View File

@ -18,6 +18,7 @@ LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s
| -- ^^^^^^^^^^^ expected `{`
| |
| this `if` statement has a condition, but no block
|
help: try placing this code inside a block
|
LL | fn foo(u: u8) { if u8 { macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {

View File

@ -3,6 +3,7 @@ error: character literal may only contain one codepoint
|
LL | let _foo = b'hello\0';
| ^^^^^^^^^
|
help: if you meant to write a byte string literal, use double quotes
|
LL | let _foo = b"hello\0";
@ -13,6 +14,7 @@ error: character literal may only contain one codepoint
|
LL | let _bar = 'hello';
| ^^^^^^^
|
help: if you meant to write a `str` literal, use double quotes
|
LL | let _bar = "hello";

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | A = 1i64,
| ^^^^ expected isize, found i64
|
help: change the type of the numeric literal from `i64` to `isize`
|
LL | A = 1isize,
@ -13,6 +14,7 @@ error[E0308]: mismatched types
|
LL | B = 2u8
| ^^^ expected isize, found u8
|
help: change the type of the numeric literal from `u8` to `isize`
|
LL | B = 2isize

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `extern`
|
LL | let extern = 0;
| ^^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#extern = 0;

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `extern`
|
LL | use extern::foo;
| ^^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | use r#extern::foo;

View File

@ -3,6 +3,7 @@ error[E0574]: expected struct, variant or union type, found type parameter `T`
|
LL | let t = T { i: 0 };
| ^ not a struct, variant or union type
|
help: possible better candidate is found in another module, you can import it into scope
|
LL | use T;

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `loop`
|
LL | loop { break 'label: loop { break 'label 42; }; }
| ^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | loop { break 'label: r#loop { break 'label 42; }; }

View File

@ -385,6 +385,7 @@ mod foo {
\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
\u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m let x: Iter;\u001b[0m
\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m
\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
\u001b[0m\u001b[1m\u001b[38;5;14mhelp\u001b[0m\u001b[0m: possible candidates are found in other modules, you can import them into scope\u001b[0m
\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
\u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse std::collections::binary_heap::Iter;\u001b[0m

View File

@ -3,6 +3,7 @@ error[E0571]: `break` with value from a `for` loop
|
LL | break 22
| ^^^^^^^^ can only break with a value inside `loop` or breakable block
|
help: instead, use `break` on its own without a value inside this `for` loop
|
LL | break

View File

@ -11,6 +11,7 @@ error[E0571]: `break` with value from a `while` loop
|
LL | break ();
| ^^^^^^^^ can only break with a value inside `loop` or breakable block
|
help: instead, use `break` on its own without a value inside this `while` loop
|
LL | break;
@ -21,6 +22,7 @@ error[E0571]: `break` with value from a `while` loop
|
LL | break 'while_loop 123;
| ^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
help: instead, use `break` on its own without a value inside this `while` loop
|
LL | break;
@ -31,6 +33,7 @@ error[E0571]: `break` with value from a `while let` loop
|
LL | if break () {
| ^^^^^^^^ can only break with a value inside `loop` or breakable block
|
help: instead, use `break` on its own without a value inside this `while let` loop
|
LL | if break {
@ -41,6 +44,7 @@ error[E0571]: `break` with value from a `while let` loop
|
LL | break None;
| ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
help: instead, use `break` on its own without a value inside this `while let` loop
|
LL | break;
@ -51,6 +55,7 @@ error[E0571]: `break` with value from a `while let` loop
|
LL | break 'while_let_loop "nope";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
help: instead, use `break` on its own without a value inside this `while let` loop
|
LL | break;
@ -61,6 +66,7 @@ error[E0571]: `break` with value from a `for` loop
|
LL | break ();
| ^^^^^^^^ can only break with a value inside `loop` or breakable block
|
help: instead, use `break` on its own without a value inside this `for` loop
|
LL | break;
@ -71,6 +77,7 @@ error[E0571]: `break` with value from a `for` loop
|
LL | break [()];
| ^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
help: instead, use `break` on its own without a value inside this `for` loop
|
LL | break;
@ -81,6 +88,7 @@ error[E0571]: `break` with value from a `for` loop
|
LL | break 'for_loop Some(17);
| ^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block
|
help: instead, use `break` on its own without a value inside this `for` loop
|
LL | break;

View File

@ -3,6 +3,7 @@ error: format argument must be a string literal
|
LL | println!(3 + 4);
| ^^^^^
|
help: you might be missing a string literal to format with
|
LL | println!("{}", 3 + 4);
@ -13,6 +14,7 @@ error: format argument must be a string literal
|
LL | println!(3, 4);
| ^
|
help: you might be missing a string literal to format with
|
LL | println!("{} {}", 3, 4);

View File

@ -11,6 +11,7 @@ LL | | }
...
LL | format_args!(hang!());
| ------- in this macro invocation
|
help: you might be missing a string literal to format with
|
LL | format_args!("{}", hang!());

View File

@ -43,6 +43,7 @@ error: format argument must be a string literal
|
LL | format!(123);
| ^^^
|
help: you might be missing a string literal to format with
|
LL | format!("{}", 123);

View File

@ -3,6 +3,7 @@ error: format argument must be a string literal
|
LL | println!(0);
| ^
|
help: you might be missing a string literal to format with
|
LL | println!("{}", 0);
@ -13,6 +14,7 @@ error: format argument must be a string literal
|
LL | eprintln!('a');
| ^^^
|
help: you might be missing a string literal to format with
|
LL | eprintln!("{}", 'a');
@ -23,6 +25,7 @@ error: format argument must be a string literal
|
LL | writeln!(s, true).unwrap();
| ^^^^
|
help: you might be missing a string literal to format with
|
LL | writeln!(s, "{}", true).unwrap();

View File

@ -33,6 +33,7 @@ LL | 2.0.neg()
...
LL | real_method_stmt!();
| -------------------- in this macro invocation
|
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()
@ -73,6 +74,7 @@ LL | 2.0.neg()
...
LL | let _ = real_method_expr!();
| ------------------- in this macro invocation
|
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()

View File

@ -3,6 +3,7 @@ error[E0425]: cannot find function `bar` in module `a`
|
LL | a::bar();
| ^^^ not found in `a`
|
help: possible candidate is found in another module, you can import it into scope
|
LL | use b::bar;

View File

@ -45,6 +45,7 @@ error: format argument must be a string literal
|
LL | format!(invalid);
| ^^^^^^^
|
help: you might be missing a string literal to format with
|
LL | format!("{}", invalid);

View File

@ -3,6 +3,7 @@ error[E0633]: malformed `unwind` attribute input
|
LL | #[unwind(allowed, aborts)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid argument
|
help: the allowed arguments are `allowed` and `aborts`
|
LL | #[unwind(allowed)]
@ -15,6 +16,7 @@ error[E0633]: malformed `unwind` attribute input
|
LL | #[unwind(unsupported)]
| ^^^^^^^^^^^^^^^^^^^^^^ invalid argument
|
help: the allowed arguments are `allowed` and `aborts`
|
LL | #[unwind(allowed)]

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | let x: u32 = 22_usize;
| ^^^^^^^^ expected u32, found usize
|
help: change the type of the numeric literal from `usize` to `u32`
|
LL | let x: u32 = 22_u32;

View File

@ -11,6 +11,7 @@ error[E0308]: mismatched types
|
LL | let y: usize = x.foo();
| ^^^^^^^ expected usize, found isize
|
help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit
|
LL | let y: usize = x.foo().try_into().unwrap();

View File

@ -3,6 +3,7 @@ error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
|
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();
@ -13,6 +14,7 @@ error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
|
LL | let x = y.neg();
| ^^^
|
help: you must specify a type for this binding, like `f32`
|
LL | let y: f32 = 2.0;
@ -31,6 +33,7 @@ error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
|
LL | local_bar.pow(2);
| ^^^
|
help: you must specify a type for this binding, like `i32`
|
LL | ($ident:ident) => { let $ident: i32 = 42; }

View File

@ -5,6 +5,7 @@ LL | let _n = m.iter().map(|_, b| {
| ^^^ ------ takes 2 distinct arguments
| |
| expected closure that takes a single 2-tuple as argument
|
help: change the closure to accept a tuple instead of individual arguments
|
LL | let _n = m.iter().map(|(_, b)| {

View File

@ -5,6 +5,7 @@ LL | [1, 2, 3].sort_by(|| panic!());
| ^^^^^^^ -- takes 0 arguments
| |
| expected closure that takes 2 arguments
|
help: consider changing the closure to take and ignore the expected arguments
|
LL | [1, 2, 3].sort_by(|_, _| panic!());
@ -25,6 +26,7 @@ LL | [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
| ^^^^^^^ ----------------- takes a single 2-tuple as argument
| |
| expected closure that takes 2 distinct arguments
|
help: change the closure to take multiple arguments instead of a single tuple
|
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
@ -37,6 +39,7 @@ LL | [1, 2, 3].sort_by(|(tuple, tuple2): (usize, _)| panic!());
| ^^^^^^^ ----------------------------- takes a single 2-tuple as argument
| |
| expected closure that takes 2 distinct arguments
|
help: change the closure to take multiple arguments instead of a single tuple
|
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
@ -52,6 +55,7 @@ LL | f(|| panic!());
| ^ -- takes 0 arguments
| |
| expected closure that takes 1 argument
|
help: consider changing the closure to take and ignore the expected argument
|
LL | f(|_| panic!());
@ -67,6 +71,7 @@ LL | f( move || panic!());
| ^ ---------- takes 0 arguments
| |
| expected closure that takes 1 argument
|
help: consider changing the closure to take and ignore the expected argument
|
LL | f( move |_| panic!());
@ -79,6 +84,7 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
| ^^^ ------ takes 2 distinct arguments
| |
| expected closure that takes a single 2-tuple as argument
|
help: change the closure to accept a tuple instead of individual arguments
|
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
@ -91,6 +97,7 @@ LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
| ^^^ ------------- takes 2 distinct arguments
| |
| expected closure that takes a single 2-tuple as argument
|
help: change the closure to accept a tuple instead of individual arguments
|
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);

View File

@ -6,6 +6,7 @@ LL | $arr.len() * size_of($arr[0]));
...
LL | write!(hello);
| -------------- in this macro invocation
|
help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit
|
LL | ($arr.len() * size_of($arr[0])).try_into().unwrap());

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
|
LL | foo(1u8);
| ^^^ expected u16, found u8
|
help: change the type of the numeric literal from `u8` to `u16`
|
LL | foo(1u16);
@ -13,6 +14,7 @@ error[E0308]: mismatched types
|
LL | foo1(2f32);
| ^^^^ expected f64, found f32
|
help: change the type of the numeric literal from `f32` to `f64`
|
LL | foo1(2f64);
@ -23,6 +25,7 @@ error[E0308]: mismatched types
|
LL | foo2(3i16);
| ^^^^ expected i32, found i16
|
help: change the type of the numeric literal from `i16` to `i32`
|
LL | foo2(3i32);

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