Increase spacing for suggestions in diagnostics

Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.
This commit is contained in:
Esteban Küber 2019-10-23 22:20:58 -07:00
parent 4a8c5b20c7
commit 0baf61bfdb
227 changed files with 744 additions and 0 deletions

View File

@ -1629,6 +1629,19 @@ impl EmitterWriter {
_ => () _ => ()
} }
} }
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);
}
match emit_to_destination(&buffer.render(), level, &mut self.dst,
self.short_message) {
Ok(()) => (),
Err(e) => panic!("failed to emit error: {}", e)
}
}
for sugg in suggestions { for sugg in suggestions {
if sugg.style == SuggestionStyle::CompletelyHidden { if sugg.style == SuggestionStyle::CompletelyHidden {
// do not display this suggestion, it is meant only for tools // do not display this suggestion, it is meant only for tools

View File

@ -23,6 +23,7 @@ error: `ambiguous` is both a struct and a function
| |
LL | /// [ambiguous] is ambiguous. LL | /// [ambiguous] is ambiguous.
| ^^^^^^^^^ ambiguous link | ^^^^^^^^^ ambiguous link
|
help: to link to the struct, prefix with the item type help: to link to the struct, prefix with the item type
| |
LL | /// [struct@ambiguous] is ambiguous. 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. LL | /// [`multi_conflict`] is a three-way conflict.
| ^^^^^^^^^^^^^^^^ ambiguous link | ^^^^^^^^^^^^^^^^ ambiguous link
|
help: to link to the struct, prefix with the item type help: to link to the struct, prefix with the item type
| |
LL | /// [`struct@multi_conflict`] is a three-way conflict. 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]. LL | /// Ambiguous [type_and_value].
| ^^^^^^^^^^^^^^ ambiguous link | ^^^^^^^^^^^^^^ ambiguous link
|
help: to link to the module, prefix with the item type help: to link to the module, prefix with the item type
| |
LL | /// Ambiguous [module@type_and_value]. 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`]. LL | /// Ambiguous non-implied shortcut link [`foo::bar`].
| ^^^^^^^^^^ ambiguous link | ^^^^^^^^^^ ambiguous link
|
help: to link to the enum, prefix with the item type help: to link to the enum, prefix with the item type
| |
LL | /// Ambiguous non-implied shortcut link [`enum@foo::bar`]. LL | /// Ambiguous non-implied shortcut link [`enum@foo::bar`].

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `async`
| |
LL | pub const async fn x() {} LL | pub const async fn x() {}
| ^^^^^ expected identifier, found keyword | ^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers help: you can escape reserved keywords to use them as identifiers
| |
LL | pub const r#async fn x() {} 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; LL | extern crate krate-name-here;
| ^^^^^^^^^^^^^^^ dash-separated idents are not valid | ^^^^^^^^^^^^^^^ dash-separated idents are not valid
|
help: if the original crate name uses dashes you need to use underscores in the code help: if the original crate name uses dashes you need to use underscores in the code
| |
LL | extern crate krate_name_here; LL | extern crate krate_name_here;

View File

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

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@ LL | struct Example {
... ...
LL | demo.example(1); LL | demo.example(1);
| ^^^^^^^ field, not a method | ^^^^^^^ field, not a method
|
help: to call the function stored in `example`, surround the field access with parentheses help: to call the function stored in `example`, surround the field access with parentheses
| |
LL | (demo.example)(1); 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(); LL | p.closure();
| ^^^^^^^ field, not a method | ^^^^^^^ field, not a method
|
help: to call the function stored in `closure`, surround the field access with parentheses help: to call the function stored in `closure`, surround the field access with parentheses
| |
LL | (p.closure)(); 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(); LL | q.fn_ptr();
| ^^^^^^ field, not a method | ^^^^^^ field, not a method
|
help: to call the function stored in `fn_ptr`, surround the field access with parentheses help: to call the function stored in `fn_ptr`, surround the field access with parentheses
| |
LL | (q.fn_ptr)(); 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(); LL | s.c_fn_ptr();
| ^^^^^^^^ field, not a method | ^^^^^^^^ field, not a method
|
help: to call the function stored in `c_fn_ptr`, surround the field access with parentheses help: to call the function stored in `c_fn_ptr`, surround the field access with parentheses
| |
LL | (s.c_fn_ptr)(); LL | (s.c_fn_ptr)();

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,7 @@ error[E0423]: expected function, found enum `Option`
| |
LL | let x = Option(1); LL | let x = Option(1);
| ^^^^^^ | ^^^^^^
|
help: try using one of the enum's variants help: try using one of the enum's variants
| |
LL | let x = std::option::Option::None(1); 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 { LL | if let Option(_) = x {
| ^^^^^^ | ^^^^^^
|
help: try using one of the enum's variants help: try using one of the enum's variants
| |
LL | if let std::option::Option::None(_) = x { 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 { LL | if let Example(_) = y {
| ^^^^^^^ | ^^^^^^^
|
help: try using one of the enum's variants help: try using one of the enum's variants
| |
LL | if let Example::Ex(_) = y { LL | if let Example::Ex(_) = y {
@ -45,6 +48,7 @@ error[E0423]: expected function, found enum `ManyVariants`
| |
LL | let z = ManyVariants(); LL | let z = ManyVariants();
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
|
help: try using one of the enum's variants help: try using one of the enum's variants
| |
LL | let z = ManyVariants::One(); 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") { 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.. 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") { 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() { LL | if let b1, b2, b3 = reading_frame.next().unwrap() {
| ^ | ^
|
help: try adding parentheses to match on a tuple.. help: try adding parentheses to match on a tuple..
| |
LL | if let (b1, b2, b3) = reading_frame.next().unwrap() { LL | if let (b1, b2, b3) = reading_frame.next().unwrap() {
@ -31,6 +33,7 @@ error: unexpected `,` in pattern
| |
LL | Nucleotide::Adenine, Nucleotide::Cytosine, _ => true LL | Nucleotide::Adenine, Nucleotide::Cytosine, _ => true
| ^ | ^
|
help: try adding parentheses to match on a tuple.. help: try adding parentheses to match on a tuple..
| |
LL | (Nucleotide::Adenine, Nucleotide::Cytosine, _) => true 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()) { LL | for x, _barr_body in women.iter().map(|woman| woman.allosomes.clone()) {
| ^ | ^
|
help: try adding parentheses to match on a tuple.. help: try adding parentheses to match on a tuple..
| |
LL | for (x, _barr_body) in women.iter().map(|woman| woman.allosomes.clone()) { 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()) { LL | for x, y @ Allosome::Y(_) in men.iter().map(|man| man.allosomes.clone()) {
| ^ | ^
|
help: try adding parentheses to match on a tuple.. help: try adding parentheses to match on a tuple..
| |
LL | for (x, y @ Allosome::Y(_)) in men.iter().map(|man| man.allosomes.clone()) { 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() LL | let women, men: (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()
| ^ | ^
|
help: try adding parentheses to match on a tuple.. help: try adding parentheses to match on a tuple..
| |
LL | let (women, men): (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned() 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⁻² LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e11; // m³⋅kg⁻¹⋅s⁻²
| ^ | ^
|
help: Unicode character '' (Minus Sign) looks like '-' (Minus/Hyphen), but it is not 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⁻² 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 } LL | fn setup() -> Set { Set }
| ^^^ not found in this scope | ^^^ not found in this scope
|
help: there is an enum variant `AffixHeart::Set` and 7 others; try using the variant's enum help: there is an enum variant `AffixHeart::Set` and 7 others; try using the variant's enum
| |
LL | fn setup() -> AffixHeart { Set } LL | fn setup() -> AffixHeart { Set }
@ -20,6 +21,7 @@ error[E0425]: cannot find value `Set` in this scope
| |
LL | fn setup() -> Set { Set } LL | fn setup() -> Set { Set }
| ^^^ not found in this scope | ^^^ not found in this scope
|
help: possible candidates are found in other modules, you can import them into scope help: possible candidates are found in other modules, you can import them into scope
| |
LL | use AffixHeart::Set; LL | use AffixHeart::Set;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,6 +33,7 @@ LL | Orange((String, String)),
... ...
LL | Fruit::Orange(a, b) => {}, LL | Fruit::Orange(a, b) => {},
| ^^^^^^^^^^^^^^^^^^^ expected 1 field, found 2 | ^^^^^^^^^^^^^^^^^^^ expected 1 field, found 2
|
help: missing parenthesis help: missing parenthesis
| |
LL | Fruit::Orange((a, b)) => {}, LL | Fruit::Orange((a, b)) => {},
@ -46,6 +47,7 @@ LL | Banana(()),
... ...
LL | Fruit::Banana() => {}, LL | Fruit::Banana() => {},
| ^^^^^^^^^^^^^^^ expected 1 field, found 0 | ^^^^^^^^^^^^^^^ expected 1 field, found 0
|
help: missing parenthesis help: missing parenthesis
| |
LL | Fruit::Banana(()) => {}, 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"); } LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
|
help: surround the struct literal with parentheses help: surround the struct literal with parentheses
| |
LL | if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); } 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 } {} LL | for _ in std::ops::Range { start: 0, end: 10 } {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: surround the struct literal with parentheses help: surround the struct literal with parentheses
| |
LL | for _ in (std::ops::Range { start: 0, end: 10 }) {} 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); LL | printf(::std::ptr::null(), printf);
| ^^^^^^ | ^^^^^^
|
help: cast the value to `unsafe extern "C" fn(*const i8, ...)` help: cast the value to `unsafe extern "C" fn(*const i8, ...)`
| |
LL | printf(::std::ptr::null(), printf as 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 | call expression requires function
|
help: `X::Entry` is a unit variant, you need to write it without the parenthesis help: `X::Entry` is a unit variant, you need to write it without the parenthesis
| |
LL | X::Entry; 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)); LL | fn foo((x, y): (i32, i32));
| ^^^^^^ | ^^^^^^
|
help: give this argument a name or use an underscore to ignore it help: give this argument a name or use an underscore to ignore it
| |
LL | fn foo(_: (i32, i32)); 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)) {} LL | fn bar((x, y): (i32, i32)) {}
| ^^^^^^ | ^^^^^^
|
help: give this argument a name or use an underscore to ignore it help: give this argument a name or use an underscore to ignore it
| |
LL | fn bar(_: (i32, i32)) {} LL | fn bar(_: (i32, i32)) {}
@ -23,6 +25,7 @@ error[E0642]: patterns aren't allowed in methods without bodies
| |
LL | fn method(S { .. }: S) {} LL | fn method(S { .. }: S) {}
| ^^^^^^^^ | ^^^^^^^^
|
help: give this argument a name or use an underscore to ignore it help: give this argument a name or use an underscore to ignore it
| |
LL | fn method(_: S) {} LL | fn method(_: S) {}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@ LL | fn foo(&self, _: &impl Debug);
... ...
LL | fn foo<U: Debug>(&self, _: &U) { } LL | fn foo<U: Debug>(&self, _: &U) { }
| ^ expected `impl Trait`, found generic parameter | ^ expected `impl Trait`, found generic parameter
|
help: try removing the generic parameter and using `impl Trait` instead help: try removing the generic parameter and using `impl Trait` instead
| |
LL | fn foo(&self, _: &impl Debug) { } LL | fn foo(&self, _: &impl Debug) { }
@ -19,6 +20,7 @@ LL | fn bar<U: Debug>(&self, _: &U);
... ...
LL | fn bar(&self, _: &impl Debug) { } LL | fn bar(&self, _: &impl Debug) { }
| ^^^^^^^^^^ expected generic parameter, found `impl Trait` | ^^^^^^^^^^ expected generic parameter, found `impl Trait`
|
help: try changing the `impl Trait` argument to a generic parameter help: try changing the `impl Trait` argument to a generic parameter
| |
LL | fn bar<U: Debug>(&self, _: &U) { } 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> { 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` | -- 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 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 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` | - ^^^^^^^^^ opaque type requires that `'1` must outlive `'static`
| | | |
| let's call the lifetime of this reference `'1` | 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 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 } 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` | -- ^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
| | | |
| lifetime `'a` defined here | lifetime `'a` defined here
|
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint 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 } 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` | - ^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'1` must outlive `'static`
| | | |
| let's call the lifetime of this reference `'1` | 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 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> + '_ { 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` | -- ^^^^^^^^^^^^^^^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
| | | |
| lifetime `'a` defined here | lifetime `'a` defined here
|
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint 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 { 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) { } LL | fn wants_debug(g: impl Debug) { }
| ^^^^^ not a trait | ^^^^^ not a trait
|
help: possible better candidate is found in another module, you can import it into scope help: possible better candidate is found in another module, you can import it into scope
| |
LL | use std::fmt::Debug; LL | use std::fmt::Debug;
@ -13,6 +14,7 @@ error[E0404]: expected trait, found derive macro `Debug`
| |
LL | fn wants_display(g: impl Debug) { } LL | fn wants_display(g: impl Debug) { }
| ^^^^^ not a trait | ^^^^^ not a trait
|
help: possible better candidate is found in another module, you can import it into scope help: possible better candidate is found in another module, you can import it into scope
| |
LL | use std::fmt::Debug; 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 LL | bar::<isize>(i); // i should not be re-coerced back to an isize
| ^ expected isize, found usize | ^ expected isize, found usize
|
help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit 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 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)?; LL | Err(a)?;
| ^^^^^^^ cannot infer type | ^^^^^^^ cannot infer type
|
help: give this closure an explicit return type without `_` placeholders help: give this closure an explicit return type without `_` placeholders
| |
LL | let x = |a: (), b: ()| -> std::result::Result<(), _> { LL | let x = |a: (), b: ()| -> std::result::Result<(), _> {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -50,6 +50,7 @@ LL | <
| ^ not interpreted as comparison | ^ not interpreted as comparison
LL | 4); LL | 4);
| - interpreted as generic arguments | - interpreted as generic arguments
|
help: try comparing the cast value help: try comparing the cast value
| |
LL | println!("{}", (a LL | println!("{}", (a
@ -64,6 +65,7 @@ LL | <
| ^ not interpreted as comparison | ^ not interpreted as comparison
LL | 5); LL | 5);
| - interpreted as generic arguments | - interpreted as generic arguments
|
help: try comparing the cast value help: try comparing the cast value
| |
LL | println!("{}", (a 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] = []; LL | const FOO: [u32; u8::MIN as usize] = [];
| ^^^ associated item not found in `u8` | ^^^ associated item not found in `u8`
|
help: you are looking for the module in `std`, not the primitive type help: you are looking for the module in `std`, not the primitive type
| |
LL | const FOO: [u32; std::u8::MIN as usize] = []; LL | const FOO: [u32; std::u8::MIN as usize] = [];

View File

@ -3,6 +3,7 @@ error[E0308]: mismatched types
| |
LL | X = Trait::Number, LL | X = Trait::Number,
| ^^^^^^^^^^^^^ expected isize, found i32 | ^^^^^^^^^^^^^ expected isize, found i32
|
help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit
| |
LL | X = Trait::Number.try_into().unwrap(), 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> LL | inner: Foo<T>
| ^^^ not found in this scope | ^^^ not found in this scope
|
help: there is an enum variant `Baz::Foo`; try using the variant's enum help: there is an enum variant `Baz::Foo`; try using the variant's enum
| |
LL | inner: Baz LL | inner: Baz
@ -13,6 +14,7 @@ error[E0412]: cannot find type `Foo` in this scope
| |
LL | Foo(Foo<T>) LL | Foo(Foo<T>)
| ^^^ not found in this scope | ^^^ not found in this scope
|
help: there is an enum variant `Baz::Foo`; try using the variant's enum help: there is an enum variant `Baz::Foo`; try using the variant's enum
| |
LL | Foo(Baz) LL | Foo(Baz)

View File

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

View File

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

View File

@ -9,6 +9,7 @@ error[E0423]: expected function, found module `baz`
| |
LL | baz(); LL | baz();
| ^^^ not a function | ^^^ not a function
|
help: possible better candidate is found in another module, you can import it into scope help: possible better candidate is found in another module, you can import it into scope
| |
LL | use bar::baz; 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() LL | 3.f()
| ^ | ^
|
help: you must specify a concrete type for this numeric value, like `i32` help: you must specify a concrete type for this numeric value, like `i32`
| |
LL | 3_i32.f() LL | 3_i32.f()

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@ LL | let _a = b + ", World!";
| | | | | |
| | `+` cannot be used to concatenate two `&str` strings | | `+` cannot be used to concatenate two `&str` strings
| &str | &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 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!"; 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 | | `+` cannot be used to concatenate two `&str` strings
| &str | &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 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!"; LL | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";

View File

@ -6,6 +6,7 @@ LL | let Point { .., y, } = p;
| | | | | |
| | expected `}` | | expected `}`
| `..` must be at the end and cannot have a trailing comma | `..` must be at the end and cannot have a trailing comma
|
help: move the `..` to the end of the field list help: move the `..` to the end of the field list
| |
LL | let Point { y, .. } = p; LL | let Point { y, .. } = p;
@ -19,6 +20,7 @@ LL | let Point { .., y } = p;
| | | | | |
| | expected `}` | | expected `}`
| `..` must be at the end and cannot have a trailing comma | `..` must be at the end and cannot have a trailing comma
|
help: move the `..` to the end of the field list help: move the `..` to the end of the field list
| |
LL | let Point { y , .. } = p; 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]) {} LL | fn foo([a, b]: [i32; 2]) {}
| ^^^^^^ | ^^^^^^
|
help: give this argument a name or use an underscore to ignore it help: give this argument a name or use an underscore to ignore it
| |
LL | fn foo(_: [i32; 2]) {} 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; LL | const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize;
| ^^^^^^^ not found in `std::f64` | ^^^^^^^ not found in `std::f64`
|
help: possible candidates are found in other modules, you can import them into scope help: possible candidates are found in other modules, you can import them into scope
| |
LL | use std::f32::consts::LOG10_2; 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); LL | let a = (1.0).pow(1.0);
| ^^^ | ^^^
|
help: you must specify a concrete type for this numeric value, like `f32` help: you must specify a concrete type for this numeric value, like `f32`
| |
LL | let a = (1.0_f32).pow(1.0); 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` | cannot use `+=` on type `&isize`
|
help: `+=` can be used on 'isize', you can dereference `x` help: `+=` can be used on 'isize', you can dereference `x`
| |
LL | let x = |ref x: isize| { *x += 1; }; 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 }, LL | F::A(x, y) | F::B(x, y) => { y },
| ^ ^ | ^ ^
|
help: consider prefixing with an underscore help: consider prefixing with an underscore
| |
LL | F::A(_x, y) | F::B(_x, y) => { y }, 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) { LL | let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
| ^ ^ | ^ ^
|
help: consider prefixing with an underscore help: consider prefixing with an underscore
| |
LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
@ -51,6 +53,7 @@ error: unused variable: `x`
| |
LL | while let F::A(x, y) | F::B(x, y) = F::A(1, 2) { LL | while let F::A(x, y) | F::B(x, y) = F::A(1, 2) {
| ^ ^ | ^ ^
|
help: consider prefixing with an underscore help: consider prefixing with an underscore
| |
LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {

View File

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

View File

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

View File

@ -41,6 +41,7 @@ LL | foo > foo;
| --- ^ --- fn() -> i32 {foo} | --- ^ --- fn() -> i32 {foo}
| | | |
| fn() -> i32 {foo} | fn() -> i32 {foo}
|
help: you might have forgotten to call this function help: you might have forgotten to call this function
| |
LL | foo() > foo; 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 `{` | -- ^^^^^^^^^^^ expected `{`
| | | |
| this `if` statement has a condition, but no block | this `if` statement has a condition, but no block
|
help: try placing this code inside a 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 { 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'; LL | let _foo = b'hello\0';
| ^^^^^^^^^ | ^^^^^^^^^
|
help: if you meant to write a byte string literal, use double quotes help: if you meant to write a byte string literal, use double quotes
| |
LL | let _foo = b"hello\0"; LL | let _foo = b"hello\0";
@ -13,6 +14,7 @@ error: character literal may only contain one codepoint
| |
LL | let _bar = 'hello'; LL | let _bar = 'hello';
| ^^^^^^^ | ^^^^^^^
|
help: if you meant to write a `str` literal, use double quotes help: if you meant to write a `str` literal, use double quotes
| |
LL | let _bar = "hello"; LL | let _bar = "hello";

View File

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

View File

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

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `extern`
| |
LL | use extern::foo; LL | use extern::foo;
| ^^^^^^ expected identifier, found keyword | ^^^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers help: you can escape reserved keywords to use them as identifiers
| |
LL | use r#extern::foo; 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 }; LL | let t = T { i: 0 };
| ^ not a struct, variant or union type | ^ not a struct, variant or union type
|
help: possible better candidate is found in another module, you can import it into scope help: possible better candidate is found in another module, you can import it into scope
| |
LL | use T; LL | use T;

View File

@ -3,6 +3,7 @@ error: expected identifier, found keyword `loop`
| |
LL | loop { break 'label: loop { break 'label 42; }; } LL | loop { break 'label: loop { break 'label 42; }; }
| ^^^^ expected identifier, found keyword | ^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers help: you can escape reserved keywords to use them as identifiers
| |
LL | loop { break 'label: r#loop { break 'label 42; }; } 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[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[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[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[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[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 \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 LL | break 22
| ^^^^^^^^ can only break with a value inside `loop` or breakable block | ^^^^^^^^ 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 help: instead, use `break` on its own without a value inside this `for` loop
| |
LL | break LL | break

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -11,6 +11,7 @@ error[E0308]: mismatched types
| |
LL | let y: usize = x.foo(); LL | let y: usize = x.foo();
| ^^^^^^^ expected usize, found isize | ^^^^^^^ expected usize, found isize
|
help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit 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(); 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(); LL | let x = 2.0.neg();
| ^^^ | ^^^
|
help: you must specify a concrete type for this numeric value, like `f32` help: you must specify a concrete type for this numeric value, like `f32`
| |
LL | let x = 2.0_f32.neg(); 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(); LL | let x = y.neg();
| ^^^ | ^^^
|
help: you must specify a type for this binding, like `f32` help: you must specify a type for this binding, like `f32`
| |
LL | let y: f32 = 2.0; 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); LL | local_bar.pow(2);
| ^^^ | ^^^
|
help: you must specify a type for this binding, like `i32` help: you must specify a type for this binding, like `i32`
| |
LL | ($ident:ident) => { let $ident: i32 = 42; } LL | ($ident:ident) => { let $ident: i32 = 42; }

View File

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

View File

@ -5,6 +5,7 @@ LL | [1, 2, 3].sort_by(|| panic!());
| ^^^^^^^ -- takes 0 arguments | ^^^^^^^ -- takes 0 arguments
| | | |
| expected closure that takes 2 arguments | expected closure that takes 2 arguments
|
help: consider changing the closure to take and ignore the expected arguments help: consider changing the closure to take and ignore the expected arguments
| |
LL | [1, 2, 3].sort_by(|_, _| panic!()); 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 | ^^^^^^^ ----------------- takes a single 2-tuple as argument
| | | |
| expected closure that takes 2 distinct arguments | expected closure that takes 2 distinct arguments
|
help: change the closure to take multiple arguments instead of a single tuple help: change the closure to take multiple arguments instead of a single tuple
| |
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!()); 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 | ^^^^^^^ ----------------------------- takes a single 2-tuple as argument
| | | |
| expected closure that takes 2 distinct arguments | expected closure that takes 2 distinct arguments
|
help: change the closure to take multiple arguments instead of a single tuple help: change the closure to take multiple arguments instead of a single tuple
| |
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!()); LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
@ -52,6 +55,7 @@ LL | f(|| panic!());
| ^ -- takes 0 arguments | ^ -- takes 0 arguments
| | | |
| expected closure that takes 1 argument | expected closure that takes 1 argument
|
help: consider changing the closure to take and ignore the expected argument help: consider changing the closure to take and ignore the expected argument
| |
LL | f(|_| panic!()); LL | f(|_| panic!());
@ -67,6 +71,7 @@ LL | f( move || panic!());
| ^ ---------- takes 0 arguments | ^ ---------- takes 0 arguments
| | | |
| expected closure that takes 1 argument | expected closure that takes 1 argument
|
help: consider changing the closure to take and ignore the expected argument help: consider changing the closure to take and ignore the expected argument
| |
LL | f( move |_| panic!()); 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 | ^^^ ------ takes 2 distinct arguments
| | | |
| expected closure that takes a single 2-tuple as argument | expected closure that takes a single 2-tuple as argument
|
help: change the closure to accept a tuple instead of individual arguments 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); 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 | ^^^ ------------- takes 2 distinct arguments
| | | |
| expected closure that takes a single 2-tuple as argument | expected closure that takes a single 2-tuple as argument
|
help: change the closure to accept a tuple instead of individual arguments 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); 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); LL | write!(hello);
| -------------- in this macro invocation | -------------- in this macro invocation
|
help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit 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()); LL | ($arr.len() * size_of($arr[0])).try_into().unwrap());

View File

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

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