about summary refs log tree commit diff
path: root/compiler/rustc_expand/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-18 13:26:31 +0000
committerbors <bors@rust-lang.org>2025-07-18 13:26:31 +0000
commit82310651b93a594a3fd69015e1562186a080d94c (patch)
tree5b05bd4dae0473e318dad7a32acf7cba9a0a6f48 /compiler/rustc_expand/src
parent6caa224a242d4c7b06c317969c51862815a4454b (diff)
parentfd18175e797f32cde999348c366bb98af41177db (diff)
downloadrust-82310651b93a594a3fd69015e1562186a080d94c.tar.gz
rust-82310651b93a594a3fd69015e1562186a080d94c.zip
Auto merge of #144130 - matthiaskrgr:rollup-t75stad, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#143280 (Remove duplicate error about raw underscore lifetime)
 - rust-lang/rust#143649 (Add test for `default_field_values` and `const_default`)
 - rust-lang/rust#143699 (Make `AsyncDrop` check that it's being implemented on a local ADT)
 - rust-lang/rust#143908 (`tests/ui`: A New Order [0/28] )
 - rust-lang/rust#143909 (docs(alloc::fmt): Make type optional, instead of matching empty string)
 - rust-lang/rust#143925 (Make slice comparisons const)
 - rust-lang/rust#143997 (Use $crate in macros for rustc_public (aka stable_mir))
 - rust-lang/rust#144013 (resolve: Make disambiguators for underscore bindings module-local)
 - rust-lang/rust#144029 (Fix wrong messages from methods with the same name from different traits)
 - rust-lang/rust#144063 (Add myself to the `infra-ci` reviewer group and adjust some infra auto-labels)
 - rust-lang/rust#144069 (ci: use windows 22 for all free runners)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_expand/src')
-rw-r--r--compiler/rustc_expand/src/build.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs
index 85683c1a03f..51d6e43ab67 100644
--- a/compiler/rustc_expand/src/build.rs
+++ b/compiler/rustc_expand/src/build.rs
@@ -3,8 +3,8 @@ use rustc_ast::token::Delimiter;
 use rustc_ast::tokenstream::TokenStream;
 use rustc_ast::util::literal;
 use rustc_ast::{
-    self as ast, AnonConst, AttrVec, BlockCheckMode, Expr, LocalKind, MatchKind, PatKind, UnOp,
-    attr, token, tokenstream,
+    self as ast, AnonConst, AttrItem, AttrVec, BlockCheckMode, Expr, LocalKind, MatchKind, PatKind,
+    UnOp, attr, token, tokenstream,
 };
 use rustc_span::source_map::Spanned;
 use rustc_span::{DUMMY_SP, Ident, Span, Symbol, kw, sym};
@@ -766,4 +766,10 @@ impl<'a> ExtCtxt<'a> {
             span,
         )
     }
+
+    // Builds an attribute fully manually.
+    pub fn attr_nested(&self, inner: AttrItem, span: Span) -> ast::Attribute {
+        let g = &self.sess.psess.attr_id_generator;
+        attr::mk_attr_from_item(g, inner, None, ast::AttrStyle::Outer, span)
+    }
 }