diff options
Diffstat (limited to 'compiler/rustc_ast/src')
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_ast/src/node_id.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_ast/src/util/comments.rs | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index f933b9b161c..31596a1e9bf 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -2554,10 +2554,9 @@ pub enum AttrStyle { } rustc_index::newtype_index! { - pub struct AttrId { - ENCODABLE = custom - DEBUG_FORMAT = "AttrId({})" - } + #[custom_encodable] + #[debug_format = "AttrId({})]"] + pub struct AttrId {} } impl<S: Encoder> Encodable<S> for AttrId { diff --git a/compiler/rustc_ast/src/node_id.rs b/compiler/rustc_ast/src/node_id.rs index 7b5acc3f485..daa82996b3d 100644 --- a/compiler/rustc_ast/src/node_id.rs +++ b/compiler/rustc_ast/src/node_id.rs @@ -8,9 +8,8 @@ rustc_index::newtype_index! { /// This is later turned into [`DefId`] and `HirId` for the HIR. /// /// [`DefId`]: rustc_span::def_id::DefId - pub struct NodeId { - DEBUG_FORMAT = "NodeId({})" - } + #[debug_format = "NodeId({})"] + pub struct NodeId {} } rustc_data_structures::define_id_collections!(NodeMap, NodeSet, NodeMapEntry, NodeId); diff --git a/compiler/rustc_ast/src/util/comments.rs b/compiler/rustc_ast/src/util/comments.rs index 35454c3a670..275ed02c2b9 100644 --- a/compiler/rustc_ast/src/util/comments.rs +++ b/compiler/rustc_ast/src/util/comments.rs @@ -51,7 +51,7 @@ pub fn beautify_doc_string(data: Symbol, kind: CommentKind) -> Symbol { if i != 0 || j != lines.len() { Some((i, j)) } else { None } } - fn get_horizontal_trim<'a>(lines: &'a [&str], kind: CommentKind) -> Option<String> { + fn get_horizontal_trim(lines: &[&str], kind: CommentKind) -> Option<String> { let mut i = usize::MAX; let mut first = true; |
