rust/tests/ui/impl-trait/precise-capturing/bad-params.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
520 B
Rust
Raw Normal View History

2024-06-05 20:18:52 +00:00
fn missing() -> impl Sized + use<T> {}
//~^ ERROR cannot find type `T` in this scope
2024-04-04 16:54:56 +00:00
2024-06-05 20:18:52 +00:00
fn missing_self() -> impl Sized + use<Self> {}
//~^ ERROR cannot find type `Self` in this scope
2024-04-04 16:54:56 +00:00
struct MyType;
impl MyType {
2024-06-05 20:18:52 +00:00
fn self_is_not_param() -> impl Sized + use<Self> {}
//~^ ERROR `Self` can't be captured in `use<...>` precise captures list, since it is an alias
2024-04-04 16:54:56 +00:00
}
2024-06-05 20:18:52 +00:00
fn hello() -> impl Sized + use<hello> {}
2024-04-05 00:36:18 +00:00
//~^ ERROR expected type or const parameter in `use<...>` precise captures list, found function
2024-04-04 16:54:56 +00:00
fn main() {}