diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/associated-type-bounds/const-projection-err.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/associated-type-bounds/const-projection-err.rs b/tests/ui/associated-type-bounds/const-projection-err.rs new file mode 100644 index 000000000..bead85630 --- /dev/null +++ b/tests/ui/associated-type-bounds/const-projection-err.rs @@ -0,0 +1,18 @@ +// revisions: stock gce + +#![feature(associated_const_equality)] +#![cfg_attr(gce, feature(generic_const_exprs))] +//[gce]~^ WARN the feature `generic_const_exprs` is incomplete + +trait TraitWAssocConst { + const A: usize; +} + +fn foo<T: TraitWAssocConst<A = 1>>() {} + +fn bar<T: TraitWAssocConst<A = 0>>() { + foo::<T>(); + //~^ ERROR type mismatch resolving `<T as TraitWAssocConst>::A == 1` +} + +fn main() {} |