diff options
| author | b-naber <b_naber@gmx.de> | 2023-06-21 18:01:31 +0000 |
|---|---|---|
| committer | b-naber <b_naber@gmx.de> | 2023-07-17 22:00:43 +0000 |
| commit | e18e3761ced3695e9d7a920b223a49767dd4f1f6 (patch) | |
| tree | 69c69c631a3f34b290a48c3122e98d7f30b5f8d4 /tests/ui/pattern | |
| parent | 2827aa975257d03f21c75fa27a594079a9da31ba (diff) | |
| download | rust-e18e3761ced3695e9d7a920b223a49767dd4f1f6.tar.gz rust-e18e3761ced3695e9d7a920b223a49767dd4f1f6.zip | |
add test, bless tests
Diffstat (limited to 'tests/ui/pattern')
| -rw-r--r-- | tests/ui/pattern/issue-76342.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/pattern/issue-76342.rs b/tests/ui/pattern/issue-76342.rs new file mode 100644 index 00000000000..2b3d3e522f2 --- /dev/null +++ b/tests/ui/pattern/issue-76342.rs @@ -0,0 +1,16 @@ +// check-pass +#![allow(unused_variables)] +struct Zeroes; +impl Into<[usize; 2]> for Zeroes { + fn into(self) -> [usize; 2] { [0; 2] } +} +impl Into<[usize; 3]> for Zeroes { + fn into(self) -> [usize; 3] { [0; 3] } +} +impl Into<[usize; 4]> for Zeroes { + fn into(self) -> [usize; 4] { [0; 4] } +} +fn main() { + let [a, b, c] = Zeroes.into(); // ERROR: type annotations needed + let [d, e, f]: [_; 3] = Zeroes.into(); // Works great +} |
