diff options
Diffstat (limited to 'compiler/rustc_span/src/symbol.rs')
-rw-r--r-- | compiler/rustc_span/src/symbol.rs | 90 |
1 files changed, 52 insertions, 38 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index f287862cc..0333b5f04 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -124,22 +124,24 @@ symbols! { // There is currently no checking that all symbols are used; that would be // nice to have. Symbols { + Abi, AcqRel, Acquire, AddToDiagnostic, - Alignment, Any, Arc, ArcWeak, Argument, ArgumentMethods, - Arguments, ArrayIntoIter, AsMut, AsRef, AssertParamIsClone, AssertParamIsCopy, AssertParamIsEq, + AsyncGenFinished, + AsyncGenPending, + AsyncGenReady, AtomicBool, AtomicI128, AtomicI16, @@ -163,16 +165,15 @@ symbols! { Break, C, CStr, - CString, Capture, Center, + Cleanup, Clone, Command, ConstParamTy, Context, Continue, Copy, - Count, Cow, Debug, DebugStruct, @@ -197,7 +198,6 @@ symbols! { Fn, FnMut, FnOnce, - FormatSpec, Formatter, From, FromIterator, @@ -206,8 +206,6 @@ symbols! { FsPermissions, Future, FutureOutput, - FxHashMap, - FxHashSet, GlobalAlloc, Hash, HashMap, @@ -215,6 +213,7 @@ symbols! { HashSet, Hasher, Implied, + InCleanup, IndexOutput, Input, Instant, @@ -250,7 +249,6 @@ symbols! { NonZeroI32, NonZeroI64, NonZeroI8, - NonZeroIsize, NonZeroU128, NonZeroU16, NonZeroU32, @@ -258,6 +256,7 @@ symbols! { NonZeroU8, NonZeroUsize, None, + Normal, Ok, Option, Ord, @@ -271,7 +270,6 @@ symbols! { Path, PathBuf, Pending, - Pin, Pointer, Poll, ProcMacro, @@ -329,7 +327,6 @@ symbols! { TyCtxt, TyKind, Unknown, - UnsafeArg, Vec, VecDeque, Wrapper, @@ -385,7 +382,6 @@ symbols! { allow_fail, allow_internal_unsafe, allow_internal_unstable, - allowed, alu32, always, and, @@ -401,8 +397,6 @@ symbols! { arm, arm_target_feature, array, - arrays, - as_mut_ptr, as_ptr, as_ref, as_str, @@ -432,6 +426,7 @@ symbols! { async_closure, async_fn_in_trait, async_fn_track_caller, + async_iterator, atomic, atomic_mod, atomics, @@ -525,6 +520,8 @@ symbols! { cmp, cmp_max, cmp_min, + cmp_partialeq_eq, + cmp_partialeq_ne, cmpxchg16b_target_feature, cmse_nonsecure_entry, coerce_unsized, @@ -585,7 +582,6 @@ symbols! { const_try, constant, constructor, - context, convert_identity, copy, copy_closures, @@ -651,7 +647,6 @@ symbols! { default_method_body_is_const, default_type_parameter_fallback, default_type_params, - delay_span_bug_from_inside_query, deny, deprecated, deprecated_safe, @@ -772,8 +767,6 @@ symbols! { field, field_init_shorthand, file, - fill, - flags, float, float_to_int_unchecked, floorf32, @@ -783,6 +776,7 @@ symbols! { fmt, fmul_fast, fn_align, + fn_delegation, fn_must_use, fn_mut, fn_once, @@ -941,10 +935,12 @@ symbols! { lib, libc, lifetime, + lifetime_capture_rules_2024, lifetimes, likely, line, link, + link_arg_attribute, link_args, link_cfg, link_llvm_intrinsics, @@ -984,6 +980,7 @@ symbols! { managed_boxes, manually_drop, map, + map_err, marker, marker_trait_attr, masked, @@ -1023,8 +1020,37 @@ symbols! { minnumf32, minnumf64, mips_target_feature, + mir_basic_block, + mir_call, + mir_cast_transmute, + mir_checked, + mir_copy_for_deref, + mir_debuginfo, + mir_deinit, + mir_discriminant, + mir_drop, + mir_field, + mir_goto, + mir_len, + mir_make_place, + mir_move, + mir_offset, + mir_retag, + mir_return, + mir_set_discriminant, + mir_static, + mir_static_mut, + mir_storage_dead, + mir_storage_live, + mir_unreachable, + mir_unwind_cleanup, + mir_unwind_continue, + mir_unwind_resume, + mir_unwind_terminate, + mir_unwind_terminate_reason, + mir_unwind_unreachable, + mir_variant, miri, - misc, mmx_reg, modifiers, module, @@ -1062,6 +1088,7 @@ symbols! { negative_impls, neon, never, + never_patterns, never_type, never_type_fallback, new, @@ -1118,19 +1145,17 @@ symbols! { offset, offset_of, offset_of_enum, + ok_or_else, omit_gdb_pretty_printer_section, on, on_unimplemented, - oom, opaque, - ops, opt_out_copy, optimize, optimize_attribute, optin_builtin_traits, option, option_env, - option_payload_ptr, options, or, or_patterns, @@ -1182,7 +1207,7 @@ symbols! { pointer, pointer_like, poll, - position, + poll_next, post_dash_lto: "post-lto", powerpc_target_feature, powf32, @@ -1191,7 +1216,6 @@ symbols! { powif64, pre_dash_lto: "pre-lto", precise_pointer_size_matching, - precision, pref_align_of, prefetch_read_data, prefetch_read_instruction, @@ -1201,7 +1225,6 @@ symbols! { prelude, prelude_import, preserves_flags, - primitive, print_macro, println_macro, proc_dash_macro: "proc-macro", @@ -1225,7 +1248,6 @@ symbols! { ptr_const_is_null, ptr_copy, ptr_copy_nonoverlapping, - ptr_drop_in_place, ptr_eq, ptr_from_ref, ptr_guaranteed_cmp, @@ -1330,13 +1352,10 @@ symbols! { rtm_target_feature, rust, rust_2015, - rust_2015_preview, rust_2018, rust_2018_preview, rust_2021, - rust_2021_preview, rust_2024, - rust_2024_preview, rust_begin_unwind, rust_cold_cc, rust_eh_catch_typeinfo, @@ -1381,7 +1400,6 @@ symbols! { rustc_expected_cgu_reuse, rustc_has_incoherent_inherent_impls, rustc_hidden_type_of_opaques, - rustc_host, rustc_if_this_changed, rustc_inherit_overflow_checks, rustc_insignificant_dtor, @@ -1498,6 +1516,8 @@ symbols! { simd_insert, simd_le, simd_lt, + simd_masked_load, + simd_masked_store, simd_mul, simd_ne, simd_neg, @@ -1544,6 +1564,7 @@ symbols! { slice_patterns, slicing_syntax, soft, + span_delayed_bug_from_inside_query, specialization, speed, spotlight, @@ -1587,7 +1608,6 @@ symbols! { structural_match, structural_peq, structural_teq, - sty, sub, sub_assign, sub_with_overflow, @@ -1709,7 +1729,6 @@ symbols! { unrestricted_attribute_tokens, unsafe_block_in_unsafe_fn, unsafe_cell, - unsafe_cell_from_mut, unsafe_cell_raw_get, unsafe_no_drop_flag, unsafe_pin_internals, @@ -1734,7 +1753,6 @@ symbols! { used_with_arg, using, usize, - v1, va_arg, va_copy, va_end, @@ -1766,7 +1784,6 @@ symbols! { wasm_import_module, wasm_target_feature, while_let, - width, windows, windows_subsystem, with_negative_coherence, @@ -1985,6 +2002,7 @@ impl fmt::Display for MacroRulesNormalizedIdent { pub struct Symbol(SymbolIndex); rustc_index::newtype_index! { + #[orderable] struct SymbolIndex {} } @@ -2108,11 +2126,7 @@ impl Interner { return Symbol::new(idx as u32); } - // SAFETY: we convert from `&str` to `&[u8]`, clone it into the arena, - // and immediately convert the clone back to `&[u8]`, all because there - // is no `inner.arena.alloc_str()` method. This is clearly safe. - let string: &str = - unsafe { str::from_utf8_unchecked(inner.arena.alloc_slice(string.as_bytes())) }; + let string: &str = inner.arena.alloc_str(string); // SAFETY: we can extend the arena allocation to `'static` because we // only access these while the arena is still alive. |