Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
60 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo` | ||
--> $DIR/E0178.rs:14:8 | ||
| | ||
14 | w: &'a Foo + Copy, | ||
| ^^^^^^^^^^^^^^ try adding parentheses: `&'a (Foo + Copy)` | ||
|
||
error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo` | ||
--> $DIR/E0178.rs:15:8 | ||
| | ||
15 | x: &'a Foo + 'a, | ||
| ^^^^^^^^^^^^ try adding parentheses: `&'a (Foo + 'a)` | ||
|
||
error[E0178]: expected a path on the left-hand side of `+`, not `&'a mut Foo` | ||
--> $DIR/E0178.rs:16:8 | ||
| | ||
16 | y: &'a mut Foo + 'a, | ||
| ^^^^^^^^^^^^^^^^ try adding parentheses: `&'a mut (Foo + 'a)` | ||
|
||
error[E0178]: expected a path on the left-hand side of `+`, not `fn() -> Foo` | ||
--> $DIR/E0178.rs:17:8 | ||
| | ||
17 | z: fn() -> Foo + 'a, | ||
| ^^^^^^^^^^^^^^^^ perhaps you forgot parentheses? | ||
|
||
error: aborting due to 4 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/test/ui/did_you_mean/trait-object-reference-without-parens-suggestion.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error[E0178]: expected a path on the left-hand side of `+`, not `&Copy` | ||
--> $DIR/trait-object-reference-without-parens-suggestion.rs:12:12 | ||
| | ||
12 | let _: &Copy + 'static; | ||
| ^^^^^^^^^^^^^^^ try adding parentheses: `&(Copy + 'static)` | ||
|
||
error[E0178]: expected a path on the left-hand side of `+`, not `&'static Copy` | ||
--> $DIR/trait-object-reference-without-parens-suggestion.rs:13:12 | ||
| | ||
13 | let _: &'static Copy + 'static; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ try adding parentheses: `&'static (Copy + 'static)` | ||
|
||
error[E0038]: the trait `std::marker::Copy` cannot be made into an object | ||
--> $DIR/trait-object-reference-without-parens-suggestion.rs:12:12 | ||
| | ||
12 | let _: &Copy + 'static; | ||
| ^^^^^ the trait `std::marker::Copy` cannot be made into an object | ||
| | ||
= note: the trait cannot require that `Self : Sized` | ||
|
||
error: aborting due to previous error | ||
|