Fix the fallout
This commit is contained in:
parent
0f8519c341
commit
35749923ee
19 changed files with 40 additions and 50 deletions
|
|
@ -225,11 +225,10 @@ impl<'a, 'tcx, 'v> Visitor<'v> for IntrinsicCheckingVisitor<'a, 'tcx> {
|
|||
intravisit::walk_fn(self, fk, fd, b, s);
|
||||
self.param_envs.pop();
|
||||
}
|
||||
FnKind::Closure(..) => {
|
||||
FnKind::Closure => {
|
||||
intravisit::walk_fn(self, fk, fd, b, s);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fn visit_expr(&mut self, expr: &hir::Expr) {
|
||||
|
|
|
|||
|
|
@ -1424,7 +1424,7 @@ impl<'tcx> cmt_<'tcx> {
|
|||
NonAliasable
|
||||
}
|
||||
|
||||
Categorization::StaticItem(..) => {
|
||||
Categorization::StaticItem => {
|
||||
if self.mutbl.is_mutable() {
|
||||
FreelyAliasable(AliasableStaticMut)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
|
|||
this.walk_fn(fk, fd, b, s)
|
||||
})
|
||||
}
|
||||
FnKind::Closure(..) => {
|
||||
FnKind::Closure => {
|
||||
self.walk_fn(fk, fd, b, s)
|
||||
}
|
||||
}
|
||||
|
|
@ -479,7 +479,7 @@ impl<'a> LifetimeContext<'a> {
|
|||
self.visit_generics(&sig.generics);
|
||||
self.visit_explicit_self(&sig.explicit_self);
|
||||
}
|
||||
FnKind::Closure(..) => {
|
||||
FnKind::Closure => {
|
||||
intravisit::walk_fn_decl(self, fd);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ fn ty_is_local_constructor<'tcx>(tcx: &ty::ctxt<'tcx>,
|
|||
ty::TyInt(..) |
|
||||
ty::TyUint(..) |
|
||||
ty::TyFloat(..) |
|
||||
ty::TyStr(..) |
|
||||
ty::TyStr |
|
||||
ty::TyBareFn(..) |
|
||||
ty::TyArray(..) |
|
||||
ty::TySlice(..) |
|
||||
|
|
|
|||
|
|
@ -1563,7 +1563,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
}
|
||||
|
||||
match other {
|
||||
&ObjectCandidate(..) |
|
||||
&ObjectCandidate |
|
||||
&ParamCandidate(_) | &ProjectionCandidate => match victim {
|
||||
&DefaultImplCandidate(..) => {
|
||||
self.tcx().sess.bug(
|
||||
|
|
@ -1572,16 +1572,16 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
}
|
||||
&ImplCandidate(..) |
|
||||
&ClosureCandidate(..) |
|
||||
&FnPointerCandidate(..) |
|
||||
&BuiltinObjectCandidate(..) |
|
||||
&BuiltinUnsizeCandidate(..) |
|
||||
&FnPointerCandidate |
|
||||
&BuiltinObjectCandidate |
|
||||
&BuiltinUnsizeCandidate |
|
||||
&DefaultImplObjectCandidate(..) |
|
||||
&BuiltinCandidate(..) => {
|
||||
// We have a where-clause so don't go around looking
|
||||
// for impls.
|
||||
true
|
||||
}
|
||||
&ObjectCandidate(..) |
|
||||
&ObjectCandidate |
|
||||
&ProjectionCandidate => {
|
||||
// Arbitrarily give param candidates priority
|
||||
// over projection and object candidates.
|
||||
|
|
|
|||
|
|
@ -188,21 +188,21 @@ fn compute_components<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
|
|||
// the type and then visits the types that are lexically
|
||||
// contained within. (The comments refer to relevant rules
|
||||
// from RFC1214.)
|
||||
ty::TyBool(..) | // OutlivesScalar
|
||||
ty::TyChar(..) | // OutlivesScalar
|
||||
ty::TyBool | // OutlivesScalar
|
||||
ty::TyChar | // OutlivesScalar
|
||||
ty::TyInt(..) | // OutlivesScalar
|
||||
ty::TyUint(..) | // OutlivesScalar
|
||||
ty::TyFloat(..) | // OutlivesScalar
|
||||
ty::TyEnum(..) | // OutlivesNominalType
|
||||
ty::TyStruct(..) | // OutlivesNominalType
|
||||
ty::TyBox(..) | // OutlivesNominalType (ish)
|
||||
ty::TyStr(..) | // OutlivesScalar (ish)
|
||||
ty::TyStr | // OutlivesScalar (ish)
|
||||
ty::TyArray(..) | // ...
|
||||
ty::TySlice(..) | // ...
|
||||
ty::TyRawPtr(..) | // ...
|
||||
ty::TyRef(..) | // OutlivesReference
|
||||
ty::TyTuple(..) | // ...
|
||||
ty::TyError(..) => {
|
||||
ty::TyError => {
|
||||
push_region_constraints(out, ty.regions());
|
||||
for subty in ty.walk_shallow() {
|
||||
compute_components(infcx, subty, out);
|
||||
|
|
|
|||
|
|
@ -540,14 +540,14 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
|
|||
ol, old_loan_msg)
|
||||
}
|
||||
|
||||
euv::OverloadedOperator(..) |
|
||||
euv::AddrOf(..) |
|
||||
euv::AutoRef(..) |
|
||||
euv::AutoUnsafe(..) |
|
||||
euv::ClosureInvocation(..) |
|
||||
euv::ForLoop(..) |
|
||||
euv::RefBinding(..) |
|
||||
euv::MatchDiscriminant(..) => {
|
||||
euv::OverloadedOperator |
|
||||
euv::AddrOf |
|
||||
euv::AutoRef |
|
||||
euv::AutoUnsafe |
|
||||
euv::ClosureInvocation |
|
||||
euv::ForLoop |
|
||||
euv::RefBinding |
|
||||
euv::MatchDiscriminant => {
|
||||
format!("previous borrow of `{}` occurs here{}",
|
||||
ol, old_loan_msg)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ impl<'a, 'tcx> RestrictionsContext<'a, 'tcx> {
|
|||
self.extend(result, &cmt, LpInterior(i.cleaned()))
|
||||
}
|
||||
|
||||
Categorization::StaticItem(..) => {
|
||||
Categorization::StaticItem => {
|
||||
Safe
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -942,8 +942,8 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
|
|||
"consider changing this closure to take self by mutable reference");
|
||||
}
|
||||
}
|
||||
mc::AliasableStatic(..) |
|
||||
mc::AliasableStaticMut(..) => {
|
||||
mc::AliasableStatic |
|
||||
mc::AliasableStaticMut => {
|
||||
span_err!(
|
||||
self.tcx.sess, span, E0388,
|
||||
"{} in a static location", prefix);
|
||||
|
|
@ -998,7 +998,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
|
|||
pub fn note_and_explain_bckerr(&self, err: BckError<'tcx>) {
|
||||
let code = err.code;
|
||||
match code {
|
||||
err_mutbl(..) => {
|
||||
err_mutbl => {
|
||||
match err.cmt.note {
|
||||
mc::NoteClosureEnv(upvar_id) | mc::NoteUpvarRef(upvar_id) => {
|
||||
// If this is an `Fn` closure, it simply can't mutate upvars.
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ impl<'a,'tcx> Builder<'a,'tcx> {
|
|||
candidate: &mut Candidate<'pat, 'tcx>)
|
||||
-> Result<BasicBlock, MatchPair<'pat, 'tcx>> {
|
||||
match *match_pair.pattern.kind {
|
||||
PatternKind::Wild(..) => {
|
||||
PatternKind::Wild => {
|
||||
// nothing left to do
|
||||
Ok(block)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ impl<'a, 'v, 'tcx> Visitor<'v> for Resolver<'a, 'tcx> {
|
|||
self.visit_explicit_self(&sig.explicit_self);
|
||||
MethodRibKind
|
||||
}
|
||||
FnKind::Closure(..) => ClosureRibKind(node_id),
|
||||
FnKind::Closure => ClosureRibKind(node_id),
|
||||
};
|
||||
self.resolve_function(rib_kind, declaration, block);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ pub fn sizing_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Typ
|
|||
}
|
||||
}
|
||||
|
||||
ty::TyProjection(..) | ty::TyInfer(..) | ty::TyParam(..) | ty::TyError(..) => {
|
||||
ty::TyProjection(..) | ty::TyInfer(..) | ty::TyParam(..) | ty::TyError => {
|
||||
cx.sess().bug(&format!("fictitious type {:?} in sizing_type_of()",
|
||||
t))
|
||||
}
|
||||
|
|
@ -451,7 +451,7 @@ pub fn in_memory_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) ->
|
|||
ty::TyInfer(..) => cx.sess().bug("type_of with TyInfer"),
|
||||
ty::TyProjection(..) => cx.sess().bug("type_of with TyProjection"),
|
||||
ty::TyParam(..) => cx.sess().bug("type_of with ty_param"),
|
||||
ty::TyError(..) => cx.sess().bug("type_of with TyError"),
|
||||
ty::TyError => cx.sess().bug("type_of with TyError"),
|
||||
};
|
||||
|
||||
debug!("--> mapped t={:?} to llty={}",
|
||||
|
|
|
|||
|
|
@ -1052,7 +1052,7 @@ impl<'a,'tcx> ProbeContext<'a,'tcx> {
|
|||
(impl_def_id, substs, ref_obligations)
|
||||
}
|
||||
|
||||
ObjectCandidate(..) |
|
||||
ObjectCandidate |
|
||||
TraitCandidate |
|
||||
WhereClauseCandidate(..) => {
|
||||
// These have no additional conditions to check.
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ fn get_base_type_def_id<'a, 'tcx>(inference_context: &InferCtxt<'a, 'tcx>,
|
|||
}
|
||||
|
||||
TyBool | TyChar | TyInt(..) | TyUint(..) | TyFloat(..) |
|
||||
TyStr(..) | TyArray(..) | TySlice(..) | TyBareFn(..) | TyTuple(..) |
|
||||
TyStr | TyArray(..) | TySlice(..) | TyBareFn(..) | TyTuple(..) |
|
||||
TyParam(..) | TyError |
|
||||
TyRawPtr(_) | TyRef(_, _) | TyProjection(..) => {
|
||||
None
|
||||
|
|
|
|||
|
|
@ -776,7 +776,7 @@ impl Clean<Option<Lifetime>> for ty::Region {
|
|||
ty::ReScope(..) |
|
||||
ty::ReVar(..) |
|
||||
ty::ReSkolemized(..) |
|
||||
ty::ReEmpty(..) => None
|
||||
ty::ReEmpty => None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1609,7 +1609,7 @@ impl Clean<Type> for hir::Ty {
|
|||
TyPolyTraitRef(ref bounds) => {
|
||||
PolyTraitRef(bounds.clean(cx))
|
||||
},
|
||||
TyInfer(..) => {
|
||||
TyInfer => {
|
||||
Infer
|
||||
},
|
||||
TyTypeof(..) => {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ pub fn test_match_partial(p: Lonely<D, D>) {
|
|||
//~^ ERROR parent_of_fragments: `$(local p)`
|
||||
//~| ERROR assigned_leaf_path: `($(local p) as Lonely::Zero)`
|
||||
match p {
|
||||
Zero(..) => {}
|
||||
Zero => {}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ pub fn test_match_full(p: Lonely<D, D>) {
|
|||
//~| ERROR assigned_leaf_path: `($(local p) as Lonely::One)`
|
||||
//~| ERROR assigned_leaf_path: `($(local p) as Lonely::Two)`
|
||||
match p {
|
||||
Zero(..) => {}
|
||||
Zero => {}
|
||||
One(..) => {}
|
||||
Two(..) => {}
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ pub fn test_match_bind_one(p: Lonely<D, D>) {
|
|||
//~| ERROR assigned_leaf_path: `($(local p) as Lonely::Two)`
|
||||
//~| ERROR assigned_leaf_path: `$(local data)`
|
||||
match p {
|
||||
Zero(..) => {}
|
||||
Zero => {}
|
||||
One(data) => {}
|
||||
Two(..) => {}
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ pub fn test_match_bind_many(p: Lonely<D, D>) {
|
|||
//~| ERROR assigned_leaf_path: `$(local left)`
|
||||
//~| ERROR assigned_leaf_path: `$(local right)`
|
||||
match p {
|
||||
Zero(..) => {}
|
||||
Zero => {}
|
||||
One(data) => {}
|
||||
Two(left, right) => {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ pub fn test_match_bind_and_underscore(p: Lonely<D, D>) {
|
|||
//~| ERROR assigned_leaf_path: `$(local left)`
|
||||
|
||||
match p {
|
||||
Zero(..) => {}
|
||||
Zero => {}
|
||||
|
||||
One(_) => {} // <-- does not fragment `($(local p) as One)` ...
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
|
||||
struct A(isize);
|
||||
struct B;
|
||||
|
||||
fn main() {
|
||||
let x = match A(3) {
|
||||
|
|
@ -22,12 +21,4 @@ fn main() {
|
|||
A(..) => 2
|
||||
};
|
||||
assert_eq!(x, 2);
|
||||
|
||||
// This next test uses a (..) wildcard match on a nullary struct.
|
||||
// There's no particularly good reason to support this, but it's currently allowed,
|
||||
// and this makes sure it doesn't ICE or break LLVM.
|
||||
let x = match B {
|
||||
B(..) => 3
|
||||
};
|
||||
assert_eq!(x, 3);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ fn noise(a: animal) -> Option<String> {
|
|||
animal::cat(..) => { Some("meow".to_string()) }
|
||||
animal::dog(..) => { Some("woof".to_string()) }
|
||||
animal::rabbit(..) => { None }
|
||||
animal::tiger(..) => { Some("roar".to_string()) }
|
||||
animal::tiger => { Some("roar".to_string()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue