Replace _, _
with ..
This commit is contained in:
parent
6f7e51e49b
commit
e05e74ac83
107 changed files with 275 additions and 271 deletions
|
@ -279,7 +279,7 @@ impl OptGroup {
|
|||
}],
|
||||
}
|
||||
}
|
||||
(_, _) => panic!("something is wrong with the long-form opt"),
|
||||
_ => panic!("something is wrong with the long-form opt"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
|
|||
|
||||
fn pat(&mut self, pat: &hir::Pat, pred: CFGIndex) -> CFGIndex {
|
||||
match pat.node {
|
||||
PatKind::Binding(_, _, None) |
|
||||
PatKind::Binding(.., None) |
|
||||
PatKind::Path(..) |
|
||||
PatKind::Lit(..) |
|
||||
PatKind::Range(..) |
|
||||
|
@ -109,7 +109,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
|
|||
|
||||
PatKind::Box(ref subpat) |
|
||||
PatKind::Ref(ref subpat, _) |
|
||||
PatKind::Binding(_, _, Some(ref subpat)) => {
|
||||
PatKind::Binding(.., Some(ref subpat)) => {
|
||||
let subpat_exit = self.pat(&subpat, pred);
|
||||
self.add_ast_node(pat.id, &[subpat_exit])
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
|
|||
self.call(expr, pred, &func, args.iter().map(|e| &**e))
|
||||
}
|
||||
|
||||
hir::ExprMethodCall(_, _, ref args) => {
|
||||
hir::ExprMethodCall(.., ref args) => {
|
||||
self.call(expr, pred, &args[0], args[1..].iter().map(|e| &**e))
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ impl Def {
|
|||
pub fn var_id(&self) -> ast::NodeId {
|
||||
match *self {
|
||||
Def::Local(_, id) |
|
||||
Def::Upvar(_, id, _, _) => {
|
||||
Def::Upvar(_, id, ..) => {
|
||||
id
|
||||
}
|
||||
|
||||
|
|
|
@ -341,7 +341,7 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
|
|||
visitor.visit_id(item.id);
|
||||
visitor.visit_trait_ref(trait_ref)
|
||||
}
|
||||
ItemImpl(_, _, ref type_parameters, ref opt_trait_reference, ref typ, ref impl_items) => {
|
||||
ItemImpl(.., ref type_parameters, ref opt_trait_reference, ref typ, ref impl_items) => {
|
||||
visitor.visit_id(item.id);
|
||||
visitor.visit_generics(type_parameters);
|
||||
walk_list!(visitor, visit_trait_ref, opt_trait_reference);
|
||||
|
@ -625,7 +625,7 @@ pub fn walk_fn_kind<'v, V: Visitor<'v>>(visitor: &mut V, function_kind: FnKind<'
|
|||
FnKind::ItemFn(_, generics, ..) => {
|
||||
visitor.visit_generics(generics);
|
||||
}
|
||||
FnKind::Method(_, sig, _, _) => {
|
||||
FnKind::Method(_, sig, ..) => {
|
||||
visitor.visit_generics(&sig.generics);
|
||||
}
|
||||
FnKind::Closure(_) => {}
|
||||
|
|
|
@ -109,7 +109,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
|
|||
this.insert(struct_def.id(), NodeStructCtor(struct_def));
|
||||
}
|
||||
}
|
||||
ItemTrait(_, _, ref bounds, _) => {
|
||||
ItemTrait(.., ref bounds, _) => {
|
||||
for b in bounds.iter() {
|
||||
if let TraitTyParamBound(ref t, TraitBoundModifier::None) = *b {
|
||||
this.insert(t.trait_ref.ref_id, NodeItem(i));
|
||||
|
|
|
@ -469,7 +469,7 @@ impl Pat {
|
|||
}
|
||||
|
||||
match self.node {
|
||||
PatKind::Binding(_, _, Some(ref p)) => p.walk_(it),
|
||||
PatKind::Binding(.., Some(ref p)) => p.walk_(it),
|
||||
PatKind::Struct(_, ref fields, _) => {
|
||||
fields.iter().all(|field| field.node.pat.walk_(it))
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ impl Pat {
|
|||
}
|
||||
PatKind::Wild |
|
||||
PatKind::Lit(_) |
|
||||
PatKind::Range(_, _) |
|
||||
PatKind::Range(..) |
|
||||
PatKind::Binding(..) |
|
||||
PatKind::Path(..) => {
|
||||
true
|
||||
|
|
|
@ -53,7 +53,7 @@ impl<T: ExactSizeIterator> EnumerateAndAdjustIterator for T {
|
|||
|
||||
pub fn pat_is_refutable(dm: &DefMap, pat: &hir::Pat) -> bool {
|
||||
match pat.node {
|
||||
PatKind::Lit(_) | PatKind::Range(_, _) | PatKind::Path(Some(..), _) => true,
|
||||
PatKind::Lit(_) | PatKind::Range(..) | PatKind::Path(Some(..), _) => true,
|
||||
PatKind::TupleStruct(..) |
|
||||
PatKind::Path(..) |
|
||||
PatKind::Struct(..) => {
|
||||
|
|
|
@ -140,9 +140,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
|||
Some(ast_map::NodeExpr(expr)) => match expr.node {
|
||||
hir::ExprCall(..) => "call",
|
||||
hir::ExprMethodCall(..) => "method call",
|
||||
hir::ExprMatch(_, _, hir::MatchSource::IfLetDesugar { .. }) => "if let",
|
||||
hir::ExprMatch(_, _, hir::MatchSource::WhileLetDesugar) => "while let",
|
||||
hir::ExprMatch(_, _, hir::MatchSource::ForLoopDesugar) => "for",
|
||||
hir::ExprMatch(.., hir::MatchSource::IfLetDesugar { .. }) => "if let",
|
||||
hir::ExprMatch(.., hir::MatchSource::WhileLetDesugar) => "while let",
|
||||
hir::ExprMatch(.., hir::MatchSource::ForLoopDesugar) => "for",
|
||||
hir::ExprMatch(..) => "match",
|
||||
_ => "expression",
|
||||
},
|
||||
|
|
|
@ -684,7 +684,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||
warnings.extend(
|
||||
match self.region_vars.var_origin(vid) {
|
||||
LateBoundRegion(_,
|
||||
ty::BrNamed(_, _, wc),
|
||||
ty::BrNamed(.., wc),
|
||||
_) => Some(wc),
|
||||
_ => None,
|
||||
});
|
||||
|
|
|
@ -225,7 +225,7 @@ impl TypeOrigin {
|
|||
&TypeOrigin::RelateOutputImplTypes(_) |
|
||||
&TypeOrigin::ExprAssignable(_) => "mismatched types",
|
||||
&TypeOrigin::MethodCompatCheck(_) => "method not compatible with trait",
|
||||
&TypeOrigin::MatchExpressionArm(_, _, source) => match source {
|
||||
&TypeOrigin::MatchExpressionArm(.., source) => match source {
|
||||
hir::MatchSource::IfLetDesugar{..} => "`if let` arms have incompatible types",
|
||||
_ => "match arms have incompatible types",
|
||||
},
|
||||
|
@ -1712,7 +1712,7 @@ impl TypeOrigin {
|
|||
TypeOrigin::ExprAssignable(span) => span,
|
||||
TypeOrigin::Misc(span) => span,
|
||||
TypeOrigin::RelateOutputImplTypes(span) => span,
|
||||
TypeOrigin::MatchExpressionArm(match_span, _, _) => match_span,
|
||||
TypeOrigin::MatchExpressionArm(match_span, ..) => match_span,
|
||||
TypeOrigin::IfExpression(span) => span,
|
||||
TypeOrigin::IfExpressionWithNoElse(span) => span,
|
||||
TypeOrigin::RangeExpression(span) => span,
|
||||
|
@ -1765,7 +1765,7 @@ impl RegionVariableOrigin {
|
|||
Autoref(a) => a,
|
||||
Coercion(a) => a,
|
||||
EarlyBoundRegion(a, _) => a,
|
||||
LateBoundRegion(a, _, _) => a,
|
||||
LateBoundRegion(a, ..) => a,
|
||||
BoundRegionInCoherence(_) => syntax_pos::DUMMY_SP,
|
||||
UpvarRegion(_, a) => a
|
||||
}
|
||||
|
|
|
@ -605,7 +605,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> {
|
|||
undo_entry: &UndoLogEntry<'tcx>)
|
||||
-> bool {
|
||||
match undo_entry {
|
||||
&AddConstraint(ConstrainVarSubVar(_, _)) =>
|
||||
&AddConstraint(ConstrainVarSubVar(..)) =>
|
||||
false,
|
||||
&AddConstraint(ConstrainRegSubVar(a, _)) =>
|
||||
skols.contains(&a),
|
||||
|
@ -613,7 +613,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> {
|
|||
skols.contains(&b),
|
||||
&AddConstraint(ConstrainRegSubReg(a, b)) =>
|
||||
skols.contains(&a) || skols.contains(&b),
|
||||
&AddGiven(_, _) =>
|
||||
&AddGiven(..) =>
|
||||
false,
|
||||
&AddVerify(_) =>
|
||||
false,
|
||||
|
@ -1372,7 +1372,7 @@ impl<'a, 'gcx, 'tcx> RegionVarBindings<'a, 'gcx, 'tcx> {
|
|||
(&ReFree(..), &ReFree(..)) => Equal,
|
||||
(&ReFree(..), _) => Less,
|
||||
(_, &ReFree(..)) => Greater,
|
||||
(_, _) => Equal,
|
||||
(..) => Equal,
|
||||
}
|
||||
}
|
||||
lower_bounds.sort_by(|a, b| free_regions_first(a, b));
|
||||
|
|
|
@ -267,7 +267,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
|
|||
debug!("NewElem({}) new_elem_threshold={}", index, new_elem_threshold);
|
||||
}
|
||||
|
||||
sv::UndoLog::Other(SpecifyVar(vid, _, _)) => {
|
||||
sv::UndoLog::Other(SpecifyVar(vid, ..)) => {
|
||||
if vid.index < new_elem_threshold {
|
||||
// quick check to see if this variable was
|
||||
// created since the snapshot started or not.
|
||||
|
|
|
@ -43,7 +43,7 @@ enum RootUnsafeContext {
|
|||
|
||||
fn type_is_unsafe_function(ty: Ty) -> bool {
|
||||
match ty.sty {
|
||||
ty::TyFnDef(_, _, ref f) |
|
||||
ty::TyFnDef(.., ref f) |
|
||||
ty::TyFnPtr(ref f) => f.unsafety == hir::Unsafety::Unsafe,
|
||||
_ => false,
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EffectCheckVisitor<'a, 'tcx> {
|
|||
let (is_item_fn, is_unsafe_fn) = match fn_kind {
|
||||
FnKind::ItemFn(_, _, unsafety, ..) =>
|
||||
(true, unsafety == hir::Unsafety::Unsafe),
|
||||
FnKind::Method(_, sig, _, _) =>
|
||||
FnKind::Method(_, sig, ..) =>
|
||||
(true, sig.unsafety == hir::Unsafety::Unsafe),
|
||||
_ => (false, false),
|
||||
};
|
||||
|
|
|
@ -409,7 +409,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
|
|||
self.consume_exprs(args);
|
||||
}
|
||||
|
||||
hir::ExprMethodCall(_, _, ref args) => { // callee.m(args)
|
||||
hir::ExprMethodCall(.., ref args) => { // callee.m(args)
|
||||
self.consume_exprs(args);
|
||||
}
|
||||
|
||||
|
@ -940,9 +940,9 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
|
|||
pat);
|
||||
return_if_err!(self.mc.cat_pattern(cmt_discr, pat, |_mc, cmt_pat, pat| {
|
||||
match pat.node {
|
||||
PatKind::Binding(hir::BindByRef(..), _, _) =>
|
||||
PatKind::Binding(hir::BindByRef(..), ..) =>
|
||||
mode.lub(BorrowingMatch),
|
||||
PatKind::Binding(hir::BindByValue(..), _, _) => {
|
||||
PatKind::Binding(hir::BindByValue(..), ..) => {
|
||||
match copy_or_move(self.mc.infcx, &cmt_pat, PatBindingMove) {
|
||||
Copy => mode.lub(CopyingMatch),
|
||||
Move(..) => mode.lub(MovingMatch),
|
||||
|
@ -964,7 +964,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
|
|||
let infcx = self.mc.infcx;
|
||||
let delegate = &mut self.delegate;
|
||||
return_if_err!(mc.cat_pattern(cmt_discr.clone(), pat, |mc, cmt_pat, pat| {
|
||||
if let PatKind::Binding(bmode, _, _) = pat.node {
|
||||
if let PatKind::Binding(bmode, ..) = pat.node {
|
||||
debug!("binding cmt_pat={:?} pat={:?} match_mode={:?}", cmt_pat, pat, match_mode);
|
||||
|
||||
// pat_ty: the type of the binding being produced.
|
||||
|
|
|
@ -52,7 +52,7 @@ struct ExprVisitor<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
|
|||
impl<'a, 'gcx, 'tcx> ExprVisitor<'a, 'gcx, 'tcx> {
|
||||
fn def_id_is_transmute(&self, def_id: DefId) -> bool {
|
||||
let intrinsic = match self.infcx.tcx.lookup_item_type(def_id).ty.sty {
|
||||
ty::TyFnDef(_, _, ref bfty) => bfty.abi == RustIntrinsic,
|
||||
ty::TyFnDef(.., ref bfty) => bfty.abi == RustIntrinsic,
|
||||
_ => return false
|
||||
};
|
||||
intrinsic && self.infcx.tcx.item_name(def_id).as_str() == "transmute"
|
||||
|
@ -160,7 +160,7 @@ impl<'a, 'gcx, 'tcx, 'v> Visitor<'v> for ExprVisitor<'a, 'gcx, 'tcx> {
|
|||
Def::Fn(did) if self.def_id_is_transmute(did) => {
|
||||
let typ = self.infcx.tcx.node_id_to_type(expr.id);
|
||||
match typ.sty {
|
||||
ty::TyFnDef(_, _, ref bare_fn_ty) if bare_fn_ty.abi == RustIntrinsic => {
|
||||
ty::TyFnDef(.., ref bare_fn_ty) if bare_fn_ty.abi == RustIntrinsic => {
|
||||
let from = bare_fn_ty.sig.0.inputs[0];
|
||||
let to = bare_fn_ty.sig.0.output;
|
||||
self.check_transmute(expr.span, from, to, expr.id);
|
||||
|
|
|
@ -482,7 +482,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
|
|||
ir.add_live_node_for_node(expr.id, ExprNode(expr.span));
|
||||
intravisit::walk_expr(ir, expr);
|
||||
}
|
||||
hir::ExprBinary(op, _, _) if op.node.is_lazy() => {
|
||||
hir::ExprBinary(op, ..) if op.node.is_lazy() => {
|
||||
ir.add_live_node_for_node(expr.id, ExprNode(expr.span));
|
||||
intravisit::walk_expr(ir, expr);
|
||||
}
|
||||
|
@ -943,7 +943,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
|||
self.propagate_through_expr(&e, succ)
|
||||
}
|
||||
|
||||
hir::ExprClosure(_, _, ref blk, _) => {
|
||||
hir::ExprClosure(.., ref blk, _) => {
|
||||
debug!("{} is an ExprClosure",
|
||||
expr_to_string(expr));
|
||||
|
||||
|
@ -1123,7 +1123,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
|||
self.propagate_through_expr(&f, succ)
|
||||
}
|
||||
|
||||
hir::ExprMethodCall(_, _, ref args) => {
|
||||
hir::ExprMethodCall(.., ref args) => {
|
||||
let method_call = ty::MethodCall::expr(expr.id);
|
||||
let method_ty = self.ir.tcx.tables.borrow().method_map[&method_call].ty;
|
||||
// FIXME(canndrew): This is_never should really be an is_uninhabited
|
||||
|
|
|
@ -228,7 +228,7 @@ fn deref_kind(t: Ty, context: DerefKindContext) -> McResult<deref_kind> {
|
|||
Ok(deref_interior(InteriorField(PositionalField(0))))
|
||||
}
|
||||
|
||||
ty::TyArray(_, _) | ty::TySlice(_) => {
|
||||
ty::TyArray(..) | ty::TySlice(_) => {
|
||||
// no deref of indexed content without supplying InteriorOffsetKind
|
||||
if let Some(context) = context {
|
||||
Ok(deref_interior(InteriorElement(context, ElementKind::VecElement)))
|
||||
|
@ -318,7 +318,7 @@ impl MutabilityCategory {
|
|||
fn from_local(tcx: TyCtxt, id: ast::NodeId) -> MutabilityCategory {
|
||||
let ret = match tcx.map.get(id) {
|
||||
ast_map::NodeLocal(p) => match p.node {
|
||||
PatKind::Binding(bind_mode, _, _) => {
|
||||
PatKind::Binding(bind_mode, ..) => {
|
||||
if bind_mode == hir::BindByValue(hir::MutMutable) {
|
||||
McDeclared
|
||||
} else {
|
||||
|
@ -419,7 +419,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
|
|||
// *being borrowed* is. But ideally we would put in a more
|
||||
// fundamental fix to this conflated use of the node id.
|
||||
let ret_ty = match pat.node {
|
||||
PatKind::Binding(hir::BindByRef(_), _, _) => {
|
||||
PatKind::Binding(hir::BindByRef(_), ..) => {
|
||||
// a bind-by-ref means that the base_ty will be the type of the ident itself,
|
||||
// but what we want here is the type of the underlying value being borrowed.
|
||||
// So peel off one-level, turning the &T into T.
|
||||
|
@ -761,7 +761,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
|
|||
};
|
||||
|
||||
match fn_expr.node {
|
||||
hir::ExprClosure(_, _, ref body, _) => body.id,
|
||||
hir::ExprClosure(.., ref body, _) => body.id,
|
||||
_ => bug!()
|
||||
}
|
||||
};
|
||||
|
@ -1185,7 +1185,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
PatKind::Binding(_, _, Some(ref subpat)) => {
|
||||
PatKind::Binding(.., Some(ref subpat)) => {
|
||||
self.cat_pattern_(cmt, &subpat, op)?;
|
||||
}
|
||||
|
||||
|
@ -1225,7 +1225,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
PatKind::Path(..) | PatKind::Binding(_, _, None) |
|
||||
PatKind::Path(..) | PatKind::Binding(.., None) |
|
||||
PatKind::Lit(..) | PatKind::Range(..) | PatKind::Wild => {
|
||||
// always ok
|
||||
}
|
||||
|
@ -1275,9 +1275,9 @@ impl<'tcx> cmt_<'tcx> {
|
|||
Categorization::Rvalue(..) |
|
||||
Categorization::StaticItem |
|
||||
Categorization::Local(..) |
|
||||
Categorization::Deref(_, _, UnsafePtr(..)) |
|
||||
Categorization::Deref(_, _, BorrowedPtr(..)) |
|
||||
Categorization::Deref(_, _, Implicit(..)) |
|
||||
Categorization::Deref(.., UnsafePtr(..)) |
|
||||
Categorization::Deref(.., BorrowedPtr(..)) |
|
||||
Categorization::Deref(.., Implicit(..)) |
|
||||
Categorization::Upvar(..) => {
|
||||
Rc::new((*self).clone())
|
||||
}
|
||||
|
@ -1320,7 +1320,7 @@ impl<'tcx> cmt_<'tcx> {
|
|||
Categorization::Rvalue(..) |
|
||||
Categorization::Local(..) |
|
||||
Categorization::Upvar(..) |
|
||||
Categorization::Deref(_, _, UnsafePtr(..)) => { // yes, it's aliasable, but...
|
||||
Categorization::Deref(.., UnsafePtr(..)) => { // yes, it's aliasable, but...
|
||||
NonAliasable
|
||||
}
|
||||
|
||||
|
@ -1349,9 +1349,9 @@ impl<'tcx> cmt_<'tcx> {
|
|||
match self.note {
|
||||
NoteClosureEnv(..) | NoteUpvarRef(..) => {
|
||||
Some(match self.cat {
|
||||
Categorization::Deref(ref inner, _, _) => {
|
||||
Categorization::Deref(ref inner, ..) => {
|
||||
match inner.cat {
|
||||
Categorization::Deref(ref inner, _, _) => inner.clone(),
|
||||
Categorization::Deref(ref inner, ..) => inner.clone(),
|
||||
Categorization::Upvar(..) => inner.clone(),
|
||||
_ => bug!()
|
||||
}
|
||||
|
@ -1379,7 +1379,7 @@ impl<'tcx> cmt_<'tcx> {
|
|||
"local variable".to_string()
|
||||
}
|
||||
}
|
||||
Categorization::Deref(_, _, pk) => {
|
||||
Categorization::Deref(.., pk) => {
|
||||
let upvar = self.upvar();
|
||||
match upvar.as_ref().map(|i| &i.cat) {
|
||||
Some(&Categorization::Upvar(ref var)) => {
|
||||
|
|
|
@ -956,7 +956,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor, local: &hir::Local) {
|
|||
/// | box P&
|
||||
fn is_binding_pat(pat: &hir::Pat) -> bool {
|
||||
match pat.node {
|
||||
PatKind::Binding(hir::BindByRef(_), _, _) => true,
|
||||
PatKind::Binding(hir::BindByRef(_), ..) => true,
|
||||
|
||||
PatKind::Struct(_, ref field_pats, _) => {
|
||||
field_pats.iter().any(|fp| is_binding_pat(&fp.node.pat))
|
||||
|
|
|
@ -157,7 +157,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for LifetimeContext<'a, 'tcx> {
|
|||
hir::ItemEnum(_, ref generics) |
|
||||
hir::ItemStruct(_, ref generics) |
|
||||
hir::ItemUnion(_, ref generics) |
|
||||
hir::ItemTrait(_, ref generics, _, _) |
|
||||
hir::ItemTrait(_, ref generics, ..) |
|
||||
hir::ItemImpl(_, _, ref generics, ..) => {
|
||||
// These kinds of items have only early bound lifetime parameters.
|
||||
let lifetimes = &generics.lifetimes;
|
||||
|
@ -209,7 +209,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for LifetimeContext<'a, 'tcx> {
|
|||
this.add_scope_and_walk_fn(fk, decl, b, s, fn_id)
|
||||
})
|
||||
}
|
||||
FnKind::Method(_, sig, _, _) => {
|
||||
FnKind::Method(_, sig, ..) => {
|
||||
self.visit_early_late(
|
||||
fn_id,
|
||||
decl,
|
||||
|
@ -455,7 +455,7 @@ fn extract_labels(ctxt: &mut LifetimeContext, b: &hir::Block) {
|
|||
|
||||
fn expression_label(ex: &hir::Expr) -> Option<(ast::Name, Span)> {
|
||||
match ex.node {
|
||||
hir::ExprWhile(_, _, Some(label)) |
|
||||
hir::ExprWhile(.., Some(label)) |
|
||||
hir::ExprLoop(_, Some(label)) => Some((label.node, label.span)),
|
||||
_ => None,
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
|||
intravisit::walk_fn_decl(self, fd);
|
||||
self.visit_generics(generics);
|
||||
}
|
||||
FnKind::Method(_, sig, _, _) => {
|
||||
FnKind::Method(_, sig, ..) => {
|
||||
intravisit::walk_fn_decl(self, fd);
|
||||
self.visit_generics(&sig.generics);
|
||||
}
|
||||
|
@ -583,7 +583,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
|||
start += 1; // Self comes first.
|
||||
}
|
||||
match parent.node {
|
||||
hir::ItemTrait(_, ref generics, _, _) |
|
||||
hir::ItemTrait(_, ref generics, ..) |
|
||||
hir::ItemImpl(_, _, ref generics, ..) => {
|
||||
start += generics.lifetimes.len() + generics.ty_params.len();
|
||||
}
|
||||
|
|
|
@ -553,7 +553,7 @@ pub fn check_expr<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, e: &hir::Expr,
|
|||
&Option<DeprecationEntry>)) {
|
||||
let span;
|
||||
let id = match e.node {
|
||||
hir::ExprMethodCall(i, _, _) => {
|
||||
hir::ExprMethodCall(i, ..) => {
|
||||
span = i.span;
|
||||
let method_call = ty::MethodCall::expr(e.id);
|
||||
tcx.tables.borrow().method_map[&method_call].def_id
|
||||
|
|
|
@ -153,7 +153,7 @@ impl<'tcx> Rvalue<'tcx> {
|
|||
))
|
||||
}
|
||||
&Rvalue::Len(..) => Some(tcx.types.usize),
|
||||
&Rvalue::Cast(_, _, ty) => Some(ty),
|
||||
&Rvalue::Cast(.., ty) => Some(ty),
|
||||
&Rvalue::BinaryOp(op, ref lhs, ref rhs) => {
|
||||
let lhs_ty = lhs.ty(mir, tcx);
|
||||
let rhs_ty = rhs.ty(mir, tcx);
|
||||
|
|
|
@ -1535,8 +1535,8 @@ pub fn get_unstable_features_setting() -> UnstableFeatures {
|
|||
let bootstrap_provided_key = env::var("RUSTC_BOOTSTRAP_KEY").ok();
|
||||
match (disable_unstable_features, bootstrap_secret_key, bootstrap_provided_key) {
|
||||
(_, Some(ref s), Some(ref p)) if s == p => UnstableFeatures::Cheat,
|
||||
(true, _, _) => UnstableFeatures::Disallow,
|
||||
(false, _, _) => UnstableFeatures::Allow
|
||||
(true, ..) => UnstableFeatures::Disallow,
|
||||
(false, ..) => UnstableFeatures::Allow
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1379,7 +1379,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
|
|||
}
|
||||
|
||||
// provide an impl, but only for suitable `fn` pointers
|
||||
ty::TyFnDef(_, _, &ty::BareFnTy {
|
||||
ty::TyFnDef(.., &ty::BareFnTy {
|
||||
unsafety: hir::Unsafety::Normal,
|
||||
abi: Abi::Rust,
|
||||
sig: ty::Binder(ty::FnSig {
|
||||
|
@ -1635,7 +1635,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
|
|||
}
|
||||
|
||||
// [T; n] -> [T].
|
||||
(&ty::TyArray(_, _), &ty::TySlice(_)) => true,
|
||||
(&ty::TyArray(..), &ty::TySlice(_)) => true,
|
||||
|
||||
// Struct<T> -> Struct<U>.
|
||||
(&ty::TyStruct(def_id_a, _), &ty::TyStruct(def_id_b, _)) => {
|
||||
|
|
|
@ -160,7 +160,7 @@ impl<'a, 'gcx, 'tcx> ty::TyS<'tcx> {
|
|||
|
||||
AdjustReifyFnPointer => {
|
||||
match self.sty {
|
||||
ty::TyFnDef(_, _, f) => tcx.mk_fn_ptr(f),
|
||||
ty::TyFnDef(.., f) => tcx.mk_fn_ptr(f),
|
||||
_ => {
|
||||
bug!("AdjustReifyFnPointer adjustment on non-fn-item: {:?}",
|
||||
self);
|
||||
|
|
|
@ -202,7 +202,7 @@ impl<'a, 'tcx> ty::TyS<'tcx> {
|
|||
TC::None
|
||||
}
|
||||
|
||||
ty::TyRef(_, _) => {
|
||||
ty::TyRef(..) => {
|
||||
TC::None
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ pub fn simplify_type<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
|
|||
ty::TyTuple(ref tys) => {
|
||||
Some(TupleSimplifiedType(tys.len()))
|
||||
}
|
||||
ty::TyFnDef(_, _, ref f) | ty::TyFnPtr(ref f) => {
|
||||
ty::TyFnDef(.., ref f) | ty::TyFnPtr(ref f) => {
|
||||
Some(FunctionSimplifiedType(f.sig.0.inputs.len()))
|
||||
}
|
||||
ty::TyProjection(_) | ty::TyParam(_) => {
|
||||
|
|
|
@ -337,7 +337,7 @@ pub fn characteristic_def_id_of_type(ty: Ty) -> Option<DefId> {
|
|||
.filter_map(|ty| characteristic_def_id_of_type(ty))
|
||||
.next(),
|
||||
|
||||
ty::TyFnDef(def_id, _, _) |
|
||||
ty::TyFnDef(def_id, ..) |
|
||||
ty::TyClosure(def_id, _) => Some(def_id),
|
||||
|
||||
ty::TyBool |
|
||||
|
|
|
@ -1269,7 +1269,7 @@ impl<'a, 'tcx> ParameterEnvironment<'tcx> {
|
|||
match tcx.map.find(id) {
|
||||
Some(ast_map::NodeImplItem(ref impl_item)) => {
|
||||
match impl_item.node {
|
||||
hir::ImplItemKind::Type(_) | hir::ImplItemKind::Const(_, _) => {
|
||||
hir::ImplItemKind::Type(_) | hir::ImplItemKind::Const(..) => {
|
||||
// associated types don't have their own entry (for some reason),
|
||||
// so for now just grab environment for the impl
|
||||
let impl_id = tcx.map.get_parent(id);
|
||||
|
@ -2290,7 +2290,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
|||
match self.map.expect_item(id).node {
|
||||
ItemTrait(.., ref tis) => {
|
||||
tis.iter().filter_map(|ti| {
|
||||
if let hir::ConstTraitItem(_, _) = ti.node {
|
||||
if let hir::ConstTraitItem(..) = ti.node {
|
||||
match self.impl_or_trait_item(self.map.local_def_id(ti.id)) {
|
||||
ConstTraitItem(ac) => Some(ac),
|
||||
_ => {
|
||||
|
@ -2306,7 +2306,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
ItemImpl(.., ref iis) => {
|
||||
iis.iter().filter_map(|ii| {
|
||||
if let hir::ImplItemKind::Const(_, _) = ii.node {
|
||||
if let hir::ImplItemKind::Const(..) = ii.node {
|
||||
match self.impl_or_trait_item(self.map.local_def_id(ii.id)) {
|
||||
ConstTraitItem(ac) => Some(ac),
|
||||
_ => {
|
||||
|
|
|
@ -1171,7 +1171,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
|
|||
|
||||
pub fn fn_sig(&self) -> &'tcx PolyFnSig<'tcx> {
|
||||
match self.sty {
|
||||
TyFnDef(_, _, ref f) | TyFnPtr(ref f) => &f.sig,
|
||||
TyFnDef(.., ref f) | TyFnPtr(ref f) => &f.sig,
|
||||
_ => bug!("Ty::fn_sig() called on non-fn type: {:?}", self)
|
||||
}
|
||||
}
|
||||
|
@ -1179,7 +1179,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
|
|||
/// Returns the ABI of the given function.
|
||||
pub fn fn_abi(&self) -> abi::Abi {
|
||||
match self.sty {
|
||||
TyFnDef(_, _, ref f) | TyFnPtr(ref f) => f.abi,
|
||||
TyFnDef(.., ref f) | TyFnPtr(ref f) => f.abi,
|
||||
_ => bug!("Ty::fn_abi() called on non-fn type"),
|
||||
}
|
||||
}
|
||||
|
@ -1252,7 +1252,7 @@ impl<'a, 'gcx, 'tcx> TyS<'tcx> {
|
|||
TyFloat(_) |
|
||||
TyBox(_) |
|
||||
TyStr |
|
||||
TyArray(_, _) |
|
||||
TyArray(..) |
|
||||
TySlice(_) |
|
||||
TyRawPtr(_) |
|
||||
TyNever |
|
||||
|
|
|
@ -439,7 +439,7 @@ impl<'a, 'gcx, 'tcx> TypeVisitor<'tcx> for TypeIdHasher<'a, 'gcx, 'tcx> {
|
|||
TyRef(_, m) => self.hash(m.mutbl),
|
||||
TyClosure(def_id, _) |
|
||||
TyAnon(def_id, _) |
|
||||
TyFnDef(def_id, _, _) => self.def_id(def_id),
|
||||
TyFnDef(def_id, ..) => self.def_id(def_id),
|
||||
TyFnPtr(f) => {
|
||||
self.hash(f.unsafety);
|
||||
self.hash(f.abi);
|
||||
|
|
|
@ -56,7 +56,7 @@ fn owned_ptr_base_path<'a, 'tcx>(loan_path: &'a LoanPath<'tcx>) -> &'a LoanPath<
|
|||
}
|
||||
}
|
||||
LpDowncast(ref lp_base, _) |
|
||||
LpExtend(ref lp_base, _, _) => helper(&lp_base)
|
||||
LpExtend(ref lp_base, ..) => helper(&lp_base)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ fn owned_ptr_base_path_rc<'tcx>(loan_path: &Rc<LoanPath<'tcx>>) -> Rc<LoanPath<'
|
|||
}
|
||||
}
|
||||
LpDowncast(ref lp_base, _) |
|
||||
LpExtend(ref lp_base, _, _) => helper(lp_base)
|
||||
LpExtend(ref lp_base, ..) => helper(lp_base)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
|
|||
break;
|
||||
}
|
||||
LpDowncast(ref lp_base, _) |
|
||||
LpExtend(ref lp_base, _, _) => {
|
||||
LpExtend(ref lp_base, ..) => {
|
||||
loan_path = &lp_base;
|
||||
}
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
|
|||
err
|
||||
}
|
||||
|
||||
(_, _) => {
|
||||
(..) => {
|
||||
let mut err = struct_span_err!(self.bccx, new_loan.span, E0502,
|
||||
"cannot borrow `{}`{} as {} because \
|
||||
{} is also borrowed as {}{}",
|
||||
|
|
|
@ -365,9 +365,9 @@ fn add_fragment_siblings<'a, 'tcx>(this: &MoveData<'tcx>,
|
|||
}
|
||||
|
||||
// *LV for unsafe and borrowed pointers do not consume their loan path, so stop here.
|
||||
LpExtend(_, _, LpDeref(mc::UnsafePtr(..))) |
|
||||
LpExtend(_, _, LpDeref(mc::Implicit(..))) |
|
||||
LpExtend(_, _, LpDeref(mc::BorrowedPtr(..))) => {}
|
||||
LpExtend(.., LpDeref(mc::UnsafePtr(..))) |
|
||||
LpExtend(.., LpDeref(mc::Implicit(..))) |
|
||||
LpExtend(.., LpDeref(mc::BorrowedPtr(..))) => {}
|
||||
|
||||
// FIXME (pnkfelix): LV[j] should be tracked, at least in the
|
||||
// sense of we will track the remaining drop obligation of the
|
||||
|
@ -378,7 +378,7 @@ fn add_fragment_siblings<'a, 'tcx>(this: &MoveData<'tcx>,
|
|||
// bind.
|
||||
//
|
||||
// Anyway, for now: LV[j] is not tracked precisely
|
||||
LpExtend(_, _, LpInterior(_, InteriorElement(..))) => {
|
||||
LpExtend(.., LpInterior(_, InteriorElement(..))) => {
|
||||
let mp = this.move_path(tcx, lp.clone());
|
||||
gathered_fragments.push(AllButOneFrom(mp));
|
||||
}
|
||||
|
|
|
@ -161,9 +161,9 @@ fn check_and_get_illegal_move_origin<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
|||
cmt: &mc::cmt<'tcx>)
|
||||
-> Option<mc::cmt<'tcx>> {
|
||||
match cmt.cat {
|
||||
Categorization::Deref(_, _, mc::BorrowedPtr(..)) |
|
||||
Categorization::Deref(_, _, mc::Implicit(..)) |
|
||||
Categorization::Deref(_, _, mc::UnsafePtr(..)) |
|
||||
Categorization::Deref(.., mc::BorrowedPtr(..)) |
|
||||
Categorization::Deref(.., mc::Implicit(..)) |
|
||||
Categorization::Deref(.., mc::UnsafePtr(..)) |
|
||||
Categorization::StaticItem => {
|
||||
Some(cmt.clone())
|
||||
}
|
||||
|
|
|
@ -74,9 +74,9 @@ impl<'a, 'tcx> GuaranteeLifetimeContext<'a, 'tcx> {
|
|||
Categorization::Rvalue(..) |
|
||||
Categorization::Local(..) | // L-Local
|
||||
Categorization::Upvar(..) |
|
||||
Categorization::Deref(_, _, mc::BorrowedPtr(..)) | // L-Deref-Borrowed
|
||||
Categorization::Deref(_, _, mc::Implicit(..)) |
|
||||
Categorization::Deref(_, _, mc::UnsafePtr(..)) => {
|
||||
Categorization::Deref(.., mc::BorrowedPtr(..)) | // L-Deref-Borrowed
|
||||
Categorization::Deref(.., mc::Implicit(..)) |
|
||||
Categorization::Deref(.., mc::UnsafePtr(..)) => {
|
||||
self.check_scope(self.scope(cmt))
|
||||
}
|
||||
|
||||
|
@ -119,11 +119,11 @@ impl<'a, 'tcx> GuaranteeLifetimeContext<'a, 'tcx> {
|
|||
self.bccx.tcx.region_maps.var_scope(local_id)))
|
||||
}
|
||||
Categorization::StaticItem |
|
||||
Categorization::Deref(_, _, mc::UnsafePtr(..)) => {
|
||||
Categorization::Deref(.., mc::UnsafePtr(..)) => {
|
||||
self.bccx.tcx.mk_region(ty::ReStatic)
|
||||
}
|
||||
Categorization::Deref(_, _, mc::BorrowedPtr(_, r)) |
|
||||
Categorization::Deref(_, _, mc::Implicit(_, r)) => {
|
||||
Categorization::Deref(.., mc::BorrowedPtr(_, r)) |
|
||||
Categorization::Deref(.., mc::Implicit(_, r)) => {
|
||||
r
|
||||
}
|
||||
Categorization::Downcast(ref cmt, _) |
|
||||
|
|
|
@ -205,7 +205,7 @@ fn check_aliasability<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
|||
alias_cause);
|
||||
Err(())
|
||||
}
|
||||
(_, _) => {
|
||||
(..) => {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,9 +117,9 @@ fn report_cannot_move_out_of<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
|
|||
move_from: mc::cmt<'tcx>)
|
||||
-> DiagnosticBuilder<'a> {
|
||||
match move_from.cat {
|
||||
Categorization::Deref(_, _, mc::BorrowedPtr(..)) |
|
||||
Categorization::Deref(_, _, mc::Implicit(..)) |
|
||||
Categorization::Deref(_, _, mc::UnsafePtr(..)) |
|
||||
Categorization::Deref(.., mc::BorrowedPtr(..)) |
|
||||
Categorization::Deref(.., mc::Implicit(..)) |
|
||||
Categorization::Deref(.., mc::UnsafePtr(..)) |
|
||||
Categorization::StaticItem => {
|
||||
let mut err = struct_span_err!(bccx, move_from.span, E0507,
|
||||
"cannot move out of {}",
|
||||
|
|
|
@ -142,7 +142,7 @@ fn borrowck_item(this: &mut BorrowckCtxt, item: &hir::Item) {
|
|||
// loan step is intended for things that have a data
|
||||
// flow dependent conditions.
|
||||
match item.node {
|
||||
hir::ItemStatic(_, _, ref ex) |
|
||||
hir::ItemStatic(.., ref ex) |
|
||||
hir::ItemConst(_, ref ex) => {
|
||||
gather_loans::gather_loans_in_static_initializer(this, item.id, &ex);
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ pub fn closure_to_block(closure_id: ast::NodeId,
|
|||
tcx: TyCtxt) -> ast::NodeId {
|
||||
match tcx.map.get(closure_id) {
|
||||
hir_map::NodeExpr(expr) => match expr.node {
|
||||
hir::ExprClosure(_, _, ref block, _) => {
|
||||
hir::ExprClosure(.., ref block, _) => {
|
||||
block.id
|
||||
}
|
||||
_ => {
|
||||
|
@ -442,7 +442,7 @@ impl<'a, 'tcx> LoanPath<'tcx> {
|
|||
tcx.region_maps.node_extent(block_id)
|
||||
}
|
||||
LpDowncast(ref base, _) |
|
||||
LpExtend(ref base, _, _) => base.kill_scope(tcx),
|
||||
LpExtend(ref base, ..) => base.kill_scope(tcx),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -464,7 +464,7 @@ impl<'a, 'tcx> LoanPath<'tcx> {
|
|||
fn depth(&self) -> usize {
|
||||
match self.kind {
|
||||
LpExtend(ref base, _, LpDeref(_)) => base.depth(),
|
||||
LpExtend(ref base, _, LpInterior(_, _)) => base.depth() + 1,
|
||||
LpExtend(ref base, _, LpInterior(..)) => base.depth() + 1,
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
|
@ -1177,7 +1177,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
|
|||
out.push(')');
|
||||
}
|
||||
|
||||
LpVar(..) | LpUpvar(..) | LpExtend(_, _, LpInterior(..)) => {
|
||||
LpVar(..) | LpUpvar(..) | LpExtend(.., LpInterior(..)) => {
|
||||
self.append_loan_path_to_string(loan_path, out)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ fn loan_path_is_precise(loan_path: &LoanPath) -> bool {
|
|||
LpVar(_) | LpUpvar(_) => {
|
||||
true
|
||||
}
|
||||
LpExtend(_, _, LpInterior(_, InteriorKind::InteriorElement(..))) => {
|
||||
LpExtend(.., LpInterior(_, InteriorKind::InteriorElement(..))) => {
|
||||
// Paths involving element accesses a[i] do not refer to a unique
|
||||
// location, as there is no accurate tracking of the indices.
|
||||
//
|
||||
|
@ -207,7 +207,7 @@ fn loan_path_is_precise(loan_path: &LoanPath) -> bool {
|
|||
false
|
||||
}
|
||||
LpDowncast(ref lp_base, _) |
|
||||
LpExtend(ref lp_base, _, _) => {
|
||||
LpExtend(ref lp_base, ..) => {
|
||||
loan_path_is_precise(&lp_base)
|
||||
}
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ impl<'a, 'tcx> MoveData<'tcx> {
|
|||
}
|
||||
|
||||
LpDowncast(ref base, _) |
|
||||
LpExtend(ref base, _, _) => {
|
||||
LpExtend(ref base, ..) => {
|
||||
let parent_index = self.move_path(tcx, base.clone());
|
||||
|
||||
let index = MovePathIndex(self.paths.borrow().len());
|
||||
|
@ -351,7 +351,7 @@ impl<'a, 'tcx> MoveData<'tcx> {
|
|||
match lp.kind {
|
||||
LpVar(..) | LpUpvar(..) => { }
|
||||
LpDowncast(ref b, _) |
|
||||
LpExtend(ref b, _, _) => {
|
||||
LpExtend(ref b, ..) => {
|
||||
self.add_existing_base_paths(b, result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -372,8 +372,8 @@ fn check_arms(cx: &MatchCheckCtxt,
|
|||
/// Checks for common cases of "catchall" patterns that may not be intended as such.
|
||||
fn pat_is_catchall(dm: &DefMap, p: &Pat) -> bool {
|
||||
match p.node {
|
||||
PatKind::Binding(_, _, None) => true,
|
||||
PatKind::Binding(_, _, Some(ref s)) => pat_is_catchall(dm, &s),
|
||||
PatKind::Binding(.., None) => true,
|
||||
PatKind::Binding(.., Some(ref s)) => pat_is_catchall(dm, &s),
|
||||
PatKind::Ref(ref s, _) => pat_is_catchall(dm, &s),
|
||||
PatKind::Tuple(ref v, _) => v.iter().all(|p| pat_is_catchall(dm, &p)),
|
||||
_ => false
|
||||
|
@ -382,7 +382,7 @@ fn pat_is_catchall(dm: &DefMap, p: &Pat) -> bool {
|
|||
|
||||
fn raw_pat(p: &Pat) -> &Pat {
|
||||
match p.node {
|
||||
PatKind::Binding(_, _, Some(ref s)) => raw_pat(&s),
|
||||
PatKind::Binding(.., Some(ref s)) => raw_pat(&s),
|
||||
_ => p
|
||||
}
|
||||
}
|
||||
|
@ -804,7 +804,7 @@ fn pat_constructors(cx: &MatchCheckCtxt, p: &Pat,
|
|||
vec![ConstantRange(eval_const_expr(cx.tcx, &lo), eval_const_expr(cx.tcx, &hi))],
|
||||
PatKind::Vec(ref before, ref slice, ref after) =>
|
||||
match left_ty.sty {
|
||||
ty::TyArray(_, _) => vec![Single],
|
||||
ty::TyArray(..) => vec![Single],
|
||||
ty::TySlice(_) if slice.is_some() => {
|
||||
(before.len() + after.len()..max_slice_length+1)
|
||||
.map(|length| Slice(length))
|
||||
|
@ -866,7 +866,7 @@ fn wrap_pat<'a, 'b, 'tcx>(cx: &MatchCheckCtxt<'b, 'tcx>,
|
|||
{
|
||||
let pat_ty = cx.tcx.pat_ty(pat);
|
||||
(pat, Some(match pat.node {
|
||||
PatKind::Binding(hir::BindByRef(..), _, _) => {
|
||||
PatKind::Binding(hir::BindByRef(..), ..) => {
|
||||
pat_ty.builtin_deref(false, NoPreference).unwrap().ty
|
||||
}
|
||||
_ => pat_ty
|
||||
|
@ -1217,7 +1217,7 @@ struct AtBindingPatternVisitor<'a, 'b:'a, 'tcx:'b> {
|
|||
impl<'a, 'b, 'tcx, 'v> Visitor<'v> for AtBindingPatternVisitor<'a, 'b, 'tcx> {
|
||||
fn visit_pat(&mut self, pat: &Pat) {
|
||||
match pat.node {
|
||||
PatKind::Binding(_, _, ref subpat) => {
|
||||
PatKind::Binding(.., ref subpat) => {
|
||||
if !self.bindings_allowed {
|
||||
span_err!(self.cx.tcx.sess, pat.span, E0303,
|
||||
"pattern bindings are not allowed after an `@`");
|
||||
|
|
|
@ -106,7 +106,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
_ => None
|
||||
},
|
||||
Some(ast_map::NodeTraitItem(ti)) => match ti.node {
|
||||
hir::ConstTraitItem(_, _) => {
|
||||
hir::ConstTraitItem(..) => {
|
||||
if let Some(substs) = substs {
|
||||
// If we have a trait item and the substitutions for it,
|
||||
// `resolve_trait_associated_const` will select an impl
|
||||
|
@ -151,7 +151,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
_ => None
|
||||
},
|
||||
Some((&InlinedItem::TraitItem(trait_id, ref ti), _)) => match ti.node {
|
||||
hir::ConstTraitItem(_, _) => {
|
||||
hir::ConstTraitItem(..) => {
|
||||
used_substs = true;
|
||||
if let Some(substs) = substs {
|
||||
// As mentioned in the comments above for in-crate
|
||||
|
@ -231,7 +231,7 @@ pub fn lookup_const_fn_by_id<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefI
|
|||
FnKind::ItemFn(_, _, _, hir::Constness::Const, ..) => {
|
||||
Some(fn_like)
|
||||
}
|
||||
FnKind::Method(_, m, _, _) => {
|
||||
FnKind::Method(_, m, ..) => {
|
||||
if m.constness == hir::Constness::Const {
|
||||
Some(fn_like)
|
||||
} else {
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#![cfg_attr(not(stage0), deny(warnings))]
|
||||
|
||||
#![feature(box_syntax)]
|
||||
#![feature(dotdot_in_tuple_patterns)]
|
||||
#![feature(libc)]
|
||||
#![feature(quote)]
|
||||
#![feature(rustc_diagnostic_macros)]
|
||||
|
@ -802,7 +803,7 @@ Available lint options:
|
|||
let (plugin_groups, builtin_groups): (Vec<_>, _) = lint_store.get_lint_groups()
|
||||
.iter()
|
||||
.cloned()
|
||||
.partition(|&(_, _, p)| p);
|
||||
.partition(|&(.., p)| p);
|
||||
let plugin_groups = sort_lint_groups(plugin_groups);
|
||||
let builtin_groups = sort_lint_groups(builtin_groups);
|
||||
|
||||
|
@ -877,7 +878,7 @@ Available lint options:
|
|||
println!("Compiler plugins can provide additional lints and lint groups. To see a \
|
||||
listing of these, re-run `rustc -W help` with a crate filename.");
|
||||
}
|
||||
(false, _, _) => panic!("didn't load lint plugins but got them anyway!"),
|
||||
(false, ..) => panic!("didn't load lint plugins but got them anyway!"),
|
||||
(true, 0, 0) => println!("This crate does not load any lint plugins or lint groups."),
|
||||
(true, l, g) => {
|
||||
if l > 0 {
|
||||
|
|
|
@ -196,7 +196,7 @@ fn check_paths<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
let targets = match then_this_would_need.get(id) {
|
||||
Some(targets) => targets,
|
||||
None => {
|
||||
for &(source_span, _, _) in sources.iter().take(1) {
|
||||
for &(source_span, ..) in sources.iter().take(1) {
|
||||
tcx.sess.span_err(
|
||||
source_span,
|
||||
&format!("no targets for id `{}`", id));
|
||||
|
|
|
@ -158,7 +158,7 @@ fn saw_expr<'a>(node: &'a Expr_) -> SawExprComponent<'a> {
|
|||
ExprCall(..) => SawExprCall,
|
||||
ExprMethodCall(..) => SawExprMethodCall,
|
||||
ExprTup(..) => SawExprTup,
|
||||
ExprBinary(op, _, _) => SawExprBinary(op.node),
|
||||
ExprBinary(op, ..) => SawExprBinary(op.node),
|
||||
ExprUnary(op, _) => SawExprUnary(op),
|
||||
ExprLit(ref lit) => SawExprLit(lit.node.clone()),
|
||||
ExprCast(..) => SawExprCast,
|
||||
|
@ -170,7 +170,7 @@ fn saw_expr<'a>(node: &'a Expr_) -> SawExprComponent<'a> {
|
|||
ExprClosure(..) => SawExprClosure,
|
||||
ExprBlock(..) => SawExprBlock,
|
||||
ExprAssign(..) => SawExprAssign,
|
||||
ExprAssignOp(op, _, _) => SawExprAssignOp(op.node),
|
||||
ExprAssignOp(op, ..) => SawExprAssignOp(op.node),
|
||||
ExprField(_, name) => SawExprField(name.node.as_str()),
|
||||
ExprTupField(_, id) => SawExprTupField(id.node),
|
||||
ExprIndex(..) => SawExprIndex,
|
||||
|
@ -179,7 +179,7 @@ fn saw_expr<'a>(node: &'a Expr_) -> SawExprComponent<'a> {
|
|||
ExprBreak(id) => SawExprBreak(id.map(|id| id.node.as_str())),
|
||||
ExprAgain(id) => SawExprAgain(id.map(|id| id.node.as_str())),
|
||||
ExprRet(..) => SawExprRet,
|
||||
ExprInlineAsm(ref a,_,_) => SawExprInlineAsm(a),
|
||||
ExprInlineAsm(ref a,..) => SawExprInlineAsm(a),
|
||||
ExprStruct(..) => SawExprStruct,
|
||||
ExprRepeat(..) => SawExprRepeat,
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
html_root_url = "https://doc.rust-lang.org/nightly/")]
|
||||
#![cfg_attr(not(stage0), deny(warnings))]
|
||||
|
||||
#![feature(dotdot_in_tuple_patterns)]
|
||||
#![feature(question_mark)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(staged_api)]
|
||||
|
|
|
@ -880,12 +880,12 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
|
|||
fn all_except_most_recent(deletion_candidates: Vec<(SystemTime, PathBuf, Option<flock::Lock>)>)
|
||||
-> FnvHashMap<PathBuf, Option<flock::Lock>> {
|
||||
let most_recent = deletion_candidates.iter()
|
||||
.map(|&(timestamp, _, _)| timestamp)
|
||||
.map(|&(timestamp, ..)| timestamp)
|
||||
.max();
|
||||
|
||||
if let Some(most_recent) = most_recent {
|
||||
deletion_candidates.into_iter()
|
||||
.filter(|&(timestamp, _, _)| timestamp != most_recent)
|
||||
.filter(|&(timestamp, ..)| timestamp != most_recent)
|
||||
.map(|(_, path, lock)| (path, lock))
|
||||
.collect()
|
||||
} else {
|
||||
|
|
|
@ -72,7 +72,7 @@ impl LintPass for WhileTrue {
|
|||
|
||||
impl LateLintPass for WhileTrue {
|
||||
fn check_expr(&mut self, cx: &LateContext, e: &hir::Expr) {
|
||||
if let hir::ExprWhile(ref cond, _, _) = e.node {
|
||||
if let hir::ExprWhile(ref cond, ..) = e.node {
|
||||
if let hir::ExprLit(ref lit) = cond.node {
|
||||
if let ast::LitKind::Bool(true) = lit.node {
|
||||
cx.span_lint(WHILE_TRUE, e.span,
|
||||
|
@ -219,7 +219,7 @@ impl LateLintPass for UnsafeCode {
|
|||
FnKind::ItemFn(_, _, hir::Unsafety::Unsafe, ..) =>
|
||||
cx.span_lint(UNSAFE_CODE, span, "declaration of an `unsafe` function"),
|
||||
|
||||
FnKind::Method(_, sig, _, _) => {
|
||||
FnKind::Method(_, sig, ..) => {
|
||||
if sig.unsafety == hir::Unsafety::Unsafe {
|
||||
cx.span_lint(UNSAFE_CODE, span, "implementation of an `unsafe` method")
|
||||
}
|
||||
|
@ -1116,7 +1116,7 @@ impl LateLintPass for MutableTransmutes {
|
|||
}
|
||||
let typ = cx.tcx.node_id_to_type(expr.id);
|
||||
match typ.sty {
|
||||
ty::TyFnDef(_, _, ref bare_fn) if bare_fn.abi == RustIntrinsic => {
|
||||
ty::TyFnDef(.., ref bare_fn) if bare_fn.abi == RustIntrinsic => {
|
||||
let from = bare_fn.sig.0.inputs[0];
|
||||
let to = bare_fn.sig.0.output;
|
||||
return Some((&from.sty, &to.sty));
|
||||
|
@ -1129,7 +1129,7 @@ impl LateLintPass for MutableTransmutes {
|
|||
|
||||
fn def_id_is_transmute(cx: &LateContext, def_id: DefId) -> bool {
|
||||
match cx.tcx.lookup_item_type(def_id).ty.sty {
|
||||
ty::TyFnDef(_, _, ref bfty) if bfty.abi == RustIntrinsic => (),
|
||||
ty::TyFnDef(.., ref bfty) if bfty.abi == RustIntrinsic => (),
|
||||
_ => return false
|
||||
}
|
||||
cx.tcx.item_name(def_id).as_str() == "transmute"
|
||||
|
|
|
@ -334,7 +334,7 @@ impl UnusedParens {
|
|||
contains_exterior_struct_lit(&x)
|
||||
}
|
||||
|
||||
ast::ExprKind::MethodCall(_, _, ref exprs) => {
|
||||
ast::ExprKind::MethodCall(.., ref exprs) => {
|
||||
// X { y: 1 }.bar(...)
|
||||
contains_exterior_struct_lit(&exprs[0])
|
||||
}
|
||||
|
@ -355,15 +355,15 @@ impl EarlyLintPass for UnusedParens {
|
|||
fn check_expr(&mut self, cx: &EarlyContext, e: &ast::Expr) {
|
||||
use syntax::ast::ExprKind::*;
|
||||
let (value, msg, struct_lit_needs_parens) = match e.node {
|
||||
If(ref cond, _, _) => (cond, "`if` condition", true),
|
||||
While(ref cond, _, _) => (cond, "`while` condition", true),
|
||||
IfLet(_, ref cond, _, _) => (cond, "`if let` head expression", true),
|
||||
WhileLet(_, ref cond, _, _) => (cond, "`while let` head expression", true),
|
||||
ForLoop(_, ref cond, _, _) => (cond, "`for` head expression", true),
|
||||
If(ref cond, ..) => (cond, "`if` condition", true),
|
||||
While(ref cond, ..) => (cond, "`while` condition", true),
|
||||
IfLet(_, ref cond, ..) => (cond, "`if let` head expression", true),
|
||||
WhileLet(_, ref cond, ..) => (cond, "`while let` head expression", true),
|
||||
ForLoop(_, ref cond, ..) => (cond, "`for` head expression", true),
|
||||
Match(ref head, _) => (head, "`match` head expression", true),
|
||||
Ret(Some(ref value)) => (value, "`return` value", false),
|
||||
Assign(_, ref value) => (value, "assigned value", false),
|
||||
AssignOp(_, _, ref value) => (value, "assigned value", false),
|
||||
AssignOp(.., ref value) => (value, "assigned value", false),
|
||||
InPlace(_, ref value) => (value, "emplacement value", false),
|
||||
_ => return
|
||||
};
|
||||
|
|
|
@ -303,7 +303,7 @@ impl Folder for NestedItemsDropper {
|
|||
blk.and_then(|hir::Block {id, stmts, expr, rules, span, ..}| {
|
||||
let stmts_sans_items = stmts.into_iter().filter_map(|stmt| {
|
||||
let use_stmt = match stmt.node {
|
||||
hir::StmtExpr(_, _) | hir::StmtSemi(_, _) => true,
|
||||
hir::StmtExpr(..) | hir::StmtSemi(..) => true,
|
||||
hir::StmtDecl(ref decl, _) => {
|
||||
match decl.node {
|
||||
hir::DeclLocal(_) => true,
|
||||
|
|
|
@ -490,7 +490,7 @@ impl<'a> CrateReader<'a> {
|
|||
// numbers
|
||||
let map: FnvHashMap<_, _> = decoder::get_crate_deps(cdata).iter().map(|dep| {
|
||||
debug!("resolving dep crate {} hash: `{}`", dep.name, dep.hash);
|
||||
let (local_cnum, _, _) = self.resolve_crate(root,
|
||||
let (local_cnum, ..) = self.resolve_crate(root,
|
||||
&dep.name,
|
||||
&dep.name,
|
||||
Some(&dep.hash),
|
||||
|
@ -1003,13 +1003,13 @@ impl<'a> LocalCrateReader<'a> {
|
|||
if !info.should_link {
|
||||
return;
|
||||
}
|
||||
let (cnum, _, _) = self.creader.resolve_crate(&None,
|
||||
&info.ident,
|
||||
&info.name,
|
||||
None,
|
||||
i.span,
|
||||
PathKind::Crate,
|
||||
true);
|
||||
let (cnum, ..) = self.creader.resolve_crate(&None,
|
||||
&info.ident,
|
||||
&info.name,
|
||||
None,
|
||||
i.span,
|
||||
PathKind::Crate,
|
||||
true);
|
||||
|
||||
let def_id = self.definitions.opt_local_def_id(i.id).unwrap();
|
||||
let len = self.definitions.def_path(def_id.index).data.len();
|
||||
|
|
|
@ -492,7 +492,7 @@ pub fn get_adt_def<'a, 'tcx>(cdata: Cmd,
|
|||
variant.name,
|
||||
ctor_ty);
|
||||
let field_tys = match ctor_ty.sty {
|
||||
ty::TyFnDef(_, _, &ty::BareFnTy { sig: ty::Binder(ty::FnSig {
|
||||
ty::TyFnDef(.., &ty::BareFnTy { sig: ty::Binder(ty::FnSig {
|
||||
ref inputs, ..
|
||||
}), ..}) => {
|
||||
// tuple-struct constructors don't have escaping regions
|
||||
|
@ -952,7 +952,7 @@ pub fn get_impl_or_trait_item<'a, 'tcx>(cdata: Cmd, id: DefIndex, tcx: TyCtxt<'a
|
|||
let predicates = doc_predicates(item_doc, tcx, cdata, tag_item_predicates);
|
||||
let ity = tcx.lookup_item_type(def_id).ty;
|
||||
let fty = match ity.sty {
|
||||
ty::TyFnDef(_, _, fty) => fty,
|
||||
ty::TyFnDef(.., fty) => fty,
|
||||
_ => bug!(
|
||||
"the type {:?} of the method {:?} is not a function?",
|
||||
ity, name)
|
||||
|
|
|
@ -915,7 +915,7 @@ impl<'a, 'tcx, 'encoder> ItemContentBuilder<'a, 'tcx, 'encoder> {
|
|||
encode_deprecation(self.rbml_w, depr);
|
||||
encode_attributes(self.rbml_w, &item.attrs);
|
||||
}
|
||||
hir::ItemConst(_, _) => {
|
||||
hir::ItemConst(..) => {
|
||||
encode_def_id_and_key(ecx, self.rbml_w, def_id);
|
||||
encode_family(self.rbml_w, 'C');
|
||||
self.encode_bounds_and_type_for_item(item.id);
|
||||
|
|
|
@ -217,7 +217,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
|
|||
|
||||
let kind = match expr.node {
|
||||
// Here comes the interesting stuff:
|
||||
hir::ExprMethodCall(_, _, ref args) => {
|
||||
hir::ExprMethodCall(.., ref args) => {
|
||||
// Rewrite a.b(c) into UFCS form like Trait::b(a, c)
|
||||
let expr = method_callee(cx, expr, ty::MethodCall::expr(expr.id));
|
||||
let args = args.iter()
|
||||
|
@ -242,7 +242,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
|
|||
let method = method_callee(cx, expr, ty::MethodCall::expr(expr.id));
|
||||
|
||||
let sig = match method.ty.sty {
|
||||
ty::TyFnDef(_, _, fn_ty) => &fn_ty.sig,
|
||||
ty::TyFnDef(.., fn_ty) => &fn_ty.sig,
|
||||
_ => span_bug!(expr.span, "type of method is not an fn")
|
||||
};
|
||||
|
||||
|
@ -743,7 +743,7 @@ fn convert_var<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
|
|||
let body_id = match cx.tcx.map.find(closure_expr_id) {
|
||||
Some(map::NodeExpr(expr)) => {
|
||||
match expr.node {
|
||||
hir::ExprClosure(_, _, ref body, _) => body.id,
|
||||
hir::ExprClosure(.., ref body, _) => body.id,
|
||||
_ => {
|
||||
span_bug!(expr.span, "closure expr is not a closure expr");
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
|
|||
let fn_like = FnLikeNode::from_node(infcx.tcx.map.get(id));
|
||||
match fn_like.map(|f| f.kind()) {
|
||||
Some(FnKind::ItemFn(_, _, _, c, ..)) => c,
|
||||
Some(FnKind::Method(_, m, _, _)) => m.constness,
|
||||
Some(FnKind::Method(_, m, ..)) => m.constness,
|
||||
_ => hir::Constness::NotConst
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ fn is_const_fn(tcx: TyCtxt, def_id: DefId) -> bool {
|
|||
Some(FnKind::ItemFn(_, _, _, c, ..)) => {
|
||||
c == hir::Constness::Const
|
||||
}
|
||||
Some(FnKind::Method(_, m, _, _)) => {
|
||||
Some(FnKind::Method(_, m, ..)) => {
|
||||
m.constness == hir::Constness::Const
|
||||
}
|
||||
_ => false
|
||||
|
@ -576,9 +576,9 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
|
|||
Rvalue::Repeat(..) |
|
||||
Rvalue::UnaryOp(..) |
|
||||
Rvalue::CheckedBinaryOp(..) |
|
||||
Rvalue::Cast(CastKind::ReifyFnPointer, _, _) |
|
||||
Rvalue::Cast(CastKind::UnsafeFnPointer, _, _) |
|
||||
Rvalue::Cast(CastKind::Unsize, _, _) => {}
|
||||
Rvalue::Cast(CastKind::ReifyFnPointer, ..) |
|
||||
Rvalue::Cast(CastKind::UnsafeFnPointer, ..) |
|
||||
Rvalue::Cast(CastKind::Unsize, ..) => {}
|
||||
|
||||
Rvalue::Len(_) => {
|
||||
// Static lvalues in consts would have errored already,
|
||||
|
@ -705,7 +705,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
|
|||
}
|
||||
|
||||
Rvalue::Aggregate(ref kind, _) => {
|
||||
if let AggregateKind::Adt(def, _, _, _) = *kind {
|
||||
if let AggregateKind::Adt(def, ..) = *kind {
|
||||
if def.has_dtor() {
|
||||
self.add(Qualif::NEEDS_DROP);
|
||||
self.deny_drop();
|
||||
|
|
|
@ -457,7 +457,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
|
|||
let func_ty = func.ty(mir, tcx);
|
||||
debug!("check_terminator: call, func_ty={:?}", func_ty);
|
||||
let func_ty = match func_ty.sty {
|
||||
ty::TyFnDef(_, _, func_ty) | ty::TyFnPtr(func_ty) => func_ty,
|
||||
ty::TyFnDef(.., func_ty) | ty::TyFnPtr(func_ty) => func_ty,
|
||||
_ => {
|
||||
span_mirbug!(self, term, "call to non-function {:?}", func_ty);
|
||||
return;
|
||||
|
|
|
@ -98,7 +98,7 @@ impl<'a> Visitor for AstValidator<'a> {
|
|||
|
||||
fn visit_expr(&mut self, expr: &Expr) {
|
||||
match expr.node {
|
||||
ExprKind::While(_, _, Some(ident)) |
|
||||
ExprKind::While(.., Some(ident)) |
|
||||
ExprKind::Loop(_, Some(ident)) |
|
||||
ExprKind::WhileLet(.., Some(ident)) |
|
||||
ExprKind::ForLoop(.., Some(ident)) |
|
||||
|
|
|
@ -149,7 +149,7 @@ impl<'a, 'gcx> CheckCrateVisitor<'a, 'gcx> {
|
|||
let mode = match fk {
|
||||
FnKind::ItemFn(_, _, _, hir::Constness::Const, ..)
|
||||
=> Mode::ConstFn,
|
||||
FnKind::Method(_, m, _, _) => {
|
||||
FnKind::Method(_, m, ..) => {
|
||||
if m.constness == hir::Constness::Const {
|
||||
Mode::ConstFn
|
||||
} else {
|
||||
|
@ -307,8 +307,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
|
|||
hir::DeclItem(_) => continue,
|
||||
}
|
||||
}
|
||||
hir::StmtExpr(_, _) => {}
|
||||
hir::StmtSemi(_, _) => {}
|
||||
hir::StmtExpr(..) => {}
|
||||
hir::StmtSemi(..) => {}
|
||||
}
|
||||
self.add_qualif(ConstQualif::NOT_CONST);
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
|
|||
Categorization::StaticItem => {
|
||||
break;
|
||||
}
|
||||
Categorization::Deref(ref cmt, _, _) |
|
||||
Categorization::Deref(ref cmt, ..) |
|
||||
Categorization::Downcast(ref cmt, _) |
|
||||
Categorization::Interior(ref cmt, _) => cur = cmt,
|
||||
|
||||
|
@ -716,7 +716,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
|
|||
// type of the expression. `&mut [1]` has exactly the
|
||||
// same representation as &mut 1.
|
||||
match cmt.ty.sty {
|
||||
ty::TyArray(_, _) |
|
||||
ty::TyArray(..) |
|
||||
ty::TySlice(_) => break,
|
||||
_ => {}
|
||||
}
|
||||
|
@ -727,7 +727,7 @@ impl<'a, 'gcx, 'tcx> euv::Delegate<'tcx> for CheckCrateVisitor<'a, 'gcx> {
|
|||
Categorization::StaticItem => {
|
||||
break;
|
||||
}
|
||||
Categorization::Deref(ref cmt, _, _) |
|
||||
Categorization::Deref(ref cmt, ..) |
|
||||
Categorization::Downcast(ref cmt, _) |
|
||||
Categorization::Interior(ref cmt, _) => {
|
||||
cur = cmt;
|
||||
|
|
|
@ -53,7 +53,7 @@ impl<'a, 'v> Visitor<'v> for CheckLoopVisitor<'a> {
|
|||
hir::ExprLoop(ref b, _) => {
|
||||
self.with_context(Loop, |v| v.visit_block(&b));
|
||||
}
|
||||
hir::ExprClosure(_, _, ref b, _) => {
|
||||
hir::ExprClosure(.., ref b, _) => {
|
||||
self.with_context(Closure, |v| v.visit_block(&b));
|
||||
}
|
||||
hir::ExprBreak(_) => self.require_loop("break", e.span),
|
||||
|
|
|
@ -249,7 +249,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for EmbargoVisitor<'a, 'tcx> {
|
|||
// The interface is empty
|
||||
hir::ItemDefaultImpl(..) => {}
|
||||
// Visit everything except for private impl items
|
||||
hir::ItemImpl(_, _, ref generics, None, _, ref impl_items) => {
|
||||
hir::ItemImpl(.., ref generics, None, _, ref impl_items) => {
|
||||
if item_level.is_some() {
|
||||
self.reach().visit_generics(generics);
|
||||
for impl_item in impl_items {
|
||||
|
@ -454,7 +454,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivacyVisitor<'a, 'tcx> {
|
|||
if let Def::Struct(..) = self.tcx.expect_def(expr.id) {
|
||||
let expr_ty = self.tcx.expr_ty(expr);
|
||||
let def = match expr_ty.sty {
|
||||
ty::TyFnDef(_, _, &ty::BareFnTy { sig: ty::Binder(ty::FnSig {
|
||||
ty::TyFnDef(.., &ty::BareFnTy { sig: ty::Binder(ty::FnSig {
|
||||
output: ty, ..
|
||||
}), ..}) => ty,
|
||||
_ => expr_ty
|
||||
|
@ -644,7 +644,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx>
|
|||
// namespace (the contents have their own privacies).
|
||||
hir::ItemForeignMod(_) => {}
|
||||
|
||||
hir::ItemTrait(_, _, ref bounds, _) => {
|
||||
hir::ItemTrait(.., ref bounds, _) => {
|
||||
if !self.trait_is_public(item.id) {
|
||||
return
|
||||
}
|
||||
|
@ -659,7 +659,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx>
|
|||
// (i.e. we could just return here to not check them at
|
||||
// all, or some worse estimation of whether an impl is
|
||||
// publicly visible).
|
||||
hir::ItemImpl(_, _, ref g, ref trait_ref, ref self_, ref impl_items) => {
|
||||
hir::ItemImpl(.., ref g, ref trait_ref, ref self_, ref impl_items) => {
|
||||
// `impl [... for] Private` is never visible.
|
||||
let self_contains_private;
|
||||
// impl [... for] Public<...>, but not `impl [... for]
|
||||
|
@ -1091,7 +1091,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivateItemsInPublicInterfacesVisitor<'a, 'tc
|
|||
hir::ItemDefaultImpl(..) => {}
|
||||
// An inherent impl is public when its type is public
|
||||
// Subitems of inherent impls have their own publicity
|
||||
hir::ItemImpl(_, _, ref generics, None, ref ty, ref impl_items) => {
|
||||
hir::ItemImpl(.., ref generics, None, ref ty, ref impl_items) => {
|
||||
let ty_vis = self.ty_visibility(ty);
|
||||
check.required_visibility = ty_vis;
|
||||
check.visit_generics(generics);
|
||||
|
@ -1105,7 +1105,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for PrivateItemsInPublicInterfacesVisitor<'a, 'tc
|
|||
}
|
||||
// A trait impl is public when both its type and its trait are public
|
||||
// Subitems of trait impls have inherited publicity
|
||||
hir::ItemImpl(_, _, ref generics, Some(ref trait_ref), ref ty, ref impl_items) => {
|
||||
hir::ItemImpl(.., ref generics, Some(ref trait_ref), ref ty, ref impl_items) => {
|
||||
let vis = min(self.ty_visibility(ty), self.trait_ref_visibility(trait_ref));
|
||||
check.required_visibility = vis;
|
||||
check.visit_generics(generics);
|
||||
|
|
|
@ -228,7 +228,7 @@ impl<'b> Resolver<'b> {
|
|||
let def = Def::Static(self.definitions.local_def_id(item.id), mutbl);
|
||||
self.define(parent, name, ValueNS, (def, sp, vis));
|
||||
}
|
||||
ItemKind::Const(_, _) => {
|
||||
ItemKind::Const(..) => {
|
||||
let def = Def::Const(self.definitions.local_def_id(item.id));
|
||||
self.define(parent, name, ValueNS, (def, sp, vis));
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ impl<'b> Resolver<'b> {
|
|||
self.structs.insert(item_def_id, field_names);
|
||||
}
|
||||
|
||||
ItemKind::DefaultImpl(_, _) | ItemKind::Impl(..) => {}
|
||||
ItemKind::DefaultImpl(..) | ItemKind::Impl(..) => {}
|
||||
|
||||
ItemKind::Trait(.., ref items) => {
|
||||
let def_id = self.definitions.local_def_id(item.id);
|
||||
|
|
|
@ -95,7 +95,7 @@ impl<'a, 'b> Visitor for UnusedImportCheckVisitor<'a, 'b> {
|
|||
}
|
||||
ast::ItemKind::Use(ref p) => {
|
||||
match p.node {
|
||||
ViewPathSimple(_, _) => {
|
||||
ViewPathSimple(..) => {
|
||||
self.check_import(item.id, p.span)
|
||||
}
|
||||
|
||||
|
|
|
@ -381,7 +381,7 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
|
|||
module = path,
|
||||
ident = ident.node)
|
||||
}
|
||||
Some(&ExprKind::MethodCall(ident, _, _)) => {
|
||||
Some(&ExprKind::MethodCall(ident, ..)) => {
|
||||
format!("to call a function from the `{module}` module, \
|
||||
use `{module}::{ident}(..)`",
|
||||
module = path,
|
||||
|
@ -1643,7 +1643,7 @@ impl<'a> Resolver<'a> {
|
|||
ItemKind::DefaultImpl(_, ref trait_ref) => {
|
||||
self.with_optional_trait_ref(Some(trait_ref), |_, _| {});
|
||||
}
|
||||
ItemKind::Impl(_, _, ref generics, ref opt_trait_ref, ref self_type, ref impl_items) =>
|
||||
ItemKind::Impl(.., ref generics, ref opt_trait_ref, ref self_type, ref impl_items) =>
|
||||
self.resolve_implementation(generics,
|
||||
opt_trait_ref,
|
||||
&self_type,
|
||||
|
@ -2369,7 +2369,7 @@ impl<'a> Resolver<'a> {
|
|||
self.record_def(pat.id, resolution);
|
||||
}
|
||||
|
||||
PatKind::TupleStruct(ref path, _, _) => {
|
||||
PatKind::TupleStruct(ref path, ..) => {
|
||||
self.resolve_pattern_path(pat.id, None, path, ValueNS, |def| {
|
||||
match def {
|
||||
Def::Struct(..) | Def::Variant(..) => true,
|
||||
|
@ -2388,7 +2388,7 @@ impl<'a> Resolver<'a> {
|
|||
}, "variant, struct or constant");
|
||||
}
|
||||
|
||||
PatKind::Struct(ref path, _, _) => {
|
||||
PatKind::Struct(ref path, ..) => {
|
||||
self.resolve_pattern_path(pat.id, None, path, TypeNS, |def| {
|
||||
match def {
|
||||
Def::Struct(..) | Def::Union(..) | Def::Variant(..) |
|
||||
|
@ -2963,7 +2963,7 @@ impl<'a> Resolver<'a> {
|
|||
visit::walk_expr(self, expr);
|
||||
}
|
||||
|
||||
ExprKind::Struct(ref path, _, _) => {
|
||||
ExprKind::Struct(ref path, ..) => {
|
||||
// Resolve the path to the structure it goes to. We don't
|
||||
// check to ensure that the path is actually a structure; that
|
||||
// is checked later during typeck.
|
||||
|
@ -2985,7 +2985,7 @@ impl<'a> Resolver<'a> {
|
|||
visit::walk_expr(self, expr);
|
||||
}
|
||||
|
||||
ExprKind::Loop(_, Some(label)) | ExprKind::While(_, _, Some(label)) => {
|
||||
ExprKind::Loop(_, Some(label)) | ExprKind::While(.., Some(label)) => {
|
||||
self.with_label_rib(|this| {
|
||||
let def = Def::Label(expr.id);
|
||||
|
||||
|
@ -3077,7 +3077,7 @@ impl<'a> Resolver<'a> {
|
|||
let traits = self.get_traits_containing_item(name.node.name);
|
||||
self.trait_map.insert(expr.id, traits);
|
||||
}
|
||||
ExprKind::MethodCall(name, _, _) => {
|
||||
ExprKind::MethodCall(name, ..) => {
|
||||
debug!("(recording candidate traits for expr) recording traits for {}",
|
||||
expr.id);
|
||||
let traits = self.get_traits_containing_item(name.node.name);
|
||||
|
@ -3241,7 +3241,7 @@ impl<'a> Resolver<'a> {
|
|||
if !in_module_is_extern || name_binding.vis == ty::Visibility::Public {
|
||||
// add the module to the lookup
|
||||
let is_extern = in_module_is_extern || name_binding.is_extern_crate();
|
||||
if !worklist.iter().any(|&(m, _, _)| m.def == module.def) {
|
||||
if !worklist.iter().any(|&(m, ..)| m.def == module.def) {
|
||||
worklist.push((module, path_segments, is_extern));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -312,7 +312,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
|
|||
qualname: String::new()
|
||||
}.lower(self.tcx));
|
||||
}
|
||||
Def::Static(_, _) |
|
||||
Def::Static(..) |
|
||||
Def::Const(_) |
|
||||
Def::AssociatedConst(..) |
|
||||
Def::Local(..) |
|
||||
|
@ -351,7 +351,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
|
|||
let mut collector = PathCollector::new();
|
||||
collector.visit_pat(&arg.pat);
|
||||
let span_utils = self.span.clone();
|
||||
for &(id, ref p, _, _) in &collector.collected_paths {
|
||||
for &(id, ref p, ..) in &collector.collected_paths {
|
||||
let typ = self.tcx.node_types().get(&id).unwrap().to_string();
|
||||
// get the span only for the name of the variable (I hope the path is only ever a
|
||||
// variable name, but who knows?)
|
||||
|
@ -879,7 +879,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump + 'll> DumpVisitor<'l, 'tcx, 'll, D> {
|
|||
}
|
||||
}
|
||||
Def::Local(..) |
|
||||
Def::Static(_,_) |
|
||||
Def::Static(..) |
|
||||
Def::Const(..) |
|
||||
Def::AssociatedConst(..) |
|
||||
Def::Struct(..) |
|
||||
|
@ -1145,7 +1145,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
|
|||
self.process_static_or_const_item(item, &typ, &expr),
|
||||
Struct(ref def, ref ty_params) => self.process_struct(item, def, ty_params),
|
||||
Enum(ref def, ref ty_params) => self.process_enum(item, def, ty_params),
|
||||
Impl(_, _,
|
||||
Impl(..,
|
||||
ref ty_params,
|
||||
ref trait_ref,
|
||||
ref typ,
|
||||
|
@ -1280,7 +1280,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
|
|||
let def = self.tcx.expect_def(hir_expr.id);
|
||||
self.process_struct_lit(ex, path, fields, adt.variant_of_def(def), base)
|
||||
}
|
||||
ast::ExprKind::MethodCall(_, _, ref args) => self.process_method_call(ex, args),
|
||||
ast::ExprKind::MethodCall(.., ref args) => self.process_method_call(ex, args),
|
||||
ast::ExprKind::Field(ref sub_ex, _) => {
|
||||
self.visit_expr(&sub_ex);
|
||||
|
||||
|
@ -1409,7 +1409,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor for DumpVisitor<'l, 'tcx, 'll, D>
|
|||
paths_to_process.push((id, p.clone(), Some(ref_kind)))
|
||||
}
|
||||
// FIXME(nrc) what are these doing here?
|
||||
Def::Static(_, _) |
|
||||
Def::Static(..) |
|
||||
Def::Const(..) |
|
||||
Def::AssociatedConst(..) => {}
|
||||
def => error!("unexpected definition kind when processing collected paths: {:?}",
|
||||
|
|
|
@ -422,7 +422,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
|
|||
}
|
||||
}
|
||||
}
|
||||
ast::ExprKind::Struct(ref path, _, _) => {
|
||||
ast::ExprKind::Struct(ref path, ..) => {
|
||||
match self.tcx.expr_ty_adjusted(&hir_node).sty {
|
||||
ty::TyStruct(def, _) | ty::TyUnion(def, _) => {
|
||||
let sub_span = self.span_utils.span_for_last_ident(path.span);
|
||||
|
@ -694,11 +694,11 @@ impl PathCollector {
|
|||
impl Visitor for PathCollector {
|
||||
fn visit_pat(&mut self, p: &ast::Pat) {
|
||||
match p.node {
|
||||
PatKind::Struct(ref path, _, _) => {
|
||||
PatKind::Struct(ref path, ..) => {
|
||||
self.collected_paths.push((p.id, path.clone(),
|
||||
ast::Mutability::Mutable, recorder::TypeRef));
|
||||
}
|
||||
PatKind::TupleStruct(ref path, _, _) |
|
||||
PatKind::TupleStruct(ref path, ..) |
|
||||
PatKind::Path(_, ref path) => {
|
||||
self.collected_paths.push((p.id, path.clone(),
|
||||
ast::Mutability::Mutable, recorder::VarRef));
|
||||
|
|
|
@ -701,7 +701,7 @@ fn generic_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
|||
debug!("adt::generic_type_of r: {:?} name: {:?} sizing: {} dst: {}",
|
||||
r, name, sizing, dst);
|
||||
match *r {
|
||||
CEnum(ity, _, _) => ll_inttype(cx, ity),
|
||||
CEnum(ity, ..) => ll_inttype(cx, ity),
|
||||
RawNullablePointer { nnty, .. } =>
|
||||
type_of::sizing_type_of(cx, nnty),
|
||||
StructWrappedNullablePointer { nonnull: ref st, .. } => {
|
||||
|
@ -839,7 +839,7 @@ pub fn trans_switch<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
|||
|
||||
pub fn is_discr_signed<'tcx>(r: &Repr<'tcx>) -> bool {
|
||||
match *r {
|
||||
CEnum(ity, _, _) => ity.is_signed(),
|
||||
CEnum(ity, ..) => ity.is_signed(),
|
||||
General(ity, _) => ity.is_signed(),
|
||||
Univariant(..) | UntaggedUnion(..) => false,
|
||||
RawNullablePointer { .. } => false,
|
||||
|
@ -918,7 +918,7 @@ fn load_discr(bcx: Block, ity: IntType, ptr: ValueRef, min: Disr, max: Disr,
|
|||
pub fn trans_case<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, r: &Repr, discr: Disr)
|
||||
-> ValueRef {
|
||||
match *r {
|
||||
CEnum(ity, _, _) => {
|
||||
CEnum(ity, ..) => {
|
||||
C_integral(ll_inttype(bcx.ccx(), ity), discr.0, true)
|
||||
}
|
||||
General(ity, _) => {
|
||||
|
|
|
@ -1130,10 +1130,10 @@ pub unsafe fn with_llvm_pmb(llmod: ModuleRef,
|
|||
// inline with lifetime intrinsics, and O2+ we add an inliner with a
|
||||
// thresholds copied from clang.
|
||||
match (opt_level, opt_size, inline_threshold) {
|
||||
(_, _, Some(t)) => {
|
||||
(.., Some(t)) => {
|
||||
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, t as u32);
|
||||
}
|
||||
(llvm::CodeGenOptLevel::Aggressive, _, _) => {
|
||||
(llvm::CodeGenOptLevel::Aggressive, ..) => {
|
||||
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 275);
|
||||
}
|
||||
(_, llvm::CodeGenOptSizeDefault, _) => {
|
||||
|
@ -1142,16 +1142,16 @@ pub unsafe fn with_llvm_pmb(llmod: ModuleRef,
|
|||
(_, llvm::CodeGenOptSizeAggressive, _) => {
|
||||
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 25);
|
||||
}
|
||||
(llvm::CodeGenOptLevel::None, _, _) => {
|
||||
(llvm::CodeGenOptLevel::None, ..) => {
|
||||
llvm::LLVMRustAddAlwaysInlinePass(builder, false);
|
||||
}
|
||||
(llvm::CodeGenOptLevel::Less, _, _) => {
|
||||
(llvm::CodeGenOptLevel::Less, ..) => {
|
||||
llvm::LLVMRustAddAlwaysInlinePass(builder, true);
|
||||
}
|
||||
(llvm::CodeGenOptLevel::Default, _, _) => {
|
||||
(llvm::CodeGenOptLevel::Default, ..) => {
|
||||
llvm::LLVMPassManagerBuilderUseInlinerWithThreshold(builder, 225);
|
||||
}
|
||||
(llvm::CodeGenOptLevel::Other, _, _) => {
|
||||
(llvm::CodeGenOptLevel::Other, ..) => {
|
||||
bug!("CodeGenOptLevel::Other selected")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -924,7 +924,7 @@ impl<'blk, 'tcx> FunctionContext<'blk, 'tcx> {
|
|||
block_arena: &'blk TypedArena<common::BlockS<'blk, 'tcx>>)
|
||||
-> FunctionContext<'blk, 'tcx> {
|
||||
let (param_substs, def_id) = match definition {
|
||||
Some((instance, _, _)) => {
|
||||
Some((instance, ..)) => {
|
||||
common::validate_substs(instance.substs);
|
||||
(instance.substs, Some(instance.def))
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ fn classify_ty(ty: Type) -> Vec<RegClass> {
|
|||
(SSEDs, SSEUp) |
|
||||
(SSEInt(_), SSEUp) => return,
|
||||
|
||||
(_, _) => newv
|
||||
(..) => newv
|
||||
};
|
||||
cls[i] = to_write;
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ impl<'tcx> Callee<'tcx> {
|
|||
}
|
||||
|
||||
let fn_ty = def_ty(ccx.shared(), def_id, substs);
|
||||
if let ty::TyFnDef(_, _, f) = fn_ty.sty {
|
||||
if let ty::TyFnDef(.., f) = fn_ty.sty {
|
||||
if f.abi == Abi::RustIntrinsic || f.abi == Abi::PlatformIntrinsic {
|
||||
return Callee {
|
||||
data: Intrinsic,
|
||||
|
@ -314,7 +314,7 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
|
|||
// Construct the "tuply" version of `bare_fn_ty`. It takes two arguments: `self`,
|
||||
// which is the fn pointer, and `args`, which is the arguments tuple.
|
||||
let sig = match bare_fn_ty.sty {
|
||||
ty::TyFnDef(_, _,
|
||||
ty::TyFnDef(..,
|
||||
&ty::BareFnTy { unsafety: hir::Unsafety::Normal,
|
||||
abi: Abi::Rust,
|
||||
ref sig }) |
|
||||
|
@ -442,7 +442,7 @@ fn get_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
|
|||
// other weird situations. Annoying.
|
||||
|
||||
let fn_ptr_ty = match fn_ty.sty {
|
||||
ty::TyFnDef(_, _, fty) => {
|
||||
ty::TyFnDef(.., fty) => {
|
||||
// Create a fn pointer with the substituted signature.
|
||||
tcx.mk_fn_ptr(fty)
|
||||
}
|
||||
|
|
|
@ -628,7 +628,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
|
|||
def_id: DefId)
|
||||
-> bool {
|
||||
if !match tcx.lookup_item_type(def_id).ty.sty {
|
||||
ty::TyFnDef(def_id, _, _) => {
|
||||
ty::TyFnDef(def_id, ..) => {
|
||||
// Some constructors also have type TyFnDef but they are
|
||||
// always instantiated inline and don't result in
|
||||
// translation item. Same for FFI functions.
|
||||
|
@ -1214,8 +1214,7 @@ fn create_trans_items_for_default_impls<'a, 'tcx>(scx: &SharedCrateContext<'a, '
|
|||
hir::ItemImpl(_,
|
||||
_,
|
||||
ref generics,
|
||||
_,
|
||||
_,
|
||||
..,
|
||||
ref items) => {
|
||||
if generics.is_type_parameterized() {
|
||||
return
|
||||
|
|
|
@ -252,7 +252,7 @@ impl<'tcx> TypeMap<'tcx> {
|
|||
principal.substs,
|
||||
&mut unique_type_id);
|
||||
},
|
||||
ty::TyFnDef(_, _, &ty::BareFnTy{ unsafety, abi, ref sig } ) |
|
||||
ty::TyFnDef(.., &ty::BareFnTy{ unsafety, abi, ref sig } ) |
|
||||
ty::TyFnPtr(&ty::BareFnTy{ unsafety, abi, ref sig } ) => {
|
||||
if unsafety == hir::Unsafety::Unsafe {
|
||||
unique_type_id.push_str("unsafe ");
|
||||
|
@ -756,7 +756,7 @@ pub fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
|||
}
|
||||
}
|
||||
}
|
||||
ty::TyFnDef(_, _, ref barefnty) | ty::TyFnPtr(ref barefnty) => {
|
||||
ty::TyFnDef(.., ref barefnty) | ty::TyFnPtr(ref barefnty) => {
|
||||
let fn_metadata = subroutine_type_metadata(cx,
|
||||
unique_type_id,
|
||||
&barefnty.sig,
|
||||
|
@ -1679,7 +1679,7 @@ fn prepare_enum_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
|||
let type_rep = adt::represent_type(cx, enum_type);
|
||||
|
||||
let discriminant_type_metadata = match *type_rep {
|
||||
adt::CEnum(inttype, _, _) => {
|
||||
adt::CEnum(inttype, ..) => {
|
||||
return FinalMetadata(discriminant_type_metadata(inttype))
|
||||
},
|
||||
adt::RawNullablePointer { .. } |
|
||||
|
@ -1962,4 +1962,4 @@ pub fn extend_scope_to_file(ccx: &CrateContext,
|
|||
scope_metadata,
|
||||
file_metadata)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ pub fn push_debuginfo_type_name<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
|||
push_item_name(cx, principal.def_id, false, output);
|
||||
push_type_params(cx, principal.substs, output);
|
||||
},
|
||||
ty::TyFnDef(_, _, &ty::BareFnTy{ unsafety, abi, ref sig } ) |
|
||||
ty::TyFnDef(.., &ty::BareFnTy{ unsafety, abi, ref sig } ) |
|
||||
ty::TyFnPtr(&ty::BareFnTy{ unsafety, abi, ref sig } ) => {
|
||||
if unsafety == hir::Unsafety::Unsafe {
|
||||
output.push_str("unsafe ");
|
||||
|
|
|
@ -544,7 +544,7 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
|
|||
|
||||
}
|
||||
|
||||
(_, _) => {
|
||||
(..) => {
|
||||
let intr = match Intrinsic::find(&name) {
|
||||
Some(intr) => intr,
|
||||
None => bug!("unknown intrinsic '{}'", name),
|
||||
|
|
|
@ -406,7 +406,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
|
|||
|
||||
// Handle intrinsics old trans wants Expr's for, ourselves.
|
||||
let intrinsic = match (&callee.ty.sty, &callee.data) {
|
||||
(&ty::TyFnDef(def_id, _, _), &Intrinsic) => {
|
||||
(&ty::TyFnDef(def_id, ..), &Intrinsic) => {
|
||||
Some(bcx.tcx().item_name(def_id).as_str())
|
||||
}
|
||||
_ => None
|
||||
|
@ -880,7 +880,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
|
|||
// FIXME #19925 Remove this hack after a release cycle.
|
||||
let f = Callee::def(bcx.ccx(), def_id, substs);
|
||||
let ty = match f.ty.sty {
|
||||
ty::TyFnDef(_, _, f) => bcx.tcx().mk_fn_ptr(f),
|
||||
ty::TyFnDef(.., f) => bcx.tcx().mk_fn_ptr(f),
|
||||
_ => f.ty
|
||||
};
|
||||
val = OperandRef {
|
||||
|
|
|
@ -454,7 +454,7 @@ pub fn push_unique_type_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
&trait_data.projection_bounds,
|
||||
output);
|
||||
},
|
||||
ty::TyFnDef(_, _, &ty::BareFnTy{ unsafety, abi, ref sig } ) |
|
||||
ty::TyFnDef(.., &ty::BareFnTy{ unsafety, abi, ref sig } ) |
|
||||
ty::TyFnPtr(&ty::BareFnTy{ unsafety, abi, ref sig } ) => {
|
||||
if unsafety == hir::Unsafety::Unsafe {
|
||||
output.push_str("unsafe ");
|
||||
|
|
|
@ -186,7 +186,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
let error_fn_sig;
|
||||
|
||||
let fn_sig = match callee_ty.sty {
|
||||
ty::TyFnDef(_, _, &ty::BareFnTy {ref sig, ..}) |
|
||||
ty::TyFnDef(.., &ty::BareFnTy {ref sig, ..}) |
|
||||
ty::TyFnPtr(&ty::BareFnTy {ref sig, ..}) => {
|
||||
sig
|
||||
}
|
||||
|
|
|
@ -319,7 +319,7 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
|
|||
(Some(t_from), Some(t_cast)) => (t_from, t_cast),
|
||||
// Function item types may need to be reified before casts.
|
||||
(None, Some(t_cast)) => {
|
||||
if let ty::TyFnDef(_, _, f) = self.expr_ty.sty {
|
||||
if let ty::TyFnDef(.., f) = self.expr_ty.sty {
|
||||
// Attempt a coercion to a fn pointer type.
|
||||
let res = fcx.try_coerce(self.expr, fcx.tcx.mk_fn_ptr(f));
|
||||
if !res.is_ok() {
|
||||
|
|
|
@ -195,7 +195,7 @@ impl<'f, 'gcx, 'tcx> Coerce<'f, 'gcx, 'tcx> {
|
|||
}
|
||||
|
||||
match a.sty {
|
||||
ty::TyFnDef(_, _, a_f) => {
|
||||
ty::TyFnDef(.., a_f) => {
|
||||
// Function items are coercible to any closure
|
||||
// type; function pointers are not (that would
|
||||
// require double indirection).
|
||||
|
|
|
@ -53,7 +53,7 @@ fn equate_intrinsic_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
|
|||
if i_n_tps != n_tps {
|
||||
let span = match it.node {
|
||||
hir::ForeignItemFn(_, ref generics) => generics.span,
|
||||
hir::ForeignItemStatic(_, _) => it.span
|
||||
hir::ForeignItemStatic(..) => it.span
|
||||
};
|
||||
|
||||
struct_span_err!(tcx.sess, span, E0094,
|
||||
|
|
|
@ -501,7 +501,7 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> {
|
|||
assert!(adr.unsize.is_none());
|
||||
(adr.autoderefs, None)
|
||||
}
|
||||
Some(AutoPtr(_, _)) => {
|
||||
Some(AutoPtr(..)) => {
|
||||
(adr.autoderefs, adr.unsize.map(|target| {
|
||||
target.builtin_deref(false, NoPreference)
|
||||
.expect("fixup: AutoPtr is not &T").ty
|
||||
|
|
|
@ -1314,8 +1314,8 @@ impl<'tcx> Candidate<'tcx> {
|
|||
Pick {
|
||||
item: self.item.clone(),
|
||||
kind: match self.kind {
|
||||
InherentImplCandidate(_, _) => InherentImplPick,
|
||||
ExtensionImplCandidate(def_id, _, _) => {
|
||||
InherentImplCandidate(..) => InherentImplPick,
|
||||
ExtensionImplCandidate(def_id, ..) => {
|
||||
ExtensionImplPick(def_id)
|
||||
}
|
||||
ObjectCandidate => ObjectPick,
|
||||
|
@ -1340,10 +1340,10 @@ impl<'tcx> Candidate<'tcx> {
|
|||
|
||||
fn to_source(&self) -> CandidateSource {
|
||||
match self.kind {
|
||||
InherentImplCandidate(_, _) => {
|
||||
InherentImplCandidate(..) => {
|
||||
ImplSource(self.item.container().id())
|
||||
}
|
||||
ExtensionImplCandidate(def_id, _, _) => ImplSource(def_id),
|
||||
ExtensionImplCandidate(def_id, ..) => ImplSource(def_id),
|
||||
ObjectCandidate |
|
||||
TraitCandidate |
|
||||
WhereClauseCandidate(_) => TraitSource(self.item.container().id()),
|
||||
|
|
|
@ -536,7 +536,7 @@ fn check_bare_fn<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
|
|||
fn_id: ast::NodeId) {
|
||||
let raw_fty = ccx.tcx.lookup_item_type(ccx.tcx.map.local_def_id(fn_id)).ty;
|
||||
let fn_ty = match raw_fty.sty {
|
||||
ty::TyFnDef(_, _, f) => f,
|
||||
ty::TyFnDef(.., f) => f,
|
||||
_ => span_bug!(body.span, "check_bare_fn: function type expected")
|
||||
};
|
||||
|
||||
|
@ -732,7 +732,7 @@ pub fn check_item_type<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) {
|
|||
let _indenter = indenter();
|
||||
match it.node {
|
||||
// Consts can play a role in type-checking, so they are included here.
|
||||
hir::ItemStatic(_, _, ref e) |
|
||||
hir::ItemStatic(.., ref e) |
|
||||
hir::ItemConst(_, ref e) => check_const(ccx, &e, it.id),
|
||||
hir::ItemEnum(ref enum_definition, _) => {
|
||||
check_enum_variants(ccx,
|
||||
|
@ -2410,7 +2410,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
self.tcx.types.err
|
||||
} else {
|
||||
match method_fn_ty.sty {
|
||||
ty::TyFnDef(_, _, ref fty) => {
|
||||
ty::TyFnDef(.., ref fty) => {
|
||||
// HACK(eddyb) ignore self in the definition (see above).
|
||||
let expected_arg_tys = self.expected_types_for_fn_args(sp, expected,
|
||||
fty.sig.0.output,
|
||||
|
@ -2647,7 +2647,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
t)
|
||||
}, arg_ty);
|
||||
}
|
||||
ty::TyFnDef(_, _, f) => {
|
||||
ty::TyFnDef(.., f) => {
|
||||
let ptr_ty = self.tcx.mk_fn_ptr(f);
|
||||
let ptr_ty = self.resolve_type_vars_if_possible(&ptr_ty);
|
||||
self.type_error_message(arg.span,
|
||||
|
@ -3983,7 +3983,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
_ => false,
|
||||
}
|
||||
}
|
||||
hir::StmtExpr(_, _) | hir::StmtSemi(_, _) => true,
|
||||
hir::StmtExpr(..) | hir::StmtSemi(..) => true,
|
||||
} {
|
||||
self.tcx
|
||||
.sess
|
||||
|
@ -4209,7 +4209,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
self.tcx.prohibit_type_params(&segments[..segments.len() - poly_segments]);
|
||||
|
||||
match def {
|
||||
Def::Local(_, nid) | Def::Upvar(_, nid, _, _) => {
|
||||
Def::Local(_, nid) | Def::Upvar(_, nid, ..) => {
|
||||
let ty = self.local_ty(span, nid);
|
||||
let ty = self.normalize_associated_types_in(span, &ty);
|
||||
self.write_ty(node_id, ty);
|
||||
|
|
|
@ -576,7 +576,7 @@ impl<'a, 'gcx, 'tcx, 'v> Visitor<'v> for RegionCtxt<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
}
|
||||
/*
|
||||
adjustment::AutoObject(_, ref bounds, _, _) => {
|
||||
adjustment::AutoObject(_, ref bounds, ..) => {
|
||||
// Determine if we are casting `expr` to a trait
|
||||
// instance. If so, we have to be sure that the type
|
||||
// of the source obeys the new region bound.
|
||||
|
@ -643,7 +643,7 @@ impl<'a, 'gcx, 'tcx, 'v> Visitor<'v> for RegionCtxt<'a, 'gcx, 'tcx> {
|
|||
intravisit::walk_expr(self, expr);
|
||||
}
|
||||
|
||||
hir::ExprMethodCall(_, _, ref args) => {
|
||||
hir::ExprMethodCall(.., ref args) => {
|
||||
self.constrain_call(expr, Some(&args[0]),
|
||||
args[1..].iter().map(|e| &**e), false);
|
||||
|
||||
|
@ -758,7 +758,7 @@ impl<'a, 'gcx, 'tcx, 'v> Visitor<'v> for RegionCtxt<'a, 'gcx, 'tcx> {
|
|||
intravisit::walk_expr(self, expr);
|
||||
}
|
||||
|
||||
hir::ExprClosure(_, _, ref body, _) => {
|
||||
hir::ExprClosure(.., ref body, _) => {
|
||||
self.check_expr_fn_block(expr, &body);
|
||||
}
|
||||
|
||||
|
@ -1156,7 +1156,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
|
|||
let _ = mc.cat_pattern(discr_cmt, root_pat, |_, sub_cmt, sub_pat| {
|
||||
match sub_pat.node {
|
||||
// `ref x` pattern
|
||||
PatKind::Binding(hir::BindByRef(mutbl), _, _) => {
|
||||
PatKind::Binding(hir::BindByRef(mutbl), ..) => {
|
||||
self.link_region_from_node_type(sub_pat.span, sub_pat.id,
|
||||
mutbl, sub_cmt);
|
||||
}
|
||||
|
@ -1269,7 +1269,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
|
|||
borrow_kind = borrow_kind;
|
||||
}
|
||||
|
||||
Categorization::Deref(_, _, mc::UnsafePtr(..)) |
|
||||
Categorization::Deref(.., mc::UnsafePtr(..)) |
|
||||
Categorization::StaticItem |
|
||||
Categorization::Upvar(..) |
|
||||
Categorization::Local(..) |
|
||||
|
|
|
@ -283,8 +283,8 @@ impl<'a, 'gcx, 'tcx> AdjustBorrowKind<'a, 'gcx, 'tcx> {
|
|||
debug!("adjust_upvar_borrow_kind_for_consume: guarantor={:?}",
|
||||
guarantor);
|
||||
match guarantor.cat {
|
||||
Categorization::Deref(_, _, mc::BorrowedPtr(..)) |
|
||||
Categorization::Deref(_, _, mc::Implicit(..)) => {
|
||||
Categorization::Deref(.., mc::BorrowedPtr(..)) |
|
||||
Categorization::Deref(.., mc::Implicit(..)) => {
|
||||
match cmt.note {
|
||||
mc::NoteUpvarRef(upvar_id) => {
|
||||
debug!("adjust_upvar_borrow_kind_for_consume: \
|
||||
|
@ -344,7 +344,7 @@ impl<'a, 'gcx, 'tcx> AdjustBorrowKind<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
Categorization::Deref(_, _, mc::UnsafePtr(..)) |
|
||||
Categorization::Deref(.., mc::UnsafePtr(..)) |
|
||||
Categorization::StaticItem |
|
||||
Categorization::Rvalue(_) |
|
||||
Categorization::Local(_) |
|
||||
|
@ -376,7 +376,7 @@ impl<'a, 'gcx, 'tcx> AdjustBorrowKind<'a, 'gcx, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
Categorization::Deref(_, _, mc::UnsafePtr(..)) |
|
||||
Categorization::Deref(.., mc::UnsafePtr(..)) |
|
||||
Categorization::StaticItem |
|
||||
Categorization::Rvalue(_) |
|
||||
Categorization::Local(_) |
|
||||
|
|
|
@ -112,7 +112,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> {
|
|||
ref trait_ref, ref self_ty, _) => {
|
||||
self.check_impl(item, self_ty, trait_ref);
|
||||
}
|
||||
hir::ItemImpl(_, hir::ImplPolarity::Negative, _, Some(_), _, _) => {
|
||||
hir::ItemImpl(_, hir::ImplPolarity::Negative, _, Some(_), ..) => {
|
||||
// FIXME(#27579) what amount of WF checking do we need for neg impls?
|
||||
|
||||
let trait_ref = ccx.tcx.impl_trait_ref(ccx.tcx.map.local_def_id(item.id)).unwrap();
|
||||
|
@ -286,7 +286,7 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> {
|
|||
let type_scheme = fcx.tcx.lookup_item_type(fcx.tcx.map.local_def_id(item.id));
|
||||
let item_ty = fcx.instantiate_type_scheme(item.span, free_substs, &type_scheme.ty);
|
||||
let bare_fn_ty = match item_ty.sty {
|
||||
ty::TyFnDef(_, _, ref bare_fn_ty) => bare_fn_ty,
|
||||
ty::TyFnDef(.., ref bare_fn_ty) => bare_fn_ty,
|
||||
_ => {
|
||||
span_bug!(item.span, "Fn item without fn type");
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ impl<'cx, 'gcx, 'tcx, 'v> Visitor<'v> for WritebackCx<'cx, 'gcx, 'tcx> {
|
|||
self.visit_method_map_entry(ResolvingExpr(e.span),
|
||||
MethodCall::expr(e.id));
|
||||
|
||||
if let hir::ExprClosure(_, ref decl, _, _) = e.node {
|
||||
if let hir::ExprClosure(_, ref decl, ..) = e.node {
|
||||
for input in &decl.inputs {
|
||||
self.visit_node_id(ResolvingExpr(e.span), input.id);
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ impl<'cx, 'gcx, 'tcx> WritebackCx<'cx, 'gcx, 'tcx> {
|
|||
|
||||
// Free regions that come from early-bound regions are valid.
|
||||
ty::ReFree(ty::FreeRegion {
|
||||
bound_region: ty::BoundRegion::BrNamed(def_id, _, _), ..
|
||||
bound_region: ty::BoundRegion::BrNamed(def_id, ..), ..
|
||||
}) if self.free_to_bound_regions.contains_key(&def_id) => {
|
||||
self.free_to_bound_regions[&def_id]
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ impl<'a, 'gcx, 'tcx> CoherenceChecker<'a, 'gcx, 'tcx> {
|
|||
TyBool | TyChar | TyInt(..) | TyUint(..) | TyFloat(..) |
|
||||
TyStr | TyArray(..) | TySlice(..) | TyFnDef(..) | TyFnPtr(_) |
|
||||
TyTuple(..) | TyParam(..) | TyError | TyNever |
|
||||
TyRawPtr(_) | TyRef(_, _) | TyProjection(..) => {
|
||||
TyRawPtr(_) | TyRef(..) | TyProjection(..) => {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
@ -740,7 +740,7 @@ fn convert_item(ccx: &CrateCtxt, it: &hir::Item) {
|
|||
tcx.impl_trait_refs.borrow_mut().insert(ccx.tcx.map.local_def_id(it.id),
|
||||
Some(trait_ref));
|
||||
}
|
||||
hir::ItemImpl(_, _,
|
||||
hir::ItemImpl(..,
|
||||
ref generics,
|
||||
ref opt_trait_ref,
|
||||
ref selfty,
|
||||
|
@ -1456,7 +1456,7 @@ fn generics_of_def_id<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
|
|||
generics
|
||||
}
|
||||
|
||||
ItemTrait(_, ref generics, _, _) => {
|
||||
ItemTrait(_, ref generics, ..) => {
|
||||
// Add in the self type parameter.
|
||||
//
|
||||
// Something of a hack: use the node id for the trait, also as
|
||||
|
@ -1566,7 +1566,7 @@ fn type_of_def_id<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
|
|||
let ty = match ccx.tcx.map.get(node_id) {
|
||||
NodeItem(item) => {
|
||||
match item.node {
|
||||
ItemStatic(ref t, _, _) | ItemConst(ref t, _) => {
|
||||
ItemStatic(ref t, ..) | ItemConst(ref t, _) => {
|
||||
ccx.icx(&()).to_ty(&ElidableRscope::new(ty::ReStatic), &t)
|
||||
}
|
||||
ItemFn(ref decl, unsafety, _, abi, ref generics, _) => {
|
||||
|
|
|
@ -415,7 +415,7 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
ty::TyFnDef(_, _, &ty::BareFnTy { ref sig, .. }) |
|
||||
ty::TyFnDef(.., &ty::BareFnTy { ref sig, .. }) |
|
||||
ty::TyFnPtr(&ty::BareFnTy { ref sig, .. }) => {
|
||||
self.add_constraints_from_sig(generics, sig, variance);
|
||||
}
|
||||
|
|
|
@ -238,7 +238,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for TermsContext<'a, 'tcx> {
|
|||
hir::ItemUnion(_, ref generics) => {
|
||||
self.add_inferreds_for_item(item.id, false, generics);
|
||||
}
|
||||
hir::ItemTrait(_, ref generics, _, _) => {
|
||||
hir::ItemTrait(_, ref generics, ..) => {
|
||||
// Note: all inputs for traits are ultimately
|
||||
// constrained to be invariant. See `visit_item` in
|
||||
// the impl for `ConstraintContext` in `constraints.rs`.
|
||||
|
|
|
@ -180,7 +180,7 @@ fn build_external_function<'a, 'tcx>(cx: &DocContext, tcx: TyCtxt<'a, 'tcx, 'tcx
|
|||
did: DefId) -> clean::Function {
|
||||
let t = tcx.lookup_item_type(did);
|
||||
let (decl, style, abi) = match t.ty.sty {
|
||||
ty::TyFnDef(_, _, ref f) => ((did, &f.sig).clean(cx), f.unsafety, f.abi),
|
||||
ty::TyFnDef(.., ref f) => ((did, &f.sig).clean(cx), f.unsafety, f.abi),
|
||||
_ => panic!("bad function"),
|
||||
};
|
||||
|
||||
|
|
|
@ -642,7 +642,7 @@ fn external_path_params(cx: &DocContext, trait_did: Option<DefId>, has_self: boo
|
|||
output: output
|
||||
}
|
||||
},
|
||||
(_, _) => {
|
||||
(..) => {
|
||||
PathParameters::AngleBracketed {
|
||||
lifetimes: lifetimes,
|
||||
types: types.clean(cx),
|
||||
|
@ -717,7 +717,7 @@ impl<'tcx> Clean<TyParamBound> for ty::TraitRef<'tcx> {
|
|||
if let ty::TyTuple(ts) = ty_s.sty {
|
||||
for &ty_s in ts {
|
||||
if let ty::TyRef(ref reg, _) = ty_s.sty {
|
||||
if let &ty::Region::ReLateBound(_, _) = *reg {
|
||||
if let &ty::Region::ReLateBound(..) = *reg {
|
||||
debug!(" hit an ReLateBound {:?}", reg);
|
||||
if let Some(lt) = reg.clean(cx) {
|
||||
late_bounds.push(lt);
|
||||
|
@ -1794,7 +1794,7 @@ impl<'tcx> Clean<Type> for ty::Ty<'tcx> {
|
|||
mutability: mt.mutbl.clean(cx),
|
||||
type_: box mt.ty.clean(cx),
|
||||
},
|
||||
ty::TyFnDef(_, _, ref fty) |
|
||||
ty::TyFnDef(.., ref fty) |
|
||||
ty::TyFnPtr(ref fty) => BareFunction(box BareFunctionDecl {
|
||||
unsafety: fty.unsafety,
|
||||
generics: Generics {
|
||||
|
@ -2699,7 +2699,7 @@ fn name_from_pat(p: &hir::Pat) -> String {
|
|||
match p.node {
|
||||
PatKind::Wild => "_".to_string(),
|
||||
PatKind::Binding(_, ref p, _) => p.node.to_string(),
|
||||
PatKind::TupleStruct(ref p, _, _) | PatKind::Path(None, ref p) => path_to_string(p),
|
||||
PatKind::TupleStruct(ref p, ..) | PatKind::Path(None, ref p) => path_to_string(p),
|
||||
PatKind::Path(..) => panic!("tried to get argument name from qualified PatKind::Path, \
|
||||
which is not allowed in function arguments"),
|
||||
PatKind::Struct(ref name, ref fields, etc) => {
|
||||
|
|
|
@ -1891,7 +1891,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
|
|||
(false, &Some(ref tracker_url), Some(issue_no)) if issue_no > 0 =>
|
||||
format!(" (<a href=\"{}{}\">#{}</a>)", Escape(&tracker_url), issue_no,
|
||||
issue_no),
|
||||
(true, _, _) =>
|
||||
(true, ..) =>
|
||||
format!(" (<code>{}</code>)", Escape(&stab.feature)),
|
||||
_ => String::new(),
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#![feature(box_patterns)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(dotdot_in_tuple_patterns)]
|
||||
#![feature(libc)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(set_stdio)]
|
||||
|
@ -420,7 +421,7 @@ fn rust_input(cratefile: &str, externs: Externs, matches: &getopts::Matches) ->
|
|||
let mut pm = plugins::PluginManager::new(PathBuf::from(path));
|
||||
for pass in &passes {
|
||||
let plugin = match PASSES.iter()
|
||||
.position(|&(p, _, _)| {
|
||||
.position(|&(p, ..)| {
|
||||
p == *pass
|
||||
}) {
|
||||
Some(i) => PASSES[i].1,
|
||||
|
|
|
@ -82,7 +82,7 @@ impl fmt::Display for FromHexError {
|
|||
impl error::Error for FromHexError {
|
||||
fn description(&self) -> &str {
|
||||
match *self {
|
||||
InvalidHexCharacter(_, _) => "invalid character",
|
||||
InvalidHexCharacter(..) => "invalid character",
|
||||
InvalidHexLength => "invalid length",
|
||||
}
|
||||
}
|
||||
|
|
|
@ -332,7 +332,7 @@ impl<'a> Prefix<'a> {
|
|||
pub fn is_verbatim(&self) -> bool {
|
||||
use self::Prefix::*;
|
||||
match *self {
|
||||
Verbatim(_) | VerbatimDisk(_) | VerbatimUNC(_, _) => true,
|
||||
Verbatim(_) | VerbatimDisk(_) | VerbatimUNC(..) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -561,7 +561,7 @@ impl Pat {
|
|||
}
|
||||
PatKind::Wild |
|
||||
PatKind::Lit(_) |
|
||||
PatKind::Range(_, _) |
|
||||
PatKind::Range(..) |
|
||||
PatKind::Ident(..) |
|
||||
PatKind::Path(..) |
|
||||
PatKind::Mac(_) => {
|
||||
|
|
|
@ -156,7 +156,7 @@ pub fn count_names(ms: &[TokenTree]) -> usize {
|
|||
TokenTree::Token(_, MatchNt(..)) => {
|
||||
1
|
||||
}
|
||||
TokenTree::Token(_, _) => 0,
|
||||
TokenTree::Token(..) => 0,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ pub fn nameize(p_s: &ParseSess, ms: &[TokenTree], res: &[Rc<NamedMatch>])
|
|||
TokenTree::Token(sp, SubstNt(..)) => {
|
||||
return Err((sp, "missing fragment specifier".to_string()))
|
||||
}
|
||||
TokenTree::Token(_, _) => (),
|
||||
TokenTree::Token(..) => (),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -180,7 +180,7 @@ impl Token {
|
|||
Ident(..) => true,
|
||||
Underscore => true,
|
||||
Tilde => true,
|
||||
Literal(_, _) => true,
|
||||
Literal(..) => true,
|
||||
Not => true,
|
||||
BinOp(Minus) => true,
|
||||
BinOp(Star) => true,
|
||||
|
@ -202,8 +202,8 @@ impl Token {
|
|||
/// Returns `true` if the token is any literal
|
||||
pub fn is_lit(&self) -> bool {
|
||||
match *self {
|
||||
Literal(_, _) => true,
|
||||
_ => false,
|
||||
Literal(..) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -233,7 +233,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt,
|
|||
p.bump();
|
||||
state = st;
|
||||
}
|
||||
(&token::Eof, _, _) => break 'statement,
|
||||
(&token::Eof, ..) => break 'statement,
|
||||
_ => break,
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue