Remove the requirement that Variable implement Default.

This commit is contained in:
Dan Gohman
2017-11-06 11:10:14 -08:00
parent 4091688cc0
commit 1d8df2ed1e
3 changed files with 13 additions and 28 deletions

View File

@@ -33,7 +33,7 @@ use std::mem;
/// can be declared.
pub struct SSABuilder<Variable>
where
Variable: EntityRef + Default,
Variable: EntityRef,
{
// Records for every variable and for every revelant block, the last definition of
// the variable in the block.
@@ -145,7 +145,7 @@ impl ReservedValue for Block {
impl<Variable> SSABuilder<Variable>
where
Variable: EntityRef + Default,
Variable: EntityRef,
{
/// Allocate a new blank SSA builder struct. Use the API function to interact with the struct.
pub fn new() -> Self {
@@ -252,7 +252,7 @@ fn emit_zero(ty: Type, mut cur: FuncCursor) -> Value {
///
impl<Variable> SSABuilder<Variable>
where
Variable: EntityRef + Default,
Variable: EntityRef,
{
/// Declares a new definition of a variable in a given basic block.
/// The SSA value is passed as an argument because it should be created with
@@ -735,11 +735,6 @@ mod tests {
self.0 as usize
}
}
impl Default for Variable {
fn default() -> Variable {
Variable(u32::MAX)
}
}
#[test]
fn simple_block() {