Skip to content

Commit 0506250

Browse files
Encode item bounds for DefKind::ImplTraitPlaceholder
1 parent e69c730 commit 0506250

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Diff for: compiler/rustc_metadata/src/rmeta/encoder.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,9 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
14471447
.is_type_alias_impl_trait
14481448
.set(def_id.index, self.tcx.is_type_alias_impl_trait(def_id));
14491449
}
1450+
if let DefKind::ImplTraitPlaceholder = def_kind {
1451+
self.encode_explicit_item_bounds(def_id);
1452+
}
14501453
if tcx.impl_method_has_trait_impl_trait_tys(def_id)
14511454
&& let Ok(table) = self.tcx.collect_return_position_impl_trait_in_trait_tys(def_id)
14521455
{

Diff for: tests/ui/impl-trait/in-trait/foreign.rs

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ impl Foo for Local {
1414
fn bar(self) -> Arc<String> { Arc::new(String::new()) }
1515
}
1616

17+
fn generic(f: impl Foo) {
18+
let x = &*f.bar();
19+
}
20+
1721
fn main() {
1822
// Witness an RPITIT from another crate.
1923
let &() = Foreign.bar();

0 commit comments

Comments
 (0)