about summary refs log tree commit diff
path: root/tests/ui/type-alias-impl-trait/issue-77179.rs
blob: 9e0c8fbbd269ad0c609f39115833e1c72fa8799a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Regression test for the ICE in #77179.

#![feature(type_alias_impl_trait)]

type Pointer<T> = impl std::ops::Deref<Target = T>;

#[define_opaque(Pointer)]
fn test() -> Pointer<_> {
    //~^ ERROR the placeholder `_` is not allowed within types
    //~| ERROR expected generic type parameter, found `i32`
    Box::new(1)
}

fn main() {
    test();
}

extern "Rust" {
    fn bar() -> Pointer<_>;
    //~^ ERROR the placeholder `_` is not allowed within types
}