mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Only require symbol name for @feature_gate
This commit is contained in:
parent
e9e6e2e444
commit
6f3ad0a40b
@ -11,7 +11,7 @@ use rustc_middle::ty::{
|
||||
self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor,
|
||||
};
|
||||
use rustc_session::{declare_lint, declare_lint_pass};
|
||||
use rustc_span::{sym, Span};
|
||||
use rustc_span::Span;
|
||||
|
||||
use crate::fluent_generated as fluent;
|
||||
use crate::{LateContext, LateLintPass};
|
||||
@ -57,7 +57,7 @@ declare_lint! {
|
||||
pub IMPL_TRAIT_OVERCAPTURES,
|
||||
Allow,
|
||||
"`impl Trait` will capture more lifetimes than possibly intended in edition 2024",
|
||||
@feature_gate = sym::precise_capturing;
|
||||
@feature_gate = precise_capturing;
|
||||
//@future_incompatible = FutureIncompatibleInfo {
|
||||
// reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
|
||||
// reference: "<FIXME>",
|
||||
@ -91,7 +91,7 @@ declare_lint! {
|
||||
pub IMPL_TRAIT_REDUNDANT_CAPTURES,
|
||||
Warn,
|
||||
"redundant precise-capturing `use<...>` syntax on an `impl Trait`",
|
||||
@feature_gate = sym::precise_capturing;
|
||||
@feature_gate = precise_capturing;
|
||||
}
|
||||
|
||||
declare_lint_pass!(
|
||||
|
@ -2,7 +2,6 @@ use crate::{LateContext, LateLintPass, LintContext};
|
||||
|
||||
use rustc_hir as hir;
|
||||
use rustc_session::{declare_lint, declare_lint_pass};
|
||||
use rustc_span::sym;
|
||||
|
||||
declare_lint! {
|
||||
/// The `multiple_supertrait_upcastable` lint detects when an object-safe trait has multiple
|
||||
@ -30,7 +29,7 @@ declare_lint! {
|
||||
pub MULTIPLE_SUPERTRAIT_UPCASTABLE,
|
||||
Allow,
|
||||
"detect when an object-safe trait has multiple supertraits",
|
||||
@feature_gate = sym::multiple_supertrait_upcastable;
|
||||
@feature_gate = multiple_supertrait_upcastable;
|
||||
}
|
||||
|
||||
declare_lint_pass!(MultipleSupertraitUpcastable => [MULTIPLE_SUPERTRAIT_UPCASTABLE]);
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
use crate::{declare_lint, declare_lint_pass, FutureIncompatibilityReason};
|
||||
use rustc_span::edition::Edition;
|
||||
use rustc_span::symbol::sym;
|
||||
|
||||
declare_lint_pass! {
|
||||
/// Does nothing as a lint pass, but registers some `Lint`s
|
||||
@ -461,7 +460,7 @@ declare_lint! {
|
||||
pub MUST_NOT_SUSPEND,
|
||||
Allow,
|
||||
"use of a `#[must_not_suspend]` value across a yield point",
|
||||
@feature_gate = rustc_span::symbol::sym::must_not_suspend;
|
||||
@feature_gate = must_not_suspend;
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
@ -1645,7 +1644,7 @@ declare_lint! {
|
||||
pub RUST_2024_INCOMPATIBLE_PAT,
|
||||
Allow,
|
||||
"detects patterns whose meaning will change in Rust 2024",
|
||||
@feature_gate = sym::ref_pat_eat_one_layer_2024;
|
||||
@feature_gate = ref_pat_eat_one_layer_2024;
|
||||
// FIXME uncomment below upon stabilization
|
||||
/*@future_incompatible = FutureIncompatibleInfo {
|
||||
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
|
||||
@ -2693,7 +2692,7 @@ declare_lint! {
|
||||
pub FUZZY_PROVENANCE_CASTS,
|
||||
Allow,
|
||||
"a fuzzy integer to pointer cast is used",
|
||||
@feature_gate = sym::strict_provenance;
|
||||
@feature_gate = strict_provenance;
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
@ -2739,7 +2738,7 @@ declare_lint! {
|
||||
pub LOSSY_PROVENANCE_CASTS,
|
||||
Allow,
|
||||
"a lossy pointer to integer cast is used",
|
||||
@feature_gate = sym::strict_provenance;
|
||||
@feature_gate = strict_provenance;
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
@ -3923,7 +3922,7 @@ declare_lint! {
|
||||
pub NON_EXHAUSTIVE_OMITTED_PATTERNS,
|
||||
Allow,
|
||||
"detect when patterns of types marked `non_exhaustive` are missed",
|
||||
@feature_gate = sym::non_exhaustive_omitted_patterns_lint;
|
||||
@feature_gate = non_exhaustive_omitted_patterns_lint;
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
@ -4043,7 +4042,7 @@ declare_lint! {
|
||||
pub TEST_UNSTABLE_LINT,
|
||||
Deny,
|
||||
"this unstable lint is only for testing",
|
||||
@feature_gate = sym::test_unstable_lint;
|
||||
@feature_gate = test_unstable_lint;
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
|
@ -865,7 +865,7 @@ macro_rules! declare_lint {
|
||||
);
|
||||
);
|
||||
($(#[$attr:meta])* $vis: vis $NAME: ident, $Level: ident, $desc: expr,
|
||||
$(@feature_gate = $gate:expr;)?
|
||||
$(@feature_gate = $gate:ident;)?
|
||||
$(@future_incompatible = FutureIncompatibleInfo {
|
||||
reason: $reason:expr,
|
||||
$($field:ident : $val:expr),* $(,)*
|
||||
@ -879,7 +879,7 @@ macro_rules! declare_lint {
|
||||
desc: $desc,
|
||||
is_externally_loaded: false,
|
||||
$($v: true,)*
|
||||
$(feature_gate: Some($gate),)?
|
||||
$(feature_gate: Some(rustc_span::symbol::sym::$gate),)?
|
||||
$(future_incompatible: Some($crate::FutureIncompatibleInfo {
|
||||
reason: $reason,
|
||||
$($field: $val,)*
|
||||
@ -895,21 +895,21 @@ macro_rules! declare_lint {
|
||||
macro_rules! declare_tool_lint {
|
||||
(
|
||||
$(#[$attr:meta])* $vis:vis $tool:ident ::$NAME:ident, $Level: ident, $desc: expr
|
||||
$(, @feature_gate = $gate:expr;)?
|
||||
$(, @feature_gate = $gate:ident;)?
|
||||
) => (
|
||||
$crate::declare_tool_lint!{$(#[$attr])* $vis $tool::$NAME, $Level, $desc, false $(, @feature_gate = $gate;)?}
|
||||
);
|
||||
(
|
||||
$(#[$attr:meta])* $vis:vis $tool:ident ::$NAME:ident, $Level:ident, $desc:expr,
|
||||
report_in_external_macro: $rep:expr
|
||||
$(, @feature_gate = $gate:expr;)?
|
||||
$(, @feature_gate = $gate:ident;)?
|
||||
) => (
|
||||
$crate::declare_tool_lint!{$(#[$attr])* $vis $tool::$NAME, $Level, $desc, $rep $(, @feature_gate = $gate;)?}
|
||||
);
|
||||
(
|
||||
$(#[$attr:meta])* $vis:vis $tool:ident ::$NAME:ident, $Level:ident, $desc:expr,
|
||||
$external:expr
|
||||
$(, @feature_gate = $gate:expr;)?
|
||||
$(, @feature_gate = $gate:ident;)?
|
||||
) => (
|
||||
$(#[$attr])*
|
||||
$vis static $NAME: &$crate::Lint = &$crate::Lint {
|
||||
@ -920,7 +920,7 @@ macro_rules! declare_tool_lint {
|
||||
report_in_external_macro: $external,
|
||||
future_incompatible: None,
|
||||
is_externally_loaded: true,
|
||||
$(feature_gate: Some($gate),)?
|
||||
$(feature_gate: Some(rustc_span::symbol::sym::$gate),)?
|
||||
crate_level_only: false,
|
||||
..$crate::Lint::default_fields_for_macro()
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ where
|
||||
macro_rules! declare_rustdoc_lint {
|
||||
(
|
||||
$(#[$attr:meta])* $name: ident, $level: ident, $descr: literal $(,)?
|
||||
$(@feature_gate = $gate:expr;)?
|
||||
$(@feature_gate = $gate:ident;)?
|
||||
) => {
|
||||
declare_tool_lint! {
|
||||
$(#[$attr])* pub rustdoc::$name, $level, $descr
|
||||
@ -128,7 +128,7 @@ declare_rustdoc_lint! {
|
||||
MISSING_DOC_CODE_EXAMPLES,
|
||||
Allow,
|
||||
"detects publicly-exported items without code samples in their documentation",
|
||||
@feature_gate = rustc_span::symbol::sym::rustdoc_missing_doc_code_examples;
|
||||
@feature_gate = rustdoc_missing_doc_code_examples;
|
||||
}
|
||||
|
||||
declare_rustdoc_lint! {
|
||||
|
Loading…
Reference in New Issue
Block a user