diff options
Diffstat (limited to 'tests/ui/specialization/issue-51892.rs')
-rw-r--r-- | tests/ui/specialization/issue-51892.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/specialization/issue-51892.rs b/tests/ui/specialization/issue-51892.rs new file mode 100644 index 000000000..5c0625414 --- /dev/null +++ b/tests/ui/specialization/issue-51892.rs @@ -0,0 +1,18 @@ +#![allow(incomplete_features)] +#![feature(generic_const_exprs)] +#![feature(specialization)] + +pub trait Trait { + type Type; +} + +impl<T: ?Sized> Trait for T { + default type Type = [u8; 1]; +} + +impl<T: Trait> Trait for *const T { + type Type = [u8; std::mem::size_of::<<T as Trait>::Type>()]; + //~^ ERROR: unconstrained generic constant +} + +fn main() {} |