Skip to content

Commit de7f598

Browse files
Apply first review round suggestions
1 parent 466e852 commit de7f598

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

compiler/rustc_feature/src/removed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ declare_features! (
101101
Some("never properly implemented; requires significant design work"), 127655),
102102
/// Allows deriving traits as per `SmartPointer` specification
103103
(removed, derive_smart_pointer, "1.84.0", Some(123430), Some("replaced by `CoercePointee`"), 131284),
104+
/// Allows `#[doc(cfg_hide(...))]`.
105+
(removed, doc_cfg_hide, "1.57.0", Some(43781), Some("merged into `doc_cfg`"), 138907),
104106
/// Allows using `#[doc(keyword = "...")]`.
105107
(removed, doc_keyword, "1.58.0", Some(51315),
106108
Some("merged into `#![feature(rustdoc_internals)]`"), 90420),

compiler/rustc_passes/messages.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ passes_doc_cfg_hide_takes_list =
153153
`#[doc(cfg_hide(...))]` takes a list of attributes
154154
155155
passes_doc_auto_cfg_expects_hide_or_show =
156-
`only "hide" or "show" are allowed in "#[doc(auto_cfg(...))]"`
156+
only `hide` or `show` are allowed in `#[doc(auto_cfg(...))]`
157157
158158
passes_doc_auto_cfg_hide_show_expects_list =
159159
`#![doc(auto_cfg({$attr_name}(...)))]` expects a list of items
@@ -162,7 +162,7 @@ passes_doc_auto_cfg_hide_show_unexpected_item =
162162
`#![doc(auto_cfg({$attr_name}(...)))]` only accepts identifiers or key/value items
163163
164164
passes_doc_auto_cfg_wrong_literal =
165-
`expected boolean for #[doc(auto_cfg = ...)]`
165+
expected boolean for `#[doc(auto_cfg = ...)]`
166166
167167
passes_doc_expect_str =
168168
doc {$attr_name} attribute expects a string: #[doc({$attr_name} = "a")]

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,7 @@ symbols! {
877877
doc_alias,
878878
doc_auto_cfg,
879879
doc_cfg,
880+
doc_cfg_hide,
880881
doc_keyword,
881882
doc_masked,
882883
doc_notable_trait,

src/librustdoc/passes/propagate_doc_cfg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ fn is_cfg_token(token: &TokenTree) -> bool {
3838
TokenTree::Token(
3939
Token {
4040
kind: TokenKind::Ident(
41-
ident,
41+
sym::cfg,
4242
_,
4343
),
4444
..
4545
},
4646
_,
47-
) if *ident == sym::cfg,
47+
),
4848
)
4949
}
5050

src/librustdoc/visit_ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_hir::attrs::AttributeKind;
99
use rustc_hir::def::{DefKind, MacroKinds, Res};
1010
use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId, LocalDefIdSet};
1111
use rustc_hir::intravisit::{Visitor, walk_body, walk_item};
12-
use rustc_hir::{CRATE_HIR_ID, Node, find_attr};
12+
use rustc_hir::{Node, find_attr};
1313
use rustc_middle::hir::nested_filter;
1414
use rustc_middle::ty::TyCtxt;
1515
use rustc_span::Span;

tests/rustdoc-ui/doc-cfg.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: `only "hide" or "show" are allowed in "#[doc(auto_cfg(...))]"`
1+
error: only `hide` or `show` are allowed in `#[doc(auto_cfg(...))]`
22
--> $DIR/doc-cfg.rs:11:7
33
|
44
LL | #[doc(auto_cfg(42))]
@@ -30,13 +30,13 @@ error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value item
3030
LL | #[doc(auto_cfg(hide(foo::bar)))]
3131
| ^^^^^^^^
3232

33-
error: `expected boolean for #[doc(auto_cfg = ...)]`
33+
error: expected boolean for `#[doc(auto_cfg = ...)]`
3434
--> $DIR/doc-cfg.rs:16:7
3535
|
3636
LL | #[doc(auto_cfg = 42)]
3737
| ^^^^^^^^^^^^^
3838

39-
error: `expected boolean for #[doc(auto_cfg = ...)]`
39+
error: expected boolean for `#[doc(auto_cfg = ...)]`
4040
--> $DIR/doc-cfg.rs:17:7
4141
|
4242
LL | #[doc(auto_cfg = "a")]

0 commit comments

Comments
 (0)