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
The compiler seems to raise a ICE whenever an enum literal reference that's passed directly as a function parameter is missing or misspelled:
enumToken{LeftParen,RightParen,Plus,Minus,/* etc */}fnuse_token(token:&Token){unimplemented!()}fnmain(){// Token::LeftParens is misspelled, should be Token::LeftParen.use_token(&Token::LeftParens);}
The compiler seems to only panic when the enum is misspelled or missing, and passed directly as a function argument. The following (erroneous) code will not cause any compiler panics:
enumToken{LeftParen,RightParen,Plus,Minus,/* etc */}fnuse_token(token:&Token){unimplemented!()}fnmain(){// yields the error: type `Token` does not implement any method in scope named `LeftParens`// The compiler error is correct behavior.let token = &Token::LeftParens;use_token(token);}
Previously it also tried to find out the best way to translate the
expression, which could ICE during type-checking.
Fixes#23173Fixes#24322Fixes#25757
r? @eddyb
The compiler seems to raise a ICE whenever an enum literal reference that's passed directly as a function parameter is missing or misspelled:
Version:
The compiler seems to only panic when the enum is misspelled or missing, and passed directly as a function argument. The following (erroneous) code will not cause any compiler panics:
The text was updated successfully, but these errors were encountered: