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
{{ message }}
Repository navigation
--cfg parse failures produces hard to understand errors #31496
A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: Syntactic analysis / parsing of Rust source code (to an AST) as done by `rustc_parse`C-enhancementCategory: An issue proposing an enhancement or a PR with one.
cfgspec:1:3: 1:3 error: this file contains an un-closed delimiter
cfgspec:1 a{
^
cfgspec:1:2: 1:3 help: did you mean to close this delimiter?
cfgspec:1 a{
^
It's clear that the way this is parsed is by constructing a fake source file and running it through the main parser. This is a confusing and ugly way to report these errors. Instead the errors should be converted to display in a way that makes it clear that what isn't parsing is the cfg provided on the command line. Perhaps like
error: invalid cfg spec passed on the command line: `a{`
Translating all possible parse errors to something that makes sense in a non-file context may be tricky, so this example does lose information about what the error was.
cc @nrc since you've done some parser refactoring recently.
changed the title [-]--print cfg parse failures produces hard to understand errors[/-][+]--cfg parse failures produces hard to understand errors[/+]on Feb 8, 2016
Current compiler (after fix for #31497) says (last line is new):
cfgspec:1:3: 1:3 error: this file contains an un-closed delimiter
cfgspec:1 a{
^
cfgspec:1:2: 1:3 help: did you mean to close this delimiter?
cfgspec:1 a{
^
error: invalid --cfg argument: a{
A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: Syntactic analysis / parsing of Rust source code (to an AST) as done by `rustc_parse`C-enhancementCategory: An issue proposing an enhancement or a PR with one.
Activity
[-]--print cfg parse failures produces hard to understand errors[/-][+]--cfg parse failures produces hard to understand errors[/+]birkenfeld commentedon May 1, 2016
Current compiler (after fix for #31497) says (last line is new):
Rollup merge of rust-lang#64467 - Mark-Simulacrum:hide-cfg-failures, …