Skip to content

Commit c4ff80c

Browse files
committed
moved renamed docs stderr formatted | elide-errors-on-mismatched-tuple.rs
1 parent 8f9a3ad commit c4ff80c

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

tests/ui/elide-errors-on-mismatched-tuple.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//! Regression test for issue #50333: elide irrelevant E0277 errors on tuple mismatch
2+
3+
// Hide irrelevant E0277 errors (#50333)
4+
5+
trait T {}
6+
7+
struct A;
8+
9+
impl T for A {}
10+
11+
impl A {
12+
fn new() -> Self {
13+
Self {}
14+
}
15+
}
16+
17+
fn main() {
18+
// This creates a tuple type mismatch: 2-element tuple destructured into 3 variables
19+
let (a, b, c) = (A::new(), A::new());
20+
//~^ ERROR mismatched types
21+
22+
// This line should NOT produce an E0277 error about `Sized` trait bounds,
23+
// because `a`, `b`, and `c` are `TyErr` due to the mismatch above
24+
let _ts: Vec<&dyn T> = vec![&a, &b, &c];
25+
}

tests/ui/elide-errors-on-mismatched-tuple.stderr renamed to tests/ui/mismatched_types/elide-on-tuple-mismatch.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0308]: mismatched types
2-
--> $DIR/elide-errors-on-mismatched-tuple.rs:14:9
2+
--> $DIR/elide-on-tuple-mismatch.rs:19:9
33
|
4-
LL | let (a, b, c) = (A::new(), A::new()); // This tuple is 2 elements, should be three
4+
LL | let (a, b, c) = (A::new(), A::new());
55
| ^^^^^^^^^ -------------------- this expression has type `(A, A)`
66
| |
77
| expected a tuple with 2 elements, found one with 3 elements

0 commit comments

Comments
 (0)