Auto merge of #143845 - cjgillot:stability-query, r=jieyouxu

Split-up stability_index query

This PR aims to move deprecation and stability processing away from the monolithic `stability_index` query, and directly implement `lookup_{deprecation,stability,body_stability,const_stability}` queries.

The basic idea is to:
- move per-attribute sanity checks into `check_attr.rs`;
- move attribute compatibility checks into the `MissingStabilityAnnotations` visitor;
- progressively dismantle the `Annotator` visitor and the `stability_index` query.

The first commit contains functional change, and now warns when `#[automatically_derived]` is applied on a non-trait impl block. The other commits should not change visible behaviour.

Perf in https://github.com/rust-lang/rust/pull/143845#issuecomment-3066308630 shows small but consistent improvement, except for unused-warnings case. That case being a stress test, I'm leaning towards accepting the regression.

This PR changes `check_attr`, so has a high conflict rate on that file. This should not cause issues for review.
This commit is contained in:
bors
2025-07-18 16:27:59 +00:00
36 changed files with 788 additions and 947 deletions

View File

@@ -24,7 +24,7 @@ use rustc_ast::token::CommentKind;
use rustc_ast::{AttrStyle, IntTy, UintTy};
use rustc_ast_pretty::pp::Printer;
use rustc_span::hygiene::Transparency;
use rustc_span::{Span, Symbol};
use rustc_span::{ErrorGuaranteed, Span, Symbol};
pub use stability::*;
use thin_vec::ThinVec;
pub use version::*;
@@ -170,7 +170,7 @@ macro_rules! print_tup {
}
print_tup!(A B C D E F G H);
print_skip!(Span, ());
print_skip!(Span, (), ErrorGuaranteed);
print_disp!(u16, bool, NonZero<u32>);
print_debug!(Symbol, UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency);

View File

