mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 10:47:16 +00:00

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.
20 lines
500 B
Rust
20 lines
500 B
Rust
//! Regression test for <https://github.com/rust-lang/rust/issues/137308>.
|
|
//!
|
|
//! This used to ICE in layout computation, because `<u8 as A>::B` fails to normalize
|
|
//! due to the unconstrained param on the impl.
|
|
|
|
#![feature(rustc_attrs)]
|
|
#![crate_type = "lib"]
|
|
|
|
trait A {
|
|
const B: usize;
|
|
}
|
|
|
|
impl<C: ?Sized> A for u8 { //~ ERROR: the type parameter `C` is not constrained
|
|
const B: usize = 42;
|
|
}
|
|
|
|
#[rustc_layout(debug)]
|
|
struct S([u8; <u8 as A>::B]);
|
|
//~^ ERROR: the type has an unknown layout
|