summary refs log tree commit diff
path: root/src/test/ui/synthetic-param.rs
blob: e53e3ba06e0d10e0c3f1525f47707fa131363593 (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
28
#![feature(rustc_attrs)]

fn func<#[rustc_synthetic] T>(_: T) {}

struct Foo;

impl Foo {
    pub fn func<#[rustc_synthetic] T>(_: T) {}
}

struct Bar<S> {
    t: S
}

impl<S> Bar<S> {
    pub fn func<#[rustc_synthetic] T>(_: T) {}
}

fn main() {
    func::<u8>(42); //~ ERROR cannot provide explicit type parameters
    func(42); // Ok

    Foo::func::<u8>(42); //~ ERROR cannot provide explicit type parameters
    Foo::func(42); // Ok

    Bar::<i8>::func::<u8>(42); //~ ERROR cannot provide explicit type parameters
    Bar::<i8>::func(42); // Ok
}