rust/tests/ui/traits/resolve-impl-before-constrain-check.rs
David Wood 8d64937dc2
trait_sel: MetaSized always holds temporarily
As a temporary measure while a proper fix for
`tests/ui/sized-hierarchy/incomplete-inference-issue-143992.rs`
is implemented, make `MetaSized` obligations always hold. In effect,
temporarily reverting the `sized_hierarchy` feature. This is a small
change that can be backported.
2025-07-16 12:35:44 +00:00

21 lines
410 B
Rust

// Need a different module so we try to build the mir for `test`
// before analyzing `mod foo`.
mod foo {
pub trait Callable {
fn call();
}
impl<V: ?Sized> Callable for () {
//~^ ERROR the type parameter `V` is not constrained by the impl trait, self type, or predicates
fn call() {}
}
}
use foo::*;
fn test() -> impl Sized {
<() as Callable>::call()
}
fn main() {}