tests: audit swap leak and remaining source rule boundaries
This commit is contained in:
1 parent
03305f0957
commit
ee09a7a290
12 files changed
+408
-10
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// expect: reject E7005
|
||||
// phase: 6
|
||||
// spec: docs/spec/15-source-language.md §5; §10; §14.2
|
||||
module test.nominal
|
||||
|
||||
struct PairA {
|
||||
value: u64
|
||||
}
|
||||
|
||||
struct PairB {
|
||||
value: u64
|
||||
}
|
||||
|
||||
fn total(pair: PairA) -> u64 effects [] {
|
||||
return pair.value;
|
||||
}
|
||||
|
||||
fn main() -> u64 effects [] {
|
||||
let pair = PairB { value: 42u64 };
|
||||
return total(pair); // diagnostic here: pair);
|
||||
}
|
||||
Reference in new issue
Block a user