Skip to content

Commit 2eccebb

Browse files
Rollup merge of #118290 - compiler-errors:placeholder-implied, r=aliemjay
Don't ICE when encountering placeholders in implied bounds computation I *could* fix this the right way, though I don't really want to think about the implications of the change. This should have minimal side-effects. r? `@aliemjay` Fixes #118286
2 parents 58ab518 + 1279f70 commit 2eccebb

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,10 @@ fn implied_bounds_from_components<'tcx>(
207207
Component::Region(r) => Some(OutlivesBound::RegionSubRegion(sub_region, r)),
208208
Component::Param(p) => Some(OutlivesBound::RegionSubParam(sub_region, p)),
209209
Component::Alias(p) => Some(OutlivesBound::RegionSubAlias(sub_region, p)),
210-
Component::Placeholder(_) => {
211-
unimplemented!("Shouldn't expect a placeholder type in implied bounds (yet)")
210+
Component::Placeholder(_p) => {
211+
// FIXME(non_lifetime_binders): Placeholders don't currently
212+
// imply anything for outlives, though they could easily.
213+
None
212214
}
213215
Component::EscapingAlias(_) =>
214216
// If the projection has escaping regions, don't
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// check-pass
2+
3+
pub fn main() {}
4+
5+
pub trait Iced {
6+
fn get(&self) -> &impl Sized;
7+
}
8+
9+
/// Impl causes ICE
10+
impl Iced for () {
11+
fn get(&self) -> &impl Sized {
12+
&()
13+
}
14+
}

0 commit comments

Comments
 (0)