1
Fork 0
rust/compiler/rustc_passes/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
..
liveness Match unmatched backticks in compiler/ that are part of rustdoc 2023-03-03 08:39:00 +01:00
abi_test.rs Instance::resolve -> Instance::try_resolve, and other nits 2024-07-02 17:28:03 -04:00
check_attr.rs Move all error reporting into rustc_trait_selection 2024-07-21 22:34:35 -04:00
check_const.rs Revert "Create const block DefIds in typeck instead of ast lowering" 2024-06-07 08:33:58 +00:00
dead.rs Rollup merge of #127017 - mu001999-contrib:dead/enhance, r=pnkfelix 2024-07-26 02:20:29 -04:00
debugger_visualizer.rs Avoid using feed_unit_query from within queries 2024-03-05 10:02:39 +00:00
diagnostic_items.rs Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk" 2024-06-06 10:06:28 +00:00
entry.rs Various improvements to entrypoint code 2024-05-04 14:48:42 +02:00
errors.rs Report usage of lib features in ast validation 2024-07-10 16:53:41 -04:00
hir_id_validator.rs Actually create ranged int types in the type system. 2024-04-08 12:02:19 +00:00
hir_stats.rs hir: Create hir::ConstArgKind enum 2024-07-16 19:27:28 -07:00
lang_items.rs Minor pub and whitespace cleanups. 2024-05-21 14:56:57 +10:00
layout_test.rs Move all error reporting into rustc_trait_selection 2024-07-21 22:34:35 -04:00
lib.rs Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
lib_features.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
liveness.rs Revert "Create const block DefIds in typeck instead of ast lowering" 2024-06-07 08:33:58 +00:00
loops.rs Revert "Create const block DefIds in typeck instead of ast lowering" 2024-06-07 08:33:58 +00:00
naked_functions.rs improve error message when global_asm! uses asm! options 2024-07-25 22:33:52 +02:00
reachable.rs Miri function identity hack: account for possible inlining 2024-07-02 21:05:30 +02:00
stability.rs Report usage of lib features in ast validation 2024-07-10 16:53:41 -04:00
upvars.rs Make body_owned_by return the body directly. 2024-05-29 10:04:08 +00:00
weak_lang_items.rs Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk" 2024-06-06 10:06:28 +00:00