rust/compiler/rustc_ast/src
Trevor Gross 9164dbd48c
Rollup merge of #128207 - folkertdev:asm-parser-generalize, r=Amanieu
improve error message when `global_asm!` uses `asm!` options

specifically, what was

    error: expected one of `)`, `att_syntax`, or `raw`, found `preserves_flags`
      --> $DIR/bad-options.rs:45:25
       |
    LL | global_asm!("", options(preserves_flags));
       |                         ^^^^^^^^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`

is now

    error: the `preserves_flags` option cannot be used with `global_asm!`
      --> $DIR/bad-options.rs:45:25
       |
    LL | global_asm!("", options(preserves_flags));
       |                         ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly

mirroring the phrasing of the [reference](https://doc.rust-lang.org/reference/inline-assembly.html#options).

This is also a bit of a refactor for a future `naked_asm!` macro (for use in `#[naked]` functions). Currently this sort of error can come up when switching from inline to global asm, or when a user just isn't that experienced with assembly. With  `naked_asm!` added to the mix hitting this error is more likely.
2024-07-27 13:32:56 -04:00
..
attr Rework Attribute::get_tokens. 2024-07-10 14:51:41 +10:00
expand Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
util Rollup merge of #127092 - compiler-errors:rtn-dots-redux, r=estebank 2024-07-03 23:30:07 +02:00
ast.rs Rollup merge of #128207 - folkertdev:asm-parser-generalize, r=Amanieu 2024-07-27 13:32:56 -04:00
ast_traits.rs Remove HasSpan trait. 2024-07-07 15:58:34 +10:00
entry.rs Various improvements to entrypoint code 2024-05-04 14:48:42 +02:00
format.rs Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
lib.rs Remove HasSpan trait. 2024-07-07 15:58:34 +10:00
mut_visit.rs Avoid passing state that will not be visited 2024-07-22 14:34:45 +00:00
node_id.rs Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
ptr.rs Implement BOXED_SLICE_INTO_ITER 2024-05-20 19:21:30 -04:00
token.rs Remove references to maybe_whole_expr. 2024-07-16 16:40:35 +10:00
tokenstream.rs Add some comments. 2024-07-10 17:03:58 +10:00
visit.rs Change RTN to use .. again 2024-06-28 14:20:43 -04:00