diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-01-02 02:21:05 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-01-13 14:17:19 +0300 |
| commit | 41c65992c52113699451a6236148d408894f89ef (patch) | |
| tree | 1b65f3b9dccc290bdc875bbd5f3e3e670f739158 /src/librustc_driver | |
| parent | 75a369c5b11459baa6bf7734eeb6135998a0a7de (diff) | |
| download | rust-41c65992c52113699451a6236148d408894f89ef.tar.gz rust-41c65992c52113699451a6236148d408894f89ef.zip | |
Implement basic input validation for built-in attributes
Diffstat (limited to 'src/librustc_driver')
| -rw-r--r-- | src/librustc_driver/driver.rs | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index bfff592a5dd..db4483ae55b 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -1070,15 +1070,6 @@ where ) }); - // Add all buffered lints from the `ParseSess` to the `Session`. - sess.parse_sess.buffered_lints.with_lock(|buffered_lints| { - info!("{} parse sess buffered_lints", buffered_lints.len()); - for BufferedEarlyLint{id, span, msg, lint_id} in buffered_lints.drain(..) { - let lint = lint::Lint::from_parser_lint_id(lint_id); - sess.buffer_lint(lint, id, span, &msg); - } - }); - // Done with macro expansion! after_expand(&krate)?; @@ -1114,6 +1105,15 @@ where ); }); + // Add all buffered lints from the `ParseSess` to the `Session`. + sess.parse_sess.buffered_lints.with_lock(|buffered_lints| { + info!("{} parse sess buffered_lints", buffered_lints.len()); + for BufferedEarlyLint{id, span, msg, lint_id} in buffered_lints.drain(..) { + let lint = lint::Lint::from_parser_lint_id(lint_id); + sess.buffer_lint(lint, id, span, &msg); + } + }); + // Lower ast -> hir. // First, we need to collect the dep_graph. let dep_graph = match future_dep_graph { @@ -1526,13 +1526,7 @@ pub fn collect_crate_types(session: &Session, attrs: &[ast::Attribute]) -> Vec<c } None } - None => { - session - .struct_span_err(a.span, "`crate_type` requires a value") - .note("for example: `#![crate_type=\"lib\"]`") - .emit(); - None - } + None => None } } else { None |
