1
Fork 0

Rollup merge of #124067 - RalfJung:weak-lang-items, r=davidtwco

weak lang items are not allowed to be #[track_caller]

For instance the panic handler will be called via this import
```rust
        extern "Rust" {
            #[lang = "panic_impl"]
            fn panic_impl(pi: &PanicInfo<'_>) -> !;
        }
```
A `#[track_caller]` would add an extra argument and thus make this the wrong signature.

The 2nd commit is a consistency rename; based on the docs [here](https://doc.rust-lang.org/unstable-book/language-features/lang-items.html) and [here](https://rustc-dev-guide.rust-lang.org/lang-items.html) I figured "lang item" is more widely used. (In the compiler output, "lang item" and "language item" seem to be pretty even.)
This commit is contained in:
Matthias Krüger 2024-04-23 12:10:25 +02:00 committed by GitHub
commit 36316df9fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 141 additions and 78 deletions

View file

@ -798,7 +798,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
// ==========================================================================
gated!(
lang, Normal, template!(NameValueStr: "name"), DuplicatesOk, EncodeCrossCrate::No, lang_items,
"language items are subject to change",
"lang items are subject to change",
),
rustc_attr!(
rustc_pass_by_value, Normal, template!(Word), ErrorFollowing,