You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structExample{foo:usize}constEXAMPLE:Example = Example{foo:42};structOther{// worksfield:[u8;EXAMPLE.foo],}structWow<constN:usize>{field:[u8;N]}impl<constN:usize>Wow<N>{fnnew() -> Self{Self{field:[0u8;N]}}}fnmain(){// workslet x = [0u8;EXAMPLE.foo];// doesn't worklet y:Wow<EXAMPLE.foo> = Wow::new();// does workconstEXAMPLE_FOO:usize = EXAMPLE.foo;// does worklet z:Wow<EXAMPLE_FOO> = Wow::new();}
I expected to see this happen:
I expect all uses of EXAMPLE.foo to be acceptable
Instead, this happened: let y: Wow<EXAMPLE.foo> = Wow::new(); is rejected with the following error:
error: expected one of `!`, `(`, `+`, `,`, `::`, `:`, `<`, `=`, or `>`, found `.`
--> src/main.rs:29:23
|
29 | let y: Wow<EXAMPLE.foo> = Wow::new();
| - ^ expected one of 9 possible tokens
| |
| while parsing the type for `y`
error: could not compile `playground` due to previous error
Meta
This is present in the current stable (1.57.0), as well as the latest nightly (1.60.0 2022-01-10)
Backtrace
<backtrace>
The text was updated successfully, but these errors were encountered:
I tried this code:
I expected to see this happen:
I expect all uses of
EXAMPLE.foo
to be acceptableInstead, this happened:
let y: Wow<EXAMPLE.foo> = Wow::new();
is rejected with the following error:Meta
This is present in the current stable (1.57.0), as well as the latest nightly (1.60.0 2022-01-10)
Backtrace
The text was updated successfully, but these errors were encountered: