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
Repro
It suffices to attempt compilation of the following:
Ex. 1
use std::ops::BitXor;fnf(){let x:u8 = BitXor::bitor(0asu8,0asu8);}
The above does compile if the obvious typo is fixed. I tried to find an even smaller example which failed similarly. A smaller example which does not compile if the typo is fixed, but as is, also fails with an error similar to Ex. 1:
Ex. 2
use std::ops::BitXor;fnf(){let g = BitXor::bitor;}
My build invocation was cargo build.
Expected behavior
For Ex 1., I would expect to see some sort of name resolution error. That example compiles if bitor is replaced with bitxor. For Ex. 2, I have a less certain expectation, but would still expect some sort of name resolution error.
Observed behavior
Both snippets fail to compile with the following error message:
error: internal compiler error: Type parameter `Self/SelfSpace.0` (Self/SelfSpace/0) out of range when substituting (root type=Some(Self)) substs=Substs[types=[[];[];[]], regions=[[];[];[]]]
Notes
Similar errors can be elicited with other imports (e.g. using BitOr instead of BitXor) or when the qualified identifier will definitely not be found elsewhere (e.g. referring to BitXor::nonexistent_name instead of BitXor::bitor).
The text was updated successfully, but these errors were encountered:
Hello! I'm reporting an apparent compiler error stemming from a typo.
Version
Repro
It suffices to attempt compilation of the following:
Ex. 1
The above does compile if the obvious typo is fixed. I tried to find an even smaller example which failed similarly. A smaller example which does not compile if the typo is fixed, but as is, also fails with an error similar to Ex. 1:
Ex. 2
My build invocation was
cargo build
.Expected behavior
For Ex 1., I would expect to see some sort of name resolution error. That example compiles if
bitor
is replaced withbitxor
. For Ex. 2, I have a less certain expectation, but would still expect some sort of name resolution error.Observed behavior
Both snippets fail to compile with the following error message:
Backtraces follow below.
Ex. 1
Ex. 2
Notes
Similar errors can be elicited with other imports (e.g. using
BitOr
instead ofBitXor
) or when the qualified identifier will definitely not be found elsewhere (e.g. referring toBitXor::nonexistent_name
instead ofBitXor::bitor
).The text was updated successfully, but these errors were encountered: