Skip to content

Commit 1d095ce

Browse files
committed
---
yaml --- r: 127999 b: refs/heads/auto c: 1c16acc h: refs/heads/master i: 127997: 5d60dd1 127995: 4849ed4 127991: b357fa3 127983: a4ded0e 127967: f52f04d 127935: 5ea3e96 127871: d12cea0 127743: 205cd49 127487: 7902172 126975: 331ad03 v: v3
1 parent d6382a8 commit 1d095ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1172
-1970
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: a8c8e3f80fd0355b2bb91337c6ad0bb0a38d5485
16+
refs/heads/auto: 1c16accfc204b447b128ed17545e88d947144682
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ extern crate foo = "some/where/rust-foo#foo:1.0"; // a full crate ID for externa
919919
##### Use declarations
920920

921921
~~~~ {.ebnf .gram}
922-
use_decl : "pub" ? "use" [ ident '=' path
922+
use_decl : "pub" ? "use" [ path "as" ident
923923
| path_glob ] ;
924924
925925
path_glob : ident [ "::" [ path_glob
@@ -939,7 +939,7 @@ module item. These declarations may appear at the top of [modules](#modules) and
939939
940940
Use declarations support a number of convenient shortcuts:
941941

942-
* Rebinding the target name as a new local name, using the syntax `use x = p::q::r;`.
942+
* Rebinding the target name as a new local name, using the syntax `use p::q::r as x;`.
943943
* Simultaneously binding a list of paths differing only in their final element,
944944
using the glob-like brace syntax `use a::b::{c,d,e,f};`
945945
* Binding all paths matching a given prefix, using the asterisk wildcard syntax `use a::b::*;`

branches/auto/src/librustc/front/config.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,10 @@ fn fold_foreign_mod(cx: &mut Context, nm: &ast::ForeignMod) -> ast::ForeignMod {
109109

110110
fn fold_item_underscore(cx: &mut Context, item: &ast::Item_) -> ast::Item_ {
111111
let item = match *item {
112-
ast::ItemImpl(ref a, ref b, c, ref impl_items) => {
113-
let impl_items = impl_items.iter()
114-
.filter(|ii| {
115-
impl_item_in_cfg(cx, &**ii)
116-
})
117-
.map(|x| *x)
118-
.collect();
119-
ast::ItemImpl((*a).clone(), (*b).clone(), c, impl_items)
112+
ast::ItemImpl(ref a, ref b, c, ref methods) => {
113+
let methods = methods.iter().filter(|m| method_in_cfg(cx, &***m))
114+
.map(|x| *x).collect();
115+
ast::ItemImpl((*a).clone(), (*b).clone(), c, methods)
120116
}
121117
ast::ItemTrait(ref a, ref b, ref c, ref methods) => {
122118
let methods = methods.iter()
@@ -234,16 +230,14 @@ fn view_item_in_cfg(cx: &mut Context, item: &ast::ViewItem) -> bool {
234230
return (cx.in_cfg)(item.attrs.as_slice());
235231
}
236232

237-
fn trait_method_in_cfg(cx: &mut Context, meth: &ast::TraitItem) -> bool {
238-
match *meth {
239-
ast::RequiredMethod(ref meth) => (cx.in_cfg)(meth.attrs.as_slice()),
240-
ast::ProvidedMethod(meth) => (cx.in_cfg)(meth.attrs.as_slice())
241-
}
233+
fn method_in_cfg(cx: &mut Context, meth: &ast::Method) -> bool {
234+
return (cx.in_cfg)(meth.attrs.as_slice());
242235
}
243236

244-
fn impl_item_in_cfg(cx: &mut Context, impl_item: &ast::ImplItem) -> bool {
245-
match *impl_item {
246-
ast::MethodImplItem(meth) => (cx.in_cfg)(meth.attrs.as_slice()),
237+
fn trait_method_in_cfg(cx: &mut Context, meth: &ast::TraitMethod) -> bool {
238+
match *meth {
239+
ast::Required(ref meth) => (cx.in_cfg)(meth.attrs.as_slice()),
240+
ast::Provided(meth) => (cx.in_cfg)(meth.attrs.as_slice())
247241
}
248242
}
249243

branches/auto/src/librustc/lint/builtin.rs

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -801,19 +801,15 @@ fn method_context(cx: &Context, m: &ast::Method) -> MethodContext {
801801
node: m.id
802802
};
803803

804-
match cx.tcx.impl_or_trait_items.borrow().find_copy(&did) {
804+
match cx.tcx.methods.borrow().find_copy(&did) {
805805
None => cx.sess().span_bug(m.span, "missing method descriptor?!"),
806806
Some(md) => {
807-
match md {
808-
ty::MethodTraitItem(md) => {
809-
match md.container {
810-
ty::TraitContainer(..) => TraitDefaultImpl,
811-
ty::ImplContainer(cid) => {
812-
match ty::impl_trait_ref(cx.tcx, cid) {
813-
Some(..) => TraitImpl,
814-
None => PlainImpl
815-
}
816-
}
807+
match md.container {
808+
ty::TraitContainer(..) => TraitDefaultImpl,
809+
ty::ImplContainer(cid) => {
810+
match ty::impl_trait_ref(cx.tcx, cid) {
811+
Some(..) => TraitImpl,
812+
None => PlainImpl
817813
}
818814
}
819815
}
@@ -1474,15 +1470,7 @@ impl LintPass for Stability {
14741470
trait_id: trait_id,
14751471
method_num: index,
14761472
..
1477-
}) => {
1478-
match ty::trait_item(cx.tcx,
1479-
trait_id,
1480-
index) {
1481-
ty::MethodTraitItem(method) => {
1482-
method.def_id
1483-
}
1484-
}
1485-
}
1473+
}) => ty::trait_method(cx.tcx, trait_id, index).def_id
14861474
}
14871475
}
14881476
None => return

branches/auto/src/librustc/lint/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,9 @@ impl<'a> Visitor<()> for Context<'a> {
563563
visit::walk_generics(self, g, ());
564564
}
565565

566-
fn visit_trait_item(&mut self, m: &ast::TraitItem, _: ()) {
566+
fn visit_trait_method(&mut self, m: &ast::TraitMethod, _: ()) {
567567
run_lints!(self, check_trait_method, m);
568-
visit::walk_trait_item(self, m, ());
568+
visit::walk_trait_method(self, m, ());
569569
}
570570

571571
fn visit_opt_lifetime_ref(&mut self, sp: Span, lt: &Option<ast::Lifetime>, _: ()) {

branches/auto/src/librustc/lint/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub trait LintPass {
141141
fn check_fn(&mut self, _: &Context,
142142
_: &FnKind, _: &ast::FnDecl, _: &ast::Block, _: Span, _: ast::NodeId) { }
143143
fn check_ty_method(&mut self, _: &Context, _: &ast::TypeMethod) { }
144-
fn check_trait_method(&mut self, _: &Context, _: &ast::TraitItem) { }
144+
fn check_trait_method(&mut self, _: &Context, _: &ast::TraitMethod) { }
145145
fn check_struct_def(&mut self, _: &Context,
146146
_: &ast::StructDef, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
147147
fn check_struct_def_post(&mut self, _: &Context,

branches/auto/src/librustc/metadata/common.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub static tag_crate_dep_hash: uint = 0x1e;
7777

7878
pub static tag_mod_impl: uint = 0x1f;
7979

80-
pub static tag_item_trait_item: uint = 0x20;
80+
pub static tag_item_trait_method: uint = 0x20;
8181

8282
pub static tag_item_trait_ref: uint = 0x21;
8383
pub static tag_item_super_trait_ref: uint = 0x22;
@@ -95,14 +95,14 @@ pub static tag_item_field_origin: uint = 0x29;
9595

9696
pub static tag_item_variances: uint = 0x2a;
9797
/*
98-
trait items contain tag_item_trait_item elements,
99-
impl items contain tag_item_impl_item elements, and classes
98+
trait items contain tag_item_trait_method elements,
99+
impl items contain tag_item_impl_method elements, and classes
100100
have both. That's because some code treats classes like traits,
101101
and other code treats them like impls. Because classes can contain
102-
both, tag_item_trait_item and tag_item_impl_item have to be two
102+
both, tag_item_trait_method and tag_item_impl_method have to be two
103103
different tags.
104104
*/
105-
pub static tag_item_impl_item: uint = 0x30;
105+
pub static tag_item_impl_method: uint = 0x30;
106106
pub static tag_item_trait_method_explicit_self: uint = 0x31;
107107

108108

@@ -154,11 +154,9 @@ impl astencode_tag {
154154
}
155155
}
156156

157-
pub static tag_item_trait_item_sort: uint = 0x60;
157+
pub static tag_item_trait_method_sort: uint = 0x60;
158158

159-
pub static tag_item_trait_parent_sort: uint = 0x61;
160-
161-
pub static tag_item_impl_type_basename: uint = 0x62;
159+
pub static tag_item_impl_type_basename: uint = 0x61;
162160

163161
pub static tag_crate_triple: uint = 0x66;
164162

branches/auto/src/librustc/metadata/csearch.rs

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use metadata::common::*;
1616
use metadata::cstore;
1717
use metadata::decoder;
1818
use middle::lang_items;
19-
use middle::resolve;
2019
use middle::ty;
2120
use middle::typeck;
2221
use middle::subst::VecPerParamSpace;
@@ -122,33 +121,30 @@ pub fn get_enum_variants(tcx: &ty::ctxt, def: ast::DefId)
122121
}
123122

124123
/// Returns information about the given implementation.
125-
pub fn get_impl_items(cstore: &cstore::CStore, impl_def_id: ast::DefId)
126-
-> Vec<ty::ImplOrTraitItemId> {
124+
pub fn get_impl_methods(cstore: &cstore::CStore, impl_def_id: ast::DefId)
125+
-> Vec<ast::DefId> {
127126
let cdata = cstore.get_crate_data(impl_def_id.krate);
128-
decoder::get_impl_items(&*cdata, impl_def_id.node)
127+
decoder::get_impl_methods(&*cdata, impl_def_id.node)
129128
}
130129

131-
pub fn get_impl_or_trait_item(tcx: &ty::ctxt, def: ast::DefId)
132-
-> ty::ImplOrTraitItem {
130+
pub fn get_method(tcx: &ty::ctxt, def: ast::DefId) -> ty::Method {
133131
let cdata = tcx.sess.cstore.get_crate_data(def.krate);
134-
decoder::get_impl_or_trait_item(tcx.sess.cstore.intr.clone(),
135-
&*cdata,
136-
def.node,
137-
tcx)
132+
decoder::get_method(tcx.sess.cstore.intr.clone(), &*cdata, def.node, tcx)
138133
}
139134

140-
pub fn get_trait_item_name_and_kind(cstore: &cstore::CStore, def: ast::DefId)
141-
-> (ast::Ident, resolve::TraitItemKind) {
135+
pub fn get_method_name_and_explicit_self(cstore: &cstore::CStore,
136+
def: ast::DefId)
137+
-> (ast::Ident,
138+
ty::ExplicitSelfCategory)
139+
{
142140
let cdata = cstore.get_crate_data(def.krate);
143-
decoder::get_trait_item_name_and_kind(cstore.intr.clone(),
144-
&*cdata,
145-
def.node)
141+
decoder::get_method_name_and_explicit_self(cstore.intr.clone(), &*cdata, def.node)
146142
}
147143

148-
pub fn get_trait_item_def_ids(cstore: &cstore::CStore, def: ast::DefId)
149-
-> Vec<ty::ImplOrTraitItemId> {
144+
pub fn get_trait_method_def_ids(cstore: &cstore::CStore,
145+
def: ast::DefId) -> Vec<ast::DefId> {
150146
let cdata = cstore.get_crate_data(def.krate);
151-
decoder::get_trait_item_def_ids(&*cdata, def.node)
147+
decoder::get_trait_method_def_ids(&*cdata, def.node)
152148
}
153149

154150
pub fn get_item_variances(cstore: &cstore::CStore,
@@ -290,15 +286,15 @@ pub fn each_implementation_for_trait(cstore: &cstore::CStore,
290286
decoder::each_implementation_for_trait(&*cdata, def_id.node, callback)
291287
}
292288

293-
/// If the given def ID describes an item belonging to a trait (either a
289+
/// If the given def ID describes a method belonging to a trait (either a
294290
/// default method or an implementation of a trait method), returns the ID of
295291
/// the trait that the method belongs to. Otherwise, returns `None`.
296-
pub fn get_trait_of_item(cstore: &cstore::CStore,
297-
def_id: ast::DefId,
298-
tcx: &ty::ctxt)
299-
-> Option<ast::DefId> {
292+
pub fn get_trait_of_method(cstore: &cstore::CStore,
293+
def_id: ast::DefId,
294+
tcx: &ty::ctxt)
295+
-> Option<ast::DefId> {
300296
let cdata = cstore.get_crate_data(def_id.krate);
301-
decoder::get_trait_of_item(&*cdata, def_id.node, tcx)
297+
decoder::get_trait_of_method(&*cdata, def_id.node, tcx)
302298
}
303299

304300
pub fn get_tuple_struct_definition_if_ctor(cstore: &cstore::CStore,

0 commit comments

Comments
 (0)