rust/tests/ui/rfcs
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
..
impl-trait
rfc-0000-never_patterns Explain why a given pattern is considered unreachable 2024-07-24 08:02:55 +02:00
rfc-0107-bind-by-move-pattern-guards
rfc-1014-stdout-existential-crisis
rfc-1445-restrict-constants-in-patterns const_to_pat: cleanup leftovers from when we had to deal with non-structural constants 2024-07-18 11:58:16 +02:00
rfc-1623-static
rfc-1717-dllimport
rfc-1789-as-cell
rfc-1857-stabilize-drop-order
rfc-1937-termination-trait
rfc-2005-default-binding-mode
rfc-2008-non-exhaustive Explain why a given pattern is considered unreachable 2024-07-24 08:02:55 +02:00
rfc-2027-object-safe-for-dispatch
rfc-2091-track-caller switch to an allowlist approach 2024-07-27 12:55:39 +02:00
rfc-2093-infer-outlives
rfc-2126-crate-paths
rfc-2126-extern-absolute-paths
rfc-2151-raw-identifiers
rfc-2175-or-if-while-let
rfc-2294-if-let-guard Explain why a given pattern is considered unreachable 2024-07-24 08:02:55 +02:00
rfc-2302-self-struct-ctor
rfc-2306-convert-id
rfc-2361-dbg-macro Suggest a borrow when using dbg 2024-07-16 02:48:47 +08:00
rfc-2396-target_feature-11
rfc-2421-unreserve-pure-offsetof-sizeof-alignof
rfc-2457-non-ascii-idents
rfc-2497-if-let-chains
rfc-2528-type-changing-struct-update
rfc-2565-param-attrs
rfc-2627-raw-dylib Fix ddltool-failed test 2024-07-24 21:06:24 +00:00
rfc-2632-const-trait-impl Rollup merge of #128171 - compiler-errors:arg-compat, r=oli-obk 2024-07-25 16:48:21 +02:00
rfc-3348-c-string-literals Replace ASCII control chars with Unicode Control Pictures 2024-07-18 19:23:42 +00:00
type-alias-impl-trait