about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-11-30 11:31:25 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-12-01 20:53:25 +0300
commitdb357a6e3be7b741a710a926d3ddeed79fc40482 (patch)
treea3c77e5480bc39b6605e7f69c154f0414acd0f55
parent55ba05bd0dd0d7f8e8b288e4a69fc426619bc806 (diff)
downloadrust-db357a6e3be7b741a710a926d3ddeed79fc40482.tar.gz
rust-db357a6e3be7b741a710a926d3ddeed79fc40482.zip
rustc_plugin: Remove support for adding plugins from command line
-rw-r--r--src/librustc/lint/context.rs3
-rw-r--r--src/librustc/session/config.rs2
-rw-r--r--src/librustc_interface/passes.rs10
-rw-r--r--src/librustc_interface/tests.rs4
-rw-r--r--src/librustc_plugin_impl/load.rs11
-rw-r--r--src/test/ui-fulldeps/lint-plugin-cmdline-load.rs6
-rw-r--r--src/test/ui-fulldeps/lint-plugin-cmdline-load.stderr8
7 files changed, 17 insertions, 27 deletions
diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs
index 05543f1d2ef..7f72154e42c 100644
--- a/src/librustc/lint/context.rs
+++ b/src/librustc/lint/context.rs
@@ -47,8 +47,7 @@ use rustc_error_codes::*;
 /// This is basically the subset of `Context` that we can
 /// build early in the compile pipeline.
 pub struct LintStore {
-    /// Registered lints. The bool is true if the lint was
-    /// added by a plugin.
+    /// Registered lints.
     lints: Vec<&'static Lint>,
 
     /// Constructor functions for each variety of lint pass.
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index fbfae721bbe..d2ac5436cc8 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -1364,8 +1364,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
         "enable queries of the dependency graph for regression testing"),
     no_analysis: bool = (false, parse_bool, [UNTRACKED],
         "parse and expand the source, but run no analysis"),
-    extra_plugins: Vec<String> = (Vec::new(), parse_list, [TRACKED],
-        "load extra plugins"),
     unstable_options: bool = (false, parse_bool, [UNTRACKED],
         "adds unstable command line options to rustc interface"),
     force_overflow_checks: Option<bool> = (None, parse_opt_bool, [TRACKED],
diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs
index 1d181faa09a..e752a5eab4e 100644
--- a/src/librustc_interface/passes.rs
+++ b/src/librustc_interface/passes.rs
@@ -106,8 +106,7 @@ declare_box_region_type!(
     (&mut Resolver<'_>) -> (Result<ast::Crate>, ResolverOutputs)
 );
 
-/// Runs the "early phases" of the compiler: initial `cfg` processing,
-/// loading compiler plugins (including those from `addl_plugins`),
+/// Runs the "early phases" of the compiler: initial `cfg` processing, loading compiler plugins,
 /// syntax expansion, secondary `cfg` expansion, synthesis of a test
 /// harness if one is to be provided, injection of a dependency on the
 /// standard library and prelude, and name resolution.
@@ -210,12 +209,7 @@ pub fn register_plugins<'a>(
     });
 
     let registrars = time(sess, "plugin loading", || {
-        plugin::load::load_plugins(
-            sess,
-            metadata_loader,
-            &krate,
-            Some(sess.opts.debugging_opts.extra_plugins.clone()),
-        )
+        plugin::load::load_plugins(sess, metadata_loader, &krate)
     });
 
     let mut lint_store = rustc_lint::new_lint_store(
diff --git a/src/librustc_interface/tests.rs b/src/librustc_interface/tests.rs
index d39a5d3a073..4c630b56cb4 100644
--- a/src/librustc_interface/tests.rs
+++ b/src/librustc_interface/tests.rs
@@ -651,10 +651,6 @@ fn test_debugging_options_tracking_hash() {
     assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
 
     opts = reference.clone();
-    opts.debugging_opts.extra_plugins = vec![String::from("plugin1"), String::from("plugin2")];
-    assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
-
-    opts = reference.clone();
     opts.debugging_opts.force_overflow_checks = Some(true);
     assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
 
diff --git a/src/librustc_plugin_impl/load.rs b/src/librustc_plugin_impl/load.rs
index 8150af5b2b6..6f2af6895e4 100644
--- a/src/librustc_plugin_impl/load.rs
+++ b/src/librustc_plugin_impl/load.rs
@@ -28,10 +28,8 @@ fn call_malformed_plugin_attribute(sess: &Session, span: Span) {
 /// Read plugin metadata and dynamically load registrar functions.
 pub fn load_plugins(sess: &Session,
                     metadata_loader: &dyn MetadataLoader,
-                    krate: &Crate,
-                    addl_plugins: Option<Vec<String>>) -> Vec<PluginRegistrarFn> {
+                    krate: &Crate) -> Vec<PluginRegistrarFn> {
     let mut plugins = Vec::new();
-    let mut load_plugin = |ident| load_plugin(&mut plugins, sess, metadata_loader, ident);
 
     for attr in &krate.attrs {
         if !attr.check_name(sym::plugin) {
@@ -40,16 +38,13 @@ pub fn load_plugins(sess: &Session,
 
         for plugin in attr.meta_item_list().unwrap_or_default() {
             match plugin.ident() {
-                Some(ident) if plugin.is_word() => load_plugin(ident),
+                Some(ident) if plugin.is_word() =>
+                    load_plugin(&mut plugins, sess, metadata_loader, ident),
                 _ => call_malformed_plugin_attribute(sess, plugin.span()),
             }
         }
     }
 
-    for plugin in addl_plugins.unwrap_or_default() {
-        load_plugin(Ident::from_str(&plugin));
-    }
-
     plugins
 }
 
diff --git a/src/test/ui-fulldeps/lint-plugin-cmdline-load.rs b/src/test/ui-fulldeps/lint-plugin-cmdline-load.rs
index fd681536b5b..0bd95dfbd14 100644
--- a/src/test/ui-fulldeps/lint-plugin-cmdline-load.rs
+++ b/src/test/ui-fulldeps/lint-plugin-cmdline-load.rs
@@ -1,9 +1,9 @@
-// run-pass
+// check-pass
 // aux-build:lint-plugin-test.rs
 // ignore-stage1
-// compile-flags: -Z extra-plugins=lint_plugin_test
+// compile-flags: -Z crate-attr=plugin(lint_plugin_test)
 
-#![allow(dead_code)]
+#![feature(plugin)]
 
 fn lintme() { } //~ WARNING item is named 'lintme'
 
diff --git a/src/test/ui-fulldeps/lint-plugin-cmdline-load.stderr b/src/test/ui-fulldeps/lint-plugin-cmdline-load.stderr
index 5a6b35433ac..1263a0efe62 100644
--- a/src/test/ui-fulldeps/lint-plugin-cmdline-load.stderr
+++ b/src/test/ui-fulldeps/lint-plugin-cmdline-load.stderr
@@ -1,3 +1,11 @@
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
+  --> <crate attribute>:1:1
+   |
+LL | plugin(lint_plugin_test)
+   | ^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
+   |
+   = note: `#[warn(deprecated)]` on by default
+
 warning: item is named 'lintme'
   --> $DIR/lint-plugin-cmdline-load.rs:8:1
    |