summary refs log tree commit diff
path: root/tests/ui/sized-hierarchy/pointee-validation.rs
blob: dfc28829e08c460824df0fde46bb753e4b2327dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Test that despite us dropping `PointeeSized` bounds during HIR ty lowering
// we still validate it first.
// issue: <https://github.com/rust-lang/rust/issues/142718>
#![feature(sized_hierarchy)]

use std::marker::PointeeSized;

struct T where (): PointeeSized<(), Undefined = ()>;
//~^ ERROR trait takes 0 generic arguments but 1 generic argument was supplied
//~| ERROR associated type `Undefined` not found for `PointeeSized`

const fn test<T, U>() where T: const PointeeSized, U: [const] PointeeSized {}
//~^ ERROR `const` can only be applied to `const` traits
//~| ERROR `const` can only be applied to `const` traits
//~| ERROR const trait impls are experimental
//~| ERROR `[const]` can only be applied to `const` traits
//~| ERROR `[const]` can only be applied to `const` traits
//~| ERROR const trait impls are experimental

fn main() {}