Skip to content

Commit 7b42e35

Browse files
committed
---
yaml --- r: 235603 b: refs/heads/stable c: 28ce509 h: refs/heads/master i: 235601: c536195 235599: 98cba9e v: v3
1 parent a6da0e9 commit 7b42e35

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
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 8edcff59d9131dfd78cf1897e861f0ee4140db10
32+
refs/heads/stable: 28ce509d3c0b3302e514d5835c43befaed6f449c
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

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