Skip to content

Commit cfcb564

Browse files
author
Ariel Ben-Yehuda
committed
---
yaml --- r: 207547 b: refs/heads/auto c: 7b1e844 h: refs/heads/master i: 207545: 0347fea 207543: b40f7a0 v: v3
1 parent 2d45431 commit cfcb564

File tree

6 files changed

+65
-14
lines changed

6 files changed

+65
-14
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: d7185dcff12a6963535e73ed4b0f392da236068c
13+
refs/heads/auto: 7b1e8446d1a7b8cccc05441e2a1f52f7c2d2871b
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc_lint/builtin.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,11 +2203,7 @@ impl LintPass for UnstableFeatures {
22032203
}
22042204
fn check_attribute(&mut self, ctx: &Context, attr: &ast::Attribute) {
22052205
if attr::contains_name(&[attr.node.value.clone()], "feature") {
2206-
if let Some(items) = attr.node.value.meta_item_list() {
2207-
for item in items {
2208-
ctx.span_lint(UNSTABLE_FEATURES, item.span, "unstable feature");
2209-
}
2210-
}
2206+
ctx.span_lint(UNSTABLE_FEATURES, attr.span, "unstable feature");
22112207
}
22122208
}
22132209
}

branches/auto/src/librustc_typeck/astconv.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,11 @@ fn base_def_to_ty<'tcx>(this: &AstConv<'tcx>,
13951395
// Self in impl (we know the concrete type).
13961396
check_path_args(tcx, base_segments, NO_TPS | NO_REGIONS);
13971397
if let Some(&ty) = tcx.ast_ty_to_ty_cache.borrow().get(&self_ty_id) {
1398-
ty
1398+
if let Some(free_substs) = this.get_free_substs() {
1399+
ty.subst(tcx, free_substs)
1400+
} else {
1401+
ty
1402+
}
13991403
} else {
14001404
tcx.sess.span_bug(span, "self type has not been fully resolved")
14011405
}

branches/auto/src/librustc_typeck/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ use std::cell::RefCell;
117117
// registered before they are used.
118118
pub mod diagnostics;
119119

120-
pub mod check;
120+
mod check;
121121
mod rscope;
122122
mod astconv;
123-
pub mod collect;
123+
mod collect;
124124
mod constrained_type_params;
125-
pub mod coherence;
126-
pub mod variance;
125+
mod coherence;
126+
mod variance;
127127

128128
pub struct TypeAndSubsts<'tcx> {
129129
pub substs: subst::Substs<'tcx>,
@@ -132,13 +132,13 @@ pub struct TypeAndSubsts<'tcx> {
132132

133133
pub struct CrateCtxt<'a, 'tcx: 'a> {
134134
// A mapping from method call sites to traits that have that method.
135-
pub trait_map: ty::TraitMap,
135+
trait_map: ty::TraitMap,
136136
/// A vector of every trait accessible in the whole crate
137137
/// (i.e. including those from subcrates). This is used only for
138138
/// error reporting, and so is lazily initialised and generally
139139
/// shouldn't taint the common path (hence the RefCell).
140-
pub all_traits: RefCell<Option<check::method::AllTraitsVec>>,
141-
pub tcx: &'a ty::ctxt<'tcx>,
140+
all_traits: RefCell<Option<check::method::AllTraitsVec>>,
141+
tcx: &'a ty::ctxt<'tcx>,
142142
}
143143

144144
// Functions that write types into the node type table
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub trait Foo {
12+
fn method1() {}
13+
fn method2();
14+
}
15+
16+
struct Slice<'a, T: 'a>(&'a [T]);
17+
18+
impl<'a, T: 'a> Foo for Slice<'a, T> {
19+
fn method2() {
20+
<Self as Foo>::method1();
21+
}
22+
}
23+
24+
fn main() {
25+
<Slice<()> as Foo>::method2();
26+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
struct S<'a>(&'a ());
12+
13+
impl<'a> S<'a> {
14+
fn foo(self) -> &'a () {
15+
<Self>::bar(self)
16+
}
17+
18+
fn bar(self) -> &'a () {
19+
self.0
20+
}
21+
}
22+
23+
fn main() {
24+
S(&()).foo();
25+
}

0 commit comments

Comments
 (0)