Skip to content

Commit f1fff92

Browse files
committed
---
yaml --- r: 220914 b: refs/heads/auto c: 28ce509 h: refs/heads/master v: v3
1 parent e73266d commit f1fff92

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 8edcff59d9131dfd78cf1897e861f0ee4140db10
11+
refs/heads/auto: 28ce509d3c0b3302e514d5835c43befaed6f449c
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc_typeck/astconv.rs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ fn report_ambiguous_associated_type(tcx: &ty::ctxt,
11121112
// any ambiguity.
11131113
fn find_bound_for_assoc_item<'tcx>(this: &AstConv<'tcx>,
11141114
ty_param_node_id: ast::NodeId,
1115-
ty_param_name: Option<ast::Name>,
1115+
ty_param_name: ast::Name,
11161116
assoc_name: ast::Name,
11171117
span: Span)
11181118
-> Result<ty::PolyTraitRef<'tcx>, ErrorReported>
@@ -1138,21 +1138,11 @@ fn find_bound_for_assoc_item<'tcx>(this: &AstConv<'tcx>,
11381138
.filter(|b| this.trait_defines_associated_type_named(b.def_id(), assoc_name))
11391139
.collect();
11401140

1141-
if let Some(s) = ty_param_name {
1142-
// borrowck doesn't like this any other way
1143-
one_bound_for_assoc_type(tcx,
1144-
suitable_bounds,
1145-
&token::get_name(s),
1146-
&token::get_name(assoc_name),
1147-
span)
1148-
} else {
1149-
one_bound_for_assoc_type(tcx,
1150-
suitable_bounds,
1151-
"Self",
1152-
&token::get_name(assoc_name),
1153-
span)
1154-
1155-
}
1141+
one_bound_for_assoc_type(tcx,
1142+
suitable_bounds,
1143+
&token::get_name(ty_param_name),
1144+
&token::get_name(assoc_name),
1145+
span)
11561146
}
11571147

11581148

@@ -1251,7 +1241,11 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
12511241
}
12521242
(&ty::TyParam(_), def::DefSelfTy(Some(trait_did), None)) => {
12531243
assert_eq!(trait_did.krate, ast::LOCAL_CRATE);
1254-
match find_bound_for_assoc_item(this, trait_did.node, None, assoc_name, span) {
1244+
match find_bound_for_assoc_item(this,
1245+
trait_did.node,
1246+
token::special_idents::type_self.name,
1247+
assoc_name,
1248+
span) {
12551249
Ok(bound) => bound,
12561250
Err(ErrorReported) => return (tcx.types.err, ty_path_def),
12571251
}
@@ -1260,7 +1254,7 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
12601254
assert_eq!(param_did.krate, ast::LOCAL_CRATE);
12611255
match find_bound_for_assoc_item(this,
12621256
param_did.node,
1263-
Some(param_name),
1257+
param_name,
12641258
assoc_name,
12651259
span) {
12661260
Ok(bound) => bound,

0 commit comments

Comments
 (0)