mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Remove support for compiler plugins.
They've been deprecated for four years. This commit includes the following changes. - It eliminates the `rustc_plugin_impl` crate. - It changes the language used for lints in `compiler/rustc_driver_impl/src/lib.rs` and `compiler/rustc_lint/src/context.rs`. External lints are now called "loaded" lints, rather than "plugins" to avoid confusion with the old plugins. This only has a tiny effect on the output of `-W help`. - E0457 and E0498 are no longer used. - E0463 is narrowed, now only relating to unfound crates, not plugins. - The `plugin` feature was moved from "active" to "removed". - It removes the entire plugins chapter from the unstable book. - It removes quite a few tests, mostly all of those in `tests/ui-fulldeps/plugin/`. Closes #29597.
This commit is contained in:
parent
ab161d1f5d
commit
5c462a32bd
17
Cargo.lock
17
Cargo.lock
@ -3796,7 +3796,6 @@ dependencies = [
|
||||
"rustc_monomorphize",
|
||||
"rustc_parse",
|
||||
"rustc_passes",
|
||||
"rustc_plugin_impl",
|
||||
"rustc_privacy",
|
||||
"rustc_query_system",
|
||||
"rustc_resolve",
|
||||
@ -4085,7 +4084,6 @@ dependencies = [
|
||||
"rustc_monomorphize",
|
||||
"rustc_parse",
|
||||
"rustc_passes",
|
||||
"rustc_plugin_impl",
|
||||
"rustc_privacy",
|
||||
"rustc_query_impl",
|
||||
"rustc_query_system",
|
||||
@ -4395,21 +4393,6 @@ dependencies = [
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc_plugin_impl"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"libloading 0.7.4",
|
||||
"rustc_ast",
|
||||
"rustc_errors",
|
||||
"rustc_fluent_macro",
|
||||
"rustc_lint",
|
||||
"rustc_macros",
|
||||
"rustc_metadata",
|
||||
"rustc_session",
|
||||
"rustc_span",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc_privacy"
|
||||
version = "0.0.0"
|
||||
|
@ -68,7 +68,6 @@ rm -r tests/run-make/split-debuginfo # same
|
||||
rm -r tests/run-make/symbols-include-type-name # --emit=asm not supported
|
||||
rm -r tests/run-make/target-specs # i686 not supported by Cranelift
|
||||
rm -r tests/run-make/mismatching-target-triples # same
|
||||
rm -r tests/run-make/use-extern-for-plugins # same
|
||||
rm tests/ui/asm/x86_64/issue-82869.rs # vector regs in inline asm not yet supported
|
||||
rm tests/ui/asm/x86_64/issue-96797.rs # const and sym inline asm operands don't work entirely correctly
|
||||
|
||||
|
@ -39,7 +39,6 @@ rustc_mir_transform = { path = "../rustc_mir_transform" }
|
||||
rustc_monomorphize = { path = "../rustc_monomorphize" }
|
||||
rustc_parse = { path = "../rustc_parse" }
|
||||
rustc_passes = { path = "../rustc_passes" }
|
||||
rustc_plugin_impl = { path = "../rustc_plugin_impl" }
|
||||
rustc_privacy = { path = "../rustc_privacy" }
|
||||
rustc_query_system = { path = "../rustc_query_system" }
|
||||
rustc_resolve = { path = "../rustc_resolve" }
|
||||
|
@ -20,8 +20,6 @@
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
||||
pub extern crate rustc_plugin_impl as plugin;
|
||||
|
||||
use rustc_ast as ast;
|
||||
use rustc_codegen_ssa::{traits::CodegenBackend, CodegenErrors, CodegenResults};
|
||||
use rustc_data_structures::profiling::{
|
||||
@ -132,7 +130,6 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
|
||||
rustc_monomorphize::DEFAULT_LOCALE_RESOURCE,
|
||||
rustc_parse::DEFAULT_LOCALE_RESOURCE,
|
||||
rustc_passes::DEFAULT_LOCALE_RESOURCE,
|
||||
rustc_plugin_impl::DEFAULT_LOCALE_RESOURCE,
|
||||
rustc_privacy::DEFAULT_LOCALE_RESOURCE,
|
||||
rustc_query_system::DEFAULT_LOCALE_RESOURCE,
|
||||
rustc_resolve::DEFAULT_LOCALE_RESOURCE,
|
||||
@ -994,16 +991,14 @@ the command line flag directly.
|
||||
}
|
||||
|
||||
/// Write to stdout lint command options, together with a list of all available lints
|
||||
pub fn describe_lints(sess: &Session, lint_store: &LintStore, loaded_plugins: bool) {
|
||||
pub fn describe_lints(sess: &Session, lint_store: &LintStore, loaded_lints: bool) {
|
||||
safe_println!(
|
||||
"
|
||||
Available lint options:
|
||||
-W <foo> Warn about <foo>
|
||||
-A <foo> \
|
||||
Allow <foo>
|
||||
-A <foo> Allow <foo>
|
||||
-D <foo> Deny <foo>
|
||||
-F <foo> Forbid <foo> \
|
||||
(deny <foo> and all attempts to override)
|
||||
-F <foo> Forbid <foo> (deny <foo> and all attempts to override)
|
||||
|
||||
"
|
||||
);
|
||||
@ -1022,18 +1017,18 @@ Available lint options:
|
||||
lints
|
||||
}
|
||||
|
||||
let (plugin, builtin): (Vec<_>, _) =
|
||||
lint_store.get_lints().iter().cloned().partition(|&lint| lint.is_plugin);
|
||||
let plugin = sort_lints(sess, plugin);
|
||||
let (loaded, builtin): (Vec<_>, _) =
|
||||
lint_store.get_lints().iter().cloned().partition(|&lint| lint.is_loaded);
|
||||
let loaded = sort_lints(sess, loaded);
|
||||
let builtin = sort_lints(sess, builtin);
|
||||
|
||||
let (plugin_groups, builtin_groups): (Vec<_>, _) =
|
||||
let (loaded_groups, builtin_groups): (Vec<_>, _) =
|
||||
lint_store.get_lint_groups().partition(|&(.., p)| p);
|
||||
let plugin_groups = sort_lint_groups(plugin_groups);
|
||||
let loaded_groups = sort_lint_groups(loaded_groups);
|
||||
let builtin_groups = sort_lint_groups(builtin_groups);
|
||||
|
||||
let max_name_len =
|
||||
plugin.iter().chain(&builtin).map(|&s| s.name.chars().count()).max().unwrap_or(0);
|
||||
loaded.iter().chain(&builtin).map(|&s| s.name.chars().count()).max().unwrap_or(0);
|
||||
let padded = |x: &str| {
|
||||
let mut s = " ".repeat(max_name_len - x.chars().count());
|
||||
s.push_str(x);
|
||||
@ -1061,7 +1056,7 @@ Available lint options:
|
||||
|
||||
let max_name_len = max(
|
||||
"warnings".len(),
|
||||
plugin_groups
|
||||
loaded_groups
|
||||
.iter()
|
||||
.chain(&builtin_groups)
|
||||
.map(|&(s, _)| s.chars().count())
|
||||
@ -1099,20 +1094,22 @@ Available lint options:
|
||||
|
||||
print_lint_groups(builtin_groups, true);
|
||||
|
||||
match (loaded_plugins, plugin.len(), plugin_groups.len()) {
|
||||
match (loaded_lints, loaded.len(), loaded_groups.len()) {
|
||||
(false, 0, _) | (false, _, 0) => {
|
||||
safe_println!("Lint tools like Clippy can provide additional lints and lint groups.");
|
||||
safe_println!("Lint tools like Clippy can load additional lints and lint groups.");
|
||||
}
|
||||
(false, ..) => panic!("didn't load additional lints but got them anyway!"),
|
||||
(true, 0, 0) => {
|
||||
safe_println!("This crate does not load any additional lints or lint groups.")
|
||||
}
|
||||
(false, ..) => panic!("didn't load lint plugins but got them anyway!"),
|
||||
(true, 0, 0) => safe_println!("This crate does not load any lint plugins or lint groups."),
|
||||
(true, l, g) => {
|
||||
if l > 0 {
|
||||
safe_println!("Lint checks provided by plugins loaded by this crate:\n");
|
||||
print_lints(plugin);
|
||||
safe_println!("Lint checks loaded by this crate:\n");
|
||||
print_lints(loaded);
|
||||
}
|
||||
if g > 0 {
|
||||
safe_println!("Lint groups provided by plugins loaded by this crate:\n");
|
||||
print_lint_groups(plugin_groups, false);
|
||||
safe_println!("Lint groups loaded by this crate:\n");
|
||||
print_lint_groups(loaded_groups, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1129,7 +1126,7 @@ pub fn describe_flag_categories(handler: &EarlyErrorHandler, matches: &Matches)
|
||||
rustc_errors::FatalError.raise();
|
||||
}
|
||||
|
||||
// Don't handle -W help here, because we might first load plugins.
|
||||
// Don't handle -W help here, because we might first load additional lints.
|
||||
let debug_flags = matches.opt_strs("Z");
|
||||
if debug_flags.iter().any(|x| *x == "help") {
|
||||
describe_debug_flags();
|
||||
|
@ -1,3 +1,5 @@
|
||||
#### Note: this error code is no longer emitted by the compiler`
|
||||
|
||||
Plugin `..` only found in rlib format, but must be available in dylib format.
|
||||
|
||||
Erroneous code example:
|
||||
|
@ -1,16 +1,13 @@
|
||||
A plugin/crate was declared but cannot be found.
|
||||
A crate was declared but cannot be found.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0463
|
||||
#![feature(plugin)]
|
||||
#![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`
|
||||
extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`
|
||||
extern crate foo; // error: can't find crate
|
||||
```
|
||||
|
||||
You need to link your code to the relevant crate in order to be able to use it
|
||||
(through Cargo or the `-L` option of rustc example). Plugins are crates as
|
||||
well, and you link to them the same way.
|
||||
(through Cargo or the `-L` option of rustc, for example).
|
||||
|
||||
## Common causes
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
#### Note: this error code is no longer emitted by the compiler.
|
||||
|
||||
The `plugin` attribute was malformed.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0498
|
||||
```ignore (E0498 is no longer emitted)
|
||||
#![feature(plugin)]
|
||||
#![plugin(foo(args))] // error: invalid argument
|
||||
#![plugin(bar="test")] // error: invalid argument
|
||||
|
@ -417,24 +417,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||
naked_functions, experimental!(naked)
|
||||
),
|
||||
|
||||
// Plugins:
|
||||
BuiltinAttribute {
|
||||
name: sym::plugin,
|
||||
only_local: false,
|
||||
type_: CrateLevel,
|
||||
template: template!(List: "name"),
|
||||
duplicates: DuplicatesOk,
|
||||
gate: Gated(
|
||||
Stability::Deprecated(
|
||||
"https://github.com/rust-lang/rust/pull/64675",
|
||||
Some("may be removed in a future compiler version"),
|
||||
),
|
||||
sym::plugin,
|
||||
"compiler plugins are deprecated",
|
||||
cfg_fn!(plugin)
|
||||
),
|
||||
},
|
||||
|
||||
// Testing:
|
||||
gated!(
|
||||
test_runner, CrateLevel, template!(List: "path"), ErrorFollowing, custom_test_frameworks,
|
||||
|
@ -152,9 +152,12 @@ declare_features! (
|
||||
Some("removed in favor of `#![feature(marker_trait_attr)]`")),
|
||||
(removed, panic_implementation, "1.28.0", Some(44489), None,
|
||||
Some("subsumed by `#[panic_handler]`")),
|
||||
/// Allows using `#![plugin(myplugin)]`.
|
||||
(removed, plugin, "CURRENT_RUSTC_VERSION", Some(29597), None,
|
||||
Some("plugins are no longer supported")),
|
||||
/// Allows using `#[plugin_registrar]` on functions.
|
||||
(removed, plugin_registrar, "1.54.0", Some(29597), None,
|
||||
Some("a __rustc_plugin_registrar symbol must now be defined instead")),
|
||||
Some("plugins are no longer supported")),
|
||||
(removed, proc_macro_expr, "1.27.0", Some(54727), None,
|
||||
Some("subsumed by `#![feature(proc_macro_hygiene)]`")),
|
||||
(removed, proc_macro_gen, "1.27.0", Some(54727), None,
|
||||
|
@ -528,8 +528,6 @@ declare_features! (
|
||||
(unstable, object_safe_for_dispatch, "1.40.0", Some(43561), None),
|
||||
/// Allows using `#[optimize(X)]`.
|
||||
(unstable, optimize_attribute, "1.34.0", Some(54882), None),
|
||||
/// Allows using `#![plugin(myplugin)]`.
|
||||
(unstable, plugin, "1.0.0", Some(29597), None),
|
||||
/// Allows exhaustive integer pattern matching on `usize` and `isize`.
|
||||
(unstable, precise_pointer_size_matching, "1.32.0", Some(56354), None),
|
||||
/// Allows macro attributes on expressions, statements and non-inline modules.
|
||||
|
@ -36,7 +36,6 @@ rustc_mir_transform = { path = "../rustc_mir_transform" }
|
||||
rustc_monomorphize = { path = "../rustc_monomorphize" }
|
||||
rustc_parse = { path = "../rustc_parse" }
|
||||
rustc_passes = { path = "../rustc_passes" }
|
||||
rustc_plugin_impl = { path = "../rustc_plugin_impl" }
|
||||
rustc_privacy = { path = "../rustc_privacy" }
|
||||
rustc_query_impl = { path = "../rustc_query_impl" }
|
||||
rustc_query_system = { path = "../rustc_query_system" }
|
||||
|
@ -354,7 +354,7 @@ pub struct Config {
|
||||
pub hash_untracked_state: Option<Box<dyn FnOnce(&Session, &mut StableHasher) + Send>>,
|
||||
|
||||
/// This is a callback from the driver that is called when we're registering lints;
|
||||
/// it is called during plugin registration when we have the LintStore in a non-shared state.
|
||||
/// it is called during lint loading when we have the LintStore in a non-shared state.
|
||||
///
|
||||
/// Note that if you find a Some here you probably want to call that function in the new
|
||||
/// function being registered.
|
||||
|
@ -23,11 +23,10 @@ use rustc_middle::util::Providers;
|
||||
use rustc_mir_build as mir_build;
|
||||
use rustc_parse::{parse_crate_from_file, parse_crate_from_source_str, validate_attr};
|
||||
use rustc_passes::{self, abi_test, hir_stats, layout_test};
|
||||
use rustc_plugin_impl as plugin;
|
||||
use rustc_resolve::Resolver;
|
||||
use rustc_session::code_stats::VTableSizeInfo;
|
||||
use rustc_session::config::{CrateType, Input, OutFileName, OutputFilenames, OutputType};
|
||||
use rustc_session::cstore::{MetadataLoader, Untracked};
|
||||
use rustc_session::cstore::Untracked;
|
||||
use rustc_session::output::filename_for_input;
|
||||
use rustc_session::search_paths::PathKind;
|
||||
use rustc_session::{Limit, Session};
|
||||
@ -75,25 +74,12 @@ fn count_nodes(krate: &ast::Crate) -> usize {
|
||||
|
||||
pub(crate) fn create_lint_store(
|
||||
sess: &Session,
|
||||
metadata_loader: &dyn MetadataLoader,
|
||||
register_lints: Option<impl Fn(&Session, &mut LintStore)>,
|
||||
pre_configured_attrs: &[ast::Attribute],
|
||||
) -> LintStore {
|
||||
let mut lint_store = rustc_lint::new_lint_store(sess.enable_internal_lints());
|
||||
if let Some(register_lints) = register_lints {
|
||||
register_lints(sess, &mut lint_store);
|
||||
}
|
||||
|
||||
let registrars = sess.time("plugin_loading", || {
|
||||
plugin::load::load_plugins(sess, metadata_loader, pre_configured_attrs)
|
||||
});
|
||||
sess.time("plugin_registration", || {
|
||||
let mut registry = plugin::Registry { lint_store: &mut lint_store };
|
||||
for registrar in registrars {
|
||||
registrar(&mut registry);
|
||||
}
|
||||
});
|
||||
|
||||
lint_store
|
||||
}
|
||||
|
||||
|
@ -148,12 +148,8 @@ impl<'tcx> Queries<'tcx> {
|
||||
);
|
||||
let dep_graph = setup_dep_graph(sess, crate_name, stable_crate_id)?;
|
||||
|
||||
let lint_store = Lrc::new(passes::create_lint_store(
|
||||
sess,
|
||||
&*self.codegen_backend().metadata_loader(),
|
||||
self.compiler.register_lints.as_deref(),
|
||||
&pre_configured_attrs,
|
||||
));
|
||||
let lint_store =
|
||||
Lrc::new(passes::create_lint_store(sess, self.compiler.register_lints.as_deref()));
|
||||
let cstore = FreezeLock::new(Box::new(CStore::new(
|
||||
self.codegen_backend().metadata_loader(),
|
||||
stable_crate_id,
|
||||
|
@ -109,7 +109,7 @@ struct LintAlias {
|
||||
|
||||
struct LintGroup {
|
||||
lint_ids: Vec<LintId>,
|
||||
from_plugin: bool,
|
||||
is_loaded: bool,
|
||||
depr: Option<LintAlias>,
|
||||
}
|
||||
|
||||
@ -160,9 +160,7 @@ impl LintStore {
|
||||
// Don't display deprecated lint groups.
|
||||
depr.is_none()
|
||||
})
|
||||
.map(|(k, LintGroup { lint_ids, from_plugin, .. })| {
|
||||
(*k, lint_ids.clone(), *from_plugin)
|
||||
})
|
||||
.map(|(k, LintGroup { lint_ids, is_loaded, .. })| (*k, lint_ids.clone(), *is_loaded))
|
||||
}
|
||||
|
||||
pub fn register_early_pass(
|
||||
@ -221,7 +219,7 @@ impl LintStore {
|
||||
.entry(edition.lint_name())
|
||||
.or_insert(LintGroup {
|
||||
lint_ids: vec![],
|
||||
from_plugin: lint.is_plugin,
|
||||
is_loaded: lint.is_loaded,
|
||||
depr: None,
|
||||
})
|
||||
.lint_ids
|
||||
@ -234,7 +232,7 @@ impl LintStore {
|
||||
.entry("future_incompatible")
|
||||
.or_insert(LintGroup {
|
||||
lint_ids: vec![],
|
||||
from_plugin: lint.is_plugin,
|
||||
is_loaded: lint.is_loaded,
|
||||
depr: None,
|
||||
})
|
||||
.lint_ids
|
||||
@ -249,7 +247,7 @@ impl LintStore {
|
||||
alias,
|
||||
LintGroup {
|
||||
lint_ids: vec![],
|
||||
from_plugin: false,
|
||||
is_loaded: false,
|
||||
depr: Some(LintAlias { name: lint_name, silent: true }),
|
||||
},
|
||||
);
|
||||
@ -257,21 +255,21 @@ impl LintStore {
|
||||
|
||||
pub fn register_group(
|
||||
&mut self,
|
||||
from_plugin: bool,
|
||||
is_loaded: bool,
|
||||
name: &'static str,
|
||||
deprecated_name: Option<&'static str>,
|
||||
to: Vec<LintId>,
|
||||
) {
|
||||
let new = self
|
||||
.lint_groups
|
||||
.insert(name, LintGroup { lint_ids: to, from_plugin, depr: None })
|
||||
.insert(name, LintGroup { lint_ids: to, is_loaded, depr: None })
|
||||
.is_none();
|
||||
if let Some(deprecated) = deprecated_name {
|
||||
self.lint_groups.insert(
|
||||
deprecated,
|
||||
LintGroup {
|
||||
lint_ids: vec![],
|
||||
from_plugin,
|
||||
is_loaded,
|
||||
depr: Some(LintAlias { name, silent: false }),
|
||||
},
|
||||
);
|
||||
|
@ -10,7 +10,7 @@
|
||||
//! all other analyses. The `LintPass`es built into rustc are defined
|
||||
//! within [rustc_session::lint::builtin],
|
||||
//! which has further comments on how to add such a lint.
|
||||
//! rustc can also load user-defined lint plugins via the plugin mechanism.
|
||||
//! rustc can also load external lint plugins, as is done for Clippy.
|
||||
//!
|
||||
//! Some of rustc's lints are defined elsewhere in the compiler and work by
|
||||
//! calling `add_lint()` on the overall `Session` object. This works when
|
||||
|
@ -321,7 +321,7 @@ pub struct Lint {
|
||||
|
||||
pub future_incompatible: Option<FutureIncompatibleInfo>,
|
||||
|
||||
pub is_plugin: bool,
|
||||
pub is_loaded: bool,
|
||||
|
||||
/// `Some` if this lint is feature gated, otherwise `None`.
|
||||
pub feature_gate: Option<Symbol>,
|
||||
@ -399,7 +399,7 @@ impl Lint {
|
||||
default_level: Level::Forbid,
|
||||
desc: "",
|
||||
edition_lint_opts: None,
|
||||
is_plugin: false,
|
||||
is_loaded: false,
|
||||
report_in_external_macro: false,
|
||||
future_incompatible: None,
|
||||
feature_gate: None,
|
||||
@ -735,7 +735,7 @@ macro_rules! declare_lint {
|
||||
name: stringify!($NAME),
|
||||
default_level: $crate::$Level,
|
||||
desc: $desc,
|
||||
is_plugin: false,
|
||||
is_loaded: false,
|
||||
$($v: true,)*
|
||||
$(feature_gate: Some($gate),)?
|
||||
$(future_incompatible: Some($crate::FutureIncompatibleInfo {
|
||||
@ -777,7 +777,7 @@ macro_rules! declare_tool_lint {
|
||||
edition_lint_opts: None,
|
||||
report_in_external_macro: $external,
|
||||
future_incompatible: None,
|
||||
is_plugin: true,
|
||||
is_loaded: true,
|
||||
$(feature_gate: Some($gate),)?
|
||||
crate_level_only: false,
|
||||
..$crate::Lint::default_fields_for_macro()
|
||||
|
@ -196,9 +196,6 @@ metadata_newer_crate_version =
|
||||
metadata_no_crate_with_triple =
|
||||
couldn't find crate `{$crate_name}` with expected target triple {$locator_triple}{$add_info}
|
||||
|
||||
metadata_no_dylib_plugin =
|
||||
plugin `{$crate_name}` only found in rlib format, but must be available in dylib format
|
||||
|
||||
metadata_no_link_mod_override =
|
||||
overriding linking modifiers from command line is not supported
|
||||
|
||||
|
@ -682,14 +682,6 @@ impl IntoDiagnostic<'_> for CannotFindCrate {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(metadata_no_dylib_plugin, code = "E0457")]
|
||||
pub struct NoDylibPlugin {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub crate_name: Symbol,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(metadata_crate_location_unknown_type)]
|
||||
pub struct CrateLocationUnknownType<'a> {
|
||||
|
@ -220,7 +220,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::memmap::Mmap;
|
||||
use rustc_data_structures::owned_slice::slice_owned;
|
||||
use rustc_data_structures::svh::Svh;
|
||||
use rustc_errors::{DiagnosticArgValue, FatalError, IntoDiagnosticArg};
|
||||
use rustc_errors::{DiagnosticArgValue, IntoDiagnosticArg};
|
||||
use rustc_fs_util::try_canonicalize;
|
||||
use rustc_session::config;
|
||||
use rustc_session::cstore::{CrateSource, MetadataLoader};
|
||||
@ -857,46 +857,6 @@ fn get_metadata_section<'p>(
|
||||
}
|
||||
}
|
||||
|
||||
/// Look for a plugin registrar. Returns its library path and crate disambiguator.
|
||||
pub fn find_plugin_registrar(
|
||||
sess: &Session,
|
||||
metadata_loader: &dyn MetadataLoader,
|
||||
span: Span,
|
||||
name: Symbol,
|
||||
) -> PathBuf {
|
||||
find_plugin_registrar_impl(sess, metadata_loader, name).unwrap_or_else(|err| {
|
||||
// `core` is always available if we got as far as loading plugins.
|
||||
err.report(sess, span, false);
|
||||
FatalError.raise()
|
||||
})
|
||||
}
|
||||
|
||||
fn find_plugin_registrar_impl<'a>(
|
||||
sess: &'a Session,
|
||||
metadata_loader: &dyn MetadataLoader,
|
||||
name: Symbol,
|
||||
) -> Result<PathBuf, CrateError> {
|
||||
info!("find plugin registrar `{}`", name);
|
||||
let mut locator = CrateLocator::new(
|
||||
sess,
|
||||
metadata_loader,
|
||||
name,
|
||||
false, // is_rlib
|
||||
None, // hash
|
||||
None, // extra_filename
|
||||
true, // is_host
|
||||
PathKind::Crate,
|
||||
);
|
||||
|
||||
match locator.maybe_load_library_crate()? {
|
||||
Some(library) => match library.source.dylib {
|
||||
Some(dylib) => Ok(dylib.0),
|
||||
None => Err(CrateError::NonDylibPlugin(name)),
|
||||
},
|
||||
None => Err(locator.into_error(None)),
|
||||
}
|
||||
}
|
||||
|
||||
/// A diagnostic function for dumping crate metadata to an output stream.
|
||||
pub fn list_file_metadata(
|
||||
target: &Target,
|
||||
@ -964,7 +924,6 @@ pub(crate) enum CrateError {
|
||||
DlOpen(String),
|
||||
DlSym(String),
|
||||
LocatorCombined(Box<CombinedLocatorError>),
|
||||
NonDylibPlugin(Symbol),
|
||||
NotFound(Symbol),
|
||||
}
|
||||
|
||||
@ -1134,9 +1093,6 @@ impl CrateError {
|
||||
});
|
||||
}
|
||||
}
|
||||
CrateError::NonDylibPlugin(crate_name) => {
|
||||
sess.emit_err(errors::NoDylibPlugin { span, crate_name });
|
||||
}
|
||||
CrateError::NotFound(crate_name) => {
|
||||
sess.emit_err(errors::CannotFindCrate {
|
||||
span,
|
||||
|
@ -17,8 +17,7 @@ use crate::ty::TyCtxt;
|
||||
/// How a lint level was set.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, HashStable, Debug)]
|
||||
pub enum LintLevelSource {
|
||||
/// Lint is at the default level as declared
|
||||
/// in rustc or a plugin.
|
||||
/// Lint is at the default level as declared in rustc.
|
||||
Default,
|
||||
|
||||
/// Lint level was set by an attribute.
|
||||
|
@ -589,9 +589,6 @@ passes_pass_by_value =
|
||||
`pass_by_value` attribute should be applied to a struct, enum or type alias
|
||||
.label = is not a struct, enum or type alias
|
||||
|
||||
passes_plugin_registrar =
|
||||
`#[plugin_registrar]` only has an effect on functions
|
||||
|
||||
passes_proc_macro_bad_sig = {$kind} has incorrect signature
|
||||
|
||||
passes_repr_conflicting =
|
||||
|
@ -211,7 +211,6 @@ impl CheckAttrVisitor<'_> {
|
||||
sym::deprecated => self.check_deprecated(hir_id, attr, span, target),
|
||||
sym::macro_use | sym::macro_escape => self.check_macro_use(hir_id, attr, target),
|
||||
sym::path => self.check_generic_attr(hir_id, attr, target, Target::Mod),
|
||||
sym::plugin_registrar => self.check_plugin_registrar(hir_id, attr, target),
|
||||
sym::macro_export => self.check_macro_export(hir_id, attr, target),
|
||||
sym::ignore | sym::should_panic => {
|
||||
self.check_generic_attr(hir_id, attr, target, Target::Fn)
|
||||
@ -2237,17 +2236,6 @@ impl CheckAttrVisitor<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
fn check_plugin_registrar(&self, hir_id: HirId, attr: &Attribute, target: Target) {
|
||||
if target != Target::Fn {
|
||||
self.tcx.emit_spanned_lint(
|
||||
UNUSED_ATTRIBUTES,
|
||||
hir_id,
|
||||
attr.span,
|
||||
errors::PluginRegistrar,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn check_unused_attribute(&self, hir_id: HirId, attr: &Attribute) {
|
||||
// Warn on useless empty attributes.
|
||||
let note = if matches!(
|
||||
|
@ -717,10 +717,6 @@ pub enum MacroExport {
|
||||
TooManyItems,
|
||||
}
|
||||
|
||||
#[derive(LintDiagnostic)]
|
||||
#[diag(passes_plugin_registrar)]
|
||||
pub struct PluginRegistrar;
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub enum UnusedNote {
|
||||
#[note(passes_unused_empty_lints_note)]
|
||||
|
@ -1,18 +0,0 @@
|
||||
[package]
|
||||
name = "rustc_plugin_impl"
|
||||
version = "0.0.0"
|
||||
build = false
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
# tidy-alphabetical-start
|
||||
libloading = "0.7.1"
|
||||
rustc_ast = { path = "../rustc_ast" }
|
||||
rustc_errors = { path = "../rustc_errors" }
|
||||
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
|
||||
rustc_lint = { path = "../rustc_lint" }
|
||||
rustc_macros = { path = "../rustc_macros" }
|
||||
rustc_metadata = { path = "../rustc_metadata" }
|
||||
rustc_session = { path = "../rustc_session" }
|
||||
rustc_span = { path = "../rustc_span" }
|
||||
# tidy-alphabetical-end
|
@ -1,4 +0,0 @@
|
||||
plugin_impl_load_plugin_error = {$msg}
|
||||
|
||||
plugin_impl_malformed_plugin_attribute = malformed `plugin` attribute
|
||||
.label = malformed attribute
|
@ -1,20 +0,0 @@
|
||||
//! Errors emitted by plugin_impl
|
||||
|
||||
use rustc_macros::Diagnostic;
|
||||
use rustc_span::Span;
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(plugin_impl_load_plugin_error)]
|
||||
pub struct LoadPluginError {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub msg: String,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(plugin_impl_malformed_plugin_attribute, code = "E0498")]
|
||||
pub struct MalformedPluginAttribute {
|
||||
#[primary_span]
|
||||
#[label]
|
||||
pub span: Span,
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
//! Infrastructure for compiler plugins.
|
||||
//!
|
||||
//! Plugins are a deprecated way to extend the behavior of `rustc` in various ways.
|
||||
//!
|
||||
//! See the [`plugin`
|
||||
//! feature](https://doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html)
|
||||
//! of the Unstable Book for some examples.
|
||||
|
||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||
#![cfg_attr(not(bootstrap), doc(rust_logo))]
|
||||
#![cfg_attr(not(bootstrap), feature(rustdoc_internals))]
|
||||
#![cfg_attr(not(bootstrap), allow(internal_features))]
|
||||
#![recursion_limit = "256"]
|
||||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
|
||||
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_lint::LintStore;
|
||||
|
||||
mod errors;
|
||||
pub mod load;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
|
||||
/// 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,
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
//! Used by `rustc` when loading a plugin.
|
||||
|
||||
use crate::errors::{LoadPluginError, MalformedPluginAttribute};
|
||||
use crate::Registry;
|
||||
use libloading::Library;
|
||||
use rustc_ast::Attribute;
|
||||
use rustc_metadata::locator;
|
||||
use rustc_session::cstore::MetadataLoader;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::symbol::{sym, Ident};
|
||||
|
||||
use std::env;
|
||||
use std::mem;
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// Pointer to a registrar function.
|
||||
type PluginRegistrarFn = fn(&mut Registry<'_>);
|
||||
|
||||
/// Read plugin metadata and dynamically load registrar functions.
|
||||
pub fn load_plugins(
|
||||
sess: &Session,
|
||||
metadata_loader: &dyn MetadataLoader,
|
||||
attrs: &[Attribute],
|
||||
) -> Vec<PluginRegistrarFn> {
|
||||
let mut plugins = Vec::new();
|
||||
|
||||
for attr in attrs {
|
||||
if !attr.has_name(sym::plugin) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for plugin in attr.meta_item_list().unwrap_or_default() {
|
||||
match plugin.ident() {
|
||||
Some(ident) if plugin.is_word() => {
|
||||
load_plugin(&mut plugins, sess, metadata_loader, ident)
|
||||
}
|
||||
_ => {
|
||||
sess.emit_err(MalformedPluginAttribute { span: plugin.span() });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugins
|
||||
}
|
||||
|
||||
fn load_plugin(
|
||||
plugins: &mut Vec<PluginRegistrarFn>,
|
||||
sess: &Session,
|
||||
metadata_loader: &dyn MetadataLoader,
|
||||
ident: Ident,
|
||||
) {
|
||||
let lib = locator::find_plugin_registrar(sess, metadata_loader, ident.span, ident.name);
|
||||
let fun = dylink_registrar(lib).unwrap_or_else(|err| {
|
||||
// This is fatal: there are almost certainly macros we need inside this crate, so
|
||||
// continuing would spew "macro undefined" errors.
|
||||
sess.emit_fatal(LoadPluginError { span: ident.span, msg: err.to_string() });
|
||||
});
|
||||
plugins.push(fun);
|
||||
}
|
||||
|
||||
/// Dynamically link a registrar function into the compiler process.
|
||||
fn dylink_registrar(lib_path: PathBuf) -> Result<PluginRegistrarFn, libloading::Error> {
|
||||
// Make sure the path contains a / or the linker will search for it.
|
||||
let lib_path = env::current_dir().unwrap().join(&lib_path);
|
||||
|
||||
let lib = unsafe { Library::new(&lib_path) }?;
|
||||
|
||||
let registrar_sym = unsafe { lib.get::<PluginRegistrarFn>(b"__rustc_plugin_registrar") }?;
|
||||
|
||||
// Intentionally leak the dynamic library. We can't ever unload it
|
||||
// since the library can make things that will live arbitrarily long
|
||||
// (e.g., an Rc cycle or a thread).
|
||||
let registrar_sym = unsafe { registrar_sym.into_raw() };
|
||||
mem::forget(lib);
|
||||
|
||||
Ok(*registrar_sym)
|
||||
}
|
@ -8,8 +8,8 @@
|
||||
//! trait, but since the assignment operator (`=`) has no backing trait, there
|
||||
//! is no way of overloading its semantics. Additionally, this module does not
|
||||
//! provide any mechanism to create new operators. If traitless overloading or
|
||||
//! custom operators are required, you should look toward macros or compiler
|
||||
//! plugins to extend Rust's syntax.
|
||||
//! custom operators are required, you should look toward macros to extend
|
||||
//! Rust's syntax.
|
||||
//!
|
||||
//! Implementations of operator traits should be unsurprising in their
|
||||
//! respective contexts, keeping in mind their usual meanings and
|
||||
|
@ -1,4 +1,3 @@
|
||||
% The (old) Rust Compiler Plugins Guide
|
||||
|
||||
This content has moved into
|
||||
[the Unstable Book](unstable-book/language-features/plugin.html).
|
||||
Support for plugins has been removed.
|
||||
|
@ -1,114 +0,0 @@
|
||||
# `plugin`
|
||||
|
||||
The tracking issue for this feature is: [#29597]
|
||||
|
||||
[#29597]: https://github.com/rust-lang/rust/issues/29597
|
||||
|
||||
|
||||
This feature is part of "compiler plugins." It will often be used with the
|
||||
`rustc_private` feature.
|
||||
|
||||
------------------------
|
||||
|
||||
`rustc` can load compiler plugins, which are user-provided libraries that
|
||||
extend the compiler's behavior with new lint checks, etc.
|
||||
|
||||
A plugin is a dynamic library crate with a designated *registrar* function that
|
||||
registers extensions with `rustc`. Other crates can load these extensions using
|
||||
the crate attribute `#![plugin(...)]`. See the
|
||||
`rustc_driver::plugin` documentation for more about the
|
||||
mechanics of defining and loading a plugin.
|
||||
|
||||
In the vast majority of cases, a plugin should *only* be used through
|
||||
`#![plugin]` and not through an `extern crate` item. Linking a plugin would
|
||||
pull in all of librustc_ast and librustc as dependencies of your crate. This is
|
||||
generally unwanted unless you are building another plugin.
|
||||
|
||||
The usual practice is to put compiler plugins in their own crate, separate from
|
||||
any `macro_rules!` macros or ordinary Rust code meant to be used by consumers
|
||||
of a library.
|
||||
|
||||
# Lint plugins
|
||||
|
||||
Plugins can extend [Rust's lint
|
||||
infrastructure](../../reference/attributes/diagnostics.md#lint-check-attributes) with
|
||||
additional checks for code style, safety, etc. Now let's write a plugin
|
||||
[`lint-plugin-test.rs`](https://github.com/rust-lang/rust/blob/master/tests/ui-fulldeps/plugin/auxiliary/lint-plugin-test.rs)
|
||||
that warns about any item named `lintme`.
|
||||
|
||||
```rust,ignore (requires-stage-2)
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_ast;
|
||||
|
||||
// Load rustc as a plugin to get macros
|
||||
extern crate rustc_driver;
|
||||
extern crate rustc_lint;
|
||||
#[macro_use]
|
||||
extern crate rustc_session;
|
||||
|
||||
use rustc_ast::ast;
|
||||
use rustc_driver::plugin::Registry;
|
||||
use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
|
||||
|
||||
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");
|
||||
|
||||
declare_lint_pass!(Pass => [TEST_LINT]);
|
||||
|
||||
impl EarlyLintPass for Pass {
|
||||
fn check_item(&mut self, cx: &EarlyContext, it: &ast::Item) {
|
||||
if it.ident.name.as_str() == "lintme" {
|
||||
cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(reg: &mut Registry) {
|
||||
reg.lint_store.register_lints(&[&TEST_LINT]);
|
||||
reg.lint_store.register_early_pass(|| Box::new(Pass));
|
||||
}
|
||||
```
|
||||
|
||||
Then code like
|
||||
|
||||
```rust,ignore (requires-plugin)
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_plugin_test)]
|
||||
|
||||
fn lintme() { }
|
||||
```
|
||||
|
||||
will produce a compiler warning:
|
||||
|
||||
```txt
|
||||
foo.rs:4:1: 4:16 warning: item is named 'lintme', #[warn(test_lint)] on by default
|
||||
foo.rs:4 fn lintme() { }
|
||||
^~~~~~~~~~~~~~~
|
||||
```
|
||||
|
||||
The components of a lint plugin are:
|
||||
|
||||
* one or more `declare_lint!` invocations, which define static `Lint` structs;
|
||||
|
||||
* a struct holding any state needed by the lint pass (here, none);
|
||||
|
||||
* a `LintPass`
|
||||
implementation defining how to check each syntax element. A single
|
||||
`LintPass` may call `span_lint` for several different `Lint`s, but should
|
||||
register them all through the `get_lints` method.
|
||||
|
||||
Lint passes are syntax traversals, but they run at a late stage of compilation
|
||||
where type information is available. `rustc`'s [built-in
|
||||
lints](https://github.com/rust-lang/rust/blob/master/compiler/rustc_lint_defs/src/builtin.rs)
|
||||
mostly use the same infrastructure as lint plugins, and provide examples of how
|
||||
to access type information.
|
||||
|
||||
Lints defined by plugins are controlled by the usual [attributes and compiler
|
||||
flags](../../reference/attributes/diagnostics.md#lint-check-attributes), e.g.
|
||||
`#[allow(test_lint)]` or `-A test-lint`. These identifiers are derived from the
|
||||
first argument to `declare_lint!`, with appropriate case and punctuation
|
||||
conversion.
|
||||
|
||||
You can run `rustc -W help foo.rs` to see a list of lints known to `rustc`,
|
||||
including those provided by plugins loaded by `foo.rs`.
|
@ -262,24 +262,6 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||
naked_functions, experimental!(naked)
|
||||
),
|
||||
|
||||
// Plugins:
|
||||
// BuiltinAttribute {
|
||||
// name: sym::plugin,
|
||||
// only_local: false,
|
||||
// type_: CrateLevel,
|
||||
// template: template!(List: "name"),
|
||||
// duplicates: DuplicatesOk,
|
||||
// gate: Gated(
|
||||
// Stability::Deprecated(
|
||||
// "https://github.com/rust-lang/rust/pull/64675",
|
||||
// Some("may be removed in a future compiler version"),
|
||||
// ),
|
||||
// sym::plugin,
|
||||
// "compiler plugins are deprecated",
|
||||
// cfg_fn!(plugin)
|
||||
// ),
|
||||
// },
|
||||
|
||||
// Testing:
|
||||
gated!(
|
||||
test_runner, CrateLevel, template!(List: "path"), ErrorFollowing, custom_test_frameworks,
|
||||
|
@ -1,17 +0,0 @@
|
||||
include ../tools.mk
|
||||
|
||||
# ignore-freebsd
|
||||
# ignore-openbsd
|
||||
# ignore-solaris
|
||||
|
||||
HOST := $(shell $(RUSTC) -vV | grep 'host:' | sed 's/host: //')
|
||||
ifeq ($(findstring i686,$(HOST)),i686)
|
||||
TARGET := $(subst i686,x86_64,$(HOST))
|
||||
else
|
||||
TARGET := $(subst x86_64,i686,$(HOST))
|
||||
endif
|
||||
|
||||
all:
|
||||
$(RUSTC) foo.rs -C extra-filename=-host
|
||||
$(RUSTC) bar.rs -C extra-filename=-targ --target $(TARGET)
|
||||
$(RUSTC) baz.rs --extern a=$(TMPDIR)/liba-targ.rlib --target $(TARGET)
|
@ -1,9 +0,0 @@
|
||||
#![feature(no_core)]
|
||||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
#![crate_name = "a"]
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! bar {
|
||||
() => ()
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
#![feature(no_core)]
|
||||
#![no_core]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[macro_use]
|
||||
extern crate a;
|
||||
|
||||
bar!();
|
@ -1,8 +0,0 @@
|
||||
#![no_std]
|
||||
#![crate_type = "lib"]
|
||||
#![crate_name = "a"]
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! foo {
|
||||
() => ()
|
||||
}
|
@ -14,11 +14,11 @@ Lint groups provided by rustc:
|
||||
|
||||
$NAMES $SUB_LINTS
|
||||
|
||||
Lint checks provided by plugins loaded by this crate:
|
||||
Lint checks loaded by this crate:
|
||||
|
||||
$NAMES $LEVELS $MEANINGS
|
||||
|
||||
Lint groups provided by plugins loaded by this crate:
|
||||
Lint groups loaded by this crate:
|
||||
|
||||
$NAMES $SUB_LINTS
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
// force-host
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_driver;
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(_: &mut Registry) {}
|
@ -1,61 +0,0 @@
|
||||
#![feature(plugin, rustc_private)]
|
||||
#![crate_type = "dylib"]
|
||||
|
||||
extern crate rustc_ast_pretty;
|
||||
extern crate rustc_driver;
|
||||
extern crate rustc_hir;
|
||||
extern crate rustc_lint;
|
||||
#[macro_use]
|
||||
extern crate rustc_session;
|
||||
extern crate rustc_ast;
|
||||
extern crate rustc_span;
|
||||
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_driver::plugin::Registry;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::intravisit;
|
||||
use rustc_hir::Node;
|
||||
use rustc_lint::{LateContext, LateLintPass, LintContext};
|
||||
use rustc_span::def_id::LocalDefId;
|
||||
use rustc_span::Span;
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(reg: &mut Registry) {
|
||||
reg.lint_store.register_lints(&[&MISSING_ALLOWED_ATTR]);
|
||||
reg.lint_store.register_late_pass(|_| Box::new(MissingAllowedAttrPass));
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
MISSING_ALLOWED_ATTR,
|
||||
Deny,
|
||||
"Checks for missing `allowed_attr` attribute"
|
||||
}
|
||||
|
||||
declare_lint_pass!(MissingAllowedAttrPass => [MISSING_ALLOWED_ATTR]);
|
||||
|
||||
impl<'tcx> LateLintPass<'tcx> for MissingAllowedAttrPass {
|
||||
fn check_fn(
|
||||
&mut self,
|
||||
cx: &LateContext<'tcx>,
|
||||
_: intravisit::FnKind<'tcx>,
|
||||
_: &'tcx hir::FnDecl,
|
||||
_: &'tcx hir::Body,
|
||||
span: Span,
|
||||
def_id: LocalDefId,
|
||||
) {
|
||||
let id = cx.tcx.hir().local_def_id_to_hir_id(def_id);
|
||||
let item = match cx.tcx.hir().get(id) {
|
||||
Node::Item(item) => item,
|
||||
_ => cx.tcx.hir().expect_item(cx.tcx.hir().get_parent_item(id).def_id),
|
||||
};
|
||||
|
||||
let allowed = |attr| pprust::attribute_to_string(attr).contains("allowed_attr");
|
||||
if !cx.tcx.hir().attrs(item.hir_id()).iter().any(allowed) {
|
||||
cx.lint(
|
||||
MISSING_ALLOWED_ATTR,
|
||||
"Missing 'allowed_attr' attribute",
|
||||
|lint| lint.set_span(span)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
// force-host
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_driver;
|
||||
extern crate rustc_hir;
|
||||
extern crate rustc_lint;
|
||||
#[macro_use]
|
||||
extern crate rustc_session;
|
||||
extern crate rustc_ast;
|
||||
extern crate rustc_span;
|
||||
|
||||
use rustc_ast::attr;
|
||||
use rustc_driver::plugin::Registry;
|
||||
use rustc_lint::{LateContext, LateLintPass, LintContext};
|
||||
use rustc_span::def_id::CRATE_DEF_ID;
|
||||
use rustc_span::symbol::Symbol;
|
||||
|
||||
declare_lint! {
|
||||
CRATE_NOT_OKAY,
|
||||
Warn,
|
||||
"crate not marked with #![crate_okay]"
|
||||
}
|
||||
|
||||
declare_lint_pass!(Pass => [CRATE_NOT_OKAY]);
|
||||
|
||||
impl<'tcx> LateLintPass<'tcx> for Pass {
|
||||
fn check_crate(&mut self, cx: &LateContext) {
|
||||
let attrs = cx.tcx.hir().attrs(rustc_hir::CRATE_HIR_ID);
|
||||
let span = cx.tcx.def_span(CRATE_DEF_ID);
|
||||
if !attr::contains_name(attrs, Symbol::intern("crate_okay")) {
|
||||
cx.lint(CRATE_NOT_OKAY, "crate is not marked with #![crate_okay]", |lint| {
|
||||
lint.set_span(span)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(reg: &mut Registry) {
|
||||
reg.lint_store.register_lints(&[&CRATE_NOT_OKAY]);
|
||||
reg.lint_store.register_late_pass(|_| Box::new(Pass));
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
// force-host
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
// Load rustc as a plugin to get macros.
|
||||
extern crate rustc_driver;
|
||||
extern crate rustc_hir;
|
||||
extern crate rustc_lint;
|
||||
#[macro_use]
|
||||
extern crate rustc_session;
|
||||
|
||||
use rustc_driver::plugin::Registry;
|
||||
use rustc_lint::{LateContext, LateLintPass, LintContext, LintId};
|
||||
|
||||
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");
|
||||
|
||||
declare_lint!(PLEASE_LINT, Warn, "Warn about items named 'pleaselintme'");
|
||||
|
||||
declare_lint_pass!(Pass => [TEST_LINT, PLEASE_LINT]);
|
||||
|
||||
impl<'tcx> LateLintPass<'tcx> for Pass {
|
||||
fn check_item(&mut self, cx: &LateContext, it: &rustc_hir::Item) {
|
||||
match it.ident.as_str() {
|
||||
"lintme" => cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span)),
|
||||
"pleaselintme" => {
|
||||
cx.lint(PLEASE_LINT, "item is named 'pleaselintme'", |lint| lint.set_span(it.span))
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(reg: &mut Registry) {
|
||||
reg.lint_store.register_lints(&[&TEST_LINT, &PLEASE_LINT]);
|
||||
reg.lint_store.register_late_pass(|_| Box::new(Pass));
|
||||
reg.lint_store.register_group(
|
||||
true,
|
||||
"lint_me",
|
||||
None,
|
||||
vec![LintId::of(&TEST_LINT), LintId::of(&PLEASE_LINT)],
|
||||
);
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
// force-host
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_ast;
|
||||
|
||||
// Load rustc as a plugin to get macros
|
||||
extern crate rustc_driver;
|
||||
extern crate rustc_lint;
|
||||
#[macro_use]
|
||||
extern crate rustc_session;
|
||||
|
||||
use rustc_ast::ast;
|
||||
use rustc_driver::plugin::Registry;
|
||||
use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
|
||||
|
||||
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");
|
||||
|
||||
declare_lint_pass!(Pass => [TEST_LINT]);
|
||||
|
||||
impl EarlyLintPass for Pass {
|
||||
fn check_item(&mut self, cx: &EarlyContext, it: &ast::Item) {
|
||||
if it.ident.name.as_str() == "lintme" {
|
||||
cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(reg: &mut Registry) {
|
||||
reg.lint_store.register_lints(&[&TEST_LINT]);
|
||||
reg.lint_store.register_early_pass(|| Box::new(Pass));
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_ast;
|
||||
|
||||
// Load rustc as a plugin to get macros
|
||||
extern crate rustc_driver;
|
||||
extern crate rustc_lint;
|
||||
#[macro_use]
|
||||
extern crate rustc_session;
|
||||
|
||||
use rustc_ast as ast;
|
||||
use rustc_driver::plugin::Registry;
|
||||
use rustc_lint::{EarlyContext, EarlyLintPass, LintContext, LintId};
|
||||
|
||||
declare_tool_lint!(pub clippy::TEST_LINT, Warn, "Warn about stuff");
|
||||
declare_tool_lint!(
|
||||
/// Some docs
|
||||
pub clippy::TEST_GROUP,
|
||||
Warn, "Warn about other stuff"
|
||||
);
|
||||
|
||||
declare_tool_lint!(
|
||||
/// Some docs
|
||||
pub rustc::TEST_RUSTC_TOOL_LINT,
|
||||
Deny,
|
||||
"Deny internal stuff"
|
||||
);
|
||||
|
||||
declare_lint_pass!(Pass => [TEST_LINT, TEST_GROUP, TEST_RUSTC_TOOL_LINT]);
|
||||
|
||||
impl EarlyLintPass for Pass {
|
||||
fn check_item(&mut self, cx: &EarlyContext, it: &ast::Item) {
|
||||
if it.ident.name.as_str() == "lintme" {
|
||||
cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span));
|
||||
}
|
||||
if it.ident.name.as_str() == "lintmetoo" {
|
||||
cx.lint(TEST_GROUP, "item is named 'lintmetoo'", |lint| lint.set_span(it.span));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(reg: &mut Registry) {
|
||||
reg.lint_store.register_lints(&[&TEST_RUSTC_TOOL_LINT, &TEST_LINT, &TEST_GROUP]);
|
||||
reg.lint_store.register_early_pass(|| Box::new(Pass));
|
||||
reg.lint_store.register_group(
|
||||
true,
|
||||
"clippy::group",
|
||||
Some("clippy_group"),
|
||||
vec![LintId::of(&TEST_LINT), LintId::of(&TEST_GROUP)],
|
||||
);
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
// no-prefer-dynamic
|
||||
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
pub fn foo() {}
|
@ -1,11 +0,0 @@
|
||||
// force-host
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_middle;
|
||||
extern crate rustc_driver;
|
||||
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(_reg: &mut Registry) {}
|
@ -1,10 +0,0 @@
|
||||
#![crate_type = "dylib"]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_middle;
|
||||
extern crate rustc_driver;
|
||||
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(_: &mut Registry) {}
|
@ -1,10 +0,0 @@
|
||||
#![crate_type = "dylib"]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_middle;
|
||||
extern crate rustc_driver;
|
||||
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(_: &mut Registry) {}
|
@ -1,24 +0,0 @@
|
||||
// force-host
|
||||
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_middle;
|
||||
extern crate rustc_driver;
|
||||
|
||||
use std::any::Any;
|
||||
use std::cell::RefCell;
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
struct Foo {
|
||||
foo: isize
|
||||
}
|
||||
|
||||
impl Drop for Foo {
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(_: &mut Registry) {
|
||||
thread_local!(static FOO: RefCell<Option<Box<Any+Send>>> = RefCell::new(None));
|
||||
FOO.with(|s| *s.borrow_mut() = Some(Box::new(Foo { foo: 10 }) as Box<Any+Send>));
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
// no-prefer-dynamic
|
||||
|
||||
#![crate_type = "rlib"]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
extern crate rustc_middle;
|
||||
extern crate rustc_driver;
|
||||
|
||||
use rustc_driver::plugin::Registry;
|
||||
|
||||
#[no_mangle]
|
||||
fn __rustc_plugin_registrar(_: &mut Registry) {}
|
@ -1,8 +0,0 @@
|
||||
// aux-build:empty-plugin.rs
|
||||
// ignore-stage1
|
||||
|
||||
#![plugin(empty_plugin)]
|
||||
//~^ ERROR compiler plugins are deprecated
|
||||
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
|
||||
|
||||
fn main() {}
|
@ -1,20 +0,0 @@
|
||||
error[E0658]: compiler plugins are deprecated
|
||||
--> $DIR/feature-gate-plugin.rs:4:1
|
||||
|
|
||||
LL | #![plugin(empty_plugin)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #29597 <https://github.com/rust-lang/rust/issues/29597> for more information
|
||||
= help: add `#![feature(plugin)]` to the crate attributes to enable
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/feature-gate-plugin.rs:4:1
|
||||
|
|
||||
LL | #![plugin(empty_plugin)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
@ -1,8 +0,0 @@
|
||||
// aux-build:empty-plugin.rs
|
||||
// ignore-stage1
|
||||
|
||||
#![plugin(empty_plugin)]
|
||||
//~^ ERROR compiler plugins are deprecated
|
||||
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
|
||||
|
||||
fn main() {}
|
@ -1,20 +0,0 @@
|
||||
error[E0658]: compiler plugins are deprecated
|
||||
--> $DIR/gated-plugin.rs:4:1
|
||||
|
|
||||
LL | #![plugin(empty_plugin)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #29597 <https://github.com/rust-lang/rust/issues/29597> for more information
|
||||
= help: add `#![feature(plugin)]` to the crate attributes to enable
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/gated-plugin.rs:4:1
|
||||
|
|
||||
LL | #![plugin(empty_plugin)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
@ -1,9 +0,0 @@
|
||||
// aux-build:lint-for-crate.rs
|
||||
// ignore-stage1
|
||||
// compile-flags: -D crate-not-okay
|
||||
|
||||
#![feature(plugin)] //~ ERROR crate is not marked with #![crate_okay]
|
||||
#![plugin(lint_for_crate)]
|
||||
//~^ WARN use of deprecated attribute `plugin`
|
||||
|
||||
pub fn main() { }
|
@ -1,22 +0,0 @@
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/issue-15778-fail.rs:6:1
|
||||
|
|
||||
LL | #![plugin(lint_for_crate)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: crate is not marked with #![crate_okay]
|
||||
--> $DIR/issue-15778-fail.rs:5:1
|
||||
|
|
||||
LL | / #![feature(plugin)]
|
||||
LL | | #![plugin(lint_for_crate)]
|
||||
LL | |
|
||||
LL | |
|
||||
LL | | pub fn main() { }
|
||||
| |_________________^
|
||||
|
|
||||
= note: requested on the command line with `-D crate-not-okay`
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
@ -1,10 +0,0 @@
|
||||
// run-pass
|
||||
// aux-build:issue-40001-plugin.rs
|
||||
// ignore-stage1
|
||||
|
||||
#![feature(plugin, register_tool)]
|
||||
#![plugin(issue_40001_plugin)] //~ WARNING compiler plugins are deprecated
|
||||
#![register_tool(plugin)]
|
||||
|
||||
#[plugin::allowed_attr]
|
||||
fn main() {}
|
@ -1,10 +0,0 @@
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/issue-40001.rs:6:1
|
||||
|
|
||||
LL | #![plugin(issue_40001_plugin)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
@ -1,17 +0,0 @@
|
||||
// aux-build:lint-group-plugin-test.rs
|
||||
// ignore-stage1
|
||||
// compile-flags: -D lint-me
|
||||
|
||||
#![feature(plugin)]
|
||||
|
||||
#![plugin(lint_group_plugin_test)]
|
||||
//~^ WARN use of deprecated attribute `plugin`
|
||||
|
||||
fn lintme() { } //~ ERROR item is named 'lintme'
|
||||
|
||||
fn pleaselintme() { } //~ ERROR item is named 'pleaselintme'
|
||||
|
||||
pub fn main() {
|
||||
lintme();
|
||||
pleaselintme();
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-group-plugin-deny-cmdline.rs:7:1
|
||||
|
|
||||
LL | #![plugin(lint_group_plugin_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: item is named 'lintme'
|
||||
--> $DIR/lint-group-plugin-deny-cmdline.rs:10:1
|
||||
|
|
||||
LL | fn lintme() { }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D test-lint` implied by `-D lint-me`
|
||||
= help: to override `-D lint-me` add `#[allow(test_lint)]`
|
||||
|
||||
error: item is named 'pleaselintme'
|
||||
--> $DIR/lint-group-plugin-deny-cmdline.rs:12:1
|
||||
|
|
||||
LL | fn pleaselintme() { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D please-lint` implied by `-D lint-me`
|
||||
= help: to override `-D lint-me` add `#[allow(please_lint)]`
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
@ -1,17 +0,0 @@
|
||||
// run-pass
|
||||
// aux-build:lint-group-plugin-test.rs
|
||||
// ignore-stage1
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_group_plugin_test)] //~ WARNING use of deprecated attribute
|
||||
#![allow(dead_code)]
|
||||
|
||||
fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
fn pleaselintme() { } //~ WARNING item is named 'pleaselintme'
|
||||
|
||||
#[allow(lint_me)]
|
||||
pub fn main() {
|
||||
fn lintme() { }
|
||||
|
||||
fn pleaselintme() { }
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-group-plugin.rs:6:1
|
||||
|
|
||||
LL | #![plugin(lint_group_plugin_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: item is named 'lintme'
|
||||
--> $DIR/lint-group-plugin.rs:9:1
|
||||
|
|
||||
LL | fn lintme() { }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(test_lint)]` on by default
|
||||
|
||||
warning: item is named 'pleaselintme'
|
||||
--> $DIR/lint-group-plugin.rs:10:1
|
||||
|
|
||||
LL | fn pleaselintme() { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(please_lint)]` on by default
|
||||
|
||||
warning: 3 warnings emitted
|
||||
|
@ -1,12 +0,0 @@
|
||||
// check-pass
|
||||
// aux-build:lint-plugin-test.rs
|
||||
// ignore-stage1
|
||||
// compile-flags: -A test-lint
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_plugin_test)] //~ WARNING compiler plugins are deprecated
|
||||
|
||||
fn lintme() { }
|
||||
|
||||
pub fn main() {
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-plugin-cmdline-allow.rs:7:1
|
||||
|
|
||||
LL | #![plugin(lint_plugin_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
@ -1,13 +0,0 @@
|
||||
// check-pass
|
||||
// aux-build:lint-plugin-test.rs
|
||||
// ignore-stage1
|
||||
// compile-flags: -Z crate-attr=plugin(lint_plugin_test)
|
||||
|
||||
#![feature(plugin)]
|
||||
|
||||
fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
|
||||
#[allow(test_lint)]
|
||||
pub fn main() {
|
||||
fn lintme() { }
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
warning: item is named 'lintme'
|
||||
--> $DIR/lint-plugin-cmdline-load.rs:8:1
|
||||
|
|
||||
LL | fn lintme() { }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(test_lint)]` on by default
|
||||
|
||||
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: 2 warnings emitted
|
||||
|
@ -1,13 +0,0 @@
|
||||
// aux-build:lint-plugin-test.rs
|
||||
// ignore-stage1
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_plugin_test)]
|
||||
//~^ WARN use of deprecated attribute `plugin`
|
||||
#![deny(test_lint)]
|
||||
|
||||
fn lintme() { } //~ ERROR item is named 'lintme'
|
||||
|
||||
pub fn main() {
|
||||
lintme();
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
error: item is named 'lintme'
|
||||
--> $DIR/lint-plugin-deny-attr.rs:9:1
|
||||
|
|
||||
LL | fn lintme() { }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-plugin-deny-attr.rs:7:9
|
||||
|
|
||||
LL | #![deny(test_lint)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-plugin-deny-attr.rs:5:1
|
||||
|
|
||||
LL | #![plugin(lint_plugin_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
@ -1,13 +0,0 @@
|
||||
// aux-build:lint-plugin-test.rs
|
||||
// ignore-stage1
|
||||
// compile-flags: -D test-lint
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_plugin_test)]
|
||||
//~^ WARN use of deprecated attribute `plugin`
|
||||
|
||||
fn lintme() { } //~ ERROR item is named 'lintme'
|
||||
|
||||
pub fn main() {
|
||||
lintme();
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
error: item is named 'lintme'
|
||||
--> $DIR/lint-plugin-deny-cmdline.rs:9:1
|
||||
|
|
||||
LL | fn lintme() { }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: requested on the command line with `-D test-lint`
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-plugin-deny-cmdline.rs:6:1
|
||||
|
|
||||
LL | #![plugin(lint_plugin_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
@ -1,16 +0,0 @@
|
||||
// aux-build:lint-plugin-test.rs
|
||||
// ignore-stage1
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_plugin_test)]
|
||||
//~^ WARN use of deprecated attribute `plugin`
|
||||
#![forbid(test_lint)]
|
||||
|
||||
fn lintme() {} //~ ERROR item is named 'lintme'
|
||||
|
||||
#[allow(test_lint)]
|
||||
//~^ ERROR allow(test_lint) incompatible
|
||||
//~| ERROR allow(test_lint) incompatible
|
||||
pub fn main() {
|
||||
lintme();
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
error[E0453]: allow(test_lint) incompatible with previous forbid
|
||||
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
|
||||
|
|
||||
LL | #![forbid(test_lint)]
|
||||
| --------- `forbid` level set here
|
||||
...
|
||||
LL | #[allow(test_lint)]
|
||||
| ^^^^^^^^^ overruled by previous forbid
|
||||
|
||||
error: item is named 'lintme'
|
||||
--> $DIR/lint-plugin-forbid-attrs.rs:9:1
|
||||
|
|
||||
LL | fn lintme() {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-plugin-forbid-attrs.rs:7:11
|
||||
|
|
||||
LL | #![forbid(test_lint)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0453]: allow(test_lint) incompatible with previous forbid
|
||||
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
|
||||
|
|
||||
LL | #![forbid(test_lint)]
|
||||
| --------- `forbid` level set here
|
||||
...
|
||||
LL | #[allow(test_lint)]
|
||||
| ^^^^^^^^^ overruled by previous forbid
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-plugin-forbid-attrs.rs:5:1
|
||||
|
|
||||
LL | #![plugin(lint_plugin_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to 3 previous errors; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0453`.
|
@ -1,15 +0,0 @@
|
||||
// aux-build:lint-plugin-test.rs
|
||||
// ignore-stage1
|
||||
// compile-flags: -F test-lint
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_plugin_test)]
|
||||
//~^ WARN use of deprecated attribute `plugin`
|
||||
fn lintme() { } //~ ERROR item is named 'lintme'
|
||||
|
||||
#[allow(test_lint)] //~ ERROR allow(test_lint) incompatible
|
||||
//~| ERROR allow(test_lint) incompatible
|
||||
|
||||
pub fn main() {
|
||||
lintme();
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
error[E0453]: allow(test_lint) incompatible with previous forbid
|
||||
--> $DIR/lint-plugin-forbid-cmdline.rs:10:9
|
||||
|
|
||||
LL | #[allow(test_lint)]
|
||||
| ^^^^^^^^^ overruled by previous forbid
|
||||
|
|
||||
= note: `forbid` lint level was set on command line
|
||||
|
||||
error: item is named 'lintme'
|
||||
--> $DIR/lint-plugin-forbid-cmdline.rs:8:1
|
||||
|
|
||||
LL | fn lintme() { }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: requested on the command line with `-F test-lint`
|
||||
|
||||
error[E0453]: allow(test_lint) incompatible with previous forbid
|
||||
--> $DIR/lint-plugin-forbid-cmdline.rs:10:9
|
||||
|
|
||||
LL | #[allow(test_lint)]
|
||||
| ^^^^^^^^^ overruled by previous forbid
|
||||
|
|
||||
= note: `forbid` lint level was set on command line
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-plugin-forbid-cmdline.rs:6:1
|
||||
|
|
||||
LL | #![plugin(lint_plugin_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to 3 previous errors; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0453`.
|
@ -1,13 +0,0 @@
|
||||
// run-pass
|
||||
// aux-build:lint-plugin-test.rs
|
||||
// ignore-stage1
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_plugin_test)] //~ WARNING use of deprecated attribute
|
||||
#![allow(dead_code)]
|
||||
|
||||
fn lintme() { } //~ WARNING item is named 'lintme'
|
||||
|
||||
#[allow(test_lint)]
|
||||
pub fn main() {
|
||||
fn lintme() { }
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
warning: item is named 'lintme'
|
||||
--> $DIR/lint-plugin.rs:8:1
|
||||
|
|
||||
LL | fn lintme() { }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(test_lint)]` on by default
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-plugin.rs:5:1
|
||||
|
|
||||
LL | #![plugin(lint_plugin_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: 2 warnings emitted
|
||||
|
@ -1,12 +0,0 @@
|
||||
// check-pass
|
||||
// aux-build:lint-tool-test.rs
|
||||
// ignore-stage1
|
||||
// compile-flags: -A test-lint
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_tool_test)] //~ WARNING compiler plugins are deprecated
|
||||
|
||||
fn lintme() {}
|
||||
//~^ WARNING item is named 'lintme' [clippy::test_lint]
|
||||
|
||||
pub fn main() {}
|
@ -1,36 +0,0 @@
|
||||
warning: lint name `test_lint` is deprecated and may not have an effect in the future.
|
||||
|
|
||||
= help: change it to clippy::test_lint
|
||||
= note: requested on the command line with `-A test_lint`
|
||||
= note: `#[warn(renamed_and_removed_lints)]` on by default
|
||||
|
||||
warning: lint name `test_lint` is deprecated and may not have an effect in the future.
|
||||
|
|
||||
= help: change it to clippy::test_lint
|
||||
= note: requested on the command line with `-A test_lint`
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: item is named 'lintme'
|
||||
--> $DIR/lint-tool-cmdline-allow.rs:9:1
|
||||
|
|
||||
LL | fn lintme() {}
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(clippy::test_lint)]` on by default
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-tool-cmdline-allow.rs:7:1
|
||||
|
|
||||
LL | #![plugin(lint_tool_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: lint name `test_lint` is deprecated and may not have an effect in the future.
|
||||
|
|
||||
= help: change it to clippy::test_lint
|
||||
= note: requested on the command line with `-A test_lint`
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: 5 warnings emitted
|
||||
|
@ -1,36 +0,0 @@
|
||||
// aux-build:lint-tool-test.rs
|
||||
// ignore-stage1
|
||||
// compile-flags: --cfg foo
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lint_tool_test)]
|
||||
//~^ WARN use of deprecated attribute `plugin`
|
||||
#![allow(dead_code)]
|
||||
#![cfg_attr(foo, warn(test_lint))]
|
||||
//~^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future
|
||||
//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future
|
||||
//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future
|
||||
#![deny(clippy_group)]
|
||||
//~^ WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
|
||||
//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
|
||||
//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
|
||||
|
||||
fn lintme() { } //~ ERROR item is named 'lintme'
|
||||
|
||||
#[allow(clippy::group)]
|
||||
fn lintmetoo() {}
|
||||
|
||||
#[allow(clippy::test_lint)]
|
||||
pub fn main() {
|
||||
fn lintme() { }
|
||||
fn lintmetoo() { } //~ ERROR item is named 'lintmetoo'
|
||||
}
|
||||
|
||||
#[allow(test_group)]
|
||||
//~^ WARNING lint name `test_group` is deprecated and may not have an effect in the future
|
||||
//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future
|
||||
//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future
|
||||
#[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist`
|
||||
fn hello() {
|
||||
fn lintmetoo() { }
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
warning: lint name `test_lint` is deprecated and may not have an effect in the future.
|
||||
--> $DIR/lint-tool-test.rs:9:23
|
||||
|
|
||||
LL | #![cfg_attr(foo, warn(test_lint))]
|
||||
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
|
||||
|
|
||||
= note: `#[warn(renamed_and_removed_lints)]` on by default
|
||||
|
||||
warning: lint name `clippy_group` is deprecated and may not have an effect in the future.
|
||||
--> $DIR/lint-tool-test.rs:13:9
|
||||
|
|
||||
LL | #![deny(clippy_group)]
|
||||
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
|
||||
|
||||
warning: lint name `test_group` is deprecated and may not have an effect in the future.
|
||||
--> $DIR/lint-tool-test.rs:29:9
|
||||
|
|
||||
LL | #[allow(test_group)]
|
||||
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
|
||||
|
||||
warning: lint name `test_lint` is deprecated and may not have an effect in the future.
|
||||
--> $DIR/lint-tool-test.rs:9:23
|
||||
|
|
||||
LL | #![cfg_attr(foo, warn(test_lint))]
|
||||
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: lint name `clippy_group` is deprecated and may not have an effect in the future.
|
||||
--> $DIR/lint-tool-test.rs:13:9
|
||||
|
|
||||
LL | #![deny(clippy_group)]
|
||||
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: item is named 'lintme'
|
||||
--> $DIR/lint-tool-test.rs:18:1
|
||||
|
|
||||
LL | fn lintme() { }
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/lint-tool-test.rs:13:9
|
||||
|
|
||||
LL | #![deny(clippy_group)]
|
||||
| ^^^^^^^^^^^^
|
||||
= note: `#[deny(clippy::test_lint)]` implied by `#[deny(clippy::group)]`
|
||||
|
||||
error: item is named 'lintmetoo'
|
||||
--> $DIR/lint-tool-test.rs:26:5
|
||||
|
|
||||
LL | fn lintmetoo() { }
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[deny(clippy::test_group)]` implied by `#[deny(clippy::group)]`
|
||||
|
||||
warning: lint name `test_group` is deprecated and may not have an effect in the future.
|
||||
--> $DIR/lint-tool-test.rs:29:9
|
||||
|
|
||||
LL | #[allow(test_group)]
|
||||
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: unknown lint: `this_lint_does_not_exist`
|
||||
--> $DIR/lint-tool-test.rs:33:8
|
||||
|
|
||||
LL | #[deny(this_lint_does_not_exist)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[warn(unknown_lints)]` on by default
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lint-tool-test.rs:6:1
|
||||
|
|
||||
LL | #![plugin(lint_tool_test)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: lint name `test_lint` is deprecated and may not have an effect in the future.
|
||||
--> $DIR/lint-tool-test.rs:9:23
|
||||
|
|
||||
LL | #![cfg_attr(foo, warn(test_lint))]
|
||||
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: lint name `clippy_group` is deprecated and may not have an effect in the future.
|
||||
--> $DIR/lint-tool-test.rs:13:9
|
||||
|
|
||||
LL | #![deny(clippy_group)]
|
||||
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
warning: lint name `test_group` is deprecated and may not have an effect in the future.
|
||||
--> $DIR/lint-tool-test.rs:29:9
|
||||
|
|
||||
LL | #[allow(test_group)]
|
||||
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
|
||||
|
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: aborting due to 2 previous errors; 11 warnings emitted
|
||||
|
@ -1,15 +0,0 @@
|
||||
// run-pass
|
||||
// aux-build:lto-syntax-extension-lib.rs
|
||||
// aux-build:lto-syntax-extension-plugin.rs
|
||||
// compile-flags:-C lto
|
||||
// ignore-stage1
|
||||
// no-prefer-dynamic
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(lto_syntax_extension_plugin)] //~ WARNING compiler plugins are deprecated
|
||||
|
||||
extern crate lto_syntax_extension_lib;
|
||||
|
||||
fn main() {
|
||||
lto_syntax_extension_lib::foo();
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/lto-syntax-extension.rs:9:1
|
||||
|
|
||||
LL | #![plugin(lto_syntax_extension_plugin)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
@ -1,9 +0,0 @@
|
||||
// aux-build:rlib-crate-test.rs
|
||||
// ignore-stage1
|
||||
// ignore-cross-compile gives a different error message
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(rlib_crate_test)]
|
||||
//~^ ERROR: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib
|
||||
|
||||
fn main() {}
|
@ -1,9 +0,0 @@
|
||||
error[E0457]: plugin `rlib_crate_test` only found in rlib format, but must be available in dylib format
|
||||
--> $DIR/macro-crate-rlib.rs:6:11
|
||||
|
|
||||
LL | #![plugin(rlib_crate_test)]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0457`.
|
@ -1,12 +0,0 @@
|
||||
// run-pass
|
||||
// aux-build:multiple-plugins-1.rs
|
||||
// aux-build:multiple-plugins-2.rs
|
||||
// ignore-stage1
|
||||
|
||||
// Check that the plugin registrar of multiple plugins doesn't conflict
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(multiple_plugins_1)] //~ WARN use of deprecated attribute `plugin`
|
||||
#![plugin(multiple_plugins_2)] //~ WARN use of deprecated attribute `plugin`
|
||||
|
||||
fn main() {}
|
@ -1,16 +0,0 @@
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/multiple-plugins.rs:9:1
|
||||
|
|
||||
LL | #![plugin(multiple_plugins_1)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/multiple-plugins.rs:10:1
|
||||
|
|
||||
LL | #![plugin(multiple_plugins_2)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
||||
warning: 2 warnings emitted
|
||||
|
@ -1,8 +0,0 @@
|
||||
// run-pass
|
||||
// aux-build:outlive-expansion-phase.rs
|
||||
// ignore-stage1
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(outlive_expansion_phase)] //~ WARNING compiler plugins are deprecated
|
||||
|
||||
pub fn main() {}
|
@ -1,10 +0,0 @@
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/outlive-expansion-phase.rs:6:1
|
||||
|
|
||||
LL | #![plugin(outlive_expansion_phase)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
@ -1,9 +0,0 @@
|
||||
// aux-build:empty-plugin.rs
|
||||
// ignore-stage1
|
||||
|
||||
#![feature(plugin)]
|
||||
#![plugin(empty_plugin(args))]
|
||||
//~^ ERROR malformed `plugin` attribute
|
||||
//~| WARNING compiler plugins are deprecated
|
||||
|
||||
fn main() {}
|
@ -1,17 +0,0 @@
|
||||
error[E0498]: malformed `plugin` attribute
|
||||
--> $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.rs:5:1
|
||||
|
|
||||
LL | #![plugin(empty_plugin(args))]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0498`.
|
@ -1,10 +0,0 @@
|
||||
// check-pass
|
||||
// aux-build:empty-plugin.rs
|
||||
// ignore-cross-compile
|
||||
//
|
||||
// empty_plugin will not compile on a cross-compiled target because
|
||||
// librustc_ast is not compiled for it.
|
||||
|
||||
extern crate empty_plugin; // OK, plugin crates are still crates
|
||||
|
||||
fn main() {}
|
@ -1,7 +0,0 @@
|
||||
#![feature(plugin)]
|
||||
#![plugin(cookie_monster)]
|
||||
//~^ ERROR E0463
|
||||
extern crate cake_is_a_lie;
|
||||
|
||||
fn main() {
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
error[E0463]: can't find crate for `cookie_monster`
|
||||
--> $DIR/E0463.rs:2:11
|
||||
|
|
||||
LL | #![plugin(cookie_monster)]
|
||||
| ^^^^^^^^^^^^^^ can't find crate
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0463`.
|
@ -1,7 +0,0 @@
|
||||
#![deny(unused_attributes)]
|
||||
#![feature(plugin)]
|
||||
|
||||
#[plugin(bla)] //~ ERROR should be an inner attribute
|
||||
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
|
||||
|
||||
fn main() {}
|
@ -1,22 +0,0 @@
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/invalid-plugin-attr.rs:4:1
|
||||
|
|
||||
LL | #[plugin(bla)]
|
||||
| ^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
|
||||
--> $DIR/invalid-plugin-attr.rs:4:1
|
||||
|
|
||||
LL | #[plugin(bla)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/invalid-plugin-attr.rs:1:9
|
||||
|
|
||||
LL | #![deny(unused_attributes)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
@ -1,5 +0,0 @@
|
||||
#![feature(plugin)]
|
||||
#![plugin] //~ ERROR malformed `plugin` attribute
|
||||
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
|
||||
|
||||
fn main() {}
|
@ -1,16 +0,0 @@
|
||||
error: malformed `plugin` attribute input
|
||||
--> $DIR/malformed-plugin-1.rs:2:1
|
||||
|
|
||||
LL | #![plugin]
|
||||
| ^^^^^^^^^^ help: must be of the form: `#![plugin(name)]`
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/malformed-plugin-1.rs:2:1
|
||||
|
|
||||
LL | #![plugin]
|
||||
| ^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
@ -1,5 +0,0 @@
|
||||
#![feature(plugin)]
|
||||
#![plugin="bleh"] //~ ERROR malformed `plugin` attribute
|
||||
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
|
||||
|
||||
fn main() {}
|
@ -1,16 +0,0 @@
|
||||
error: malformed `plugin` attribute input
|
||||
--> $DIR/malformed-plugin-2.rs:2:1
|
||||
|
|
||||
LL | #![plugin="bleh"]
|
||||
| ^^^^^^^^^^^^^^^^^ help: must be of the form: `#![plugin(name)]`
|
||||
|
||||
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
|
||||
--> $DIR/malformed-plugin-2.rs:2:1
|
||||
|
|
||||
LL | #![plugin="bleh"]
|
||||
| ^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
|
||||
|
|
||||
= note: `#[warn(deprecated)]` on by default
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
@ -1,5 +0,0 @@
|
||||
#![feature(plugin)]
|
||||
#![plugin(foo="bleh")] //~ ERROR malformed `plugin` attribute
|
||||
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
|
||||
|
||||
fn main() {}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user