summary refs log tree commit diff
path: root/tests/ui/impl-trait/precise-capturing/illegal-positions.rs
blob: 681458e25f801906d9be073cd6eb4046e3fc4af1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//@ revisions: real pre_expansion
//@[pre_expansion] check-pass
//@ edition: 2021

#![feature(precise_capturing)]

#[cfg(real)]
trait Foo: use<> {
    //[real]~^ ERROR `use<...>` precise capturing syntax not allowed
    type Assoc: use<> where (): use<>;
    //[real]~^ ERROR `use<...>` precise capturing syntax not allowed
    //[real]~| ERROR `use<...>` precise capturing syntax not allowed
}

#[cfg(real)]
fn fun<T: use<>>(_: impl use<>) where (): use<> {}
//[real]~^ ERROR `use<...>` precise capturing syntax not allowed
//[real]~| ERROR `use<...>` precise capturing syntax not allowed
//[real]~| ERROR `use<...>` precise capturing syntax not allowed
//[real]~| ERROR at least one trait must be specified

#[cfg(real)]
fn dynamic() -> Box<dyn use<>> {}
//[real]~^ ERROR `use<...>` precise capturing syntax not allowed in `dyn` trait object bounds
//[real]~| ERROR at least one trait is required for an object type [E0224]

fn main() {}