Skip to content

Commit fb89862

Browse files
committedApr 21, 2024·
Auto merge of #124241 - matthiaskrgr:rollup-xhu90xr, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #123840 (Add an intrinsic for `ptr::from_raw_parts(_mut)`) - #124224 (cleanup: unnecessary clone during lower generics args) - #124229 (Add gnullvm targets to manifest) - #124231 (remove from reviewers) - #124235 (Move some tests) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1b3fba0 + 3315bf9 commit fb89862

File tree

100 files changed

+989
-54
lines changed

Some content is hidden

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

100 files changed

+989
-54
lines changed
 

‎compiler/rustc_borrowck/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
13151315
}
13161316
AggregateKind::Adt(..)
13171317
| AggregateKind::Array(..)
1318-
| AggregateKind::Tuple { .. } => (),
1318+
| AggregateKind::Tuple { .. }
1319+
| AggregateKind::RawPtr(..) => (),
13191320
}
13201321

13211322
for operand in operands {

‎compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19211921
}
19221922
}
19231923
AggregateKind::Array(ty) => Ok(ty),
1924-
AggregateKind::Tuple => {
1924+
AggregateKind::Tuple | AggregateKind::RawPtr(..) => {
19251925
unreachable!("This should have been covered in check_rvalues");
19261926
}
19271927
}
@@ -2518,6 +2518,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25182518
AggregateKind::Closure(_, _) => None,
25192519
AggregateKind::Coroutine(_, _) => None,
25202520
AggregateKind::CoroutineClosure(_, _) => None,
2521+
AggregateKind::RawPtr(_, _) => None,
25212522
},
25222523
}
25232524
}
@@ -2539,6 +2540,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
25392540
return;
25402541
}
25412542

2543+
if let AggregateKind::RawPtr(..) = aggregate_kind {
2544+
bug!("RawPtr should only be in runtime MIR");
2545+
}
2546+
25422547
for (i, operand) in operands.iter_enumerated() {
25432548
let field_ty = match self.aggregate_field_ty(aggregate_kind, i, location) {
25442549
Ok(field_ty) => field_ty,
@@ -2757,7 +2762,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
27572762
),
27582763
),
27592764

2760-
AggregateKind::Array(_) | AggregateKind::Tuple => {
2765+
AggregateKind::Array(_) | AggregateKind::Tuple | AggregateKind::RawPtr(..) => {
27612766
(CRATE_DEF_ID.to_def_id(), ty::InstantiatedPredicates::empty())
27622767
}
27632768
};

0 commit comments

Comments
 (0)
Please sign in to comment.