Skip to content

Commit 8b35be7

Browse files
committed
consistency rename: language item -> lang item
1 parent d101971 commit 8b35be7

32 files changed

+72
-72
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
$(
@@ -165,7 +165,7 @@ language_item_table! {
165165
CoerceUnsized, sym::coerce_unsized, coerce_unsized_trait, Target::Trait, GenericRequirement::Minimum(1);
166166
DispatchFromDyn, sym::dispatch_from_dyn, dispatch_from_dyn_trait, Target::Trait, GenericRequirement::Minimum(1);
167167

168-
// language items relating to transmutability
168+
// lang items relating to transmutability
169169
TransmuteOpts, sym::transmute_opts, transmute_opts, Target::Struct, GenericRequirement::Exact(0);
170170
TransmuteTrait, sym::transmute_trait, transmute_trait, Target::Trait, GenericRequirement::Exact(2);
171171

@@ -291,7 +291,7 @@ language_item_table! {
291291
OwnedBox, sym::owned_box, owned_box, Target::Struct, GenericRequirement::Minimum(1);
292292
GlobalAlloc, sym::global_alloc_ty, global_alloc_ty, Target::Struct, GenericRequirement::None;
293293

294-
// Experimental language item for Miri
294+
// Experimental lang item for Miri
295295
PtrUnique, sym::ptr_unique, ptr_unique, Target::Struct, GenericRequirement::Exact(1);
296296

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

compiler/rustc_hir_analysis/src/check/intrinsic.rs

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

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

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

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

553553
sym::nontemporal_store => {

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

compiler/rustc_passes/messages.ftl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ passes_incorrect_meta_item = expected a quoted string literal
353353
passes_incorrect_meta_item_suggestion = consider surrounding this with quotes
354354
355355
passes_incorrect_target =
356-
`{$name}` language item must be applied to a {$kind} with {$at_least ->
356+
`{$name}` lang item must be applied to a {$kind} with {$at_least ->
357357
[true] at least {$num}
358358
*[false] {$num}
359359
} generic {$num ->
@@ -396,7 +396,7 @@ passes_invalid_macro_export_arguments_too_many_items = `#[macro_export]` can onl
396396
397397
passes_lang_item_fn = {$name ->
398398
[panic_impl] `#[panic_handler]`
399-
*[other] `{$name}` language item
399+
*[other] `{$name}` lang item
400400
} function
401401
402402
passes_lang_item_fn_with_target_feature =
@@ -408,7 +408,7 @@ passes_lang_item_fn_with_track_caller =
408408
.label = {passes_lang_item_fn} is not allowed to have `#[target_feature]`
409409
410410
passes_lang_item_on_incorrect_target =
411-
`{$name}` language item must be applied to a {$expected_target}
411+
`{$name}` lang item must be applied to a {$expected_target}
412412
.label = attribute should be applied to a {$expected_target}, not a {$actual_target}
413413
414414
passes_layout_abi =
@@ -464,7 +464,7 @@ passes_missing_const_stab_attr =
464464
{$descr} has missing const stability attribute
465465
466466
passes_missing_lang_item =
467-
language item required, but not found: `{$name}`
467+
lang item required, but not found: `{$name}`
468468
.note = this can occur when a binary crate with `#![no_std]` is compiled for a target where `{$name}` is defined in the standard library
469469
.help = you may be able to compile for a target that doesn't need `{$name}`, specify a target with `--target` or in `.cargo/config`
470470
@@ -705,8 +705,8 @@ passes_unknown_feature =
705705
unknown feature `{$feature}`
706706
707707
passes_unknown_lang_item =
708-
definition of an unknown language item: `{$name}`
709-
.label = definition of unknown language item `{$name}`
708+
definition of an unknown lang item: `{$name}`
709+
.label = definition of unknown lang item `{$name}`
710710
711711
passes_unlabeled_cf_in_while_condition =
712712
`break` or `continue` with no label in the condition of a `while` loop

compiler/rustc_passes/src/check_attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
621621
) -> bool {
622622
match target {
623623
Target::Fn => {
624-
// `#[target_feature]` is not allowed in language items.
624+
// `#[target_feature]` is not allowed in lang items.
625625
if let Some((lang_item, _)) = hir::lang_items::extract(attrs)
626626
// Calling functions with `#[target_feature]` is
627627
// not unsafe on WASM, see #84988

0 commit comments

Comments
 (0)