Skip to content

Commit 969e8fe

Browse files
pnkfelixManishearth
authored andcommitted
---
yaml --- r: 187880 b: refs/heads/tmp c: 9549350 h: refs/heads/master v: v3
1 parent 304021f commit 969e8fe

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 08360892a0f842ef60ea795469fb7330b5874849
37+
refs/heads/tmp: 9549350b874be76636388ef718a93caea96ada9f
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/tmp/src/libcore/iter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ pub trait IteratorExt: Iterator + Sized {
171171
self.fold(0, |cnt, _x| cnt + 1)
172172
}
173173

174-
/// Loops through the entire iterator, returning the last element.
174+
/// Loops through the entire iterator, returning the last element of the
175+
/// iterator.
175176
///
176177
/// # Examples
177178
///

branches/tmp/src/librustc_typeck/astconv.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,17 @@ fn trait_ref_to_object_type<'tcx>(this: &AstConv<'tcx>,
991991
result
992992
}
993993

994+
fn report_ambiguous_associated_type(tcx: &ty::ctxt,
995+
span: Span,
996+
type_str: &str,
997+
trait_str: &str,
998+
name: &str) {
999+
span_err!(tcx.sess, span, E0223,
1000+
"ambiguous associated type; specify the type using the syntax \
1001+
`<{} as {}>::{}`",
1002+
type_str, trait_str, name);
1003+
}
1004+
9941005
fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
9951006
span: Span,
9961007
ty: Ty<'tcx>,
@@ -1011,10 +1022,8 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
10111022
let ty_param_node_id = if is_param {
10121023
ty_path_def.local_node_id()
10131024
} else {
1014-
span_err!(tcx.sess, span, E0223,
1015-
"ambiguous associated type; specify the type using the syntax \
1016-
`<{} as Trait>::{}`",
1017-
ty.user_string(tcx), token::get_name(assoc_name));
1025+
report_ambiguous_associated_type(
1026+
tcx, span, &ty.user_string(tcx), "Trait", &token::get_name(assoc_name));
10181027
return (tcx.types.err, ty_path_def);
10191028
};
10201029

@@ -1109,10 +1118,8 @@ fn qpath_to_ty<'tcx>(this: &AstConv<'tcx>,
11091118
ty
11101119
} else {
11111120
let path_str = ty::item_path_str(tcx, trait_def_id);
1112-
span_err!(tcx.sess, span, E0223,
1113-
"ambiguous associated type; specify the type using the syntax \
1114-
`<Type as {}>::{}`",
1115-
path_str, &token::get_ident(item_segment.identifier));
1121+
report_ambiguous_associated_type(
1122+
tcx, span, "Type", &path_str, &token::get_ident(item_segment.identifier));
11161123
return tcx.types.err;
11171124
};
11181125

0 commit comments

Comments
 (0)