Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f40aa59

Browse files
Rename doc(primitive) into rustc_doc_primitive
1 parent 789ee5e commit f40aa59

File tree

6 files changed

+6
-19
lines changed

6 files changed

+6
-19
lines changed

compiler/rustc_feature/src/active.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ declare_features! (
225225
(active, rustc_allow_const_fn_unstable, "1.49.0", Some(69399), None),
226226
/// Allows using compiler's own crates.
227227
(active, rustc_private, "1.0.0", Some(27812), None),
228-
/// Allows using internal rustdoc features like `doc(primitive)` or `doc(keyword)`.
228+
/// Allows using internal rustdoc features like `doc(keyword)`.
229229
(active, rustdoc_internals, "1.58.0", Some(90418), None),
230230
/// Allows using the `rustdoc::missing_doc_code_examples` lint
231231
(active, rustdoc_missing_doc_code_examples, "1.31.0", Some(101730), None),

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,10 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
778778
definition of a trait, it's currently in experimental form and should be changed before \
779779
being exposed outside of the std"
780780
),
781+
rustc_attr!(
782+
rustc_doc_primitive, Normal, template!(NameValueStr: "primitive name"), ErrorFollowing,
783+
r#"`rustc_doc_primitive` is a rustc internal attribute"#,
784+
),
781785

782786
// ==========================================================================
783787
// Internal attributes, Testing:

compiler/rustc_passes/messages.ftl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,6 @@ passes_doc_test_unknown =
148148
passes_doc_test_takes_list =
149149
`#[doc(test(...)]` takes a list of attributes
150150
151-
passes_doc_primitive =
152-
`doc(primitive)` should never have been stable
153-
154151
passes_doc_cfg_hide_takes_list =
155152
`#[doc(cfg_hide(...)]` takes a list of attributes
156153

compiler/rustc_passes/src/check_attr.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,17 +1109,6 @@ impl CheckAttrVisitor<'_> {
11091109
}
11101110
}
11111111

1112-
sym::primitive => {
1113-
if !self.tcx.features().rustdoc_internals {
1114-
self.tcx.emit_spanned_lint(
1115-
INVALID_DOC_ATTRIBUTES,
1116-
hir_id,
1117-
i_meta.span,
1118-
errors::DocPrimitive,
1119-
);
1120-
}
1121-
}
1122-
11231112
_ => {
11241113
let path = rustc_ast_pretty::pprust::path_to_string(&i_meta.path);
11251114
if i_meta.has_name(sym::spotlight) {

compiler/rustc_passes/src/errors.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,6 @@ pub struct DocTestTakesList;
288288
#[diag(passes_doc_cfg_hide_takes_list)]
289289
pub struct DocCfgHideTakesList;
290290

291-
#[derive(LintDiagnostic)]
292-
#[diag(passes_doc_primitive)]
293-
pub struct DocPrimitive;
294-
295291
#[derive(LintDiagnostic)]
296292
#[diag(passes_doc_test_unknown_any)]
297293
pub struct DocTestUnknownAny {

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,7 @@ symbols! {
12451245
rustc_diagnostic_macros,
12461246
rustc_dirty,
12471247
rustc_do_not_const_check,
1248+
rustc_doc_primitive,
12481249
rustc_dummy,
12491250
rustc_dump_env_program_clauses,
12501251
rustc_dump_program_clauses,

0 commit comments

Comments
 (0)