diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-10-23 22:20:58 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-10-24 12:26:01 -0700 |
| commit | 0baf61bfdb95980c69fbfcc0fc95ce82e8d81ac9 (patch) | |
| tree | 83a1e3a9b3ce6bdf5e87d47d5a79c5e033096519 /src/test/ui/issues | |
| parent | 4a8c5b20c7772bc5342b83d4b0696ea216ef75a7 (diff) | |
| download | rust-0baf61bfdb95980c69fbfcc0fc95ce82e8d81ac9.tar.gz rust-0baf61bfdb95980c69fbfcc0fc95ce82e8d81ac9.zip | |
Increase spacing for suggestions in diagnostics
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.
Diffstat (limited to 'src/test/ui/issues')
31 files changed, 46 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-13359.stderr b/src/test/ui/issues/issue-13359.stderr index 7cfd754f72d..76c5f39fe10 100644 --- a/src/test/ui/issues/issue-13359.stderr +++ b/src/test/ui/issues/issue-13359.stderr @@ -3,6 +3,7 @@ error[E0308]: mismatched types | LL | foo(1*(1 as isize)); | ^^^^^^^^^^^^^^ expected i16, found isize + | help: you can convert an `isize` to `i16` and panic if the converted value wouldn't fit | LL | foo((1*(1 as isize)).try_into().unwrap()); @@ -13,6 +14,7 @@ error[E0308]: mismatched types | LL | bar(1*(1 as usize)); | ^^^^^^^^^^^^^^ expected u32, found usize + | help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit | LL | bar((1*(1 as usize)).try_into().unwrap()); diff --git a/src/test/ui/issues/issue-1362.stderr b/src/test/ui/issues/issue-1362.stderr index 3f4fdee50fd..7ffbbbce7a8 100644 --- a/src/test/ui/issues/issue-1362.stderr +++ b/src/test/ui/issues/issue-1362.stderr @@ -3,6 +3,7 @@ error[E0308]: mismatched types | LL | let x: u32 = 20i32; | ^^^^^ expected u32, found i32 + | help: change the type of the numeric literal from `i32` to `u32` | LL | let x: u32 = 20u32; diff --git a/src/test/ui/issues/issue-1448-2.stderr b/src/test/ui/issues/issue-1448-2.stderr index a9fabca50a6..28c561462d4 100644 --- a/src/test/ui/issues/issue-1448-2.stderr +++ b/src/test/ui/issues/issue-1448-2.stderr @@ -3,6 +3,7 @@ error[E0308]: mismatched types | LL | println!("{}", foo(10i32)); | ^^^^^ expected u32, found i32 + | help: change the type of the numeric literal from `i32` to `u32` | LL | println!("{}", foo(10u32)); diff --git a/src/test/ui/issues/issue-17546.stderr b/src/test/ui/issues/issue-17546.stderr index 291086d4f69..f3242919e01 100644 --- a/src/test/ui/issues/issue-17546.stderr +++ b/src/test/ui/issues/issue-17546.stderr @@ -3,6 +3,7 @@ error[E0573]: expected type, found variant `NoResult` | LL | fn new() -> NoResult<MyEnum, String> { | ^^^^^^^^^^^^^^^^^^^^^^^^ + | help: try using the variant's enum | LL | fn new() -> foo::MyEnum { @@ -17,6 +18,7 @@ error[E0573]: expected type, found variant `Result` | LL | fn new() -> Result<foo::MyEnum, String> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type + | help: possible better candidates are found in other modules, you can import them into scope | LL | use std::fmt::Result; @@ -34,6 +36,7 @@ error[E0573]: expected type, found variant `Result` | LL | fn new() -> Result<foo::MyEnum, String> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type + | help: possible better candidates are found in other modules, you can import them into scope | LL | use std::fmt::Result; @@ -51,6 +54,7 @@ error[E0573]: expected type, found variant `NoResult` | LL | fn newer() -> NoResult<foo::MyEnum, String> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | help: try using the variant's enum | LL | fn newer() -> foo::MyEnum { diff --git a/src/test/ui/issues/issue-22644.stderr b/src/test/ui/issues/issue-22644.stderr index 0fe167963c3..2bddcc2ba56 100644 --- a/src/test/ui/issues/issue-22644.stderr +++ b/src/test/ui/issues/issue-22644.stderr @@ -50,6 +50,7 @@ LL | < | ^ not interpreted as comparison LL | 4); | - interpreted as generic arguments + | help: try comparing the cast value | LL | println!("{}", (a @@ -64,6 +65,7 @@ LL | < | ^ not interpreted as comparison LL | 5); | - interpreted as generic arguments + | help: try comparing the cast value | LL | println!("{}", (a diff --git a/src/test/ui/issues/issue-22933-3.stderr b/src/test/ui/issues/issue-22933-3.stderr index e0e8b5e18a4..72bca3b0408 100644 --- a/src/test/ui/issues/issue-22933-3.stderr +++ b/src/test/ui/issues/issue-22933-3.stderr @@ -3,6 +3,7 @@ error[E0599]: no associated item named `MIN` found for type `u8` in the current | LL | const FOO: [u32; u8::MIN as usize] = []; | ^^^ associated item not found in `u8` + | help: you are looking for the module in `std`, not the primitive type | LL | const FOO: [u32; std::u8::MIN as usize] = []; diff --git a/src/test/ui/issues/issue-31910.stderr b/src/test/ui/issues/issue-31910.stderr index e7555b958a3..19b67ef2a72 100644 --- a/src/test/ui/issues/issue-31910.stderr +++ b/src/test/ui/issues/issue-31910.stderr @@ -3,6 +3,7 @@ error[E0308]: mismatched types | LL | X = Trait::Number, | ^^^^^^^^^^^^^ expected isize, found i32 + | help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit | LL | X = Trait::Number.try_into().unwrap(), diff --git a/src/test/ui/issues/issue-35075.stderr b/src/test/ui/issues/issue-35075.stderr index 2aeb6b15224..85acbfb8de4 100644 --- a/src/test/ui/issues/issue-35075.stderr +++ b/src/test/ui/issues/issue-35075.stderr @@ -3,6 +3,7 @@ error[E0412]: cannot find type `Foo` in this scope | LL | inner: Foo<T> | ^^^ not found in this scope + | help: there is an enum variant `Baz::Foo`; try using the variant's enum | LL | inner: Baz @@ -13,6 +14,7 @@ error[E0412]: cannot find type `Foo` in this scope | LL | Foo(Foo<T>) | ^^^ not found in this scope + | help: there is an enum variant `Baz::Foo`; try using the variant's enum | LL | Foo(Baz) diff --git a/src/test/ui/issues/issue-35675.stderr b/src/test/ui/issues/issue-35675.stderr index 91814d94963..8072141aefd 100644 --- a/src/test/ui/issues/issue-35675.stderr +++ b/src/test/ui/issues/issue-35675.stderr @@ -3,6 +3,7 @@ error[E0412]: cannot find type `Apple` in this scope | LL | fn should_return_fruit() -> Apple { | ^^^^^ not found in this scope + | help: there is an enum variant `Fruit::Apple`; try using the variant's enum | LL | fn should_return_fruit() -> Fruit { @@ -13,6 +14,7 @@ error[E0425]: cannot find function `Apple` in this scope | LL | Apple(5) | ^^^^^ not found in this scope + | help: possible candidate is found in another module, you can import it into scope | LL | use Fruit::Apple; @@ -32,6 +34,7 @@ error[E0425]: cannot find function `Apple` in this scope | LL | Apple(5) | ^^^^^ not found in this scope + | help: possible candidate is found in another module, you can import it into scope | LL | use Fruit::Apple; @@ -51,6 +54,7 @@ error[E0412]: cannot find type `Variant3` in this scope | LL | fn bar() -> Variant3 { | ^^^^^^^^ not found in this scope + | help: there is an enum variant `x::Enum::Variant3`; try using the variant's enum | LL | fn bar() -> x::Enum { diff --git a/src/test/ui/issues/issue-35976.stderr b/src/test/ui/issues/issue-35976.stderr index d12198de5e1..99b243a0777 100644 --- a/src/test/ui/issues/issue-35976.stderr +++ b/src/test/ui/issues/issue-35976.stderr @@ -3,6 +3,7 @@ error: the `wait` method cannot be invoked on a trait object | LL | arg.wait(); | ^^^^ + | help: another candidate was found in the following trait, perhaps add a `use` for it: | LL | use private::Future; diff --git a/src/test/ui/issues/issue-37534.stderr b/src/test/ui/issues/issue-37534.stderr index fadb9cdd1a3..1a05c7ab420 100644 --- a/src/test/ui/issues/issue-37534.stderr +++ b/src/test/ui/issues/issue-37534.stderr @@ -3,6 +3,7 @@ error[E0404]: expected trait, found derive macro `Hash` | LL | struct Foo<T: ?Hash> { } | ^^^^ not a trait + | help: possible better candidate is found in another module, you can import it into scope | LL | use std::hash::Hash; diff --git a/src/test/ui/issues/issue-38293.stderr b/src/test/ui/issues/issue-38293.stderr index d16d45277c0..cc3c72b496f 100644 --- a/src/test/ui/issues/issue-38293.stderr +++ b/src/test/ui/issues/issue-38293.stderr @@ -9,6 +9,7 @@ error[E0423]: expected function, found module `baz` | LL | baz(); | ^^^ not a function + | help: possible better candidate is found in another module, you can import it into scope | LL | use bar::baz; diff --git a/src/test/ui/issues/issue-41652/issue-41652.stderr b/src/test/ui/issues/issue-41652/issue-41652.stderr index 3c71536de2e..f7107d61ac3 100644 --- a/src/test/ui/issues/issue-41652/issue-41652.stderr +++ b/src/test/ui/issues/issue-41652/issue-41652.stderr @@ -3,6 +3,7 @@ error[E0689]: can't call method `f` on ambiguous numeric type `{integer}` | LL | 3.f() | ^ + | help: you must specify a concrete type for this numeric value, like `i32` | LL | 3_i32.f() diff --git a/src/test/ui/issues/issue-42944.stderr b/src/test/ui/issues/issue-42944.stderr index ba285953dbd..4ab272b9e9b 100644 --- a/src/test/ui/issues/issue-42944.stderr +++ b/src/test/ui/issues/issue-42944.stderr @@ -9,6 +9,7 @@ error[E0425]: cannot find function `B` in this scope | LL | B(()); | ^ not found in this scope + | help: possible candidate is found in another module, you can import it into scope | LL | use foo::B; diff --git a/src/test/ui/issues/issue-4366-2.stderr b/src/test/ui/issues/issue-4366-2.stderr index 63013a6523a..60a1155c614 100644 --- a/src/test/ui/issues/issue-4366-2.stderr +++ b/src/test/ui/issues/issue-4366-2.stderr @@ -3,6 +3,7 @@ error[E0412]: cannot find type `Bar` in this scope | LL | fn sub() -> Bar { 1 } | ^^^ not found in this scope + | help: possible candidate is found in another module, you can import it into scope | LL | use a::b::Bar; @@ -13,6 +14,7 @@ error[E0423]: expected function, found module `foo` | LL | foo(); | ^^^ not a function + | help: possible better candidates are found in other modules, you can import them into scope | LL | use foo::foo; diff --git a/src/test/ui/issues/issue-4366.stderr b/src/test/ui/issues/issue-4366.stderr index c59ab004557..d931d519117 100644 --- a/src/test/ui/issues/issue-4366.stderr +++ b/src/test/ui/issues/issue-4366.stderr @@ -3,6 +3,7 @@ error[E0425]: cannot find function `foo` in this scope | LL | fn sub() -> isize { foo(); 1 } | ^^^ not found in this scope + | help: possible candidates are found in other modules, you can import them into scope | LL | use foo::foo; diff --git a/src/test/ui/issues/issue-44406.stderr b/src/test/ui/issues/issue-44406.stderr index 108542c9b6f..a98d833969e 100644 --- a/src/test/ui/issues/issue-44406.stderr +++ b/src/test/ui/issues/issue-44406.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `true` | LL | foo!(true); | ^^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | foo!(r#true); diff --git a/src/test/ui/issues/issue-47377.stderr b/src/test/ui/issues/issue-47377.stderr index 7d11a8c8021..3460c1dae22 100644 --- a/src/test/ui/issues/issue-47377.stderr +++ b/src/test/ui/issues/issue-47377.stderr @@ -6,6 +6,7 @@ LL | let _a = b + ", World!"; | | | | | `+` cannot be used to concatenate two `&str` strings | &str + | help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left | LL | let _a = b.to_owned() + ", World!"; diff --git a/src/test/ui/issues/issue-47380.stderr b/src/test/ui/issues/issue-47380.stderr index 89a154c5109..f334dcbd916 100644 --- a/src/test/ui/issues/issue-47380.stderr +++ b/src/test/ui/issues/issue-47380.stderr @@ -6,6 +6,7 @@ LL | println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!"; | | | | | `+` cannot be used to concatenate two `&str` strings | &str + | help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left | LL | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!"; diff --git a/src/test/ui/issues/issue-49257.stderr b/src/test/ui/issues/issue-49257.stderr index 43a505cfe85..b9d96dc7907 100644 --- a/src/test/ui/issues/issue-49257.stderr +++ b/src/test/ui/issues/issue-49257.stderr @@ -6,6 +6,7 @@ LL | let Point { .., y, } = p; | | | | | expected `}` | `..` must be at the end and cannot have a trailing comma + | help: move the `..` to the end of the field list | LL | let Point { y, .. } = p; @@ -19,6 +20,7 @@ LL | let Point { .., y } = p; | | | | | expected `}` | `..` must be at the end and cannot have a trailing comma + | help: move the `..` to the end of the field list | LL | let Point { y , .. } = p; diff --git a/src/test/ui/issues/issue-50571.stderr b/src/test/ui/issues/issue-50571.stderr index 834635388a0..df9d10b3950 100644 --- a/src/test/ui/issues/issue-50571.stderr +++ b/src/test/ui/issues/issue-50571.stderr @@ -3,6 +3,7 @@ error[E0642]: patterns aren't allowed in methods without bodies | LL | fn foo([a, b]: [i32; 2]) {} | ^^^^^^ + | help: give this argument a name or use an underscore to ignore it | LL | fn foo(_: [i32; 2]) {} diff --git a/src/test/ui/issues/issue-50599.stderr b/src/test/ui/issues/issue-50599.stderr index 4bd74c3c785..5c8cac44438 100644 --- a/src/test/ui/issues/issue-50599.stderr +++ b/src/test/ui/issues/issue-50599.stderr @@ -3,6 +3,7 @@ error[E0425]: cannot find value `LOG10_2` in module `std::f64` | LL | const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize; | ^^^^^^^ not found in `std::f64` + | help: possible candidates are found in other modules, you can import them into scope | LL | use std::f32::consts::LOG10_2; diff --git a/src/test/ui/issues/issue-51874.stderr b/src/test/ui/issues/issue-51874.stderr index 9b1a6bf2e12..c7c4843a0fa 100644 --- a/src/test/ui/issues/issue-51874.stderr +++ b/src/test/ui/issues/issue-51874.stderr @@ -3,6 +3,7 @@ error[E0689]: can't call method `pow` on ambiguous numeric type `{float}` | LL | let a = (1.0).pow(1.0); | ^^^ + | help: you must specify a concrete type for this numeric value, like `f32` | LL | let a = (1.0_f32).pow(1.0); diff --git a/src/test/ui/issues/issue-5239-1.stderr b/src/test/ui/issues/issue-5239-1.stderr index a95014fb12d..f4f0f17d001 100644 --- a/src/test/ui/issues/issue-5239-1.stderr +++ b/src/test/ui/issues/issue-5239-1.stderr @@ -5,6 +5,7 @@ LL | let x = |ref x: isize| { x += 1; }; | -^^^^^ | | | cannot use `+=` on type `&isize` + | help: `+=` can be used on 'isize', you can dereference `x` | LL | let x = |ref x: isize| { *x += 1; }; diff --git a/src/test/ui/issues/issue-56685.stderr b/src/test/ui/issues/issue-56685.stderr index 4a461c72b24..30fedbe1653 100644 --- a/src/test/ui/issues/issue-56685.stderr +++ b/src/test/ui/issues/issue-56685.stderr @@ -19,6 +19,7 @@ error: unused variable: `x` | LL | F::A(x, y) | F::B(x, y) => { y }, | ^ ^ + | help: consider prefixing with an underscore | LL | F::A(_x, y) | F::B(_x, y) => { y }, @@ -41,6 +42,7 @@ error: unused variable: `x` | LL | let _ = if let F::A(x, y) | F::B(x, y) = F::A(1, 2) { | ^ ^ + | help: consider prefixing with an underscore | LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { @@ -51,6 +53,7 @@ error: unused variable: `x` | LL | while let F::A(x, y) | F::B(x, y) = F::A(1, 2) { | ^ ^ + | help: consider prefixing with an underscore | LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) { diff --git a/src/test/ui/issues/issue-57198.stderr b/src/test/ui/issues/issue-57198.stderr index 2ab552ccbd3..197c4cc967d 100644 --- a/src/test/ui/issues/issue-57198.stderr +++ b/src/test/ui/issues/issue-57198.stderr @@ -3,6 +3,7 @@ error: expected identifier, found keyword `for` | LL | m::for(); | ^^^ expected identifier, found keyword + | help: you can escape reserved keywords to use them as identifiers | LL | m::r#for(); diff --git a/src/test/ui/issues/issue-58857.stderr b/src/test/ui/issues/issue-58857.stderr index 56e87215a80..ab9a0130c00 100644 --- a/src/test/ui/issues/issue-58857.stderr +++ b/src/test/ui/issues/issue-58857.stderr @@ -3,6 +3,7 @@ error: negative trait bounds are not supported | LL | impl<A: !Valid> Conj<A>{} | ^^^^^^^^ negative trait bounds are not supported + | = help: remove the trait bound error: aborting due to previous error diff --git a/src/test/ui/issues/issue-59488.stderr b/src/test/ui/issues/issue-59488.stderr index e0cb1f7b96d..2397d583488 100644 --- a/src/test/ui/issues/issue-59488.stderr +++ b/src/test/ui/issues/issue-59488.stderr @@ -41,6 +41,7 @@ LL | foo > foo; | --- ^ --- fn() -> i32 {foo} | | | fn() -> i32 {foo} + | help: you might have forgotten to call this function | LL | foo() > foo; diff --git a/src/test/ui/issues/issue-62554.stderr b/src/test/ui/issues/issue-62554.stderr index 9675d540e72..87aaa036613 100644 --- a/src/test/ui/issues/issue-62554.stderr +++ b/src/test/ui/issues/issue-62554.stderr @@ -18,6 +18,7 @@ LL | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s | -- ^^^^^^^^^^^ expected `{` | | | this `if` statement has a condition, but no block + | help: try placing this code inside a block | LL | fn foo(u: u8) { if u8 { macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 { diff --git a/src/test/ui/issues/issue-64732.stderr b/src/test/ui/issues/issue-64732.stderr index fc0e8e3bdb2..3b00ffc8f6c 100644 --- a/src/test/ui/issues/issue-64732.stderr +++ b/src/test/ui/issues/issue-64732.stderr @@ -3,6 +3,7 @@ error: character literal may only contain one codepoint | LL | let _foo = b'hello\0'; | ^^^^^^^^^ + | help: if you meant to write a byte string literal, use double quotes | LL | let _foo = b"hello\0"; @@ -13,6 +14,7 @@ error: character literal may only contain one codepoint | LL | let _bar = 'hello'; | ^^^^^^^ + | help: if you meant to write a `str` literal, use double quotes | LL | let _bar = "hello"; diff --git a/src/test/ui/issues/issue-8761.stderr b/src/test/ui/issues/issue-8761.stderr index 28847c5a82a..5a657575c1d 100644 --- a/src/test/ui/issues/issue-8761.stderr +++ b/src/test/ui/issues/issue-8761.stderr @@ -3,6 +3,7 @@ error[E0308]: mismatched types | LL | A = 1i64, | ^^^^ expected isize, found i64 + | help: change the type of the numeric literal from `i64` to `isize` | LL | A = 1isize, @@ -13,6 +14,7 @@ error[E0308]: mismatched types | LL | B = 2u8 | ^^^ expected isize, found u8 + | help: change the type of the numeric literal from `u8` to `isize` | LL | B = 2isize |
