]> git.lizzy.rs Git - rust.git/blob - src/test/ui/resolve/issue-65035-static-with-parent-generics.rs
Rollup merge of #87180 - notriddle:notriddle/sidebar-keyboard-mobile, r=GuillaumeGomez
[rust.git] / src / test / ui / resolve / issue-65035-static-with-parent-generics.rs
1 #![feature(const_generics)]
2 //~^ WARN the feature `const_generics` is incomplete
3
4 fn f<T>() {
5     extern "C" {
6         static a: *const T;
7         //~^ ERROR can't use generic parameters from outer function
8     }
9 }
10
11 fn g<T: Default>() {
12     static a: *const T = Default::default();
13     //~^ ERROR can't use generic parameters from outer function
14 }
15
16 fn h<const N: usize>() {
17     extern "C" {
18         static a: [u8; N];
19         //~^ ERROR can't use generic parameters from outer function
20     }
21 }
22
23 fn i<const N: usize>() {
24     static a: [u8; N] = [0; N];
25     //~^ ERROR can't use generic parameters from outer function
26     //~| ERROR can't use generic parameters from outer function
27 }
28
29 fn main() {}