summaryrefslogtreecommitdiffstats
path: root/tests/ui/attributes/no-mangle-closure.rs
blob: c76baa27f38a0f73eeb2140d5c653bd0d2ef8822 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Check that we do not ICE when `no_mangle` is applied to something that has no name.

#![crate_type = "lib"]
#![feature(stmt_expr_attributes)]

pub struct S([usize; 8]);

pub fn outer_function(x: S, y: S) -> usize {
    (#[no_mangle] || y.0[0])()
    //~^ ERROR `#[no_mangle]` cannot be used on a closure as it has no name
}