@@ -1,7 +1,7 @@
use std::num::NonZero;
use rustc_macros::{Decodable, Encodable, HashStable_Generic, PrintAttribute};
use rustc_span::{Symbol, sym};
use rustc_span::{ErrorGuaranteed, Symbol, sym};
use crate::{PrintAttribute, RustcVersion};
@@ -153,7 +153,7 @@ pub enum StableSince {
/// Stabilized in the upcoming version, whatever number that is.
Current,
/// Failed to parse a stabilization version.
Err,
Err(ErrorGuaranteed),
}
impl StabilityLevel {

View File

@@ -292,12 +292,12 @@ pub(crate) fn parse_stability<S: Stage>(
} else if let Some(version) = parse_version(since) {
StableSince::Version(version)
} else {
cx.emit_err(session_diagnostics::InvalidSince { span: cx.attr_span });
StableSince::Err
let err = cx.emit_err(session_diagnostics::InvalidSince { span: cx.attr_span });
StableSince::Err(err)
}
} else {
cx.emit_err(session_diagnostics::MissingSince { span: cx.attr_span });
StableSince::Err
let err = cx.emit_err(session_diagnostics::MissingSince { span: cx.attr_span });
StableSince::Err(err)
};
match feature {

View File

@@ -41,7 +41,7 @@ pub enum Target {
Union,
Trait,
TraitAlias,
Impl,
Impl { of_trait: bool },
Expression,
Statement,
Arm,
@@ -51,7 +51,7 @@ pub enum Target {
ForeignFn,
ForeignStatic,
ForeignTy,
GenericParam(GenericParamKind),
GenericParam { kind: GenericParamKind, has_default: bool },
MacroDef,
Param,
PatField,
@@ -86,14 +86,14 @@ impl Target {
| Target::Union
| Target::Trait
| Target::TraitAlias
| Target::Impl
| Target::Impl { .. }
| Target::Expression
| Target::Statement
| Target::Arm
| Target::ForeignFn
| Target::ForeignStatic
| Target::ForeignTy
| Target::GenericParam(_)
| Target::GenericParam { .. }
| Target::MacroDef
| Target::Param
| Target::PatField
@@ -119,7 +119,7 @@ impl Target {
ItemKind::Union(..) => Target::Union,
ItemKind::Trait(..) => Target::Trait,
ItemKind::TraitAlias(..) => Target::TraitAlias,
ItemKind::Impl { .. } => Target::Impl,
ItemKind::Impl(imp_) => Target::Impl { of_trait: imp_.of_trait.is_some() },
}
}
@@ -141,7 +141,7 @@ impl Target {
DefKind::Union => Target::Union,
DefKind::Trait => Target::Trait,
DefKind::TraitAlias => Target::TraitAlias,
DefKind::Impl { .. } => Target::Impl,
DefKind::Impl { of_trait } => Target::Impl { of_trait },
_ => panic!("impossible case reached"),
}
}
@@ -169,11 +169,17 @@ impl Target {
pub fn from_generic_param(generic_param: &hir::GenericParam<'_>) -> Target {
match generic_param.kind {
hir::GenericParamKind::Type { .. } => Target::GenericParam(GenericParamKind::Type),
hir::GenericParamKind::Type { default, .. } => Target::GenericParam {
kind: GenericParamKind::Type,
has_default: default.is_some(),
},
hir::GenericParamKind::Lifetime { .. } => {
Target::GenericParam(GenericParamKind::Lifetime)
Target::GenericParam { kind: GenericParamKind::Lifetime, has_default: false }
}
hir::GenericParamKind::Const { .. } => Target::GenericParam(GenericParamKind::Const),
hir::GenericParamKind::Const { default, .. } => Target::GenericParam {
kind: GenericParamKind::Const,
has_default: default.is_some(),
},
}
}
@@ -196,7 +202,8 @@ impl Target {
Target::Union => "union",
Target::Trait => "trait",
Target::TraitAlias => "trait alias",
Target::Impl => "implementation block",
Target::Impl { of_trait: false } => "inherent implementation block",
Target::Impl { of_trait: true } => "trait implementation block",
Target::Expression => "expression",
Target::Statement => "statement",
Target::Arm => "match arm",
@@ -210,7 +217,7 @@ impl Target {
Target::ForeignFn => "foreign function",
Target::ForeignStatic => "foreign static item",
Target::ForeignTy => "foreign type",
Target::GenericParam(kind) => match kind {
Target::GenericParam { kind, has_default: _ } => match kind {
GenericParamKind::Type => "type parameter",
GenericParamKind::Lifetime => "lifetime parameter",
GenericParamKind::Const => "const parameter",

View File

@@ -1054,18 +1054,12 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
tcx.ensure_ok().check_mod_unstable_api_usage(module);
});
},
{
sess.time("unused_lib_feature_checking", || {
rustc_passes::stability::check_unused_or_stable_features(tcx)
});
},
{
// We force these queries to run,
// since they might not otherwise get called.
// This marks the corresponding crate-level attributes
// as used, and ensures that their values are valid.
tcx.ensure_ok().limits(());
tcx.ensure_ok().stability_index(());
}
);
});

View File

@@ -7,10 +7,9 @@ use rustc_ast::NodeId;
use rustc_attr_data_structures::{
self as attrs, ConstStability, DefaultBodyStability, DeprecatedSince, Deprecation, Stability,
};
use rustc_data_structures::unord::UnordMap;
use rustc_errors::{Applicability, Diag, EmissionGuarantee};
use rustc_feature::GateIssue;
use rustc_hir::def_id::{DefId, LocalDefId, LocalDefIdMap};
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::{self as hir, HirId};
use rustc_macros::{Decodable, Encodable, HashStable, Subdiagnostic};
use rustc_session::Session;
@@ -65,48 +64,6 @@ impl DeprecationEntry {
}
}
/// A stability index, giving the stability level for items and methods.
#[derive(HashStable, Debug)]
pub struct Index {
/// This is mostly a cache, except the stabilities of local items
/// are filled by the annotator.
pub stab_map: LocalDefIdMap<Stability>,
pub const_stab_map: LocalDefIdMap<ConstStability>,
pub default_body_stab_map: LocalDefIdMap<DefaultBodyStability>,
pub depr_map: LocalDefIdMap<DeprecationEntry>,
/// Mapping from feature name to feature name based on the `implied_by` field of `#[unstable]`
/// attributes. If a `#[unstable(feature = "implier", implied_by = "impliee")]` attribute
/// exists, then this map will have a `impliee -> implier` entry.
///
/// This mapping is necessary unless both the `#[stable]` and `#[unstable]` attributes should
/// specify their implications (both `implies` and `implied_by`). If only one of the two
/// attributes do (as in the current implementation, `implied_by` in `#[unstable]`), then this
/// mapping is necessary for diagnostics. When a "unnecessary feature attribute" error is
/// reported, only the `#[stable]` attribute information is available, so the map is necessary
/// to know that the feature implies another feature. If it were reversed, and the `#[stable]`
/// attribute had an `implies` meta item, then a map would be necessary when avoiding a "use of
/// unstable feature" error for a feature that was implied.
pub implications: UnordMap<Symbol, Symbol>,
}
impl Index {
pub fn local_stability(&self, def_id: LocalDefId) -> Option<Stability> {
self.stab_map.get(&def_id).copied()
}
pub fn local_const_stability(&self, def_id: LocalDefId) -> Option<ConstStability> {
self.const_stab_map.get(&def_id).copied()
}
pub fn local_default_body_stability(&self, def_id: LocalDefId) -> Option<DefaultBodyStability> {
self.default_body_stab_map.get(&def_id).copied()
}
pub fn local_deprecation_entry(&self, def_id: LocalDefId) -> Option<DeprecationEntry> {
self.depr_map.get(&def_id).cloned()
}
}
pub fn report_unstable(
sess: &Session,
feature: Symbol,

View File

@@ -112,7 +112,7 @@ use crate::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
use crate::middle::lib_features::LibFeatures;
use crate::middle::privacy::EffectiveVisibilities;
use crate::middle::resolve_bound_vars::{ObjectLifetimeDefault, ResolveBoundVars, ResolvedArg};
use crate::middle::stability::{self, DeprecationEntry};
use crate::middle::stability::DeprecationEntry;
use crate::mir::interpret::{
EvalStaticInitializerRawResult, EvalToAllocationRawResult, EvalToConstValueResult,
EvalToValTreeResult, GlobalId, LitToConstInput,
@@ -2171,6 +2171,18 @@ rustc_queries! {
separate_provide_extern
arena_cache
}
/// Mapping from feature name to feature name based on the `implied_by` field of `#[unstable]`
/// attributes. If a `#[unstable(feature = "implier", implied_by = "impliee")]` attribute
/// exists, then this map will have a `impliee -> implier` entry.
///
/// This mapping is necessary unless both the `#[stable]` and `#[unstable]` attributes should
/// specify their implications (both `implies` and `implied_by`). If only one of the two
/// attributes do (as in the current implementation, `implied_by` in `#[unstable]`), then this
/// mapping is necessary for diagnostics. When a "unnecessary feature attribute" error is
/// reported, only the `#[stable]` attribute information is available, so the map is necessary
/// to know that the feature implies another feature. If it were reversed, and the `#[stable]`
/// attribute had an `implies` meta item, then a map would be necessary when avoiding a "use of
/// unstable feature" error for a feature that was implied.
query stability_implications(_: CrateNum) -> &'tcx UnordMap<Symbol, Symbol> {
arena_cache
desc { "calculating the implications between `#[unstable]` features defined in a crate" }
@@ -2277,11 +2289,6 @@ rustc_queries! {
desc { "fetching potentially unused trait imports" }
}
query stability_index(_: ()) -> &'tcx stability::Index {
arena_cache
eval_always
desc { "calculating the stability index for the local crate" }
}
/// All available crates in the graph, including those that should not be user-facing
/// (such as private crates).
query crates(_: ()) -> &'tcx [CrateNum] {

View File

@@ -65,7 +65,7 @@ use crate::infer::canonical::{CanonicalParamEnvCache, CanonicalVarKind, Canonica
use crate::lint::lint_level;
use crate::metadata::ModChild;
use crate::middle::codegen_fn_attrs::{CodegenFnAttrs, TargetFeature};
use crate::middle::{resolve_bound_vars, stability};
use crate::middle::resolve_bound_vars;
use crate::mir::interpret::{self, Allocation, ConstAllocation};
use crate::mir::{Body, Local, Place, PlaceElem, ProjectionKind, Promoted};
use crate::query::plumbing::QuerySystem;
@@ -1807,10 +1807,6 @@ impl<'tcx> TyCtxt<'tcx> {
)
}
pub fn stability(self) -> &'tcx stability::Index {
self.stability_index(())
}
pub fn features(self) -> &'tcx rustc_feature::Features {
self.features_query(())
}

View File

@@ -560,7 +560,8 @@ passes_only_has_effect_on =
`#[{$attr_name}]` only has an effect on {$target_name ->
[function] functions
[module] modules
[implementation_block] implementation blocks
[trait_implementation_block] trait implementation blocks
[inherent_implementation_block] inherent implementation blocks
*[unspecified] (unspecified--this is a compiler bug)
}

View File

