Skip to content

Commit 64ec762

Browse files
authored
Rollup merge of rust-lang#40239 - nagisa:death-to-plugins, r=nikomatsakis
Remove ability for plugins to register a MIR pass In recent months there have been a few different people investigating how to make a plugin that registers a MIR-pass – one that isn’t intended to be eventually merged into rustc proper. The interface to register MIR passes was added primarily for miri (& later was found to make prototyping of rustc-proper MIR passes a tiny bit faster). Since miri does not use this interface anymore it seems like a good time to remove this "feature". For prototyping purposes a similar interface can be added by developers themselves in their custom rustc build. cc @nikomatsakis
2 parents 1e61d08 + 5945d1d commit 64ec762

File tree

4 files changed

+1
-91
lines changed

4 files changed

+1
-91
lines changed

src/librustc_driver/driver.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
604604

605605
let whitelisted_legacy_custom_derives = registry.take_whitelisted_custom_derives();
606606
let Registry { syntax_exts, early_lint_passes, late_lint_passes, lint_groups,
607-
llvm_passes, attributes, mir_passes, .. } = registry;
607+
llvm_passes, attributes, .. } = registry;
608608

609609
sess.track_errors(|| {
610610
let mut ls = sess.lint_store.borrow_mut();
@@ -620,7 +620,6 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
620620
}
621621

622622
*sess.plugin_llvm_passes.borrow_mut() = llvm_passes;
623-
sess.mir_passes.borrow_mut().extend(mir_passes);
624623
*sess.plugin_attributes.borrow_mut() = attributes.clone();
625624
})?;
626625

src/librustc_plugin/registry.rs

-11
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
use rustc::lint::{EarlyLintPassObject, LateLintPassObject, LintId, Lint};
1414
use rustc::session::Session;
1515

16-
use rustc::mir::transform::MirMapPass;
17-
1816
use syntax::ext::base::{SyntaxExtension, NamedSyntaxExtension, NormalTT, IdentTT};
1917
use syntax::ext::base::MacroExpanderFn;
2018
use syntax::symbol::Symbol;
@@ -53,9 +51,6 @@ pub struct Registry<'a> {
5351
#[doc(hidden)]
5452
pub late_lint_passes: Vec<LateLintPassObject>,
5553

56-
#[doc(hidden)]
57-
pub mir_passes: Vec<Box<for<'pcx> MirMapPass<'pcx>>>,
58-
5954
#[doc(hidden)]
6055
pub lint_groups: HashMap<&'static str, Vec<LintId>>,
6156

@@ -81,7 +76,6 @@ impl<'a> Registry<'a> {
8176
lint_groups: HashMap::new(),
8277
llvm_passes: vec![],
8378
attributes: vec![],
84-
mir_passes: Vec::new(),
8579
whitelisted_custom_derives: Vec::new(),
8680
}
8781
}
@@ -157,11 +151,6 @@ impl<'a> Registry<'a> {
157151
self.lint_groups.insert(name, to.into_iter().map(|x| LintId::of(x)).collect());
158152
}
159153

160-
/// Register a MIR pass
161-
pub fn register_mir_pass(&mut self, pass: Box<for<'pcx> MirMapPass<'pcx>>) {
162-
self.mir_passes.push(pass);
163-
}
164-
165154
/// Register an LLVM pass.
166155
///
167156
/// Registration with LLVM itself is handled through static C++ objects with

src/test/run-pass-fulldeps/auxiliary/dummy_mir_pass.rs

-55
This file was deleted.

src/test/run-pass-fulldeps/mir-pass.rs

-23
This file was deleted.

0 commit comments

Comments
 (0)