Skip to content

Commit 726d472

Browse files
committed
---
yaml --- r: 217588 b: refs/heads/tmp c: bf3c979 h: refs/heads/master v: v3
1 parent b88f705 commit 726d472

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
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: 2ad26e850ed5dfedda8c96d7315aee50145ceedd
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 08f9b98e57f2332da522ebf98c74a315211b98ac
28+
refs/heads/tmp: bf3c979ec31300e38c1607d605cf47f231bf6480
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: a5286998df566e736b32f6795bfc3803bdaf453d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/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/tmp/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)