From 8d4f59bed7af3c8be61f1b96c5bbb25dc4d5b3a8 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 5 Dec 2025 23:13:09 +0100 Subject: [PATCH] Clean up code --- compiler/rustc_attr_parsing/src/attributes/doc.rs | 6 ++---- compiler/rustc_attr_parsing/src/context.rs | 1 - compiler/rustc_attr_parsing/src/lib.rs | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/doc.rs b/compiler/rustc_attr_parsing/src/attributes/doc.rs index 83a6c4fc44d9..4c0a7a19e5b8 100644 --- a/compiler/rustc_attr_parsing/src/attributes/doc.rs +++ b/compiler/rustc_attr_parsing/src/attributes/doc.rs @@ -1,6 +1,3 @@ -// FIXME: to be removed -#![allow(unused_imports)] - use rustc_ast::ast::{AttrStyle, LitKind, MetaItemLit}; use rustc_feature::template; use rustc_hir::attrs::{ @@ -13,7 +10,6 @@ use thin_vec::ThinVec; use super::prelude::{Allow, AllowedTargets, Error, MethodKind, Target}; use super::{AcceptMapping, AttributeParser}; use crate::context::{AcceptContext, FinalizeContext, Stage}; -use crate::fluent_generated as fluent; use crate::parser::{ArgParser, MetaItemOrLitParser, MetaItemParser, PathParser}; use crate::session_diagnostics::{ DocAliasBadChar, DocAliasEmpty, DocAliasMalformed, DocAliasStartEnd, DocAttributeNotAttribute, @@ -355,6 +351,8 @@ impl DocParser { // FIXME: It's errorring when the attribute is passed multiple times on the command // line. + // The right fix for this would be to only check this rule if the attribute is + // not set on the command line but directly in the code. // if self.attribute.$ident.is_some() { // cx.duplicate_key(path.span(), path.word_sym().unwrap()); // return; diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index 5d15588033fd..f41ea3708788 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -165,7 +165,6 @@ attribute_parsers!( ConstStabilityParser, DocParser, MacroUseParser, - NakedParser, StabilityParser, UsedParser, diff --git a/compiler/rustc_attr_parsing/src/lib.rs b/compiler/rustc_attr_parsing/src/lib.rs index 3e9d8087a192..cb02bb9d501f 100644 --- a/compiler/rustc_attr_parsing/src/lib.rs +++ b/compiler/rustc_attr_parsing/src/lib.rs @@ -78,10 +78,10 @@ // tidy-alphabetical-start #![feature(decl_macro)] -#![recursion_limit = "256"] -// tidy-alphabetical-end #![feature(if_let_guard)] #![feature(iter_intersperse)] +#![recursion_limit = "256"] +// tidy-alphabetical-end #[macro_use] /// All the individual attribute parsers for each of rustc's built-in attributes.