]> git.lizzy.rs Git - rust.git/blob - src/test/ui/synthetic-param.rs
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[rust.git] / src / test / ui / synthetic-param.rs
1 #![feature(rustc_attrs)]
2
3 fn func<#[rustc_synthetic] T>(_: T) {}
4
5 struct Foo;
6
7 impl Foo {
8     pub fn func<#[rustc_synthetic] T>(_: T) {}
9 }
10
11 struct Bar<S> {
12     t: S
13 }
14
15 impl<S> Bar<S> {
16     pub fn func<#[rustc_synthetic] T>(_: T) {}
17 }
18
19 fn main() {
20     func::<u8>(42); //~ ERROR cannot provide explicit generic arguments
21     func(42); // Ok
22
23     Foo::func::<u8>(42); //~ ERROR cannot provide explicit generic arguments
24     Foo::func(42); // Ok
25
26     Bar::<i8>::func::<u8>(42); //~ ERROR cannot provide explicit generic arguments
27     Bar::<i8>::func(42); // Ok
28 }