]> git.proxmox.com Git - rustc.git/blame - src/test/ui/synthetic-param.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / synthetic-param.rs
CommitLineData
83c7162d 1#![feature(rustc_attrs)]
ea8adc8c
XL
2
3fn func<#[rustc_synthetic] T>(_: T) {}
4
5struct Foo;
6
7impl Foo {
8 pub fn func<#[rustc_synthetic] T>(_: T) {}
9}
10
11struct Bar<S> {
12 t: S
13}
14
15impl<S> Bar<S> {
16 pub fn func<#[rustc_synthetic] T>(_: T) {}
17}
18
19fn main() {
e74abb32 20 func::<u8>(42); //~ ERROR cannot provide explicit generic arguments
ea8adc8c
XL
21 func(42); // Ok
22
e74abb32 23 Foo::func::<u8>(42); //~ ERROR cannot provide explicit generic arguments
ea8adc8c
XL
24 Foo::func(42); // Ok
25
e74abb32 26 Bar::<i8>::func::<u8>(42); //~ ERROR cannot provide explicit generic arguments
ea8adc8c
XL
27 Bar::<i8>::func(42); // Ok
28}