mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Don't ICE when encountering placeholders in implied bounds computation
This commit is contained in:
parent
fe3038f263
commit
1279f70bf4
@ -207,8 +207,10 @@ fn implied_bounds_from_components<'tcx>(
|
||||
Component::Region(r) => Some(OutlivesBound::RegionSubRegion(sub_region, r)),
|
||||
Component::Param(p) => Some(OutlivesBound::RegionSubParam(sub_region, p)),
|
||||
Component::Alias(p) => Some(OutlivesBound::RegionSubAlias(sub_region, p)),
|
||||
Component::Placeholder(_) => {
|
||||
unimplemented!("Shouldn't expect a placeholder type in implied bounds (yet)")
|
||||
Component::Placeholder(_p) => {
|
||||
// FIXME(non_lifetime_binders): Placeholders don't currently
|
||||
// imply anything for outlives, though they could easily.
|
||||
None
|
||||
}
|
||||
Component::EscapingAlias(_) =>
|
||||
// If the projection has escaping regions, don't
|
||||
|
14
tests/ui/impl-trait/in-trait/placeholder-implied-bounds.rs
Normal file
14
tests/ui/impl-trait/in-trait/placeholder-implied-bounds.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// check-pass
|
||||
|
||||
pub fn main() {}
|
||||
|
||||
pub trait Iced {
|
||||
fn get(&self) -> &impl Sized;
|
||||
}
|
||||
|
||||
/// Impl causes ICE
|
||||
impl Iced for () {
|
||||
fn get(&self) -> &impl Sized {
|
||||
&()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user