mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-24 22:37:08 +00:00
As a performance optimization, skip elaborating the supertraits of `Sized`, and if a `MetaSized` obligation is being checked, then look for a `Sized` predicate in the parameter environment. This makes the `ParamEnv` smaller which should improve compiler performance as it avoids all the iteration over the larger `ParamEnv`.
19 lines
408 B
Rust
19 lines
408 B
Rust
//@ check-pass
|
|
//@ compile-flags: --crate-type=lib
|
|
//@ revisions: old next
|
|
//@[next] compile-flags: -Znext-solver
|
|
#![feature(sized_hierarchy)]
|
|
|
|
use std::marker::{PhantomData, MetaSized, PointeeSized};
|
|
|
|
struct Foo<'a, T: PointeeSized>(PhantomData<&'a T>, T);
|
|
|
|
fn requires_metasized<T: MetaSized>() {}
|
|
|
|
fn foo<'a, T: 'a + PointeeSized>()
|
|
where
|
|
Foo<'a, T>: Sized
|
|
{
|
|
requires_metasized::<Foo<'_, T>>();
|
|
}
|