Skip to content

Commit bd8360c

Browse files
committed
---
yaml --- r: 173918 b: refs/heads/auto c: ee2bfae h: refs/heads/master v: v3
1 parent a856e80 commit bd8360c

File tree

5 files changed

+41
-24
lines changed

5 files changed

+41
-24
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: cb852239033baf4f44ab448f27127d6ab906c7c0
13+
refs/heads/auto: ee2bfae011e368e224d6d4f4c9fad13606ee99da
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/trpl/ownership.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ valid for. For example:
326326

327327
```rust
328328
fn main() {
329-
let y = &5; // -+ y goes into scope
329+
let y = &5; // -+ y goes into scope
330330
// |
331331
// stuff // |
332332
// |
@@ -341,7 +341,7 @@ struct Foo<'a> {
341341
}
342342

343343
fn main() {
344-
let y = &5; // -+ y goes into scope
344+
let y = &5; // -+ y goes into scope
345345
let f = Foo { x: y }; // -+ f goes into scope
346346
// stuff // |
347347
// |
@@ -360,7 +360,7 @@ fn main() {
360360
let x; // -+ x goes into scope
361361
// |
362362
{ // |
363-
let y = &5; // ---+ y goes into scope
363+
let y = &5; // ---+ y goes into scope
364364
let f = Foo { x: y }; // ---+ f goes into scope
365365
x = &f.x; // | | error here
366366
} // ---+ f and y go out of scope

branches/auto/src/librustc_trans/save/mod.rs

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
278278
// The qualname for a method is the trait name or name of the struct in an impl in
279279
// which the method is declared in followed by the method's name.
280280
let mut qualname = match ty::impl_of_method(&self.analysis.ty_cx,
281-
ast_util::local_def(method.id)) {
281+
ast_util::local_def(method.id)) {
282282
Some(impl_id) => match self.analysis.ty_cx.map.get(impl_id.node) {
283283
NodeItem(item) => {
284284
scope_id = item.id;
@@ -349,7 +349,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
349349
.and_then(|def_id| {
350350
if match def_id {
351351
ty::MethodTraitItemId(def_id) => {
352-
method.id != 0 && def_id.node == 0
352+
def_id.node != 0 && def_id != ast_util::local_def(method.id)
353353
}
354354
ty::TypeTraitItemId(_) => false,
355355
} {
@@ -392,8 +392,7 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
392392
}
393393

394394
fn process_trait_ref(&mut self,
395-
trait_ref: &ast::TraitRef,
396-
impl_id: Option<NodeId>) {
395+
trait_ref: &ast::TraitRef) {
397396
match self.lookup_type_ref(trait_ref.ref_id) {
398397
Some(id) => {
399398
let sub_span = self.span.sub_span_for_type_name(trait_ref.path.span);
@@ -402,14 +401,6 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
402401
sub_span,
403402
id,
404403
self.cur_scope);
405-
match impl_id {
406-
Some(impl_id) => self.fmt.impl_str(trait_ref.path.span,
407-
sub_span,
408-
impl_id,
409-
id,
410-
self.cur_scope),
411-
None => (),
412-
}
413404
visit::walk_path(self, &trait_ref.path);
414405
},
415406
None => ()
@@ -652,7 +643,9 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
652643
trait_ref: &Option<ast::TraitRef>,
653644
typ: &ast::Ty,
654645
impl_items: &Vec<ast::ImplItem>) {
646+
let trait_id = trait_ref.as_ref().and_then(|tr| self.lookup_type_ref(tr.ref_id));
655647
match typ.node {
648+
// Common case impl for a struct or something basic.
656649
ast::TyPath(ref path, id) => {
657650
match self.lookup_type_ref(id) {
658651
Some(id) => {
@@ -665,17 +658,29 @@ impl <'l, 'tcx> DxrVisitor<'l, 'tcx> {
665658
self.fmt.impl_str(path.span,
666659
sub_span,
667660
item.id,
668-
id,
661+
Some(id),
662+
trait_id,
669663
self.cur_scope);
670664
},
671665
None => ()
672666
}
673667
},
674-
_ => self.visit_ty(&*typ),
668+
_ => {
669+
// Less useful case, impl for a compound type.
670+
self.visit_ty(&*typ);
671+
672+
let sub_span = self.span.sub_span_for_type_name(typ.span);
673+
self.fmt.impl_str(typ.span,
674+
sub_span,
675+
item.id,
676+
None,
677+
trait_id,
678+
self.cur_scope);
679+
}
675680
}
676681

677682
match *trait_ref {
678-
Some(ref trait_ref) => self.process_trait_ref(trait_ref, Some(item.id)),
683+
Some(ref trait_ref) => self.process_trait_ref(trait_ref),
679684
None => (),
680685
}
681686

@@ -1076,7 +1081,7 @@ impl<'l, 'tcx, 'v> Visitor<'v> for DxrVisitor<'l, 'tcx> {
10761081
for param in generics.ty_params.iter() {
10771082
for bound in param.bounds.iter() {
10781083
if let ast::TraitTyParamBound(ref trait_ref, _) = *bound {
1079-
self.process_trait_ref(&trait_ref.trait_ref, None);
1084+
self.process_trait_ref(&trait_ref.trait_ref);
10801085
}
10811086
}
10821087
if let Some(ref ty) = param.default {

branches/auto/src/librustc_trans/save/recorder.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ use syntax::ast;
1919
use syntax::ast::{NodeId,DefId};
2020
use syntax::codemap::*;
2121

22+
const ZERO_DEF_ID: DefId = DefId { node: 0, krate: 0 };
23+
2224
pub struct Recorder {
2325
// output file
2426
pub out: Box<Writer+'static>,
@@ -121,7 +123,9 @@ impl<'a> FmtStrs<'a> {
121123
MethodDecl => ("method_decl", vec!("id","qualname","scopeid"), true, true),
122124
Struct => ("struct", vec!("id","ctor_id","qualname","scopeid","value"), true, true),
123125
Trait => ("trait", vec!("id","qualname","scopeid","value"), true, true),
124-
Impl => ("impl", vec!("id","refid","refidcrate","scopeid"), true, true),
126+
Impl => ("impl",
127+
vec!("id","refid","refidcrate","traitid","traitidcrate","scopeid"),
128+
true, true),
125129
Module => ("module", vec!("id","qualname","scopeid","def_file"), true, false),
126130
UseAlias => ("use_alias",
127131
vec!("id","refid","refidcrate","name","scopeid"),
@@ -444,12 +448,20 @@ impl<'a> FmtStrs<'a> {
444448
span: Span,
445449
sub_span: Option<Span>,
446450
id: NodeId,
447-
ref_id: DefId,
451+
ref_id: Option<DefId>,
452+
trait_id: Option<DefId>,
448453
scope_id: NodeId) {
454+
let ref_id = ref_id.unwrap_or(ZERO_DEF_ID);
455+
let trait_id = trait_id.unwrap_or(ZERO_DEF_ID);
449456
self.check_and_record(Impl,
450457
span,
451458
sub_span,
452-
svec!(id, ref_id.node, ref_id.krate, scope_id));
459+
svec!(id,
460+
ref_id.node,
461+
ref_id.krate,
462+
trait_id.node,
463+
trait_id.krate,
464+
scope_id));
453465
}
454466

455467
pub fn mod_str(&mut self,

branches/auto/src/libstd/sync/condvar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl Condvar {
173173
/// be woken up from its call to `wait` or `wait_timeout`. Calls to
174174
/// `notify_one` are not buffered in any way.
175175
///
176-
/// To wake up all threads, see `notify_one()`.
176+
/// To wake up all threads, see `notify_all()`.
177177
#[stable]
178178
pub fn notify_one(&self) { unsafe { self.inner.inner.notify_one() } }
179179

0 commit comments

Comments
 (0)