rust/compiler/rustc_passes/src
Matthias Krüger a13f40dae6
Rollup merge of #127853 - folkertdev:naked-function-error-messages, r=bjorn3
`#[naked]`: report incompatible attributes

tracking issue: https://github.com/rust-lang/rust/issues/90957

this is a re-implementation of https://github.com/rust-lang/rust/pull/93809 by ``@bstrie`` which was closed 2 years ago due to inactivity.

This PR takes some of the final comments into account, specifically providing a little more context in error messages, and using an allow list to determine which attributes are compatible with `#[naked]`.

Notable attributes that are incompatible with `#[naked]` are:

  * `#[inline]`
  * `#[track_caller]`
  * ~~`#[target_feature]`~~ (this is now allowed, see PR discussion)
  * `#[test]`, `#[ignore]`, `#[should_panic]`

These attributes just directly conflict with what `#[naked]` should do.

Naked functions are still important for systems programming, embedded, and operating systems, so I'd like to move them forward.
2024-07-28 08:57:16 +02: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 Rollup merge of #127853 - folkertdev:naked-function-error-messages, r=bjorn3 2024-07-28 08:57:16 +02: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 switch to an allowlist approach 2024-07-27 12:55:39 +02: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_features.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
lib.rs Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10: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 Rollup merge of #127853 - folkertdev:naked-function-error-messages, r=bjorn3 2024-07-28 08:57:16 +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