-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
ICE when using typeof #42060
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Obviously
typeofisn't used in the current version of Rust, but if you do try to use it you get some strange behaviour.rustccorrectly reports thattypeofis unimplemented, and the error message is sensible if used with a constant expression, but using it with local variables causes an ICE.Minimum code sample:
I'd expect this to return the same error as doing
typeof(5), which is:But instead I get this: