mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 02:40:40 +00:00
15 lines
346 B
Rust
15 lines
346 B
Rust
//! Test that generic parameters from an outer function are not accessible
|
|
//! in nested functions.
|
|
|
|
fn foo<U>(v: Vec<U>) -> U {
|
|
fn bar(w: [U]) -> U {
|
|
//~^ ERROR can't use generic parameters from outer item
|
|
//~| ERROR can't use generic parameters from outer item
|
|
return w[0];
|
|
}
|
|
|
|
return bar(v);
|
|
}
|
|
|
|
fn main() {}
|