File tree 3 files changed +13
-1
lines changed
tests/ui/impl-trait/in-trait
3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -404,8 +404,12 @@ impl DefPathData {
404
404
match * self {
405
405
TypeNs ( name) | ValueNs ( name) | MacroNs ( name) | LifetimeNs ( name) => Some ( name) ,
406
406
407
+ // We use this name when collecting `ModChild`s.
408
+ // FIXME this could probably be removed with some refactoring to the name resolver.
409
+ ImplTraitAssocTy => Some ( kw:: Empty ) ,
410
+
407
411
Impl | ForeignMod | CrateRoot | Use | GlobalAsm | ClosureExpr | Ctor | AnonConst
408
- | ImplTrait | ImplTraitAssocTy => None ,
412
+ | ImplTrait => None ,
409
413
}
410
414
}
411
415
Original file line number Diff line number Diff line change @@ -328,6 +328,9 @@ fn impl_associated_item_for_impl_trait_in_trait(
328
328
// `opt_local_def_id_to_hir_id` with `None`.
329
329
impl_assoc_ty. opt_local_def_id_to_hir_id ( None ) ;
330
330
331
+ // Copy span of the opaque.
332
+ impl_assoc_ty. def_ident_span ( Some ( span) ) ;
333
+
331
334
impl_assoc_ty. associated_item ( ty:: AssocItem {
332
335
name : kw:: Empty ,
333
336
kind : ty:: AssocKind :: Type ,
@@ -342,6 +345,9 @@ fn impl_associated_item_for_impl_trait_in_trait(
342
345
// extra predicates to assume.
343
346
impl_assoc_ty. param_env ( tcx. param_env ( impl_fn_def_id) ) ;
344
347
348
+ // Copy visility of the containing function.
349
+ impl_assoc_ty. visibility ( tcx. visibility ( impl_fn_def_id) ) ;
350
+
345
351
// Copy impl_defaultness of the containing function.
346
352
impl_assoc_ty. impl_defaultness ( tcx. impl_defaultness ( impl_fn_def_id) ) ;
347
353
Original file line number Diff line number Diff line change 1
1
// check-pass
2
2
// aux-build: rpitit.rs
3
+ // [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
4
+ // revisions: current next
3
5
4
6
extern crate rpitit;
5
7
You can’t perform that action at this time.
0 commit comments