Skip to content

Commit d40f30e

Browse files
committedJun 21, 2024
Auto merge of #126781 - matthiaskrgr:rollup-5u4pens, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #126125 (Improve conflict marker recovery) - #126481 (Add `powerpc-unknown-openbsd` maintenance status) - #126613 (Print the tested value in int_log tests) - #126617 (Expand `avx512_target_feature` to include VEX variants) - #126700 (Make edition dependent `:expr` macro fragment act like the edition-dependent `:pat` fragment does) - #126707 (Pass target to inaccessible-temp-dir rmake test) - #126767 (`StaticForeignItem` and `StaticItem` are the same) - #126774 (Fix another assertion failure for some Expect diagnostics.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e32ea48 + d86736c commit d40f30e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+300
-237
lines changed
 

‎compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3184,38 +3184,6 @@ pub struct StaticItem {
31843184
pub expr: Option<P<Expr>>,
31853185
}
31863186

3187-
/// A static item in `extern` block.
3188-
// This struct is identical to StaticItem for now but it's going to have a safety attribute.
3189-
#[derive(Clone, Encodable, Decodable, Debug)]
3190-
pub struct StaticForeignItem {
3191-
pub ty: P<Ty>,
3192-
pub safety: Safety,
3193-
pub mutability: Mutability,
3194-
pub expr: Option<P<Expr>>,
3195-
}
3196-
3197-
impl From<StaticItem> for StaticForeignItem {
3198-
fn from(static_item: StaticItem) -> StaticForeignItem {
3199-
StaticForeignItem {
3200-
ty: static_item.ty,
3201-
safety: static_item.safety,
3202-
mutability: static_item.mutability,
3203-
expr: static_item.expr,
3204-
}
3205-
}
3206-
}
3207-
3208-
impl From<StaticForeignItem> for StaticItem {
3209-
fn from(static_item: StaticForeignItem) -> StaticItem {
3210-
StaticItem {
3211-
ty: static_item.ty,
3212-
safety: static_item.safety,
3213-
mutability: static_item.mutability,
3214-
expr: static_item.expr,
3215-
}
3216-
}
3217-
}
3218-
32193187
#[derive(Clone, Encodable, Decodable, Debug)]
32203188
pub struct ConstItem {
32213189
pub defaultness: Defaultness,
@@ -3430,7 +3398,7 @@ impl TryFrom<ItemKind> for AssocItemKind {
34303398
#[derive(Clone, Encodable, Decodable, Debug)]
34313399
pub enum ForeignItemKind {
34323400
/// A foreign static item (`static FOO: u8`).
3433-
Static(Box<StaticForeignItem>),
3401+
Static(Box<StaticItem>),
34343402
/// An foreign function.
34353403
Fn(Box<Fn>),
34363404
/// An foreign type.

‎compiler/rustc_ast/src/mut_visit.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,12 +1310,7 @@ pub fn noop_flat_map_item<K: NoopVisitItemKind>(
13101310
impl NoopVisitItemKind for ForeignItemKind {
13111311
fn noop_visit(&mut self, visitor: &mut impl MutVisitor) {
13121312
match self {
1313-
ForeignItemKind::Static(box StaticForeignItem {
1314-
ty,
1315-
mutability: _,
1316-
expr,
1317-
safety: _,
1318-
}) => {
1313+
ForeignItemKind::Static(box StaticItem { ty, mutability: _, expr, safety: _ }) => {
13191314
visitor.visit_ty(ty);
13201315
visit_opt(expr, |expr| visitor.visit_expr(expr));
13211316
}

0 commit comments

Comments
 (0)
Please sign in to comment.