Skip to content

Commit

Permalink
Unrolled build for rust-lang#118456
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#118456 - aDotInTheVoid:unused-symbols, r=WaffleLapkin

rustc_span: Remove unused symbols.

As noted  here, there is no guarantee that all pre-interned symbols are used.

https://github.com/rust-lang/rust/blob/b10cfcd65fd7f7b1ab9beb34798b2108de003452/compiler/rustc_span/src/symbol.rs#L124-L125

This was done starting with using ripgrep to search for `sym::whatever`. I removed anything that didn't show up. However this had a huge number of false positives, due to extensive macro use. Then there was a manual phase of adding back all the ones used my macros.

I don't think this was worth my time to do, but it's done now . ¯\_(ツ)_/¯
  • Loading branch information
rust-timer authored Nov 30, 2023
2 parents c52b876 + 32c035c commit 33805cb
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,11 @@ symbols! {
AcqRel,
Acquire,
AddToDiagnostic,
Alignment,
Any,
Arc,
ArcWeak,
Argument,
ArgumentMethods,
Arguments,
ArrayIntoIter,
AsMut,
AsRef,
Expand Down Expand Up @@ -164,7 +162,6 @@ symbols! {
Break,
C,
CStr,
CString,
Capture,
Center,
Cleanup,
Expand All @@ -174,7 +171,6 @@ symbols! {
Context,
Continue,
Copy,
Count,
Cow,
Debug,
DebugStruct,
Expand All @@ -199,7 +195,6 @@ symbols! {
Fn,
FnMut,
FnOnce,
FormatSpec,
Formatter,
From,
FromIterator,
Expand All @@ -208,8 +203,6 @@ symbols! {
FsPermissions,
Future,
FutureOutput,
FxHashMap,
FxHashSet,
GlobalAlloc,
Hash,
HashMap,
Expand Down Expand Up @@ -253,7 +246,6 @@ symbols! {
NonZeroI32,
NonZeroI64,
NonZeroI8,
NonZeroIsize,
NonZeroU128,
NonZeroU16,
NonZeroU32,
Expand All @@ -275,7 +267,6 @@ symbols! {
Path,
PathBuf,
Pending,
Pin,
Pointer,
Poll,
ProcMacro,
Expand Down Expand Up @@ -333,7 +324,6 @@ symbols! {
TyCtxt,
TyKind,
Unknown,
UnsafeArg,
Vec,
VecDeque,
Wrapper,
Expand Down Expand Up @@ -389,7 +379,6 @@ symbols! {
allow_fail,
allow_internal_unsafe,
allow_internal_unstable,
allowed,
alu32,
always,
and,
Expand All @@ -405,8 +394,6 @@ symbols! {
arm,
arm_target_feature,
array,
arrays,
as_mut_ptr,
as_ptr,
as_ref,
as_str,
Expand Down Expand Up @@ -589,7 +576,6 @@ symbols! {
const_try,
constant,
constructor,
context,
convert_identity,
copy,
copy_closures,
Expand Down Expand Up @@ -776,8 +762,6 @@ symbols! {
field,
field_init_shorthand,
file,
fill,
flags,
float,
float_to_int_unchecked,
floorf32,
Expand Down Expand Up @@ -1059,7 +1043,6 @@ symbols! {
mir_unwind_unreachable,
mir_variant,
miri,
misc,
mmx_reg,
modifiers,
module,
Expand Down Expand Up @@ -1157,9 +1140,7 @@ symbols! {
omit_gdb_pretty_printer_section,
on,
on_unimplemented,
oom,
opaque,
ops,
opt_out_copy,
optimize,
optimize_attribute,
Expand Down Expand Up @@ -1217,7 +1198,6 @@ symbols! {
pointer,
pointer_like,
poll,
position,
post_dash_lto: "post-lto",
powerpc_target_feature,
powf32,
Expand All @@ -1226,7 +1206,6 @@ symbols! {
powif64,
pre_dash_lto: "pre-lto",
precise_pointer_size_matching,
precision,
pref_align_of,
prefetch_read_data,
prefetch_read_instruction,
Expand All @@ -1236,7 +1215,6 @@ symbols! {
prelude,
prelude_import,
preserves_flags,
primitive,
print_macro,
println_macro,
proc_dash_macro: "proc-macro",
Expand All @@ -1260,7 +1238,6 @@ symbols! {
ptr_const_is_null,
ptr_copy,
ptr_copy_nonoverlapping,
ptr_drop_in_place,
ptr_eq,
ptr_from_ref,
ptr_guaranteed_cmp,
Expand Down Expand Up @@ -1622,7 +1599,6 @@ symbols! {
structural_match,
structural_peq,
structural_teq,
sty,
sub,
sub_assign,
sub_with_overflow,
Expand Down Expand Up @@ -1744,7 +1720,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,
Expand All @@ -1769,7 +1744,6 @@ symbols! {
used_with_arg,
using,
usize,
v1,
va_arg,
va_copy,
va_end,
Expand Down Expand Up @@ -1801,7 +1775,6 @@ symbols! {
wasm_import_module,
wasm_target_feature,
while_let,
width,
windows,
windows_subsystem,
with_negative_coherence,
Expand Down

0 comments on commit 33805cb

Please sign in to comment.