Skip to content

Commit

Permalink
rustc_plugin: Some further cleanup
Browse files Browse the repository at this point in the history
Remove a useless test
  • Loading branch information
petrochenkov committed Dec 1, 2019
1 parent 2799378 commit e5944a5
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 62 deletions.
3 changes: 1 addition & 2 deletions src/librustc_interface/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use rustc_mir as mir;
use rustc_parse::{parse_crate_from_file, parse_crate_from_source_str};
use rustc_passes::{self, ast_validation, hir_stats, layout_test};
use rustc_plugin_impl as plugin;
use rustc_plugin_impl::registry::Registry;
use rustc_privacy;
use rustc_resolve::{Resolver, ResolverArenas};
use rustc_traits;
Expand Down Expand Up @@ -218,7 +217,7 @@ pub fn register_plugins<'a>(
plugin::load::load_plugins(sess, metadata_loader, &krate)
});
time(sess, "plugin registration", || {
let mut registry = Registry::new(sess, &mut lint_store, krate.span);
let mut registry = plugin::Registry { lint_store: &mut lint_store };
for registrar in registrars {
registrar(&mut registry);
}
Expand Down
16 changes: 11 additions & 5 deletions src/librustc_plugin_impl/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@

#![feature(nll)]

#![recursion_limit="256"]
use rustc::lint::LintStore;

pub use registry::Registry;

pub mod registry;
pub mod load;
pub mod build;
pub mod load;

/// Structure used to register plugins.
///
/// A plugin registrar function takes an `&mut Registry` and should call
/// methods to register its plugins.
pub struct Registry<'a> {
/// The `LintStore` allows plugins to register new lints.
pub lint_store: &'a mut LintStore,
}
2 changes: 1 addition & 1 deletion src/librustc_plugin_impl/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use rustc::middle::cstore::MetadataLoader;
use rustc::session::Session;
use rustc_metadata::locator;
use crate::registry::Registry;
use crate::Registry;

use std::borrow::ToOwned;
use std::env;
Expand Down
36 changes: 0 additions & 36 deletions src/librustc_plugin_impl/registry.rs

This file was deleted.

8 changes: 0 additions & 8 deletions src/test/ui-fulldeps/plugin-args-1.rs

This file was deleted.

8 changes: 0 additions & 8 deletions src/test/ui-fulldeps/plugin-args-1.stderr

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0498]: malformed `plugin` attribute
--> $DIR/plugin-args-2.rs:5:11
--> $DIR/plugin-args.rs:5:11
|
LL | #![plugin(empty_plugin(args))]
| ^^^^^^^^^^^^^^^^^^ malformed attribute

warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/plugin-args-2.rs:5:1
--> $DIR/plugin-args.rs:5:1
|
LL | #![plugin(empty_plugin(args))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
Expand Down

0 comments on commit e5944a5

Please sign in to comment.