Skip to content

Commit

Permalink
Add tests ensuring slices are not Copy/Clone
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwhit committed May 9, 2020
1 parent ee4b03f commit 4d440e9
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test/slices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,35 @@ fn slices_are_well_formed() {
}
}
}

#[test]
fn slices_are_not_copy() {
test! {
program {
#[lang(copy)]
trait Copy { }
}

goal {
forall<T> { not { [T]: Copy } }
} yields {
"Unique; substitution [], lifetime constraints []"
}
}
}

#[test]
fn slices_are_not_clone() {
test! {
program {
#[lang(clone)]
trait Clone { }
}

goal {
forall<T> { not { [T]: Clone } }
} yields {
"Unique; substitution [], lifetime constraints []"
}
}
}

0 comments on commit 4d440e9

Please sign in to comment.