Skip to content

Commit 1279f70

Browse files
Don't ICE when encountering placeholders in implied bounds computation
1 parent fe3038f commit 1279f70

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)