Skip to content

Commit 99e9c1d

Browse files
committed
Remove six macros relating to lint definitions.
These were enabled by the removal of `-Zno-interleave-lints`.
1 parent 67cfe2c commit 99e9c1d

File tree

1 file changed

+103
-119
lines changed

1 file changed

+103
-119
lines changed

compiler/rustc_lint/src/lib.rs

Lines changed: 103 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -127,127 +127,111 @@ fn lint_mod(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
127127
late::late_lint_mod(tcx, module_def_id, BuiltinCombinedModuleLateLintPass::new());
128128
}
129129

130-
macro_rules! pre_expansion_lint_passes {
131-
($macro:path, $args:tt) => {
132-
$macro!($args, [KeywordIdents: KeywordIdents,]);
133-
};
134-
}
135-
136-
macro_rules! early_lint_passes {
137-
($macro:path, $args:tt) => {
138-
$macro!(
139-
$args,
140-
[
141-
UnusedParens: UnusedParens,
142-
UnusedBraces: UnusedBraces,
143-
UnusedImportBraces: UnusedImportBraces,
144-
UnsafeCode: UnsafeCode,
145-
SpecialModuleName: SpecialModuleName,
146-
AnonymousParameters: AnonymousParameters,
147-
EllipsisInclusiveRangePatterns: EllipsisInclusiveRangePatterns::default(),
148-
NonCamelCaseTypes: NonCamelCaseTypes,
149-
DeprecatedAttr: DeprecatedAttr::new(),
150-
WhileTrue: WhileTrue,
151-
NonAsciiIdents: NonAsciiIdents,
152-
HiddenUnicodeCodepoints: HiddenUnicodeCodepoints,
153-
IncompleteFeatures: IncompleteFeatures,
154-
RedundantSemicolons: RedundantSemicolons,
155-
UnusedDocComment: UnusedDocComment,
156-
UnexpectedCfgs: UnexpectedCfgs,
157-
]
158-
);
159-
};
160-
}
161-
162-
macro_rules! declare_combined_early_pass {
163-
([$name:ident], $passes:tt) => (
164-
early_lint_methods!(declare_combined_early_lint_pass, [pub $name, $passes]);
165-
)
166-
}
167-
168-
pre_expansion_lint_passes!(declare_combined_early_pass, [BuiltinCombinedPreExpansionLintPass]);
169-
early_lint_passes!(declare_combined_early_pass, [BuiltinCombinedEarlyLintPass]);
170-
171-
macro_rules! late_lint_passes {
172-
($macro:path, $args:tt) => {
173-
$macro!(
174-
$args,
175-
[
176-
// Tracks state across modules
177-
UnnameableTestItems: UnnameableTestItems::new(),
178-
// Tracks attributes of parents
179-
MissingDoc: MissingDoc::new(),
180-
// Builds a global list of all impls of `Debug`.
181-
// FIXME: Turn the computation of types which implement Debug into a query
182-
// and change this to a module lint pass
183-
MissingDebugImplementations: MissingDebugImplementations::default(),
184-
// Keeps a global list of foreign declarations.
185-
ClashingExternDeclarations: ClashingExternDeclarations::new(),
186-
]
187-
);
188-
};
189-
}
190-
191-
macro_rules! late_lint_mod_passes {
192-
($macro:path, $args:tt) => {
193-
$macro!(
194-
$args,
195-
[
196-
ForLoopsOverFallibles: ForLoopsOverFallibles,
197-
DerefIntoDynSupertrait: DerefIntoDynSupertrait,
198-
HardwiredLints: HardwiredLints,
199-
ImproperCTypesDeclarations: ImproperCTypesDeclarations,
200-
ImproperCTypesDefinitions: ImproperCTypesDefinitions,
201-
VariantSizeDifferences: VariantSizeDifferences,
202-
BoxPointers: BoxPointers,
203-
PathStatements: PathStatements,
204-
LetUnderscore: LetUnderscore,
205-
// Depends on referenced function signatures in expressions
206-
UnusedResults: UnusedResults,
207-
NonUpperCaseGlobals: NonUpperCaseGlobals,
208-
NonShorthandFieldPatterns: NonShorthandFieldPatterns,
209-
UnusedAllocation: UnusedAllocation,
210-
// Depends on types used in type definitions
211-
MissingCopyImplementations: MissingCopyImplementations,
212-
// Depends on referenced function signatures in expressions
213-
MutableTransmutes: MutableTransmutes,
214-
TypeAliasBounds: TypeAliasBounds,
215-
TrivialConstraints: TrivialConstraints,
216-
TypeLimits: TypeLimits::new(),
217-
NonSnakeCase: NonSnakeCase,
218-
InvalidNoMangleItems: InvalidNoMangleItems,
219-
// Depends on effective visibilities
220-
UnreachablePub: UnreachablePub,
221-
ExplicitOutlivesRequirements: ExplicitOutlivesRequirements,
222-
InvalidValue: InvalidValue,
223-
DerefNullPtr: DerefNullPtr,
224-
// May Depend on constants elsewhere
225-
UnusedBrokenConst: UnusedBrokenConst,
226-
UnstableFeatures: UnstableFeatures,
227-
ArrayIntoIter: ArrayIntoIter::default(),
228-
DropTraitConstraints: DropTraitConstraints,
229-
TemporaryCStringAsPtr: TemporaryCStringAsPtr,
230-
NonPanicFmt: NonPanicFmt,
231-
NoopMethodCall: NoopMethodCall,
232-
EnumIntrinsicsNonEnums: EnumIntrinsicsNonEnums,
233-
InvalidAtomicOrdering: InvalidAtomicOrdering,
234-
NamedAsmLabels: NamedAsmLabels,
235-
OpaqueHiddenInferredBound: OpaqueHiddenInferredBound,
236-
]
237-
);
238-
};
239-
}
240-
241-
macro_rules! declare_combined_late_pass {
242-
([$v:vis $name:ident], $passes:tt) => (
243-
late_lint_methods!(declare_combined_late_lint_pass, [$v $name, $passes], ['tcx]);
244-
)
245-
}
130+
early_lint_methods!(
131+
declare_combined_early_lint_pass,
132+
[
133+
pub BuiltinCombinedPreExpansionLintPass,
134+
[
135+
KeywordIdents: KeywordIdents,
136+
]
137+
]
138+
);
139+
140+
early_lint_methods!(
141+
declare_combined_early_lint_pass,
142+
[
143+
pub BuiltinCombinedEarlyLintPass,
144+
[
145+
UnusedParens: UnusedParens,
146+
UnusedBraces: UnusedBraces,
147+
UnusedImportBraces: UnusedImportBraces,
148+
UnsafeCode: UnsafeCode,
149+
SpecialModuleName: SpecialModuleName,
150+
AnonymousParameters: AnonymousParameters,
151+
EllipsisInclusiveRangePatterns: EllipsisInclusiveRangePatterns::default(),
152+
NonCamelCaseTypes: NonCamelCaseTypes,
153+
DeprecatedAttr: DeprecatedAttr::new(),
154+
WhileTrue: WhileTrue,
155+
NonAsciiIdents: NonAsciiIdents,
156+
HiddenUnicodeCodepoints: HiddenUnicodeCodepoints,
157+
IncompleteFeatures: IncompleteFeatures,
158+
RedundantSemicolons: RedundantSemicolons,
159+
UnusedDocComment: UnusedDocComment,
160+
UnexpectedCfgs: UnexpectedCfgs,
161+
]
162+
]
163+
);
246164

247165
// FIXME: Make a separate lint type which do not require typeck tables
248-
late_lint_passes!(declare_combined_late_pass, [pub BuiltinCombinedLateLintPass]);
249-
250-
late_lint_mod_passes!(declare_combined_late_pass, [BuiltinCombinedModuleLateLintPass]);
166+
late_lint_methods!(
167+
declare_combined_late_lint_pass,
168+
[
169+
pub BuiltinCombinedLateLintPass,
170+
[
171+
// Tracks state across modules
172+
UnnameableTestItems: UnnameableTestItems::new(),
173+
// Tracks attributes of parents
174+
MissingDoc: MissingDoc::new(),
175+
// Builds a global list of all impls of `Debug`.
176+
// FIXME: Turn the computation of types which implement Debug into a query
177+
// and change this to a module lint pass
178+
MissingDebugImplementations: MissingDebugImplementations::default(),
179+
// Keeps a global list of foreign declarations.
180+
ClashingExternDeclarations: ClashingExternDeclarations::new(),
181+
]
182+
],
183+
['tcx]
184+
);
185+
186+
late_lint_methods!(
187+
declare_combined_late_lint_pass,
188+
[
189+
BuiltinCombinedModuleLateLintPass,
190+
[
191+
ForLoopsOverFallibles: ForLoopsOverFallibles,
192+
DerefIntoDynSupertrait: DerefIntoDynSupertrait,
193+
HardwiredLints: HardwiredLints,
194+
ImproperCTypesDeclarations: ImproperCTypesDeclarations,
195+
ImproperCTypesDefinitions: ImproperCTypesDefinitions,
196+
VariantSizeDifferences: VariantSizeDifferences,
197+
BoxPointers: BoxPointers,
198+
PathStatements: PathStatements,
199+
LetUnderscore: LetUnderscore,
200+
// Depends on referenced function signatures in expressions
201+
UnusedResults: UnusedResults,
202+
NonUpperCaseGlobals: NonUpperCaseGlobals,
203+
NonShorthandFieldPatterns: NonShorthandFieldPatterns,
204+
UnusedAllocation: UnusedAllocation,
205+
// Depends on types used in type definitions
206+
MissingCopyImplementations: MissingCopyImplementations,
207+
// Depends on referenced function signatures in expressions
208+
MutableTransmutes: MutableTransmutes,
209+
TypeAliasBounds: TypeAliasBounds,
210+
TrivialConstraints: TrivialConstraints,
211+
TypeLimits: TypeLimits::new(),
212+
NonSnakeCase: NonSnakeCase,
213+
InvalidNoMangleItems: InvalidNoMangleItems,
214+
// Depends on effective visibilities
215+
UnreachablePub: UnreachablePub,
216+
ExplicitOutlivesRequirements: ExplicitOutlivesRequirements,
217+
InvalidValue: InvalidValue,
218+
DerefNullPtr: DerefNullPtr,
219+
// May Depend on constants elsewhere
220+
UnusedBrokenConst: UnusedBrokenConst,
221+
UnstableFeatures: UnstableFeatures,
222+
ArrayIntoIter: ArrayIntoIter::default(),
223+
DropTraitConstraints: DropTraitConstraints,
224+
TemporaryCStringAsPtr: TemporaryCStringAsPtr,
225+
NonPanicFmt: NonPanicFmt,
226+
NoopMethodCall: NoopMethodCall,
227+
EnumIntrinsicsNonEnums: EnumIntrinsicsNonEnums,
228+
InvalidAtomicOrdering: InvalidAtomicOrdering,
229+
NamedAsmLabels: NamedAsmLabels,
230+
OpaqueHiddenInferredBound: OpaqueHiddenInferredBound,
231+
]
232+
],
233+
['tcx]
234+
);
251235

252236
pub fn new_lint_store(internal_lints: bool) -> LintStore {
253237
let mut lint_store = LintStore::new();

0 commit comments

Comments
 (0)