Prepare mir::Constant for ty::Const only supporting valtrees
This commit is contained in:
parent
3ecde6f5db
commit
3127a9c60f
38 changed files with 369 additions and 153 deletions
|
@ -377,7 +377,10 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
|
|||
let local = self.place_to_local(span, p)?;
|
||||
Ok(self.locals[local])
|
||||
}
|
||||
mir::Operand::Constant(ct) => Ok(self.add_node(Node::Leaf(ct.literal), span)),
|
||||
mir::Operand::Constant(ct) => match ct.literal {
|
||||
mir::ConstantSource::Ty(ct) => Ok(self.add_node(Node::Leaf(ct), span)),
|
||||
mir::ConstantSource::Val(..) => self.error(Some(span), "unsupported constant")?,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue