Skip to content

Commit e33a65a

Browse files
committed
---
yaml --- r: 227970 b: refs/heads/try c: bf3c979 h: refs/heads/master v: v3
1 parent 06fdbd3 commit e33a65a

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 08f9b98e57f2332da522ebf98c74a315211b98ac
4+
refs/heads/try: bf3c979ec31300e38c1607d605cf47f231bf6480
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,10 @@ fn encode_info_for_item(ecx: &EncodeContext,
14511451
encode_item_sort(rbml_w, 't');
14521452
encode_family(rbml_w, 'y');
14531453

1454+
if let Some(ty) = associated_type.ty {
1455+
encode_type(ecx, rbml_w, ty);
1456+
}
1457+
14541458
is_nonstatic_method = false;
14551459
}
14561460
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,9 @@ fn confirm_impl_candidate<'cx,'tcx>(
904904
// ought to be reported by the type checker method
905905
// `check_impl_items_against_trait`, so here we
906906
// just return TyError.
907+
debug!("confirm_impl_candidate: no associated type {:?} for {:?}",
908+
assoc_ty.name,
909+
trait_ref);
907910
return (selcx.tcx().types.err, vec!());
908911
}
909912
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
type Input = usize;
13+
fn bar(&self, _: Self::Input) {}
14+
}
15+
16+
impl Foo for () {}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
// aux-build:xcrate_associated_type_defaults.rs
12+
13+
extern crate xcrate_associated_type_defaults;
14+
use xcrate_associated_type_defaults::Foo;
15+
16+
fn main() {
17+
().bar(5);
18+
}

0 commit comments

Comments
 (0)