-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
900 additions
and
303 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mod clone; | ||
mod copy; | ||
mod sized; | ||
mod unsize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
use crate::test::*; | ||
|
||
#[test] | ||
fn tuples_are_clone() { | ||
test! { | ||
program { | ||
#[non_enumerable] // see above | ||
#[lang(clone)] | ||
trait Clone { } | ||
|
||
struct S {} | ||
|
||
impl Clone for u8 {} | ||
} | ||
|
||
goal { | ||
([u8],): Clone | ||
} yields { | ||
"No possible solution" | ||
} | ||
|
||
goal { | ||
(u8, [u8]): Clone | ||
} yields { | ||
"No possible solution" | ||
} | ||
|
||
goal { | ||
([u8], u8): Clone | ||
} yields { | ||
"No possible solution" | ||
} | ||
|
||
goal { | ||
(): Clone | ||
} yields { | ||
"Unique; substitution [], lifetime constraints []" | ||
} | ||
|
||
goal { | ||
(u8,): Clone | ||
} yields { | ||
"Unique; substitution [], lifetime constraints []" | ||
} | ||
|
||
goal { | ||
(u8, u8): Clone | ||
} yields { | ||
"Unique; substitution [], lifetime constraints []" | ||
} | ||
|
||
goal { | ||
exists<T> { (T, u8): Clone } | ||
} yields { | ||
"Ambiguous" | ||
} | ||
|
||
goal { | ||
forall<T> { if (T: Clone) { (T, u8): Clone } } | ||
} yields { | ||
"Unique; substitution [], lifetime constraints []" | ||
} | ||
} | ||
} |
Oops, something went wrong.