Make fns from other crates with RPITIT work
This commit is contained in:
parent
b535da6841
commit
a4e40370d0
3 changed files with 13 additions and 1 deletions
|
@ -404,8 +404,12 @@ impl DefPathData {
|
||||||
match *self {
|
match *self {
|
||||||
TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) => Some(name),
|
TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) => Some(name),
|
||||||
|
|
||||||
|
// We use this name when collecting `ModChild`s.
|
||||||
|
// FIXME this could probably be removed with some refactoring to the name resolver.
|
||||||
|
ImplTraitAssocTy => Some(kw::Empty),
|
||||||
|
|
||||||
Impl | ForeignMod | CrateRoot | Use | GlobalAsm | ClosureExpr | Ctor | AnonConst
|
Impl | ForeignMod | CrateRoot | Use | GlobalAsm | ClosureExpr | Ctor | AnonConst
|
||||||
| ImplTrait | ImplTraitAssocTy => None,
|
| ImplTrait => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -328,6 +328,9 @@ fn impl_associated_item_for_impl_trait_in_trait(
|
||||||
// `opt_local_def_id_to_hir_id` with `None`.
|
// `opt_local_def_id_to_hir_id` with `None`.
|
||||||
impl_assoc_ty.opt_local_def_id_to_hir_id(None);
|
impl_assoc_ty.opt_local_def_id_to_hir_id(None);
|
||||||
|
|
||||||
|
// Copy span of the opaque.
|
||||||
|
impl_assoc_ty.def_ident_span(Some(span));
|
||||||
|
|
||||||
impl_assoc_ty.associated_item(ty::AssocItem {
|
impl_assoc_ty.associated_item(ty::AssocItem {
|
||||||
name: kw::Empty,
|
name: kw::Empty,
|
||||||
kind: ty::AssocKind::Type,
|
kind: ty::AssocKind::Type,
|
||||||
|
@ -342,6 +345,9 @@ fn impl_associated_item_for_impl_trait_in_trait(
|
||||||
// extra predicates to assume.
|
// extra predicates to assume.
|
||||||
impl_assoc_ty.param_env(tcx.param_env(impl_fn_def_id));
|
impl_assoc_ty.param_env(tcx.param_env(impl_fn_def_id));
|
||||||
|
|
||||||
|
// Copy visility of the containing function.
|
||||||
|
impl_assoc_ty.visibility(tcx.visibility(impl_fn_def_id));
|
||||||
|
|
||||||
// Copy impl_defaultness of the containing function.
|
// Copy impl_defaultness of the containing function.
|
||||||
impl_assoc_ty.impl_defaultness(tcx.impl_defaultness(impl_fn_def_id));
|
impl_assoc_ty.impl_defaultness(tcx.impl_defaultness(impl_fn_def_id));
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// check-pass
|
// check-pass
|
||||||
// aux-build: rpitit.rs
|
// aux-build: rpitit.rs
|
||||||
|
// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
|
||||||
|
// revisions: current next
|
||||||
|
|
||||||
extern crate rpitit;
|
extern crate rpitit;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue