Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ad07aa1

Browse files
committed
Auto merge of rust-lang#124289 - matthiaskrgr:rollup-oxw52jy, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang#123050 (panic_str only exists for the migration to 2021 panic macros) - rust-lang#124067 (weak lang items are not allowed to be #[track_caller]) - rust-lang#124099 (Disallow ambiguous attributes on expressions) - rust-lang#124284 (parser: remove unused(no reads) max_angle_bracket_count field) - rust-lang#124288 (remove `push_trait_bound_inner`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents c672773 + 802f629 commit ad07aa1

File tree

61 files changed

+307
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+307
-159
lines changed

compiler/rustc_error_codes/src/error_codes/E0522.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Erroneous code example:
66
#![feature(lang_items)]
77
88
#[lang = "cookie"]
9-
fn cookie() -> ! { // error: definition of an unknown language item: `cookie`
9+
fn cookie() -> ! { // error: definition of an unknown lang item: `cookie`
1010
loop {}
1111
}
1212
```

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
798798
// ==========================================================================
799799
gated!(
800800
lang, Normal, template!(NameValueStr: "name"), DuplicatesOk, EncodeCrossCrate::No, lang_items,
801-
"language items are subject to change",
801+
"lang items are subject to change",
802802
),
803803
rustc_attr!(
804804
rustc_pass_by_value, Normal, template!(Word), ErrorFollowing,

compiler/rustc_hir/src/lang_items.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Defines language items.
1+
//! Defines lang items.
22
//!
33
//! Language items are items that represent concepts intrinsic to the language
44
//! itself. Examples are:
@@ -16,7 +16,7 @@ use rustc_macros::HashStable_Generic;
1616
use rustc_span::symbol::{kw, sym, Symbol};
1717
use rustc_span::Span;
1818

19-
/// All of the language items, defined or not.
19+
/// All of the lang items, defined or not.
2020
/// Defined lang items can come from the current crate or its dependencies.
2121
#[derive(HashStable_Generic, Debug)]
2222
pub struct LanguageItems {
@@ -57,7 +57,7 @@ macro_rules! language_item_table {
5757
) => {
5858

5959
enum_from_u32! {
60-
/// A representation of all the valid language items in Rust.
60+
/// A representation of all the valid lang items in Rust.
6161
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable)]
6262
pub enum LangItem {
6363
$(
@@ -177,7 +177,7 @@ language_item_table! {
177177
CoerceUnsized, sym::coerce_unsized, coerce_unsized_trait, Target::Trait, GenericRequirement::Minimum(1);
178178
DispatchFromDyn, sym::dispatch_from_dyn, dispatch_from_dyn_trait, Target::Trait, GenericRequirement::Minimum(1);
179179

180-
// language items relating to transmutability
180+
// lang items relating to transmutability
181181
TransmuteOpts, sym::transmute_opts, transmute_opts, Target::Struct, GenericRequirement::Exact(0);
182182
TransmuteTrait, sym::transmute_trait, transmute_trait, Target::Trait, GenericRequirement::Exact(2);
183183

@@ -304,7 +304,7 @@ language_item_table! {
304304
OwnedBox, sym::owned_box, owned_box, Target::Struct, GenericRequirement::Minimum(1);
305305
GlobalAlloc, sym::global_alloc_ty, global_alloc_ty, Target::Struct, GenericRequirement::None;
306306

307-
// Experimental language item for Miri
307+
// Experimental lang item for Miri
308308
PtrUnique, sym::ptr_unique, ptr_unique, Target::Struct, GenericRequirement::Exact(1);
309309

310310
PhantomData, sym::phantom_data, phantom_data, Target::Struct, GenericRequirement::Exact(1);

compiler/rustc_hir_analysis/src/bounds.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,6 @@ impl<'tcx> Bounds<'tcx> {
4343
trait_ref: ty::PolyTraitRef<'tcx>,
4444
span: Span,
4545
polarity: ty::PredicatePolarity,
46-
) {
47-
self.push_trait_bound_inner(tcx, trait_ref, span, polarity);
48-
}
49-
50-
fn push_trait_bound_inner(
51-
&mut self,
52-
tcx: TyCtxt<'tcx>,
53-
trait_ref: ty::PolyTraitRef<'tcx>,
54-
span: Span,
55-
polarity: ty::PredicatePolarity,
5646
) {
5747
let clause = (
5848
trait_ref

compiler/rustc_hir_analysis/src/check/intrinsic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,20 +535,20 @@ pub fn check_intrinsic_type(
535535

536536
sym::va_start | sym::va_end => match mk_va_list_ty(hir::Mutability::Mut) {
537537
Some((va_list_ref_ty, _)) => (0, 0, vec![va_list_ref_ty], Ty::new_unit(tcx)),
538-
None => bug!("`va_list` language item needed for C-variadic intrinsics"),
538+
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
539539
},
540540

541541
sym::va_copy => match mk_va_list_ty(hir::Mutability::Not) {
542542
Some((va_list_ref_ty, va_list_ty)) => {
543543
let va_list_ptr_ty = Ty::new_mut_ptr(tcx, va_list_ty);
544544
(0, 0, vec![va_list_ptr_ty, va_list_ref_ty], Ty::new_unit(tcx))
545545
}
546-
None => bug!("`va_list` language item needed for C-variadic intrinsics"),
546+
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
547547
},
548548

549549
sym::va_arg => match mk_va_list_ty(hir::Mutability::Mut) {
550550
Some((va_list_ref_ty, _)) => (1, 0, vec![va_list_ref_ty], param(0)),
551-
None => bug!("`va_list` language item needed for C-variadic intrinsics"),
551+
None => bug!("`va_list` lang item needed for C-variadic intrinsics"),
552552
},
553553

554554
sym::nontemporal_store => {

compiler/rustc_lint/src/non_fmt_panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl<'tcx> LateLintPass<'tcx> for NonPanicFmt {
5353

5454
if Some(def_id) == cx.tcx.lang_items().begin_panic_fn()
5555
|| Some(def_id) == cx.tcx.lang_items().panic_fn()
56-
|| f_diagnostic_name == Some(sym::panic_str)
56+
|| f_diagnostic_name == Some(sym::panic_str_2015)
5757
{
5858
if let Some(id) = f.span.ctxt().outer_expn_data().macro_def_id {
5959
if matches!(

compiler/rustc_metadata/src/rmeta/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
12081208
tcx.arena.alloc_from_iter(self.root.stability_implications.decode(self))
12091209
}
12101210

1211-
/// Iterates over the language items in the given crate.
1211+
/// Iterates over the lang items in the given crate.
12121212
fn get_lang_items(self, tcx: TyCtxt<'tcx>) -> &'tcx [(DefId, LangItem)] {
12131213
tcx.arena.alloc_from_iter(
12141214
self.root

compiler/rustc_middle/src/middle/lang_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Detecting language items.
1+
//! Detecting lang items.
22
//!
33
//! Language items are items that represent concepts intrinsic to the language
44
//! itself. Examples are:

compiler/rustc_mir_transform/src/deduce_param_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub fn deduced_param_attrs<'tcx>(
160160
return &[];
161161
}
162162

163-
// If the Freeze language item isn't present, then don't bother.
163+
// If the Freeze lang item isn't present, then don't bother.
164164
if tcx.lang_items().freeze_trait().is_none() {
165165
return &[];
166166
}

compiler/rustc_mir_transform/src/lower_slice_len.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<'tcx> MirPass<'tcx> for LowerSliceLenCalls {
2121
pub fn lower_slice_len_calls<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
2222
let language_items = tcx.lang_items();
2323
let Some(slice_len_fn_item_def_id) = language_items.slice_len_fn() else {
24-
// there is no language item to compare to :)
24+
// there is no lang item to compare to :)
2525
return;
2626
};
2727

0 commit comments

Comments
 (0)