diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-02-05 09:14:39 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-05 09:14:39 -0500 |
| commit | 4f8ce9efb9ff27af430d398ca472049e3595aaa6 (patch) | |
| tree | 63e137a34f2935f1fc91eb796962a7a7fa5642a6 /src/librustc/middle | |
| parent | ca202fe181ec52998fe8843e87528bbd920605d5 (diff) | |
| parent | 42f3ac5ea610b351e404dd30199d13ffc91617d5 (diff) | |
| download | rust-4f8ce9efb9ff27af430d398ca472049e3595aaa6.tar.gz rust-4f8ce9efb9ff27af430d398ca472049e3595aaa6.zip | |
Rollup merge of #39009 - canndrew:default-unit-warnings, r=nikomatsakis
Add warning for () to ! switch With feature(never_type) enabled diverging type variables will default to `!` instead of `()`. This can cause breakages where a trait is resolved on such a type. This PR emits a future-compatibility warning when it sees this happen.
Diffstat (limited to 'src/librustc/middle')
| -rw-r--r-- | src/librustc/middle/mem_categorization.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 0e8e1921de7..9d1bcb8164a 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -1199,7 +1199,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> { PatKind::Tuple(ref subpats, ddpos) => { // (p1, ..., pN) let expected_len = match self.pat_ty(&pat)?.sty { - ty::TyTuple(ref tys) => tys.len(), + ty::TyTuple(ref tys, _) => tys.len(), ref ty => span_bug!(pat.span, "tuple pattern unexpected type {:?}", ty), }; for (i, subpat) in subpats.iter().enumerate_and_adjust(expected_len, ddpos) { |
