Closed
Description
Given the following code:
mod foo {
mod bar {
struct A;
}
}
struct Foo {
a: Vec<foo::bar:A>,
}
The current output is:
error: expected one of `,` or `>`, found `:`
[--> src/lib.rs:8:18
](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c816dd29ce8ce457fbdaa7f0eb66d2d3#) |
8 | a: Vec<foo::bar:A>,
| ^ expected one of `,` or `>`
|
help: expressions must be enclosed in braces to be used as const generic arguments
|
8 | a: Vec<{ foo::bar:A }>,
| + +
error[[E0747]](https://doc.rust-lang.org/nightly/error-index.html#E0747): constant provided when a type was expected
[--> src/lib.rs:8:10
](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c816dd29ce8ce457fbdaa7f0eb66d2d3#) |
8 | a: Vec<foo::bar:A>,
| ^^^^^^^^^^
For more information about this error, try `rustc --explain E0747`.
error: could not compile `playground` due to 2 previous errors
Ideally the output should look like:
error[[E0405]](https://doc.rust-lang.org/nightly/error-index.html#E0405): cannot find trait `A` in this scope
[--> src/lib.rs:6:14
](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c816dd29ce8ce457fbdaa7f0eb66d2d3#) |
6 | a: Vec<foo::bar:A>,
| ^ not found in this scope
|
help: you might have meant to write a path instead of an associated type bound
|
6 | a: Vec<foo::var::A>,
| ~~