22 lines
372 B
Rust
22 lines
372 B
Rust
// 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);
|
|
}
|