Apply suggestions from code review
Co-authored-by: Wesley Wiser <wwiser@gmail.com>
This commit is contained in:
parent
f0bae6726f
commit
dcc202723a
@ -77,14 +77,14 @@ impl<'tcx> HasLocalDecls<'tcx> for Body<'tcx> {
|
|||||||
/// dialects forbid certain variants or values in certain phases.
|
/// dialects forbid certain variants or values in certain phases.
|
||||||
///
|
///
|
||||||
/// Note: Each phase's validation checks all invariants of the *previous* phases' dialects. A phase
|
/// Note: Each phase's validation checks all invariants of the *previous* phases' dialects. A phase
|
||||||
/// that changes the dialect documents what invariants must be uphelpd *after* that phase finishes.
|
/// that changes the dialect documents what invariants must be upheld *after* that phase finishes.
|
||||||
///
|
///
|
||||||
/// Warning: ordering of variants is significant.
|
/// Warning: ordering of variants is significant.
|
||||||
#[derive(Copy, Clone, TyEncodable, TyDecodable, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
#[derive(Copy, Clone, TyEncodable, TyDecodable, Debug, PartialEq, Eq, PartialOrd, Ord)]
|
||||||
#[derive(HashStable)]
|
#[derive(HashStable)]
|
||||||
pub enum MirPhase {
|
pub enum MirPhase {
|
||||||
Build = 0,
|
Build = 0,
|
||||||
// FIXME: it's unclear whether we still need this phase (and its corresponding query).
|
// FIXME(oli-obk): it's unclear whether we still need this phase (and its corresponding query).
|
||||||
// We used to have this for pre-miri MIR based const eval.
|
// We used to have this for pre-miri MIR based const eval.
|
||||||
Const = 1,
|
Const = 1,
|
||||||
/// This phase checks the MIR for promotable elements and takes them out of the main MIR body
|
/// This phase checks the MIR for promotable elements and takes them out of the main MIR body
|
||||||
|
@ -857,7 +857,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
|
|||||||
|
|
||||||
if let Some(Some(alloc)) = alloc {
|
if let Some(Some(alloc)) = alloc {
|
||||||
// Assign entire constant in a single statement.
|
// Assign entire constant in a single statement.
|
||||||
// We can't use aggregates, as we are post-aggregate-lowering.
|
// We can't use aggregates, as we run after the aggregate-lowering `MirPhase`.
|
||||||
*rval = Rvalue::Use(Operand::Constant(Box::new(Constant {
|
*rval = Rvalue::Use(Operand::Constant(Box::new(Constant {
|
||||||
span: source_info.span,
|
span: source_info.span,
|
||||||
user_ty: None,
|
user_ty: None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user