@@ -11,11 +11,17 @@ use std::slice;
use rustc_abi::{Align, ExternAbi, Size};
use rustc_ast::{AttrStyle, LitKind, MetaItemInner, MetaItemKind, ast, join_path_syms};
use rustc_attr_data_structures::{AttributeKind, InlineAttr, ReprAttr, find_attr};
use rustc_attr_data_structures::{
AttributeKind, InlineAttr, PartialConstStability, ReprAttr, Stability, StabilityLevel,
find_attr,
};
use rustc_attr_parsing::{AttributeParser, Late};
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{Applicability, DiagCtxtHandle, IntoDiagArg, MultiSpan, StashKey};
use rustc_feature::{AttributeDuplicates, AttributeType, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute};
use rustc_feature::{
ACCEPTED_LANG_FEATURES, AttributeDuplicates, AttributeType, BUILTIN_ATTRIBUTE_MAP,
BuiltinAttribute,
};
use rustc_hir::def::DefKind;
use rustc_hir::def_id::LocalModDefId;
use rustc_hir::intravisit::{self, Visitor};
@@ -36,6 +42,7 @@ use rustc_session::lint;
use rustc_session::lint::builtin::{
CONFLICTING_REPR_HINTS, INVALID_DOC_ATTRIBUTES, INVALID_MACRO_EXPORT_ARGUMENTS,
MALFORMED_DIAGNOSTIC_ATTRIBUTES, MISPLACED_DIAGNOSTIC_ATTRIBUTES, UNUSED_ATTRIBUTES,
USELESS_DEPRECATED,
};
use rustc_session::parse::feature_err;
use rustc_span::edition::Edition;
@@ -161,12 +168,18 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
sym::automatically_derived,
*attr_span,
target,
Target::Impl,
Target::Impl { of_trait: true },
),
Attribute::Parsed(
AttributeKind::Stability { span, .. }
| AttributeKind::ConstStability { span, .. },
) => self.check_stability_promotable(*span, target),
AttributeKind::Stability {
span: attr_span,
stability: Stability { level, feature },
}
| AttributeKind::ConstStability {
span: attr_span,
stability: PartialConstStability { level, feature, .. },
},
) => self.check_stability(*attr_span, span, level, *feature, target),
Attribute::Parsed(AttributeKind::Inline(InlineAttr::Force { .. }, ..)) => {} // handled separately below
Attribute::Parsed(AttributeKind::Inline(kind, attr_span)) => {
self.check_inline(hir_id, *attr_span, span, kind, target)
@@ -494,7 +507,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
attr: &Attribute,
item: Option<ItemLike<'_>>,
) {
if !matches!(target, Target::Impl)
if !matches!(target, Target::Impl { .. })
|| matches!(
item,
Some(ItemLike::Item(hir::Item { kind: hir::ItemKind::Impl(_impl),.. }))
@@ -598,7 +611,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
Target::Fn
| Target::Closure
| Target::Method(MethodKind::Trait { body: true } | MethodKind::Inherent)
| Target::Impl
| Target::Impl { .. }
| Target::Mod => return,
// These are "functions", but they aren't allowed because they don't
@@ -987,9 +1000,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
let span = meta.span();
if let Some(location) = match target {
Target::AssocTy => {
let parent_def_id = self.tcx.hir_get_parent_item(hir_id).def_id;
let containing_item = self.tcx.hir_expect_item(parent_def_id);
if Target::from_item(containing_item) == Target::Impl {
if let DefKind::Impl { .. } =
self.tcx.def_kind(self.tcx.local_parent(hir_id.owner.def_id))
{
Some("type alias in implementation block")
} else {
None
@@ -1012,7 +1025,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
| Target::Arm
| Target::ForeignMod
| Target::Closure
| Target::Impl
| Target::Impl { .. }
| Target::WherePredicate => Some(target.name()),
Target::ExternCrate
| Target::Use
@@ -1033,7 +1046,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
| Target::ForeignFn
| Target::ForeignStatic
| Target::ForeignTy
| Target::GenericParam(..)
| Target::GenericParam { .. }
| Target::MacroDef
| Target::PatField
| Target::ExprField => None,
@@ -1590,7 +1603,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
let article = match target {
Target::ExternCrate
| Target::Enum
| Target::Impl
| Target::Impl { .. }
| Target::Expression
| Target::Arm
| Target::AssocConst
@@ -2274,7 +2287,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
match target {
// FIXME(staged_api): There's no reason we can't support more targets here. We're just
// being conservative to begin with.
Target::Fn | Target::Impl => {}
Target::Fn | Target::Impl { .. } => {}
Target::ExternCrate
| Target::Use
| Target::Static
@@ -2300,7 +2313,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
| Target::ForeignFn
| Target::ForeignStatic
| Target::ForeignTy
| Target::GenericParam(_)
| Target::GenericParam { .. }
| Target::MacroDef
| Target::Param
| Target::PatField
@@ -2320,13 +2333,30 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
}
}
fn check_stability_promotable(&self, span: Span, target: Target) {
fn check_stability(
&self,
attr_span: Span,
item_span: Span,
level: &StabilityLevel,
feature: Symbol,
target: Target,
) {
match target {
Target::Expression => {
self.dcx().emit_err(errors::StabilityPromotable { attr_span: span });
self.dcx().emit_err(errors::StabilityPromotable { attr_span });
}
_ => {}
}
// Stable *language* features shouldn't be used as unstable library features.
// (Not doing this for stable library features is checked by tidy.)
if level.is_unstable()
&& ACCEPTED_LANG_FEATURES.iter().find(|f| f.name == feature).is_some()
{
self.tcx
.dcx()
.emit_err(errors::UnstableAttrForAlreadyStableFeature { attr_span, item_span });
}
}
fn check_link_ordinal(&self, attr_span: Span, _span: Span, target: Target) {
@@ -2354,6 +2384,28 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
errors::Deprecated,
);
}
Target::Impl { of_trait: true }
| Target::GenericParam { has_default: false, kind: _ } => {
self.tcx.emit_node_span_lint(
USELESS_DEPRECATED,
hir_id,
attr.span(),
errors::DeprecatedAnnotationHasNoEffect { span: attr.span() },
);
}
Target::AssocConst | Target::Method(..) | Target::AssocTy
if matches!(
self.tcx.def_kind(self.tcx.local_parent(hir_id.owner.def_id)),
DefKind::Impl { of_trait: true }
) =>
{
self.tcx.emit_node_span_lint(
USELESS_DEPRECATED,
hir_id,
attr.span(),
errors::DeprecatedAnnotationHasNoEffect { span: attr.span() },
);
}
_ => {}
}
}

View File

@@ -1373,9 +1373,9 @@ pub(crate) struct UnstableAttrForAlreadyStableFeature {
#[primary_span]
#[label]
#[help]
pub span: Span,
pub attr_span: Span,
#[label(passes_item)]
pub item_sp: Span,
pub item_span: Span,
}
#[derive(Diagnostic)]

View File

@@ -287,7 +287,7 @@ impl<'ast, 'tcx> visit::Visitor<'ast> for LanguageItemCollector<'ast, 'tcx> {
ast::ItemKind::Union(..) => Target::Union,
ast::ItemKind::Trait(_) => Target::Trait,
ast::ItemKind::TraitAlias(..) => Target::TraitAlias,
ast::ItemKind::Impl(_) => Target::Impl,
ast::ItemKind::Impl(imp_) => Target::Impl { of_trait: imp_.of_trait.is_some() },
ast::ItemKind::MacroDef(..) => Target::MacroDef,
ast::ItemKind::MacCall(_) | ast::ItemKind::DelegationMac(_) => {
unreachable!("macros should have been expanded")

View File

@@ -44,7 +44,7 @@ impl<'tcx> LibFeatureCollector<'tcx> {
StabilityLevel::Stable { since, .. } => FeatureStability::AcceptedSince(match since {
StableSince::Version(v) => Symbol::intern(&v.to_string()),
StableSince::Current => sym::env_CFG_RELEASE,
StableSince::Err => return None,
StableSince::Err(_) => return None,
}),
};

File diff suppressed because it is too large Load Diff

View File

@@ -1110,7 +1110,7 @@ fn since_to_string(since: &StableSince) -> Option<String> {
match since {
StableSince::Version(since) => Some(since.to_string()),
StableSince::Current => Some(RustcVersion::CURRENT.to_string()),
StableSince::Err => None,
StableSince::Err(_) => None,
}
}

View File

@@ -249,7 +249,7 @@ fn is_stable(cx: &LateContext<'_>, mut def_id: DefId, msrv: Msrv) -> bool {
let stable = match since {
StableSince::Version(v) => msrv.meets(cx, v),
StableSince::Current => msrv.current(cx).is_none(),
StableSince::Err => false,
StableSince::Err(_) => false,
};
if !stable {

View File

@@ -432,7 +432,7 @@ pub fn is_stable_const_fn(cx: &LateContext<'_>, def_id: DefId, msrv: Msrv) -> bo
let const_stab_rust_version = match since {
StableSince::Version(version) => version,
StableSince::Current => RustcVersion::CURRENT,
StableSince::Err => return false,
StableSince::Err(_) => return false,
};
msrv.meets(cx, const_stab_rust_version)

View File

@@ -4,13 +4,13 @@ error: `#[doc(alias = "...")]` isn't allowed on foreign module
LL | #[doc(alias = "foo")]
| ^^^^^^^^^^^^^
error: `#[doc(alias = "...")]` isn't allowed on implementation block
error: `#[doc(alias = "...")]` isn't allowed on inherent implementation block
--> $DIR/check-doc-alias-attr-location.rs:10:7
|
LL | #[doc(alias = "bar")]
| ^^^^^^^^^^^^^
error: `#[doc(alias = "...")]` isn't allowed on implementation block
error: `#[doc(alias = "...")]` isn't allowed on trait implementation block
--> $DIR/check-doc-alias-attr-location.rs:16:7
|
LL | #[doc(alias = "foobar")]

View File

@@ -28,7 +28,7 @@ error: attribute must be applied to a `static` variable
LL | #[used]
| ^^^^^^^
LL | impl Bar for Foo {}
| ------------------- but this is a implementation block
| ------------------- but this is a trait implementation block
error: attribute must be applied to a `static` variable
--> $DIR/used.rs:21:5

View File

@@ -22,30 +22,6 @@ help: make the function or method const
LL | pub fn bar() {}
| ^^^^^^^^^^^^
error: attributes `#[rustc_const_unstable]`, `#[rustc_const_stable]` and `#[rustc_const_stable_indirect]` require the function or method to be `const`
--> $DIR/rustc-const-stability-require-const.rs:21:5
|
LL | pub fn salad(&self) -> &'static str { "mmmmmm" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: make the function or method const
--> $DIR/rustc-const-stability-require-const.rs:21:5
|
LL | pub fn salad(&self) -> &'static str { "mmmmmm" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: attributes `#[rustc_const_unstable]`, `#[rustc_const_stable]` and `#[rustc_const_stable_indirect]` require the function or method to be `const`
--> $DIR/rustc-const-stability-require-const.rs:26:5
|
LL | pub fn roasted(&self) -> &'static str { "mmmmmmmmmm" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: make the function or method const
--> $DIR/rustc-const-stability-require-const.rs:26:5
|
LL | pub fn roasted(&self) -> &'static str { "mmmmmmmmmm" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: attributes `#[rustc_const_unstable]`, `#[rustc_const_stable]` and `#[rustc_const_stable_indirect]` require the function or method to be `const`
--> $DIR/rustc-const-stability-require-const.rs:32:1
|
@@ -86,5 +62,29 @@ LL | #[rustc_const_stable(feature = "barfoo_const", since = "1.0.0")]
LL | pub const fn barfoo_unstable() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: attributes `#[rustc_const_unstable]`, `#[rustc_const_stable]` and `#[rustc_const_stable_indirect]` require the function or method to be `const`
--> $DIR/rustc-const-stability-require-const.rs:21:5
|
LL | pub fn salad(&self) -> &'static str { "mmmmmm" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: make the function or method const
--> $DIR/rustc-const-stability-require-const.rs:21:5
|
LL | pub fn salad(&self) -> &'static str { "mmmmmm" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: attributes `#[rustc_const_unstable]`, `#[rustc_const_stable]` and `#[rustc_const_stable_indirect]` require the function or method to be `const`
--> $DIR/rustc-const-stability-require-const.rs:26:5
|
LL | pub fn roasted(&self) -> &'static str { "mmmmmmmmmm" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: make the function or method const
--> $DIR/rustc-const-stability-require-const.rs:26:5
|
LL | pub fn roasted(&self) -> &'static str { "mmmmmmmmmm" }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 8 previous errors

View File

@@ -269,7 +269,13 @@ mod automatically_derived {
#[automatically_derived] type T = S;
//~^ WARN `#[automatically_derived]
#[automatically_derived] trait W { }
//~^ WARN `#[automatically_derived]
#[automatically_derived] impl S { }
//~^ WARN `#[automatically_derived]
#[automatically_derived] impl W for S { }
}
#[no_mangle]

View File

@@ -1,5 +1,5 @@
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:391:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:397:17
|
LL | mod inner { #![macro_escape] }
| ^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | mod inner { #![macro_escape] }
= help: try an outer attribute: `#[macro_use]`
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:388:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:1
|
LL | #[macro_escape]
| ^^^^^^^^^^^^^^^
@@ -198,14 +198,14 @@ note: the lint level is defined here
LL | #![warn(unused_attributes, unknown_lints)]
| ^^^^^^^^^^^^^^^^^
warning: `#[automatically_derived]` only has an effect on implementation blocks
warning: `#[automatically_derived]` only has an effect on trait implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:257:1
|
LL | #[automatically_derived]
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:275:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:281:1
|
LL | #[no_mangle]
| ^^^^^^^^^^^^
@@ -220,31 +220,31 @@ LL | | }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: `#[should_panic]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:315:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:321:1
|
LL | #[should_panic]
| ^^^^^^^^^^^^^^^
warning: `#[ignore]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:339:1
|
LL | #[ignore]
| ^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:1
|
LL | #[reexport_test_harness_main = "2900"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:408:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:1
|
LL | #[no_std]
| ^^^^^^^^^
warning: attribute should be applied to a function definition
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:450:1
|
LL | #[cold]
| ^^^^^^^
@@ -260,7 +260,7 @@ LL | | }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:1
|
LL | #[link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^
@@ -276,7 +276,7 @@ LL | | }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:518:1
|
LL | #[link_section = "1800"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -292,7 +292,7 @@ LL | | }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:544:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:550:1
|
LL | #[link()]
| ^^^^^^^^^
@@ -308,55 +308,55 @@ LL | | }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: `#[must_use]` has no effect when applied to a module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:595:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:601:1
|
LL | #[must_use]
| ^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:608:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:614:1
|
LL | #[windows_subsystem = "windows"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:629:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:635:1
|
LL | #[crate_name = "0900"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:648:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:654:1
|
LL | #[crate_type = "0800"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:667:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:1
|
LL | #[feature(x0600)]
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:1
|
LL | #[no_main]
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:706:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:1
|
LL | #[no_builtins]
| ^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:725:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:731:1
|
LL | #[recursion_limit="0200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:744:1
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:1
|
LL | #[type_length_limit="0100"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -417,6 +417,14 @@ LL | #![cold]
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:85:12
|
LL | #![feature(rust1)]
| ^^^^^
|
= note: `#[warn(stable_features)]` on by default
warning: `#[macro_use]` only has an effect on `extern crate` and modules
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:5
|
@@ -495,32 +503,44 @@ warning: `#[path]` only has an effect on modules
LL | #[path = "3800"] impl S { }
| ^^^^^^^^^^^^^^^^
warning: `#[automatically_derived]` only has an effect on implementation blocks
warning: `#[automatically_derived]` only has an effect on trait implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:260:17
|
LL | mod inner { #![automatically_derived] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: `#[automatically_derived]` only has an effect on implementation blocks
warning: `#[automatically_derived]` only has an effect on trait implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:263:5
|
LL | #[automatically_derived] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: `#[automatically_derived]` only has an effect on implementation blocks
warning: `#[automatically_derived]` only has an effect on trait implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:266:5
|
LL | #[automatically_derived] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: `#[automatically_derived]` only has an effect on implementation blocks
warning: `#[automatically_derived]` only has an effect on trait implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:269:5
|
LL | #[automatically_derived] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: `#[automatically_derived]` only has an effect on trait implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:272:5
|
LL | #[automatically_derived] trait W { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: `#[automatically_derived]` only has an effect on trait implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:275:5
|
LL | #[automatically_derived] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:280:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:286:17
|
LL | mod inner { #![no_mangle] }
| ------------^^^^^^^^^^^^^-- not a free function, impl method or static
@@ -528,7 +548,7 @@ LL | mod inner { #![no_mangle] }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:287:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:293:5
|
LL | #[no_mangle] struct S;
| ^^^^^^^^^^^^ --------- not a free function, impl method or static
@@ -536,7 +556,7 @@ LL | #[no_mangle] struct S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:292:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:298:5
|
LL | #[no_mangle] type T = S;
| ^^^^^^^^^^^^ ----------- not a free function, impl method or static
@@ -544,7 +564,7 @@ LL | #[no_mangle] type T = S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:297:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:5
|
LL | #[no_mangle] impl S { }
| ^^^^^^^^^^^^ ---------- not a free function, impl method or static
@@ -552,7 +572,7 @@ LL | #[no_mangle] impl S { }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:9
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:309:9
|
LL | #[no_mangle] fn foo();
| ^^^^^^^^^^^^ --------- not a free function, impl method or static
@@ -560,7 +580,7 @@ LL | #[no_mangle] fn foo();
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:308:9
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:9
|
LL | #[no_mangle] fn bar() {}
| ^^^^^^^^^^^^ ----------- not a free function, impl method or static
@@ -568,163 +588,163 @@ LL | #[no_mangle] fn bar() {}
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: `#[should_panic]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:318:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:324:17
|
LL | mod inner { #![should_panic] }
| ^^^^^^^^^^^^^^^^
warning: `#[should_panic]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:323:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:329:5
|
LL | #[should_panic] struct S;
| ^^^^^^^^^^^^^^^
warning: `#[should_panic]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:326:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:332:5
|
LL | #[should_panic] type T = S;
| ^^^^^^^^^^^^^^^
warning: `#[should_panic]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:329:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:335:5
|
LL | #[should_panic] impl S { }
| ^^^^^^^^^^^^^^^
warning: `#[ignore]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:336:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:342:17
|
LL | mod inner { #![ignore] }
| ^^^^^^^^^^
warning: `#[ignore]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:341:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:5
|
LL | #[ignore] struct S;
| ^^^^^^^^^
warning: `#[ignore]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:344:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:350:5
|
LL | #[ignore] type T = S;
| ^^^^^^^^^
warning: `#[ignore]` only has an effect on functions
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:353:5
|
LL | #[ignore] impl S { }
| ^^^^^^^^^
warning: `#[no_implicit_prelude]` only has an effect on modules
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:355:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:5
|
LL | #[no_implicit_prelude] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: `#[no_implicit_prelude]` only has an effect on modules
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:358:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:5
|
LL | #[no_implicit_prelude] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: `#[no_implicit_prelude]` only has an effect on modules
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:361:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:367:5
|
LL | #[no_implicit_prelude] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: `#[no_implicit_prelude]` only has an effect on modules
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:364:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:370:5
|
LL | #[no_implicit_prelude] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:371:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:377:17
|
LL | mod inner { #![reexport_test_harness_main="2900"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:374:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:5
|
LL | #[reexport_test_harness_main = "2900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:377:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:383:5
|
LL | #[reexport_test_harness_main = "2900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:5
|
LL | #[reexport_test_harness_main = "2900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:383:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:389:5
|
LL | #[reexport_test_harness_main = "2900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: `#[macro_escape]` only has an effect on `extern crate` and modules
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:5
|
LL | #[macro_escape] fn f() { }
| ^^^^^^^^^^^^^^^
warning: `#[macro_escape]` only has an effect on `extern crate` and modules
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:5
|
LL | #[macro_escape] struct S;
| ^^^^^^^^^^^^^^^
warning: `#[macro_escape]` only has an effect on `extern crate` and modules
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:407:5
|
LL | #[macro_escape] type T = S;
| ^^^^^^^^^^^^^^^
warning: `#[macro_escape]` only has an effect on `extern crate` and modules
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:410:5
|
LL | #[macro_escape] impl S { }
| ^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:411:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:17
|
LL | mod inner { #![no_std] }
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:414:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:5
|
LL | #[no_std] fn f() { }
| ^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:5
|
LL | #[no_std] struct S;
| ^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5
|
LL | #[no_std] type T = S;
| ^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:5
|
LL | #[no_std] impl S { }
| ^^^^^^^^^
warning: attribute should be applied to a function definition
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:450:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:456:17
|
LL | mod inner { #![cold] }
| ------------^^^^^^^^-- not a function definition
@@ -732,7 +752,7 @@ LL | mod inner { #![cold] }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function definition
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:463:5
|
LL | #[cold] struct S;
| ^^^^^^^ --------- not a function definition
@@ -740,7 +760,7 @@ LL | #[cold] struct S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function definition
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:5
|
LL | #[cold] type T = S;
| ^^^^^^^ ----------- not a function definition
@@ -748,7 +768,7 @@ LL | #[cold] type T = S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function definition
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:467:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:5
|
LL | #[cold] impl S { }
| ^^^^^^^ ---------- not a function definition
@@ -756,7 +776,7 @@ LL | #[cold] impl S { }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:485:5
|
LL | #[link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^
@@ -766,13 +786,13 @@ LL | extern "C" { }
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
help: try `#[link(name = "1900")]` instead
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:485:5
|
LL | #[link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^
warning: attribute should be applied to a foreign function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:486:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:492:17
|
LL | mod inner { #![link_name="1900"] }
| ------------^^^^^^^^^^^^^^^^^^^^-- not a foreign function or static
@@ -780,7 +800,7 @@ LL | mod inner { #![link_name="1900"] }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:491:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:497:5
|
LL | #[link_name = "1900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static
@@ -788,7 +808,7 @@ LL | #[link_name = "1900"] fn f() { }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:496:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:502:5
|
LL | #[link_name = "1900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^ --------- not a foreign function or static
@@ -796,7 +816,7 @@ LL | #[link_name = "1900"] struct S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:501:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:507:5
|
LL | #[link_name = "1900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^ ----------- not a foreign function or static
@@ -804,7 +824,7 @@ LL | #[link_name = "1900"] type T = S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:506:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:5
|
LL | #[link_name = "1900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static
@@ -812,7 +832,7 @@ LL | #[link_name = "1900"] impl S { }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:518:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:524:17
|
LL | mod inner { #![link_section="1800"] }
| ------------^^^^^^^^^^^^^^^^^^^^^^^-- not a function or static
@@ -820,7 +840,7 @@ LL | mod inner { #![link_section="1800"] }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:525:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:531:5
|
LL | #[link_section = "1800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^ --------- not a function or static
@@ -828,7 +848,7 @@ LL | #[link_section = "1800"] struct S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:530:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:536:5
|
LL | #[link_section = "1800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a function or static
@@ -836,7 +856,7 @@ LL | #[link_section = "1800"] type T = S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:535:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:541:5
|
LL | #[link_section = "1800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a function or static
@@ -844,7 +864,7 @@ LL | #[link_section = "1800"] impl S { }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:550:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:556:17
|
LL | mod inner { #![link()] }
| ------------^^^^^^^^^^-- not an `extern` block
@@ -852,7 +872,7 @@ LL | mod inner { #![link()] }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:555:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:561:5
|
LL | #[link()] fn f() { }
| ^^^^^^^^^ ---------- not an `extern` block
@@ -860,7 +880,7 @@ LL | #[link()] fn f() { }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:560:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:566:5
|
LL | #[link()] struct S;
| ^^^^^^^^^ --------- not an `extern` block
@@ -868,7 +888,7 @@ LL | #[link()] struct S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:565:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:571:5
|
LL | #[link()] type T = S;
| ^^^^^^^^^ ----------- not an `extern` block
@@ -876,7 +896,7 @@ LL | #[link()] type T = S;
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:570:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:576:5
|
LL | #[link()] impl S { }
| ^^^^^^^^^ ---------- not an `extern` block
@@ -884,7 +904,7 @@ LL | #[link()] impl S { }
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to an `extern` block with non-Rust ABI
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:575:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:581:5
|
LL | #[link()] extern "Rust" {}
| ^^^^^^^^^
@@ -892,270 +912,262 @@ LL | #[link()] extern "Rust" {}
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: `#[must_use]` has no effect when applied to a module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:597:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:603:17
|
LL | mod inner { #![must_use] }
| ^^^^^^^^^^^^
warning: `#[must_use]` has no effect when applied to a type alias
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:603:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:609:5
|
LL | #[must_use] type T = S;
| ^^^^^^^^^^^
warning: `#[must_use]` has no effect when applied to an implementation block
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:605:5
warning: `#[must_use]` has no effect when applied to an inherent implementation block
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:611:5
|
LL | #[must_use] impl S { }
| ^^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:611:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:617:17
|
LL | mod inner { #![windows_subsystem="windows"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:614:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:620:5
|
LL | #[windows_subsystem = "windows"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:617:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:623:5
|
LL | #[windows_subsystem = "windows"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:620:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:626:5
|
LL | #[windows_subsystem = "windows"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:623:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:629:5
|
LL | #[windows_subsystem = "windows"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:632:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:638:17
|
LL | mod inner { #![crate_name="0900"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:635:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:641:5
|
LL | #[crate_name = "0900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:638:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:644:5
|
LL | #[crate_name = "0900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:641:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:647:5
|
LL | #[crate_name = "0900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:644:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:650:5
|
LL | #[crate_name = "0900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:651:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:657:17
|
LL | mod inner { #![crate_type="0800"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:654:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:660:5
|
LL | #[crate_type = "0800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:657:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:5
|
LL | #[crate_type = "0800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:660:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:5
|
LL | #[crate_type = "0800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:663:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:669:5
|
LL | #[crate_type = "0800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:676:17
|
LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5
|
LL | #[feature(x0600)] fn f() { }
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:676:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5
|
LL | #[feature(x0600)] struct S;
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:679:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5
|
LL | #[feature(x0600)] type T = S;
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:5
|
LL | #[feature(x0600)] impl S { }
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:690:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:17
|
LL | mod inner { #![no_main] }
| ^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
|
LL | #[no_main] fn f() { }
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:696:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:702:5
|
LL | #[no_main] struct S;
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:705:5
|
LL | #[no_main] type T = S;
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:702:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:5
|
LL | #[no_main] impl S { }
| ^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:709:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:715:17
|
LL | mod inner { #![no_builtins] }
| ^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5
|
LL | #[no_builtins] fn f() { }
| ^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:715:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5
|
LL | #[no_builtins] struct S;
| ^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:718:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
|
LL | #[no_builtins] type T = S;
| ^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:727:5
|
LL | #[no_builtins] impl S { }
| ^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:17
|
LL | mod inner { #![recursion_limit="0200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:731:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5
|
LL | #[recursion_limit="0200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:740:5
|
LL | #[recursion_limit="0200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:743:5
|
LL | #[recursion_limit="0200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:740:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:5
|
LL | #[recursion_limit="0200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:747:17
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:17
|
LL | mod inner { #![type_length_limit="0100"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:756:5
|
LL | #[type_length_limit="0100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5
|
LL | #[type_length_limit="0100"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:756:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:762:5
|
LL | #[type_length_limit="0100"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:759:5
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:765:5
|
LL | #[type_length_limit="0100"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:85:12
|
LL | #![feature(rust1)]
| ^^^^^
|
= note: `#[warn(stable_features)]` on by default
warning: 171 warnings emitted
warning: 173 warnings emitted

View File

@@ -1,3 +1,17 @@
error: can't mark as unstable using an already stable feature
--> $DIR/unstable-attribute-rejects-already-stable-features.rs:7:1
|
LL | #[rustc_const_unstable(feature = "arbitrary_enum_discriminant", issue = "42")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this feature is already stable
LL | const fn my_fun() {}
| -------------------- the stability attribute annotates this item
|
help: consider removing the attribute
--> $DIR/unstable-attribute-rejects-already-stable-features.rs:7:1
|
LL | #[rustc_const_unstable(feature = "arbitrary_enum_discriminant", issue = "42")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: can't mark as unstable using an already stable feature
--> $DIR/unstable-attribute-rejects-already-stable-features.rs:6:1
|
@@ -13,19 +27,5 @@ help: consider removing the attribute
LL | #[unstable(feature = "arbitrary_enum_discriminant", issue = "42")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: can't mark as unstable using an already stable feature
--> $DIR/unstable-attribute-rejects-already-stable-features.rs:7:1
|
LL | #[rustc_const_unstable(feature = "arbitrary_enum_discriminant", issue = "42")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this feature is already stable
LL | const fn my_fun() {}
| -------------------- the stability attribute annotates this item
|
help: consider removing the attribute
--> $DIR/unstable-attribute-rejects-already-stable-features.rs:7:1
|
LL | #[rustc_const_unstable(feature = "arbitrary_enum_discriminant", issue = "42")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@@ -1,8 +1,8 @@
warning: use of deprecated function `lint_stability::deprecated`: text
--> $DIR/lint-stability-deprecated.rs:24:9
warning: use of deprecated associated type `lint_stability::TraitWithAssociatedTypes::TypeDeprecated`: text
--> $DIR/lint-stability-deprecated.rs:97:48
|
LL | deprecated();
| ^^^^^^^^^^
LL | struct S2<T: TraitWithAssociatedTypes>(T::TypeDeprecated);
| ^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/lint-stability-deprecated.rs:6:9
@@ -10,6 +10,12 @@ note: the lint level is defined here
LL | #![warn(deprecated)]
| ^^^^^^^^^^
warning: use of deprecated function `lint_stability::deprecated`: text
--> $DIR/lint-stability-deprecated.rs:24:9
|
LL | deprecated();
| ^^^^^^^^^^
warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:29:16
|
@@ -316,12 +322,6 @@ warning: use of deprecated function `this_crate::MethodTester::test_method_body:
LL | fn_in_body();
| ^^^^^^^^^^
warning: use of deprecated associated type `lint_stability::TraitWithAssociatedTypes::TypeDeprecated`: text
--> $DIR/lint-stability-deprecated.rs:97:48
|
LL | struct S2<T: TraitWithAssociatedTypes>(T::TypeDeprecated);
| ^^^^^^^^^^^^^^^^^
warning: use of deprecated associated type `lint_stability::TraitWithAssociatedTypes::TypeDeprecated`: text
--> $DIR/lint-stability-deprecated.rs:101:13
|

View File

@@ -1,3 +1,12 @@
error[E0658]: use of unstable library feature `unstable_test_feature`
--> $DIR/lint-stability.rs:88:48
|
LL | struct S1<T: TraitWithAssociatedTypes>(T::TypeUnstable);
| ^^^^^^^^^^^^^^^
|
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: use of unstable library feature `unstable_test_feature`
--> $DIR/lint-stability.rs:17:5
|
@@ -367,15 +376,6 @@ LL | let _ = Unstable::StableVariant;
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: use of unstable library feature `unstable_test_feature`
--> $DIR/lint-stability.rs:88:48
|
LL | struct S1<T: TraitWithAssociatedTypes>(T::TypeUnstable);
| ^^^^^^^^^^^^^^^
|
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: use of unstable library feature `unstable_test_feature`
--> $DIR/lint-stability.rs:92:13
|

View File

@@ -66,9 +66,11 @@ fn t1() {}
#[non_exhaustive] //~ ERROR unused attribute
pub struct X;
trait Trait {}
#[automatically_derived]
#[automatically_derived] //~ ERROR unused attribute
impl X {}
impl Trait for X {}
#[inline(always)]
#[inline(never)] //~ ERROR unused attribute

View File

@@ -179,112 +179,112 @@ LL | #[non_exhaustive]
| ^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:70:1
--> $DIR/unused-attr-duplicate.rs:72:1
|
LL | #[automatically_derived]
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:69:1
--> $DIR/unused-attr-duplicate.rs:71:1
|
LL | #[automatically_derived]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:74:1
--> $DIR/unused-attr-duplicate.rs:76:1
|
LL | #[inline(never)]
| ^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:73:1
--> $DIR/unused-attr-duplicate.rs:75:1
|
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:77:1
--> $DIR/unused-attr-duplicate.rs:79:1
|
LL | #[cold]
| ^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:76:1
--> $DIR/unused-attr-duplicate.rs:78:1
|
LL | #[cold]
| ^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:79:1
--> $DIR/unused-attr-duplicate.rs:81:1
|
LL | #[track_caller]
| ^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:78:1
--> $DIR/unused-attr-duplicate.rs:80:1
|
LL | #[track_caller]
| ^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:86:5
--> $DIR/unused-attr-duplicate.rs:88:5
|
LL | #[link_name = "this_does_not_exist"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:88:5
--> $DIR/unused-attr-duplicate.rs:90:5
|
LL | #[link_name = "rust_dbg_extern_identity_u32"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:92:1
--> $DIR/unused-attr-duplicate.rs:94:1
|
LL | #[export_name = "exported_symbol_name"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:94:1
--> $DIR/unused-attr-duplicate.rs:96:1
|
LL | #[export_name = "exported_symbol_name2"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:98:1
--> $DIR/unused-attr-duplicate.rs:100:1
|
LL | #[no_mangle]
| ^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:97:1
--> $DIR/unused-attr-duplicate.rs:99:1
|
LL | #[no_mangle]
| ^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:102:1
--> $DIR/unused-attr-duplicate.rs:104:1
|
LL | #[used]
| ^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:101:1
--> $DIR/unused-attr-duplicate.rs:103:1
|
LL | #[used]
| ^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:105:1
--> $DIR/unused-attr-duplicate.rs:107:1
|
LL | #[link_section = ".text"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:108:1
--> $DIR/unused-attr-duplicate.rs:110:1
|
LL | #[link_section = ".bss"]
| ^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -45,7 +45,7 @@ error: `#[must_use]` has no effect when applied to a static item
LL | #[must_use]
| ^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to an implementation block
error: `#[must_use]` has no effect when applied to an inherent implementation block
--> $DIR/unused_attributes-must_use.rs:33:1
|
LL | #[must_use]
@@ -69,7 +69,7 @@ error: `#[must_use]` has no effect when applied to a type parameter
LL | fn qux<#[must_use] T>(_: T) {}
| ^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to an implementation block
error: `#[must_use]` has no effect when applied to an trait implementation block
--> $DIR/unused_attributes-must_use.rs:79:1
|
LL | #[must_use]

View File

@@ -1,17 +1,14 @@
error: function has missing stability attribute
--> $DIR/missing-stability.rs:8:1
|
LL | / pub fn unmarked() {
LL | |
LL | | ()
LL | | }
| |_^
LL | pub fn unmarked() {
| ^^^^^^^^^^^^^^^^^
error: function has missing stability attribute
--> $DIR/missing-stability.rs:22:5
|
LL | pub fn unmarked() {}
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@@ -23,7 +23,7 @@ error: module has missing stability attribute
--> $DIR/effective_visibilities_invariants.rs:5:1
|
LL | pub mod m {}
| ^^^^^^^^^^^^
| ^^^^^^^^^
error: aborting due to 3 previous errors

View File

@@ -20,28 +20,20 @@ LL | | fn main() {}
error: trait has missing stability attribute
--> $DIR/issue-113860-1.rs:4:1
|
LL | / pub trait Trait {
LL | |
LL | | fn fun() {}
LL | |
LL | | }
| |_^
LL | pub trait Trait {
| ^^^^^^^^^^^^^^^
error: implementation has missing stability attribute
--> $DIR/issue-113860-1.rs:10:1
|
LL | / impl Trait for u8 {
LL | |
LL | | pub(self) fn fun() {}
LL | |
LL | | }
| |_^
LL | impl Trait for u8 {
| ^^^^^^^^^^^^^^^^^
error: associated function has missing stability attribute
--> $DIR/issue-113860-1.rs:6:5
|
LL | fn fun() {}
| ^^^^^^^^^^^
| ^^^^^^^^
error: aborting due to 5 previous errors

View File

@@ -20,28 +20,20 @@ LL | | fn main() {}
error: trait has missing stability attribute
--> $DIR/issue-113860-2.rs:4:1
|
LL | / pub trait Trait {
LL | |
LL | | type X;
LL | |
LL | | }
| |_^
LL | pub trait Trait {
| ^^^^^^^^^^^^^^^
error: implementation has missing stability attribute
--> $DIR/issue-113860-2.rs:10:1
|
LL | / impl Trait for u8 {
LL | |
LL | | pub(self) type X = Self;
LL | |
LL | | }
| |_^
LL | impl Trait for u8 {
| ^^^^^^^^^^^^^^^^^
error: associated type has missing stability attribute
--> $DIR/issue-113860-2.rs:6:5
|
LL | type X;
| ^^^^^^^
| ^^^^^^
error: aborting due to 5 previous errors

View File

@@ -20,28 +20,20 @@ LL | | fn main() {}
error: trait has missing stability attribute
--> $DIR/issue-113860.rs:4:1
|
LL | / pub trait Trait {
LL | |
LL | | const X: u32;
LL | |
LL | | }
| |_^
LL | pub trait Trait {
| ^^^^^^^^^^^^^^^
error: implementation has missing stability attribute
--> $DIR/issue-113860.rs:10:1
|
LL | / impl Trait for u8 {
LL | |
LL | | pub(self) const X: u32 = 3;
LL | |
LL | | }
| |_^
LL | impl Trait for u8 {
| ^^^^^^^^^^^^^^^^^
error: associated constant has missing stability attribute
--> $DIR/issue-113860.rs:6:5
|
LL | const X: u32;
| ^^^^^^^^^^^^^
| ^^^^^^^^^^^^
error: aborting due to 5 previous errors

View File

@@ -10,13 +10,13 @@ error: `#[doc(alias = "...")]` isn't allowed on foreign module
LL | #[doc(alias = "foo")]
| ^^^^^^^^^^^^^
error: `#[doc(alias = "...")]` isn't allowed on implementation block
error: `#[doc(alias = "...")]` isn't allowed on inherent implementation block
--> $DIR/check-doc-alias-attr-location.rs:12:7
|
LL | #[doc(alias = "bar")]
| ^^^^^^^^^^^^^
error: `#[doc(alias = "...")]` isn't allowed on implementation block
error: `#[doc(alias = "...")]` isn't allowed on trait implementation block
--> $DIR/check-doc-alias-attr-location.rs:18:7
|
LL | #[doc(alias = "foobar")]

View File

@@ -2,29 +2,25 @@ error: function has missing const stability attribute
--> $DIR/missing-const-stability.rs:7:1
|
LL | pub const fn foo() {}
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^
error: trait has missing const stability attribute
--> $DIR/missing-const-stability.rs:23:1
|
LL | / pub const trait Bar {
LL | |
LL | | #[stable(feature = "stable", since = "1.0.0")]
LL | | fn fun();
LL | | }
| |_^
LL | pub const trait Bar {
| ^^^^^^^^^^^^^^^^^^^
error: function has missing const stability attribute
--> $DIR/missing-const-stability.rs:36:1
|
LL | pub const unsafe fn size_of_val<T>(x: *const T) -> usize { 42 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: associated function has missing const stability attribute
--> $DIR/missing-const-stability.rs:16:5
|
LL | pub const fn foo() {}
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors

View File

@@ -1,10 +1,8 @@
error: macro has missing stability attribute
--> $DIR/stability-attribute-sanity-3.rs:8:1
|
LL | / macro_rules! mac {
LL | | () => ()
LL | | }
| |_^
LL | macro_rules! mac {
| ^^^^^^^^^^^^^^^^
error: aborting due to 1 previous error