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
Add an option to emit compiler warnings when using 'rustc --parse-only' #3808
Right now, when using rustc to only parse an input file, only errors are displayed. There should be an option to also display warnings (and notes) without having to fully compile the program.
Trying again with a recent build of rustc, it appears that not even errors are displayed with rustc 0.5
--parse-only results in no analysis being performed, so only syntax errors can be emitted. When I run rustc --parse-only over a file with invalid syntax I see the error. The parser doesn't appear to contain any warnings and only one 'note' (for duplicate drop blocks in structs), but I do see that emitted.
can we get a recommendation from one of the devs as to what arguments we should use if we are checking the syntax of a file for correctness? For error and warning highlighting.
@Ghoughpteighbteau I'm guessing that since the lints use much info from the analysis passes, you still need those, so --no-analysis is not good enough.
@Hi-Angel you probably want to use cargo check, which uses rustc --emit=metadata internally. This thread is extremely old, things have changed a lot since then.
Activity
brson commentedon Oct 22, 2012
--parse-onlyresults in no analysis being performed, so only syntax errors can be emitted. When I runrustc --parse-onlyover a file with invalid syntax I see the error. The parser doesn't appear to contain any warnings and only one 'note' (for duplicatedropblocks in structs), but I do see that emitted.catamorphism commentedon Oct 25, 2012
Closing because this isn't really feasible (linting comes after many other passes that get skipped with
--parse-only.)Ghoughpteighbteau commentedon Jan 20, 2014
can we get a recommendation from one of the devs as to what arguments we should use if we are checking the syntax of a file for correctness? For error and warning highlighting.
pnkfelix commentedon Jan 21, 2014
@Ghoughpteighbteau I'm guessing that since the lints use much info from the analysis passes, you still need those, so
--no-analysisis not good enough.Thus I suspect
--no-transis the best you can do.change rustc invocation to --no-trans
change rustc invocation to --no-trans
Update/fix to rust checker.
Hi-Angel commentedon Apr 21, 2019
Neither option works for me.
jonas-schievink commentedon Apr 21, 2019
@Hi-Angel you probably want to use
cargo check, which usesrustc --emit=metadatainternally. This thread is extremely old, things have changed a lot since then.tests: add more merge_import tests for rust-lang#3808
Auto merge of rust-lang#3867 - DeSevilla:rename-fd, r=RalfJung
Merge rust-lang#3808