]> git.lizzy.rs Git - rust.git/blob - tests/ui/resolve/issue-65035-static-with-parent-generics.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / resolve / issue-65035-static-with-parent-generics.rs
1 fn f<T>() {
2     extern "C" {
3         static a: *const T;
4         //~^ ERROR can't use generic parameters from outer function
5     }
6 }
7
8 fn g<T: Default>() {
9     static a: *const T = Default::default();
10     //~^ ERROR can't use generic parameters from outer function
11 }
12
13 fn h<const N: usize>() {
14     extern "C" {
15         static a: [u8; N];
16         //~^ ERROR can't use generic parameters from outer function
17     }
18 }
19
20 fn i<const N: usize>() {
21     static a: [u8; N] = [0; N];
22     //~^ ERROR can't use generic parameters from outer function
23     //~| ERROR can't use generic parameters from outer function
24 }
25
26 fn main() {}