mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-03 01:25:15 +00:00
These changes involve the error messages produced in `check_attribute_stability`, plus some related ones. The basic idea: - Use "the `foo` attribute" in `error` lines as much as possible, where `foo` is the attribute's path. - Point carets at just the attribute's path, to match the `error` line.
27 lines
879 B
Rust
27 lines
879 B
Rust
//@ revisions: e2024 none
|
|
//@[e2024] edition: 2024
|
|
#![cfg_attr(e2024, feature(gen_blocks))]
|
|
#![feature(stmt_expr_attributes)]
|
|
|
|
fn main() {
|
|
let x = gen {};
|
|
//[none]~^ ERROR: cannot find
|
|
//[e2024]~^^ ERROR: type annotations needed
|
|
let y = gen { yield 42 };
|
|
//[none]~^ ERROR: found reserved keyword `yield`
|
|
//[none]~| ERROR: cannot find
|
|
gen {};
|
|
//[none]~^ ERROR: cannot find
|
|
|
|
let _ = || yield true; //[none]~ ERROR yield syntax is experimental
|
|
//[none]~^ ERROR yield syntax is experimental
|
|
//~^^ ERROR `yield` can only be used in
|
|
|
|
let _ = #[coroutine] || yield true; //[none]~ ERROR yield syntax is experimental
|
|
//~^ ERROR the `coroutine` attribute is an experimental feature
|
|
//[none]~^^ ERROR yield syntax is experimental
|
|
|
|
let _ = #[coroutine] || {};
|
|
//~^ ERROR the `coroutine` attribute is an experimental feature
|
|
}
|