Rollup merge of #138911 - compiler-errors:define-opaque, r=oli-obk

Allow defining opaques in statics and consts

r? oli-obk

Fixes https://github.com/rust-lang/rust/issues/138902
This commit is contained in:
Jacob Pratt 2025-03-25 20:34:49 -04:00 committed by GitHub
commit 5bd69d940e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 362 additions and 165 deletions

View file

@ -698,8 +698,14 @@ impl<'a> ExtCtxt<'a> {
name,
AttrVec::new(),
ast::ItemKind::Static(
ast::StaticItem { ty, safety: ast::Safety::Default, mutability, expr: Some(expr) }
.into(),
ast::StaticItem {
ty,
safety: ast::Safety::Default,
mutability,
expr: Some(expr),
define_opaque: None,
}
.into(),
),
)
}
@ -723,6 +729,7 @@ impl<'a> ExtCtxt<'a> {
generics: ast::Generics::default(),
ty,
expr: Some(expr),
define_opaque: None,
}
.into(),
),