Skip to content

Commit

Permalink
Rollup merge of rust-lang#47417 - petrochenkov:noasm, r=estebank
Browse files Browse the repository at this point in the history
Move "no asm" check into AST validation
  • Loading branch information
kennytm committed Jan 15, 2018
2 parents 63f4285 + 318cf22 commit 2dc815c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 53 deletions.
6 changes: 1 addition & 5 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use rustc_typeck as typeck;
use rustc_privacy;
use rustc_plugin::registry::Registry;
use rustc_plugin as plugin;
use rustc_passes::{self, ast_validation, no_asm, loops, consts, static_recursion, hir_stats};
use rustc_passes::{self, ast_validation, loops, consts, static_recursion, hir_stats};
use rustc_const_eval::{self, check_match};
use super::Compilation;
use ::DefaultTransCrate;
Expand Down Expand Up @@ -852,10 +852,6 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
println!("{}", json::as_json(&krate));
}

time(time_passes,
"checking for inline asm in case the target doesn't support it",
|| no_asm::check_crate(sess, &krate));

time(time_passes,
"AST validation",
|| ast_validation::check_crate(sess, &krate));
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_passes/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
ExprKind::Continue(Some(ident)) => {
self.check_label(ident.node, ident.span);
}
ExprKind::InlineAsm(..) if !self.session.target.target.options.allow_asm => {
span_err!(self.session, expr.span, E0472, "asm! is unsupported on this target");
}
_ => {}
}

Expand Down
1 change: 0 additions & 1 deletion src/librustc_passes/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ pub mod consts;
pub mod hir_stats;
pub mod loops;
mod mir_stats;
pub mod no_asm;
pub mod static_recursion;

#[cfg(not(stage0))] // remove after the next snapshot
Expand Down
47 changes: 0 additions & 47 deletions src/librustc_passes/no_asm.rs

This file was deleted.

0 comments on commit 2dc815c

Please sign in to comment.