diff --git a/src/test/ui/const-generics/issues/issue-62220.rs b/src/test/ui/const-generics/issues/issue-62220.rs new file mode 100644 index 0000000000000..c95b306320175 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-62220.rs @@ -0,0 +1,22 @@ +// build-pass +#![allow(incomplete_features)] + +#![feature(const_generics)] +pub struct Vector([T; N]); + +pub type TruncatedVector = Vector; + +impl Vector { + /// Drop the last component and return the vector with one fewer dimension. + pub fn trunc(self) -> (TruncatedVector, T) { + unimplemented!() + } +} + +fn vec4(a: T, b: T, c: T, d: T) -> Vector { + Vector([a, b, c, d]) +} + +fn main() { + let (_xyz, _w): (TruncatedVector, u32) = vec4(0u32, 1, 2, 3).trunc(); +}