about summary refs log tree commit diff
path: root/tests/ui/cmse-nonsecure/cmse-nonsecure-call/undeclared-lifetime.rs
blob: 5fa5b74c0c0b9c4bd59b8e9ef0806513ad875aa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ add-core-stubs
//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -Cincremental=true
//@ needs-llvm-components: arm
#![feature(abi_cmse_nonsecure_call, no_core)]
#![no_core]

extern crate minicore;
use minicore::*;

// A regression test for https://github.com/rust-lang/rust/issues/131639.
// NOTE: -Cincremental=true was required for triggering the bug.

fn foo() {
    id::<extern "cmse-nonsecure-call" fn(&'a ())>(PhantomData);
    //~^ ERROR use of undeclared lifetime name `'a`
}

fn id<T>(x: PhantomData<T>) -> PhantomData<T> {
    x
}