Skip to content

Commit 13c516e

Browse files
committed
Continue cooking
1 parent adac3bc commit 13c516e

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ fn trivial_const_provider<'tcx>(
385385
DefKind::AssocConst
386386
| DefKind::Const
387387
//| DefKind::Static { .. }
388-
| DefKind::InlineConst
388+
//| DefKind::InlineConst
389389
| DefKind::AnonConst => trivial_const(&tcx.mir_built(def).borrow()),
390390
_ => None,
391391
}
@@ -433,7 +433,7 @@ fn mir_built(tcx: TyCtxt<'_>, def: LocalDefId) -> &Steal<Body<'_>> {
433433
DefKind::AssocConst
434434
| DefKind::Const
435435
//| DefKind::Static { .. }
436-
| DefKind::InlineConst
436+
//| DefKind::InlineConst
437437
| DefKind::AnonConst
438438
) && trivial_const(&body).is_some()
439439
{

compiler/rustc_public_bridge/src/context/impls.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ impl<'tcx, B: Bridge> CompilerCtxt<'tcx, B> {
9292
} else {
9393
false
9494
};
95-
!must_override && self.tcx.is_mir_available(def_id)
95+
// FIXME: A good reason to make is_mir_available or mir_keys change behavior
96+
!must_override && self.tcx.is_mir_available(def_id) && !self.tcx.is_trivial_const(def_id)
9697
}
9798

9899
fn filter_fn_def(&self, def_id: DefId) -> Option<DefId> {

tests/ui/rustc_public-ir-print/operands.stdout

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,6 @@ fn operands(_1: u8) -> () {
397397
_89 = core::panicking::assert_failed::<usize, usize>(move _90, move _91, move _93, move _95) -> unwind unreachable;
398398
}
399399
}
400-
fn operands::{constant#0}() -> usize {
401-
let mut _0: usize;
402-
bb0: {
403-
_0 = 10_usize;
404-
return;
405-
}
406-
}
407400
fn more_operands() -> [Ctors; 3] {
408401
let mut _0: [Ctors; 3];
409402
let _1: Dummy;
@@ -447,13 +440,6 @@ fn more_operands() -> [Ctors; 3] {
447440
return;
448441
}
449442
}
450-
fn more_operands::{constant#0}() -> usize {
451-
let mut _0: usize;
452-
bb0: {
453-
_0 = 3_usize;
454-
return;
455-
}
456-
}
457443
fn closures(_1: bool, _2: bool) -> {closure@$DIR/operands.rs:47:5: 47:19} {
458444
let mut _0: {closure@$DIR/operands.rs:47:5: 47:19};
459445
debug x => _1;

0 commit comments

Comments
 (0)