Skip to content

Commit 743d6a4

Browse files
committed
Review changes
1 parent 6561664 commit 743d6a4

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ pub trait AstConv<'tcx> {
7373
fn tcx<'a>(&'a self) -> &'a ty::ctxt<'tcx>;
7474
fn get_item_ty(&self, id: ast::DefId) -> ty::Polytype<'tcx>;
7575
fn get_trait_def(&self, id: ast::DefId) -> Rc<ty::TraitDef<'tcx>>;
76+
77+
/// Return an (optional) substitution to convert bound type parameters that
78+
/// are in scope into free ones. This function should only return Some
79+
/// within a fn body.
80+
/// See ParameterEnvironment::free_substs for more information.
7681
fn get_free_substs(&self) -> Option<&Substs<'tcx>> {
7782
None
7883
}
@@ -1029,21 +1034,15 @@ pub fn ast_ty_to_ty<'tcx, AC: AstConv<'tcx>, RS: RegionScope>(
10291034
// FIXME(#19541): in both branches we should consider
10301035
// associated types in super-traits.
10311036
let (assoc_tys, tp_name): (Vec<_>, _) = match typ {
1032-
def::TyParamProvenance::FromParam(did) => {
1037+
def::TyParamProvenance::FromParam(did) |
1038+
def::TyParamProvenance::FromSelf(did) => {
10331039
let ty_param_defs = tcx.ty_param_defs.borrow();
10341040
let tp_def = &(*ty_param_defs)[did.node];
10351041
let assoc_tys = tp_def.bounds.trait_bounds.iter()
10361042
.filter_map(|b| find_assoc_ty(this, &**b, assoc_ident))
10371043
.collect();
10381044
(assoc_tys, token::get_name(tp_def.name).to_string())
10391045
}
1040-
def::TyParamProvenance::FromSelf(did) => {
1041-
let assoc_tys = find_assoc_ty(this,
1042-
&*this.get_trait_def(did).trait_ref,
1043-
assoc_ident)
1044-
.into_iter().collect();
1045-
(assoc_tys, "Self".to_string())
1046-
}
10471046
};
10481047

10491048
if assoc_tys.len() == 0 {

0 commit comments

Comments
 (0)