rust/tests/ui/resolve/issue-65035-static-with-parent-generics.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
594 B
Rust
Raw Normal View History

fn f<T>() {
extern "C" {
static a: *const T;
2023-09-10 16:06:14 -05:00
//~^ ERROR can't use generic parameters from outer item
}
}
fn g<T: Default>() {
static a: *const T = Default::default();
2023-09-10 16:06:14 -05:00
//~^ ERROR can't use generic parameters from outer item
}
fn h<const N: usize>() {
extern "C" {
static a: [u8; N];
2023-09-10 16:06:14 -05:00
//~^ ERROR can't use generic parameters from outer item
}
}
fn i<const N: usize>() {
static a: [u8; N] = [0; N];
2023-09-10 16:06:14 -05:00
//~^ ERROR can't use generic parameters from outer item
//~| ERROR can't use generic parameters from outer item
}
fn main() {}