mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
16 lines
344 B
Rust
16 lines
344 B
Rust
//! Test that generic parameters shadow structs and modules with the same name.
|
|
|
|
struct T { i: i32 }
|
|
fn f<T>() {
|
|
let t = T { i: 0 }; //~ ERROR expected struct, variant or union type, found type parameter `T`
|
|
}
|
|
|
|
mod Foo {
|
|
pub fn f() {}
|
|
}
|
|
fn g<Foo>() {
|
|
Foo::f(); //~ ERROR no associated function or constant named `f`
|
|
}
|
|
|
|
fn main() {}
|