Skip to content

Commit 2baae51

Browse files
committed
---
yaml --- r: 187214 b: refs/heads/try c: d38aab3 h: refs/heads/master v: v3
1 parent 3ccf29f commit 2baae51

File tree

37 files changed

+94
-94
lines changed

37 files changed

+94
-94
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b4c965ee803a4521d8b4575f634e036f93e408f3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: 7e382132a57953e09bbb4e41152107032d69a2cf
5+
refs/heads/try: d38aab397e3295ead5869f84cd54044c1759c6d7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librustc/metadata/decoder.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ enum Family {
126126
TupleVariant, // v
127127
StructVariant, // V
128128
Impl, // i
129-
DefTrait, // d
129+
DefaultImpl, // d
130130
Trait, // I
131131
Struct, // S
132132
PublicField, // g
@@ -152,7 +152,7 @@ fn item_family(item: rbml::Doc) -> Family {
152152
'v' => TupleVariant,
153153
'V' => StructVariant,
154154
'i' => Impl,
155-
'd' => DefTrait,
155+
'd' => DefaultImpl,
156156
'I' => Trait,
157157
'S' => Struct,
158158
'g' => PublicField,
@@ -357,9 +357,9 @@ fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
357357
let enum_did = item_reqd_and_translated_parent_item(cnum, item);
358358
DlDef(def::DefVariant(enum_did, did, false))
359359
}
360-
Trait => DlDef(def::DefTrait(did)),
360+
Trait => DlDef(def::DefaultImpl(did)),
361361
Enum => DlDef(def::DefTy(did, true)),
362-
Impl | DefTrait => DlImpl(did),
362+
Impl | DefaultImpl => DlImpl(did),
363363
PublicField | InheritedField => DlField,
364364
}
365365
}
@@ -482,7 +482,7 @@ pub fn get_impl_trait<'tcx>(cdata: Cmd,
482482
let item_doc = lookup_item(id, cdata.data());
483483
let fam = item_family(item_doc);
484484
match fam {
485-
Family::Impl | Family::DefTrait => {
485+
Family::Impl | Family::DefaultImpl => {
486486
reader::maybe_get_doc(item_doc, tag_item_trait_ref).map(|tp| {
487487
doc_trait_ref(tp, tcx, cdata)
488488
})
@@ -1358,7 +1358,7 @@ pub fn get_trait_of_item(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
13581358
let parent_item_doc = lookup_item(parent_item_id.node, cdata.data());
13591359
match item_family(parent_item_doc) {
13601360
Trait => Some(item_def_id(parent_item_doc, cdata)),
1361-
Impl | DefTrait => {
1361+
Impl | DefaultImpl => {
13621362
reader::maybe_get_doc(parent_item_doc, tag_item_trait_ref)
13631363
.map(|_| item_trait_ref(parent_item_doc, tcx, cdata).def_id)
13641364
}
@@ -1568,7 +1568,7 @@ pub fn is_associated_type(cdata: Cmd, id: ast::NodeId) -> bool {
15681568
pub fn is_default_trait<'tcx>(cdata: Cmd, id: ast::NodeId) -> bool {
15691569
let item_doc = lookup_item(id, cdata.data());
15701570
match item_family(item_doc) {
1571-
Family::DefTrait => true,
1571+
Family::DefaultImpl => true,
15721572
_ => false
15731573
}
15741574
}

branches/try/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ fn encode_info_for_item(ecx: &EncodeContext,
12011201
None => {}
12021202
}
12031203
}
1204-
ast::ItemDefTrait(unsafety, ref ast_trait_ref) => {
1204+
ast::ItemDefaultImpl(unsafety, ref ast_trait_ref) => {
12051205
add_to_index(item, rbml_w, index);
12061206
rbml_w.start_tag(tag_items_data_item);
12071207
encode_def_id(rbml_w, def_id);

branches/try/src/librustc/middle/astencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ impl tr for def::Def {
440440
def::DefVariant(e_did, v_did, is_s) => {
441441
def::DefVariant(e_did.tr(dcx), v_did.tr(dcx), is_s)
442442
},
443-
def::DefTrait(did) => def::DefTrait(did.tr(dcx)),
443+
def::DefaultImpl(did) => def::DefaultImpl(did.tr(dcx)),
444444
def::DefTy(did, is_enum) => def::DefTy(did.tr(dcx), is_enum),
445445
def::DefAssociatedTy(did) => def::DefAssociatedTy(did.tr(dcx)),
446446
def::DefAssociatedPath(def::TyParamProvenance::FromSelf(did), ident) =>

branches/try/src/librustc/middle/def.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub enum Def {
3838
// type `U` (indicated by the Ident).
3939
// FIXME(#20301) -- should use Name
4040
DefAssociatedPath(TyParamProvenance, ast::Ident),
41-
DefTrait(ast::DefId),
41+
DefaultImpl(ast::DefId),
4242
DefPrimTy(ast::PrimTy),
4343
DefTyParam(ParamSpace, u32, ast::DefId, ast::Name),
4444
DefUse(ast::DefId),
@@ -135,7 +135,7 @@ impl Def {
135135
DefFn(id, _) | DefStaticMethod(id, _) | DefMod(id) |
136136
DefForeignMod(id) | DefStatic(id, _) |
137137
DefVariant(_, id, _) | DefTy(id, _) | DefAssociatedTy(id) |
138-
DefTyParam(_, _, id, _) | DefUse(id) | DefStruct(id) | DefTrait(id) |
138+
DefTyParam(_, _, id, _) | DefUse(id) | DefStruct(id) | DefaultImpl(id) |
139139
DefMethod(id, _, _) | DefConst(id) |
140140
DefAssociatedPath(TyParamProvenance::FromSelf(id), _) |
141141
DefAssociatedPath(TyParamProvenance::FromParam(id), _) => {

branches/try/src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
579579
Ok(self.cat_rvalue_node(id, span, expr_ty))
580580
}
581581
def::DefMod(_) | def::DefForeignMod(_) | def::DefUse(_) |
582-
def::DefTrait(_) | def::DefTy(..) | def::DefPrimTy(_) |
582+
def::DefaultImpl(_) | def::DefTy(..) | def::DefPrimTy(_) |
583583
def::DefTyParam(..) | def::DefTyParamBinder(..) | def::DefRegion(_) |
584584
def::DefLabel(_) | def::DefSelfTy(..) |
585585
def::DefAssociatedTy(..) | def::DefAssociatedPath(..)=> {

branches/try/src/librustc/middle/reachable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
302302
ast::ItemMod(..) | ast::ItemForeignMod(..) |
303303
ast::ItemImpl(..) | ast::ItemTrait(..) |
304304
ast::ItemStruct(..) | ast::ItemEnum(..) |
305-
ast::ItemDefTrait(..) => {}
305+
ast::ItemDefaultImpl(..) => {}
306306

307307
_ => {
308308
self.tcx.sess.span_bug(item.span,

branches/try/src/librustc/middle/resolve_lifetime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
115115
ast::ItemUse(_) |
116116
ast::ItemMod(..) |
117117
ast::ItemMac(..) |
118-
ast::ItemDefTrait(..) |
118+
ast::ItemDefaultImpl(..) |
119119
ast::ItemForeignMod(..) |
120120
ast::ItemStatic(..) |
121121
ast::ItemConst(..) => {
@@ -169,7 +169,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
169169
// if this path references a trait, then this will resolve to
170170
// a trait ref, which introduces a binding scope.
171171
match self.def_map.borrow().get(&id) {
172-
Some(&def::DefTrait(..)) => {
172+
Some(&def::DefaultImpl(..)) => {
173173
self.with(LateScope(&Vec::new(), self.scope), |_, this| {
174174
this.visit_path(path, id);
175175
});

branches/try/src/librustc/middle/traits/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub enum Vtable<'tcx, N> {
222222
VtableImpl(VtableImplData<'tcx, N>),
223223

224224
/// Vtable for default trait implementations
225-
VtableDefaultTrait(VtableDefaultTraitData<N>),
225+
VtableDefaultImpl(VtableDefaultImplData<N>),
226226

227227
/// Successful resolution to an obligation provided by the caller
228228
/// for some type parameter. The `Vec<N>` represents the
@@ -263,7 +263,7 @@ pub struct VtableImplData<'tcx, N> {
263263
}
264264

265265
#[derive(Debug,Clone)]
266-
pub struct VtableDefaultTraitData<N> {
266+
pub struct VtableDefaultImplData<N> {
267267
pub trait_def_id: ast::DefId,
268268
pub nested: Vec<N>
269269
}
@@ -525,15 +525,15 @@ impl<'tcx, N> Vtable<'tcx, N> {
525525
VtableParam(ref n) => n.iter(),
526526
VtableBuiltin(ref i) => i.iter_nested(),
527527
VtableObject(_) |
528-
VtableDefaultTrait(..) | VtableFnPointer(..) |
528+
VtableDefaultImpl(..) | VtableFnPointer(..) |
529529
VtableClosure(..) => (&[]).iter(),
530530
}
531531
}
532532

533533
pub fn map_nested<M, F>(&self, op: F) -> Vtable<'tcx, M> where F: FnMut(&N) -> M {
534534
match *self {
535535
VtableImpl(ref i) => VtableImpl(i.map_nested(op)),
536-
VtableDefaultTrait(ref t) => VtableDefaultTrait(t.map_nested(op)),
536+
VtableDefaultImpl(ref t) => VtableDefaultImpl(t.map_nested(op)),
537537
VtableFnPointer(ref sig) => VtableFnPointer((*sig).clone()),
538538
VtableClosure(d, ref s) => VtableClosure(d, s.clone()),
539539
VtableParam(ref n) => VtableParam(n.iter().map(op).collect()),
@@ -549,7 +549,7 @@ impl<'tcx, N> Vtable<'tcx, N> {
549549
VtableImpl(i) => VtableImpl(i.map_move_nested(op)),
550550
VtableFnPointer(sig) => VtableFnPointer(sig),
551551
VtableClosure(d, s) => VtableClosure(d, s),
552-
VtableDefaultTrait(t) => VtableDefaultTrait(t.map_move_nested(op)),
552+
VtableDefaultImpl(t) => VtableDefaultImpl(t.map_move_nested(op)),
553553
VtableParam(n) => VtableParam(n.into_iter().map(op).collect()),
554554
VtableObject(p) => VtableObject(p),
555555
VtableBuiltin(no) => VtableBuiltin(no.map_move_nested(op)),
@@ -584,25 +584,25 @@ impl<'tcx, N> VtableImplData<'tcx, N> {
584584
}
585585
}
586586

587-
impl<N> VtableDefaultTraitData<N> {
587+
impl<N> VtableDefaultImplData<N> {
588588
pub fn iter_nested(&self) -> Iter<N> {
589589
self.nested.iter()
590590
}
591591

592-
pub fn map_nested<M, F>(&self, op: F) -> VtableDefaultTraitData<M> where
592+
pub fn map_nested<M, F>(&self, op: F) -> VtableDefaultImplData<M> where
593593
F: FnMut(&N) -> M,
594594
{
595-
VtableDefaultTraitData {
595+
VtableDefaultImplData {
596596
trait_def_id: self.trait_def_id,
597597
nested: self.nested.iter().map(op).collect()
598598
}
599599
}
600600

601-
pub fn map_move_nested<M, F>(self, op: F) -> VtableDefaultTraitData<M> where
601+
pub fn map_move_nested<M, F>(self, op: F) -> VtableDefaultImplData<M> where
602602
F: FnMut(N) -> M,
603603
{
604-
let VtableDefaultTraitData { trait_def_id, nested } = self;
605-
VtableDefaultTraitData {
604+
let VtableDefaultImplData { trait_def_id, nested } = self;
605+
VtableDefaultImplData {
606606
trait_def_id: trait_def_id,
607607
nested: nested.into_iter().map(op).collect()
608608
}

branches/try/src/librustc/middle/traits/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ fn assemble_candidates_from_impls<'cx,'tcx>(
709709
// projection. And the projection where clause is handled
710710
// in `assemble_candidates_from_param_env`.
711711
}
712-
super::VtableDefaultTrait(..) |
712+
super::VtableDefaultImpl(..) |
713713
super::VtableBuiltin(..) => {
714714
// These traits have no associated types.
715715
selcx.tcx().sess.span_bug(

branches/try/src/librustc/middle/traits/select.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ use super::{SelectionError, Unimplemented, Overflow, OutputTypeParameterMismatch
2626
use super::{Selection};
2727
use super::{SelectionResult};
2828
use super::{VtableBuiltin, VtableImpl, VtableParam, VtableClosure,
29-
VtableFnPointer, VtableObject, VtableDefaultTrait};
30-
use super::{VtableImplData, VtableObjectData, VtableBuiltinData, VtableDefaultTraitData};
29+
VtableFnPointer, VtableObject, VtableDefaultImpl};
30+
use super::{VtableImplData, VtableObjectData, VtableBuiltinData, VtableDefaultImplData};
3131
use super::object_safety;
3232
use super::{util};
3333

@@ -136,7 +136,7 @@ enum SelectionCandidate<'tcx> {
136136
BuiltinCandidate(ty::BuiltinBound),
137137
ParamCandidate(ty::PolyTraitRef<'tcx>),
138138
ImplCandidate(ast::DefId),
139-
DefaultTraitCandidate(ast::DefId),
139+
DefaultImplCandidate(ast::DefId),
140140

141141
/// This is a trait matching with a projected type as `Self`, and
142142
/// we found an applicable bound in the trait definition.
@@ -1150,7 +1150,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11501150
}
11511151

11521152
if ty::trait_has_default_impl(self.tcx(), def_id) {
1153-
candidates.vec.push(DefaultTraitCandidate(def_id.clone()))
1153+
candidates.vec.push(DefaultImplCandidate(def_id.clone()))
11541154
}
11551155

11561156
Ok(())
@@ -1275,7 +1275,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12751275
// #18453.
12761276
true
12771277
}
1278-
(&DefaultTraitCandidate(_), _) => {
1278+
(&DefaultImplCandidate(_), _) => {
12791279
// Prefer other candidates over default implementations.
12801280
true
12811281
}
@@ -1728,9 +1728,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
17281728
Ok(VtableParam(obligations))
17291729
}
17301730

1731-
DefaultTraitCandidate(trait_def_id) => {
1731+
DefaultImplCandidate(trait_def_id) => {
17321732
let data = try!(self.confirm_default_impl_candidate(obligation, trait_def_id));
1733-
Ok(VtableDefaultTrait(data))
1733+
Ok(VtableDefaultImpl(data))
17341734
}
17351735

17361736
ImplCandidate(impl_def_id) => {
@@ -1868,7 +1868,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
18681868
fn confirm_default_impl_candidate(&mut self,
18691869
obligation: &TraitObligation<'tcx>,
18701870
impl_def_id: ast::DefId)
1871-
-> Result<VtableDefaultTraitData<PredicateObligation<'tcx>>,
1871+
-> Result<VtableDefaultImplData<PredicateObligation<'tcx>>,
18721872
SelectionError<'tcx>>
18731873
{
18741874
debug!("confirm_default_impl_candidate({}, {})",
@@ -1884,7 +1884,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
18841884
obligation: &TraitObligation<'tcx>,
18851885
trait_def_id: ast::DefId,
18861886
nested: Vec<Ty<'tcx>>)
1887-
-> VtableDefaultTraitData<PredicateObligation<'tcx>>
1887+
-> VtableDefaultImplData<PredicateObligation<'tcx>>
18881888
{
18891889
let derived_cause = self.derived_cause(obligation, ImplDerivedObligation);
18901890
let obligations = nested.iter().map(|&nested_ty| {
@@ -1920,7 +1920,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
19201920

19211921
debug!("vtable_default_impl_data: obligations={}", obligations.repr(self.tcx()));
19221922

1923-
VtableDefaultTraitData {
1923+
VtableDefaultImplData {
19241924
trait_def_id: trait_def_id,
19251925
nested: obligations
19261926
}
@@ -2456,7 +2456,7 @@ impl<'tcx> Repr<'tcx> for SelectionCandidate<'tcx> {
24562456
BuiltinCandidate(b) => format!("BuiltinCandidate({:?})", b),
24572457
ParamCandidate(ref a) => format!("ParamCandidate({})", a.repr(tcx)),
24582458
ImplCandidate(a) => format!("ImplCandidate({})", a.repr(tcx)),
2459-
DefaultTraitCandidate(t) => format!("DefaultTraitCandidate({:?})", t),
2459+
DefaultImplCandidate(t) => format!("DefaultImplCandidate({:?})", t),
24602460
ProjectionCandidate => format!("ProjectionCandidate"),
24612461
FnPointerCandidate => format!("FnPointerCandidate"),
24622462
ObjectCandidate => {

branches/try/src/librustc/middle/traits/util.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use util::nodemap::FnvHashSet;
2020
use util::ppaux::Repr;
2121

2222
use super::{Obligation, ObligationCause, PredicateObligation,
23-
VtableImpl, VtableParam, VtableImplData, VtableDefaultTraitData};
23+
VtableImpl, VtableParam, VtableImplData, VtableDefaultImplData};
2424

2525
struct PredicateSet<'a,'tcx:'a> {
2626
tcx: &'a ty::ctxt<'tcx>,
@@ -469,7 +469,7 @@ impl<'tcx, N:Repr<'tcx>> Repr<'tcx> for super::Vtable<'tcx, N> {
469469
super::VtableImpl(ref v) =>
470470
v.repr(tcx),
471471

472-
super::VtableDefaultTrait(ref t) =>
472+
super::VtableDefaultImpl(ref t) =>
473473
t.repr(tcx),
474474

475475
super::VtableClosure(ref d, ref s) =>
@@ -511,9 +511,9 @@ impl<'tcx, N:Repr<'tcx>> Repr<'tcx> for super::VtableBuiltinData<N> {
511511
}
512512
}
513513

514-
impl<'tcx, N:Repr<'tcx>> Repr<'tcx> for super::VtableDefaultTraitData<N> {
514+
impl<'tcx, N:Repr<'tcx>> Repr<'tcx> for super::VtableDefaultImplData<N> {
515515
fn repr(&self, tcx: &ty::ctxt<'tcx>) -> String {
516-
format!("VtableDefaultTraitData(trait_def_id={}, nested={})",
516+
format!("VtableDefaultImplData(trait_def_id={}, nested={})",
517517
self.trait_def_id.repr(tcx),
518518
self.nested.repr(tcx))
519519
}

branches/try/src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5175,7 +5175,7 @@ pub fn impl_trait_ref<'tcx>(cx: &ctxt<'tcx>, id: ast::DefId)
51755175
&None => None
51765176
}
51775177
}
5178-
ast::ItemDefTrait(_, ref ast_trait_ref) => {
5178+
ast::ItemDefaultImpl(_, ref ast_trait_ref) => {
51795179
Some(ty::node_id_to_trait_ref(cx, ast_trait_ref.ref_id))
51805180
}
51815181
_ => None

branches/try/src/librustc/middle/ty_fold.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,9 @@ impl<'tcx, N: TypeFoldable<'tcx>> TypeFoldable<'tcx> for traits::VtableImplData<
507507
}
508508
}
509509

510-
impl<'tcx, N: TypeFoldable<'tcx>> TypeFoldable<'tcx> for traits::VtableDefaultTraitData<N> {
511-
fn fold_with<F:TypeFolder<'tcx>>(&self, folder: &mut F) -> traits::VtableDefaultTraitData<N> {
512-
traits::VtableDefaultTraitData {
510+
impl<'tcx, N: TypeFoldable<'tcx>> TypeFoldable<'tcx> for traits::VtableDefaultImplData<N> {
511+
fn fold_with<F:TypeFolder<'tcx>>(&self, folder: &mut F) -> traits::VtableDefaultImplData<N> {
512+
traits::VtableDefaultImplData {
513513
trait_def_id: self.trait_def_id,
514514
nested: self.nested.fold_with(folder),
515515
}
@@ -528,7 +528,7 @@ impl<'tcx, N: TypeFoldable<'tcx>> TypeFoldable<'tcx> for traits::Vtable<'tcx, N>
528528
fn fold_with<F:TypeFolder<'tcx>>(&self, folder: &mut F) -> traits::Vtable<'tcx, N> {
529529
match *self {
530530
traits::VtableImpl(ref v) => traits::VtableImpl(v.fold_with(folder)),
531-
traits::VtableDefaultTrait(ref t) => traits::VtableDefaultTrait(t.fold_with(folder)),
531+
traits::VtableDefaultImpl(ref t) => traits::VtableDefaultImpl(t.fold_with(folder)),
532532
traits::VtableClosure(d, ref s) => {
533533
traits::VtableClosure(d, s.fold_with(folder))
534534
}

0 commit comments

Comments
 (0)