Skip to content

Commit 4a58463

Browse files
authoredOct 27, 2016
Auto merge of #36695 - arielb1:literal-match, r=eddyb
Refactor match checking to use HAIR Refactor match checking to use HAIR instead of HIR, fixing quite a few bugs in the process. r? @eddyb
·
1.87.01.14.0
2 parents c59cb71 + 3f9ebb4 commit 4a58463

24 files changed

+1904
-1331
lines changed
 

‎src/Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/librustc_const_eval/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ path = "lib.rs"
99
crate-type = ["dylib"]
1010

1111
[dependencies]
12+
arena = { path = "../libarena" }
1213
log = { path = "../liblog" }
1314
serialize = { path = "../libserialize" }
1415
rustc = { path = "../librustc" }
1516
rustc_back = { path = "../librustc_back" }
1617
rustc_const_math = { path = "../librustc_const_math" }
18+
rustc_data_structures = { path = "../librustc_data_structures" }
1719
rustc_errors = { path = "../librustc_errors" }
1820
syntax = { path = "../libsyntax" }
1921
graphviz = { path = "../libgraphviz" }

‎src/librustc_const_eval/_match.rs

Lines changed: 767 additions & 0 deletions
Large diffs are not rendered by default.

‎src/librustc_const_eval/check_match.rs

Lines changed: 225 additions & 897 deletions
Large diffs are not rendered by default.

‎src/librustc_const_eval/diagnostics.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Ensure the ordering of the match arm is correct and remove any superfluous
4040
arms.
4141
"##,
4242

43-
E0002: r##"
43+
/*E0002: r##"
4444
This error indicates that an empty match expression is invalid because the type
4545
it is matching on is non-empty (there exist values of this type). In safe code
4646
it is impossible to create an instance of an empty type, so empty match
@@ -68,10 +68,10 @@ fn foo(x: Option<String>) {
6868
}
6969
}
7070
```
71-
"##,
71+
"##,*/
7272

7373

74-
E0003: r##"
74+
/*E0003: r##"
7575
Not-a-Number (NaN) values cannot be compared for equality and hence can never
7676
match the input to a match expression. So, the following will not compile:
7777
@@ -100,7 +100,7 @@ match number {
100100
}
101101
```
102102
"##,
103-
103+
*/
104104

105105
E0004: r##"
106106
This error indicates that the compiler cannot guarantee a matching pattern for

‎src/librustc_const_eval/eval.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ pub fn note_const_eval_err<'a, 'tcx>(
392392

393393
pub fn eval_const_expr<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
394394
e: &Expr) -> ConstVal {
395-
match eval_const_expr_partial(tcx, e, ExprTypeChecked, None) {
395+
match eval_const_expr_checked(tcx, e) {
396396
Ok(r) => r,
397397
// non-const path still needs to be a fatal error, because enums are funky
398398
Err(s) => {
@@ -407,15 +407,21 @@ pub fn eval_const_expr<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
407407
}
408408
}
409409

410+
pub fn eval_const_expr_checked<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
411+
e: &Expr) -> EvalResult
412+
{
413+
eval_const_expr_partial(tcx, e, ExprTypeChecked, None)
414+
}
415+
410416
pub type FnArgMap<'a> = Option<&'a NodeMap<ConstVal>>;
411417

412-
#[derive(Clone)]
418+
#[derive(Clone, Debug)]
413419
pub struct ConstEvalErr {
414420
pub span: Span,
415421
pub kind: ErrKind,
416422
}
417423

418-
#[derive(Clone)]
424+
#[derive(Clone, Debug)]
419425
pub enum ErrKind {
420426
CannotCast,
421427
CannotCastTo(&'static str),

‎src/librustc_const_eval/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
#![feature(box_patterns)]
3232
#![feature(box_syntax)]
3333

34+
extern crate arena;
3435
#[macro_use] extern crate syntax;
3536
#[macro_use] extern crate log;
3637
#[macro_use] extern crate rustc;
3738
extern crate rustc_back;
3839
extern crate rustc_const_math;
40+
extern crate rustc_data_structures;
3941
extern crate rustc_errors;
4042
extern crate graphviz;
4143
extern crate syntax_pos;
@@ -46,7 +48,9 @@ extern crate serialize as rustc_serialize; // used by deriving
4648
pub mod diagnostics;
4749

4850
mod eval;
51+
mod _match;
4952
pub mod check_match;
53+
pub mod pattern;
5054

5155
pub use eval::*;
5256

‎src/librustc_const_eval/pattern.rs

Lines changed: 612 additions & 0 deletions
Large diffs are not rendered by default.

‎src/librustc_mir/build/matches/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
7373
Test {
7474
span: match_pair.pattern.span,
7575
kind: TestKind::Range {
76-
lo: lo.clone(),
77-
hi: hi.clone(),
76+
lo: Literal::Value { value: lo.clone() },
77+
hi: Literal::Value { value: hi.clone() },
7878
ty: match_pair.pattern.ty.clone(),
7979
},
8080
}

‎src/librustc_mir/build/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111
use hair::cx::Cx;
12+
use hair::Pattern;
13+
1214
use rustc::middle::region::{CodeExtent, CodeExtentData, ROOT_CODE_EXTENT};
1315
use rustc::ty::{self, Ty};
1416
use rustc::mir::repr::*;
@@ -339,7 +341,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
339341
let lvalue = Lvalue::Local(Local::new(index + 1));
340342

341343
if let Some(pattern) = pattern {
342-
let pattern = self.hir.irrefutable_pat(pattern);
344+
let pattern = Pattern::from_hir(self.hir.tcx(), pattern);
343345
scope = self.declare_bindings(scope, ast_block.span, &pattern);
344346
unpack!(block = self.lvalue_into_pattern(block, pattern, &lvalue));
345347
}

‎src/librustc_mir/hair/cx/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn mirror_stmts<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
5757
let remainder_extent =
5858
cx.tcx.region_maps.lookup_code_extent(remainder_extent);
5959

60-
let pattern = cx.irrefutable_pat(&local.pat);
60+
let pattern = Pattern::from_hir(cx.tcx, &local.pat);
6161
result.push(StmtRef::Mirror(Box::new(Stmt {
6262
span: stmt.span,
6363
kind: StmtKind::Let {

‎src/librustc_mir/hair/cx/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ fn to_borrow_kind(m: hir::Mutability) -> BorrowKind {
657657
fn convert_arm<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
658658
arm: &'tcx hir::Arm) -> Arm<'tcx> {
659659
Arm {
660-
patterns: arm.pats.iter().map(|p| cx.refutable_pat(p)).collect(),
660+
patterns: arm.pats.iter().map(|p| Pattern::from_hir(cx.tcx, p)).collect(),
661661
guard: arm.guard.to_ref(),
662662
body: arm.body.to_ref(),
663663
}

‎src/librustc_mir/hair/cx/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,4 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
196196

197197
mod block;
198198
mod expr;
199-
mod pattern;
200199
mod to_ref;

‎src/librustc_mir/hair/cx/pattern.rs

Lines changed: 0 additions & 328 deletions
This file was deleted.

‎src/librustc_mir/hair/mod.rs

Lines changed: 3 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
//! unit-tested and separated from the Rust source and compiler data
1515
//! structures.
1616
17-
use rustc::mir::repr::{BinOp, BorrowKind, Field, Literal, Mutability, UnOp,
18-
TypedConstVal};
19-
use rustc::middle::const_val::ConstVal;
17+
use rustc::mir::repr::{BinOp, BorrowKind, Field, Literal, UnOp, TypedConstVal};
2018
use rustc::hir::def_id::DefId;
2119
use rustc::middle::region::CodeExtent;
2220
use rustc::ty::subst::Substs;
@@ -28,6 +26,8 @@ use self::cx::Cx;
2826

2927
pub mod cx;
3028

29+
pub use rustc_const_eval::pattern::{BindingMode, Pattern, PatternKind, FieldPattern};
30+
3131
#[derive(Clone, Debug)]
3232
pub struct Block<'tcx> {
3333
pub extent: CodeExtent,
@@ -266,86 +266,12 @@ pub struct Arm<'tcx> {
266266
pub body: ExprRef<'tcx>,
267267
}
268268

269-
#[derive(Clone, Debug)]
270-
pub struct Pattern<'tcx> {
271-
pub ty: Ty<'tcx>,
272-
pub span: Span,
273-
pub kind: Box<PatternKind<'tcx>>,
274-
}
275-
276269
#[derive(Copy, Clone, Debug)]
277270
pub enum LogicalOp {
278271
And,
279272
Or,
280273
}
281274

282-
#[derive(Clone, Debug)]
283-
pub enum PatternKind<'tcx> {
284-
Wild,
285-
286-
/// x, ref x, x @ P, etc
287-
Binding {
288-
mutability: Mutability,
289-
name: ast::Name,
290-
mode: BindingMode<'tcx>,
291-
var: ast::NodeId,
292-
ty: Ty<'tcx>,
293-
subpattern: Option<Pattern<'tcx>>,
294-
},
295-
296-
/// Foo(...) or Foo{...} or Foo, where `Foo` is a variant name from an adt with >1 variants
297-
Variant {
298-
adt_def: AdtDef<'tcx>,
299-
variant_index: usize,
300-
subpatterns: Vec<FieldPattern<'tcx>>,
301-
},
302-
303-
/// (...), Foo(...), Foo{...}, or Foo, where `Foo` is a variant name from an adt with 1 variant
304-
Leaf {
305-
subpatterns: Vec<FieldPattern<'tcx>>,
306-
},
307-
308-
/// box P, &P, &mut P, etc
309-
Deref {
310-
subpattern: Pattern<'tcx>,
311-
},
312-
313-
Constant {
314-
value: ConstVal,
315-
},
316-
317-
Range {
318-
lo: Literal<'tcx>,
319-
hi: Literal<'tcx>,
320-
},
321-
322-
/// matches against a slice, checking the length and extracting elements
323-
Slice {
324-
prefix: Vec<Pattern<'tcx>>,
325-
slice: Option<Pattern<'tcx>>,
326-
suffix: Vec<Pattern<'tcx>>,
327-
},
328-
329-
/// fixed match against an array, irrefutable
330-
Array {
331-
prefix: Vec<Pattern<'tcx>>,
332-
slice: Option<Pattern<'tcx>>,
333-
suffix: Vec<Pattern<'tcx>>,
334-
},
335-
}
336-
337-
#[derive(Copy, Clone, Debug)]
338-
pub enum BindingMode<'tcx> {
339-
ByValue,
340-
ByRef(&'tcx Region, BorrowKind),
341-
}
342-
343-
#[derive(Clone, Debug)]
344-
pub struct FieldPattern<'tcx> {
345-
pub field: Field,
346-
pub pattern: Pattern<'tcx>,
347-
}
348-
349275
///////////////////////////////////////////////////////////////////////////
350276
// The Mirror trait
351277

‎src/test/compile-fail/const-eval-overflow-2.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ const NEG_128: i8 = -128;
2121
const NEG_NEG_128: i8 = -NEG_128;
2222
//~^ ERROR constant evaluation error
2323
//~| attempt to negate with overflow
24-
//~| ERROR constant evaluation error
25-
//~| attempt to negate with overflow
26-
//~| ERROR constant evaluation error
27-
//~| attempt to negate with overflow
2824

2925
fn main() {
3026
match -128i8 {

‎src/test/compile-fail/const-pattern-not-const-evaluable.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ const fn foo() -> Cake {
2525
Marmor
2626
//~^ ERROR: constant evaluation error [E0080]
2727
//~| unimplemented constant expression: enum variants
28-
//~^^^ ERROR: constant evaluation error [E0080]
29-
//~| unimplemented constant expression: enum variants
3028
}
3129

3230
const WORKS: Cake = Marmor;
3331

34-
const GOO: Cake = foo(); //~ NOTE for expression here
32+
const GOO: Cake = foo();
3533

3634
fn main() {
3735
match BlackForest {

‎src/test/compile-fail/issue-26158.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(slice_patterns)]
12+
13+
fn main() {
14+
let x: &[u32] = &[];
15+
let &[[ref _a, ref _b..]..] = x; //~ ERROR refutable pattern
16+
}

‎src/test/compile-fail/issue-6804.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,24 @@
1111
#![feature(rustc_attrs)]
1212
#![feature(slice_patterns)]
1313
#![allow(dead_code)]
14+
#![deny(illegal_floating_point_constant_pattern)]
1415

1516
// Matching against NaN should result in a warning
1617

1718
use std::f64::NAN;
1819

1920
#[rustc_error]
20-
fn main() { //~ ERROR compilation successful
21+
fn main() {
2122
let x = NAN;
2223
match x {
23-
NAN => {},
24+
NAN => {}, //~ ERROR floating point constants cannot be used
25+
//~| WARNING hard error
2426
_ => {},
2527
};
26-
//~^^^ WARNING unmatchable NaN in pattern, use the is_nan method in a guard instead
27-
//~| WARNING floating point constants cannot be used
28-
//~| WARNING this was previously accepted
28+
2929
match [x, 1.0] {
30-
[NAN, _] => {},
30+
[NAN, _] => {}, //~ ERROR floating point constants cannot be used
31+
//~| WARNING hard error
3132
_ => {},
3233
};
33-
//~^^^ WARNING unmatchable NaN in pattern, use the is_nan method in a guard instead
34-
//~| WARNING floating point constants cannot be used
35-
//~| WARNING this was previously accepted
3634
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(advanced_slice_patterns, slice_patterns)]
12+
13+
fn main() {
14+
let buf = &[0, 1, 2, 3];
15+
16+
match buf {
17+
b"AAAA" => {},
18+
&[0x41, 0x41, 0x41, 0x41] => {} //~ ERROR unreachable pattern
19+
_ => {}
20+
}
21+
22+
match buf {
23+
&[0x41, 0x41, 0x41, 0x41] => {}
24+
b"AAAA" => {}, //~ ERROR unreachable pattern
25+
_ => {}
26+
}
27+
28+
match buf {
29+
&[_, 0x41, 0x41, 0x41] => {},
30+
b"AAAA" => {}, //~ ERROR unreachable pattern
31+
_ => {}
32+
}
33+
34+
match buf {
35+
&[0x41, .., 0x41] => {}
36+
b"AAAA" => {}, //~ ERROR unreachable pattern
37+
_ => {}
38+
}
39+
40+
match buf { //~ ERROR non-exhaustive
41+
b"AAAA" => {}
42+
}
43+
44+
let buf: &[u8] = buf;
45+
46+
match buf {
47+
b"AAAA" => {},
48+
&[0x41, 0x41, 0x41, 0x41] => {} //~ ERROR unreachable pattern
49+
_ => {}
50+
}
51+
52+
match buf {
53+
&[0x41, 0x41, 0x41, 0x41] => {}
54+
b"AAAA" => {}, //~ ERROR unreachable pattern
55+
_ => {}
56+
}
57+
58+
match buf {
59+
&[_, 0x41, 0x41, 0x41] => {},
60+
b"AAAA" => {}, //~ ERROR unreachable pattern
61+
_ => {}
62+
}
63+
64+
match buf {
65+
&[0x41, .., 0x41] => {}
66+
b"AAAA" => {}, //~ ERROR unreachable pattern
67+
_ => {}
68+
}
69+
70+
match buf { //~ ERROR non-exhaustive
71+
b"AAAA" => {}
72+
}
73+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(slice_patterns)]
12+
13+
fn main() {
14+
let buf = &[0u8; 4];
15+
match buf {
16+
&[0, 1, 0, 0] => unimplemented!(),
17+
b"true" => unimplemented!(),
18+
_ => {}
19+
}
20+
21+
match buf {
22+
b"true" => unimplemented!(),
23+
&[0, 1, 0, 0] => unimplemented!(),
24+
_ => {}
25+
}
26+
27+
match buf {
28+
b"true" => unimplemented!(),
29+
&[0, x, 0, 0] => assert_eq!(x, 0),
30+
_ => unimplemented!(),
31+
}
32+
33+
let buf: &[u8] = buf;
34+
35+
match buf {
36+
&[0, 1, 0, 0] => unimplemented!(),
37+
&[_] => unimplemented!(),
38+
&[_, _, _, _, _, ..] => unimplemented!(),
39+
b"true" => unimplemented!(),
40+
_ => {}
41+
}
42+
43+
match buf {
44+
b"true" => unimplemented!(),
45+
&[0, 1, 0, 0] => unimplemented!(),
46+
_ => {}
47+
}
48+
49+
match buf {
50+
b"true" => unimplemented!(),
51+
&[0, x, 0, 0] => assert_eq!(x, 0),
52+
_ => unimplemented!(),
53+
}
54+
}

‎src/test/run-pass/vec-matching.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,26 @@ fn e() {
144144
assert_eq!(c, 1);
145145
}
146146

147+
fn f() {
148+
let x = &[1, 2, 3, 4, 5];
149+
let [a, [b, [c, ..].., d].., e] = *x;
150+
assert_eq!((a, b, c, d, e), (1, 2, 3, 4, 5));
151+
152+
let x: &[isize] = x;
153+
let (a, b, c, d, e) = match *x {
154+
[a, [b, [c, ..].., d].., e] => (a, b, c, d, e),
155+
_ => unimplemented!()
156+
};
157+
158+
assert_eq!((a, b, c, d, e), (1, 2, 3, 4, 5));
159+
}
160+
147161
pub fn main() {
148162
a();
149163
b();
150164
b_slice();
151165
c();
152166
d();
153167
e();
168+
f();
154169
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
enum Enum {
12+
A, B, C, D, E, F
13+
}
14+
use Enum::*;
15+
16+
struct S(Enum, ());
17+
struct Sd { x: Enum, y: () }
18+
19+
fn main() {
20+
match (A, ()) {
21+
(A, _) => {}
22+
}
23+
24+
match (A, A) {
25+
(_, A) => {}
26+
}
27+
28+
match ((A, ()), ()) {
29+
((A, ()), _) => {}
30+
}
31+
32+
match ((A, ()), A) {
33+
((A, ()), _) => {}
34+
}
35+
36+
match ((A, ()), ()) {
37+
((A, _), _) => {}
38+
}
39+
40+
41+
match S(A, ()) {
42+
S(A, _) => {}
43+
}
44+
45+
match (Sd { x: A, y: () }) {
46+
Sd { x: A, y: _ } => {}
47+
}
48+
49+
match Some(A) {
50+
Some(A) => (),
51+
None => ()
52+
}
53+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
error[E0004]: non-exhaustive patterns: `(B, _)`, `(C, _)`, `(D, _)` and 2 more not covered
2+
--> $DIR/issue-35609.rs:20:11
3+
|
4+
20 | match (A, ()) {
5+
| ^^^^^^^ patterns `(B, _)`, `(C, _)`, `(D, _)` and 2 more not covered
6+
7+
error[E0004]: non-exhaustive patterns: `(A, B)`, `(B, B)`, `(C, B)` and 27 more not covered
8+
--> $DIR/issue-35609.rs:24:11
9+
|
10+
24 | match (A, A) {
11+
| ^^^^^^ patterns `(A, B)`, `(B, B)`, `(C, B)` and 27 more not covered
12+
13+
error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
14+
--> $DIR/issue-35609.rs:28:11
15+
|
16+
28 | match ((A, ()), ()) {
17+
| ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
18+
19+
error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
20+
--> $DIR/issue-35609.rs:32:11
21+
|
22+
32 | match ((A, ()), A) {
23+
| ^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
24+
25+
error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
26+
--> $DIR/issue-35609.rs:36:11
27+
|
28+
36 | match ((A, ()), ()) {
29+
| ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
30+
31+
error[E0004]: non-exhaustive patterns: `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
32+
--> $DIR/issue-35609.rs:41:11
33+
|
34+
41 | match S(A, ()) {
35+
| ^^^^^^^^ patterns `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
36+
37+
error[E0004]: non-exhaustive patterns: `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
38+
--> $DIR/issue-35609.rs:45:11
39+
|
40+
45 | match (Sd { x: A, y: () }) {
41+
| ^^^^^^^^^^^^^^^^^^^^ patterns `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
42+
43+
error[E0004]: non-exhaustive patterns: `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
44+
--> $DIR/issue-35609.rs:49:11
45+
|
46+
49 | match Some(A) {
47+
| ^^^^^^^ patterns `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
48+
49+
error: aborting due to 8 previous errors
50+

0 commit comments

Comments
 (0)
Please sign in to comment.