Skip to content

Commit

Permalink
Encode item bounds for DefKind::ImplTraitPlaceholder
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Jun 29, 2023
1 parent e69c730 commit 0506250
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_metadata/src/rmeta/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,9 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
.is_type_alias_impl_trait
.set(def_id.index, self.tcx.is_type_alias_impl_trait(def_id));
}
if let DefKind::ImplTraitPlaceholder = def_kind {
self.encode_explicit_item_bounds(def_id);
}
if tcx.impl_method_has_trait_impl_trait_tys(def_id)
&& let Ok(table) = self.tcx.collect_return_position_impl_trait_in_trait_tys(def_id)
{
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/impl-trait/in-trait/foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ impl Foo for Local {
fn bar(self) -> Arc<String> { Arc::new(String::new()) }
}

fn generic(f: impl Foo) {
let x = &*f.bar();
}

fn main() {
// Witness an RPITIT from another crate.
let &() = Foreign.bar();
Expand Down

0 comments on commit 0506250

Please sign in to comment.