Skip to content

Commit a77d746

Browse files
committed
tidy
1 parent ea3a125 commit a77d746

File tree

4 files changed

+37
-40
lines changed

4 files changed

+37
-40
lines changed

compiler/rustc_passes/messages.ftl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,10 +594,6 @@ passes_rustc_allow_const_fn_unstable =
594594
attribute should be applied to `const fn`
595595
.label = not a `const fn`
596596
597-
passes_rustc_unstable_feature_bound =
598-
attribute should be applied to `impl` or free function outside of any `impl` or trait
599-
.label = not an `impl` or free function
600-
601597
passes_rustc_const_stable_indirect_pairing =
602598
`const_stable_indirect` attribute does not make sense on `rustc_const_stable` function, its behavior is already implied
603599
passes_rustc_dirty_clean =
@@ -655,6 +651,10 @@ passes_rustc_std_internal_symbol =
655651
attribute should be applied to functions or statics
656652
.label = not a function or static
657653
654+
passes_rustc_unstable_feature_bound =
655+
attribute should be applied to `impl` or free function outside of any `impl` or trait
656+
.label = not an `impl` or free function
657+
658658
passes_should_be_applied_to_fn =
659659
attribute should be applied to a function definition
660660
.label = {$on_crate ->

compiler/rustc_passes/src/check_attr.rs

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,40 +2280,38 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
22802280
fn check_unstable_feature_bound(&self, attr_span: Span, span: Span, target: Target) {
22812281
match target {
22822282
Target::Fn | Target::Impl => {}
2283-
Target::ExternCrate |
2284-
Target::Use |
2285-
Target::Static |
2286-
Target::Const |
2287-
Target::Closure |
2288-
Target::Mod |
2289-
Target::ForeignMod |
2290-
Target::GlobalAsm |
2291-
Target::TyAlias |
2292-
Target::Enum |
2293-
Target::Variant |
2294-
Target::Struct |
2295-
Target::Field |
2296-
Target::Union |
2297-
Target::Trait |
2298-
Target::TraitAlias |
2299-
Target::Expression |
2300-
Target::Statement |
2301-
Target::Arm |
2302-
Target::AssocConst |
2303-
Target::Method(_) |
2304-
Target::AssocTy |
2305-
Target::ForeignFn |
2306-
Target::ForeignStatic |
2307-
Target::ForeignTy |
2308-
Target::GenericParam(_) |
2309-
Target::MacroDef |
2310-
Target::Param |
2311-
Target::PatField |
2312-
Target::ExprField |
2313-
Target::WherePredicate => {
2314-
self.tcx
2315-
.dcx()
2316-
.emit_err(errors::RustcUnstableFeatureBound{ attr_span, span });
2283+
Target::ExternCrate
2284+
| Target::Use
2285+
| Target::Static
2286+
| Target::Const
2287+
| Target::Closure
2288+
| Target::Mod
2289+
| Target::ForeignMod
2290+
| Target::GlobalAsm
2291+
| Target::TyAlias
2292+
| Target::Enum
2293+
| Target::Variant
2294+
| Target::Struct
2295+
| Target::Field
2296+
| Target::Union
2297+
| Target::Trait
2298+
| Target::TraitAlias
2299+
| Target::Expression
2300+
| Target::Statement
2301+
| Target::Arm
2302+
| Target::AssocConst
2303+
| Target::Method(_)
2304+
| Target::AssocTy
2305+
| Target::ForeignFn
2306+
| Target::ForeignStatic
2307+
| Target::ForeignTy
2308+
| Target::GenericParam(_)
2309+
| Target::MacroDef
2310+
| Target::Param
2311+
| Target::PatField
2312+
| Target::ExprField
2313+
| Target::WherePredicate => {
2314+
self.tcx.dcx().emit_err(errors::RustcUnstableFeatureBound { attr_span, span });
23172315
}
23182316
}
23192317
}

compiler/rustc_passes/src/errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@ pub(crate) struct RustcUnstableFeatureBound {
671671
pub span: Span,
672672
}
673673

674-
675674
#[derive(Diagnostic)]
676675
#[diag(passes_rustc_std_internal_symbol)]
677676
pub(crate) struct RustcStdInternalSymbol {

tests/ui/internal/unstable_inherent_method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ impl Trait for u8 {
2121
fn foo() {}
2222
}
2323

24-
fn main() {}
24+
fn main() {}

0 commit comments

Comments
 (0)