forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#94865 - notriddle:notriddle/single-colon-path…
…-not-const-generics, r=cjgillot diagnostics: single colon within `<>` probably, not type ascription Fixes rust-lang#94812
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 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
13 changes: 13 additions & 0 deletions
13
src/test/ui/generics/single-colon-path-not-const-generics.rs
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,13 @@ | ||
pub mod foo { | ||
pub mod bar { | ||
pub struct A; | ||
} | ||
} | ||
|
||
pub struct Foo { | ||
a: Vec<foo::bar:A>, | ||
//~^ ERROR expected | ||
//~| HELP path separator | ||
} | ||
|
||
fn main() {} |
11 changes: 11 additions & 0 deletions
11
src/test/ui/generics/single-colon-path-not-const-generics.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,11 @@ | ||
error: expected one of `,` or `>`, found `:` | ||
--> $DIR/single-colon-path-not-const-generics.rs:8:18 | ||
| | ||
LL | a: Vec<foo::bar:A>, | ||
| ^ | ||
| | | ||
| expected one of `,` or `>` | ||
| help: write a path separator here: `::` | ||
|
||
error: aborting due to previous error | ||
|