mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 01:25:15 +00:00
remove `check_const_continue` from `check_attr.rs` as it only verifies that the target is a break, which is already enforced by `check_target` in `target_checking.rs` via `ALLOWED_TARGETS`, and it's's `ConstContinueAttr` diagnostic.
45 lines
1.2 KiB
Rust
45 lines
1.2 KiB
Rust
// Test that the `#[loop_match]` and `#[const_continue]` attributes can only be
|
|
// placed on expressions.
|
|
|
|
#![allow(incomplete_features)]
|
|
#![feature(loop_match)]
|
|
#![loop_match] //~ ERROR attribute cannot be used on
|
|
#![const_continue] //~ ERROR attribute cannot be used on
|
|
|
|
extern "C" {
|
|
#[loop_match] //~ ERROR attribute cannot be used on
|
|
#[const_continue] //~ ERROR attribute cannot be used on
|
|
fn f();
|
|
}
|
|
|
|
#[loop_match] //~ ERROR attribute cannot be used on
|
|
#[const_continue] //~ ERROR attribute cannot be used on
|
|
#[repr(C)]
|
|
struct S {
|
|
a: u32,
|
|
b: u32,
|
|
}
|
|
|
|
trait Invoke {
|
|
#[loop_match] //~ ERROR attribute cannot be used on
|
|
#[const_continue] //~ ERROR attribute cannot be used on
|
|
extern "C" fn invoke(&self);
|
|
}
|
|
|
|
#[loop_match] //~ ERROR attribute cannot be used on
|
|
#[const_continue] //~ ERROR attribute cannot be used on
|
|
extern "C" fn ok() {}
|
|
|
|
fn main() {
|
|
#[loop_match] //~ ERROR attribute cannot be used on
|
|
#[const_continue] //~ ERROR attribute cannot be used on
|
|
|| {};
|
|
|
|
{
|
|
#[loop_match] //~ ERROR attribute cannot be used on
|
|
#[const_continue]
|
|
//~^ ERROR `#[const_continue]` attribute cannot be used on expressions
|
|
5
|
|
};
|
|
}
|