Skip to content

Rollup of 11 pull requests #51805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d259f43
Fix doc build on unknown windows target
GuillaumeGomez Jun 19, 2018
3bcb85e
`PinMut`: Add safe `get_mut` and rename unsafe fns to `get_mut_unchec…
MajorBreakfast Jun 23, 2018
f68ee0b
Fix an ICE with `continue` as an array length
varkor Jun 23, 2018
4efd5c7
Fix an ICE with continue inside a closure inside a loop condition
varkor Jun 23, 2018
dc7d77f
Add a test for break
varkor Jun 23, 2018
ee7e30f
Fix codegen tests
varkor Jun 23, 2018
74609bc
Add error for using null characters in export_name
varkor Jun 23, 2018
82803fd
Add backticks to E0558
varkor Jun 23, 2018
4b18085
add `dyn` to display of dynamic (trait) type names
zackmdavis May 27, 2018
f94c075
Add item after attribute
varkor Jun 24, 2018
fdc2275
Update broken rustc-guide links
Jun 25, 2018
2d3c369
Link the docs of panic!() and compile_error!()
ogham May 29, 2018
f85ddfb
Add sentence to compile_error!() docs
ogham May 29, 2018
c3d6ee9
Make find_breakable_scope non-mutable
varkor Jun 25, 2018
3c6c18d
Add missing \[allow(missing_docs)\]
GuillaumeGomez Jun 25, 2018
490f49f
Remove unnecessary stat64 pointer casts
cuviper Jun 25, 2018
0747968
Fix typo
Jun 25, 2018
7aab3bf
Don't ICE when performing `lower_pattern_unadjusted` on a `TyError`
estebank Jun 25, 2018
f7485df
Minify css
GuillaumeGomez Jun 25, 2018
d72a67f
Rollup merge of #51104 - zackmdavis:dynamo, r=nikomatsakis
pietroalbini Jun 26, 2018
756b694
Rollup merge of #51153 - ogham:panic-and-compile_error-docs, r=Guilla…
pietroalbini Jun 26, 2018
1215965
Rollup merge of #51642 - GuillaumeGomez:fix-unknown-windows-build, r=…
pietroalbini Jun 26, 2018
b71f6df
Rollup merge of #51730 - MajorBreakfast:pin-get-mut-unchecked, r=with…
pietroalbini Jun 26, 2018
7262824
Rollup merge of #51731 - varkor:closure-array-break-length, r=estebank
pietroalbini Jun 26, 2018
b2cf26e
Rollup merge of #51747 - varkor:export_name-null-character, r=estebank
pietroalbini Jun 26, 2018
932db19
Rollup merge of #51769 - alexcameron89:update_rustc_guide_links, r=fr…
pietroalbini Jun 26, 2018
2348dc5
Rollup merge of #51786 - cuviper:stat64-pointers, r=Mark-Simulacrum
pietroalbini Jun 26, 2018
8014713
Rollup merge of #51788 - berkus:fix-typo, r=varkor
pietroalbini Jun 26, 2018
f2a099b
Rollup merge of #51789 - estebank:issue-50577, r=oli-obk
pietroalbini Jun 26, 2018
a539885
Rollup merge of #51791 - GuillaumeGomez:minify-css, r=estebank
pietroalbini Jun 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/librustc_mir/hair/pattern/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
}

PatKind::Slice(ref prefix, ref slice, ref suffix) => {
let ty = self.tables.node_id_to_type(pat.hir_id);
match ty.sty {
ty::TyRef(_, ty, _) =>
PatternKind::Deref {
Expand All @@ -427,11 +426,12 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
pat.span, ty, prefix, slice, suffix))
},
},

ty::TySlice(..) |
ty::TyArray(..) =>
self.slice_or_array_pattern(pat.span, ty, prefix, slice, suffix),

ty::TyError => { // Avoid ICE
return Pattern { span: pat.span, ty, kind: Box::new(PatternKind::Wild) };
}
ref sty =>
span_bug!(
pat.span,
Expand All @@ -441,7 +441,6 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
}

PatKind::Tuple(ref subpatterns, ddpos) => {
let ty = self.tables.node_id_to_type(pat.hir_id);
match ty.sty {
ty::TyTuple(ref tys) => {
let subpatterns =
Expand All @@ -455,7 +454,9 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {

PatternKind::Leaf { subpatterns: subpatterns }
}

ty::TyError => { // Avoid ICE (#50577)
return Pattern { span: pat.span, ty, kind: Box::new(PatternKind::Wild) };
}
ref sty => span_bug!(pat.span, "unexpected type for tuple pattern: {:?}", sty),
}
}
Expand All @@ -464,6 +465,9 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
let var_ty = self.tables.node_id_to_type(pat.hir_id);
let region = match var_ty.sty {
ty::TyRef(r, _, _) => Some(r),
ty::TyError => { // Avoid ICE
return Pattern { span: pat.span, ty, kind: Box::new(PatternKind::Wild) };
}
_ => None,
};
let bm = *self.tables.pat_binding_modes().get(pat.hir_id)
Expand Down Expand Up @@ -505,12 +509,8 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
let def = self.tables.qpath_def(qpath, pat.hir_id);
let adt_def = match ty.sty {
ty::TyAdt(adt_def, _) => adt_def,
ty::TyError => { // Avoid ICE (#50585)
return Pattern {
span: pat.span,
ty,
kind: Box::new(PatternKind::Wild),
};
ty::TyError => { // Avoid ICE (#50585)
return Pattern { span: pat.span, ty, kind: Box::new(PatternKind::Wild) };
}
_ => span_bug!(pat.span,
"tuple struct pattern not applied to an ADT {:?}",
Expand Down
15 changes: 15 additions & 0 deletions src/test/ui/issue-50577.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
enum Foo {
Drop = assert_eq!(1, 1)
}
}
13 changes: 13 additions & 0 deletions src/test/ui/issue-50577.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error[E0317]: if may be missing an else clause
--> $DIR/issue-50577.rs:13:16
|
LL | Drop = assert_eq!(1, 1)
| ^^^^^^^^^^^^^^^^ expected (), found isize
|
= note: expected type `()`
found type `isize`
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0317`.