rust/compiler/rustc_parse/src/parser
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
..
mut_visit Specialize assert_pred. 2024-06-06 08:26:54 +10:00
tokenstream Move some tests from rustc_expand to rustc_parse. 2024-05-06 09:06:02 +10:00
attr.rs Move is_complete to the module that uses it. 2024-07-26 09:44:39 +10:00
attr_wrapper.rs Rollup merge of #128224 - nnethercote:fewer-replace_ranges, r=petrochenkov 2024-07-26 19:03:06 -04:00
diagnostics.rs Rollup merge of #127350 - veera-sivarajan:bugfix-126311, r=lcnr 2024-07-19 10:48:03 +02:00
expr.rs Always pass the visitor as the first argument to walk* functions 2024-07-22 14:01:24 +00:00
generics.rs Remove TrailingToken. 2024-07-18 17:28:49 +10:00
item.rs Improve error message for extern "C" unsafe fn() 2024-07-26 15:14:05 +02:00
mod.rs improve error message when global_asm! uses asm! options 2024-07-25 22:33:52 +02:00
nonterminal.rs Use ForceCollect in parse_attr_item. 2024-07-19 08:24:54 +10:00
pat.rs Always pass the visitor as the first argument to walk* functions 2024-07-22 14:01:24 +00:00
path.rs Use more accurate span for : to :: suggestion 2024-07-12 03:02:58 +00:00
stmt.rs Only check force_collect in collect_tokens_trailing_token. 2024-07-19 08:42:33 +10:00
tests.rs Make Parser::num_bump_calls 0-indexed. 2024-07-19 15:25:55 +10:00
ty.rs Rollup merge of #127054 - compiler-errors:bound-ordering, r=fmease 2024-07-25 04:43:18 +02:00