Skip to content

Commit 2c29b05

Browse files
authored
Rollup merge of #104383 - WaffleLapkin:rustc_undiagnostic_item, r=compiler-errors
Remove unused symbols and diagnostic items As the title suggests, this removes unused symbols from `sym::` and `#[rustc_diagnostic_item]` annotations that weren't mentioned anywhere. Originally I tried to use grep, to find symbols and item names that are never mentioned via `sym::name`, however this produced a lot of false positives (?), for example clippy matching on `Symbol::as_str` or macros "implicitly" adding `sym::`. I ended up fixing all these false positives (?) by hand, but tbh I'm not sure if it was worth it...
2 parents 0a3cb1e + 29fe28f commit 2c29b05

File tree

7 files changed

+7
-79
lines changed

7 files changed

+7
-79
lines changed

compiler/rustc_span/src/symbol.rs

+1-51
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ symbols! {
170170
Count,
171171
Cow,
172172
Debug,
173-
DebugStruct,
174-
DebugTuple,
175173
Decodable,
176174
Decoder,
177175
DecorateLint,
@@ -190,9 +188,6 @@ symbols! {
190188
Error,
191189
File,
192190
FileType,
193-
Fn,
194-
FnMut,
195-
FnOnce,
196191
FormatSpec,
197192
Formatter,
198193
From,
@@ -211,7 +206,6 @@ symbols! {
211206
Input,
212207
Into,
213208
IntoDiagnostic,
214-
IntoFuture,
215209
IntoIterator,
216210
IoRead,
217211
IoWrite,
@@ -256,7 +250,6 @@ symbols! {
256250
Pointer,
257251
Poll,
258252
ProcMacro,
259-
ProcMacroHack,
260253
ProceduralMasqueradeDummyType,
261254
Range,
262255
RangeFrom,
@@ -332,7 +325,6 @@ symbols! {
332325
abi_vectorcall,
333326
abi_x86_interrupt,
334327
abort,
335-
aborts,
336328
add,
337329
add_assign,
338330
add_with_overflow,
@@ -344,7 +336,6 @@ symbols! {
344336
align,
345337
align_offset,
346338
alignment,
347-
alignstack,
348339
all,
349340
alloc,
350341
alloc_error_handler,
@@ -433,7 +424,6 @@ symbols! {
433424
bool,
434425
borrowck_graphviz_format,
435426
borrowck_graphviz_postflow,
436-
borrowck_graphviz_preflow,
437427
box_free,
438428
box_patterns,
439429
box_syntax,
@@ -462,15 +452,13 @@ symbols! {
462452
cfg_doctest,
463453
cfg_eval,
464454
cfg_hide,
465-
cfg_macro,
466455
cfg_panic,
467456
cfg_sanitize,
468457
cfg_target_abi,
469458
cfg_target_compact,
470459
cfg_target_feature,
471460
cfg_target_has_atomic,
472461
cfg_target_has_atomic_equal_alignment,
473-
cfg_target_has_atomic_load_store,
474462
cfg_target_thread_local,
475463
cfg_target_vendor,
476464
cfg_version,
@@ -495,19 +483,15 @@ symbols! {
495483
cold,
496484
collapse_debuginfo,
497485
column,
498-
column_macro,
499-
compare_and_swap,
500486
compare_exchange,
501487
compare_exchange_weak,
502488
compile_error,
503-
compile_error_macro,
504489
compiler,
505490
compiler_builtins,
506491
compiler_fence,
507492
concat,
508493
concat_bytes,
509494
concat_idents,
510-
concat_macro,
511495
conservative_impl_trait,
512496
console,
513497
const_allocate,
@@ -528,7 +512,6 @@ symbols! {
528512
const_fn_unsize,
529513
const_for,
530514
const_format_args,
531-
const_generic_defaults,
532515
const_generics,
533516
const_generics_defaults,
534517
const_if_match,
@@ -547,22 +530,19 @@ symbols! {
547530
const_trait,
548531
const_trait_bound_opt_out,
549532
const_trait_impl,
550-
const_transmute,
551533
const_try,
552534
constant,
553535
constructor,
554-
contents,
555536
context,
556-
convert,
557537
copy,
558538
copy_closures,
559539
copy_nonoverlapping,
560540
copysignf32,
561541
copysignf64,
562542
core,
563-
core_intrinsics,
564543
core_panic,
565544
core_panic_2015_macro,
545+
core_panic_2021_macro,
566546
core_panic_macro,
567547
cosf32,
568548
cosf64,
@@ -598,7 +578,6 @@ symbols! {
598578
debug_assertions,
599579
debug_struct,
600580
debug_struct_fields_finish,
601-
debug_trait_builder,
602581
debug_tuple,
603582
debug_tuple_fields_finish,
604583
debugger_visualizer,
@@ -630,7 +609,6 @@ symbols! {
630609
discriminant_type,
631610
discriminant_value,
632611
dispatch_from_dyn,
633-
display_trait,
634612
div,
635613
div_assign,
636614
doc,
@@ -661,7 +639,6 @@ symbols! {
661639
dyn_star,
662640
dyn_trait,
663641
e,
664-
edition_macro_pats,
665642
edition_panic,
666643
eh_catch_typeinfo,
667644
eh_personality,
@@ -674,7 +651,6 @@ symbols! {
674651
encode,
675652
end,
676653
env,
677-
env_macro,
678654
eprint_macro,
679655
eprintln_macro,
680656
eq,
@@ -724,9 +700,7 @@ symbols! {
724700
field,
725701
field_init_shorthand,
726702
file,
727-
file_macro,
728703
fill,
729-
finish,
730704
flags,
731705
float,
732706
float_to_int_unchecked,
@@ -735,8 +709,6 @@ symbols! {
735709
fmaf32,
736710
fmaf64,
737711
fmt,
738-
fmt_as_str,
739-
fmt_internals,
740712
fmul_fast,
741713
fn_align,
742714
fn_must_use,
@@ -751,7 +723,6 @@ symbols! {
751723
format_args_macro,
752724
format_args_nl,
753725
format_macro,
754-
fp,
755726
freeze,
756727
freg,
757728
frem_fast,
@@ -814,7 +785,6 @@ symbols! {
814785
ignore,
815786
impl_header_lifetime_elision,
816787
impl_lint_pass,
817-
impl_macros,
818788
impl_trait_in_bindings,
819789
impl_trait_in_fn_trait_return,
820790
implied_by,
@@ -826,7 +796,6 @@ symbols! {
826796
include,
827797
include_bytes,
828798
include_bytes_macro,
829-
include_macro,
830799
include_str,
831800
include_str_macro,
832801
inclusive_range_syntax,
@@ -844,7 +813,6 @@ symbols! {
844813
instruction_set,
845814
integer_: "integer",
846815
integral,
847-
intel,
848816
into_future,
849817
into_iter,
850818
intra_doc_pointers,
@@ -881,7 +849,6 @@ symbols! {
881849
lifetimes,
882850
likely,
883851
line,
884-
line_macro,
885852
link,
886853
link_args,
887854
link_cfg,
@@ -926,7 +893,6 @@ symbols! {
926893
masked,
927894
match_beginning_vert,
928895
match_default_bindings,
929-
matches_macro,
930896
maxnumf32,
931897
maxnumf64,
932898
may_dangle,
@@ -965,7 +931,6 @@ symbols! {
965931
modifiers,
966932
module,
967933
module_path,
968-
module_path_macro,
969934
more_qualified_paths,
970935
more_struct_aliases,
971936
movbe_target_feature,
@@ -1059,7 +1024,6 @@ symbols! {
10591024
optin_builtin_traits,
10601025
option,
10611026
option_env,
1062-
option_env_macro,
10631027
options,
10641028
or,
10651029
or_patterns,
@@ -1102,7 +1066,6 @@ symbols! {
11021066
plugins,
11031067
pointee_trait,
11041068
pointer,
1105-
pointer_trait_fmt,
11061069
poll,
11071070
position,
11081071
post_dash_lto: "post-lto",
@@ -1129,7 +1092,6 @@ symbols! {
11291092
proc_dash_macro: "proc-macro",
11301093
proc_macro,
11311094
proc_macro_attribute,
1132-
proc_macro_def_site,
11331095
proc_macro_derive,
11341096
proc_macro_expr,
11351097
proc_macro_gen,
@@ -1230,9 +1192,6 @@ symbols! {
12301192
rust_cold_cc,
12311193
rust_eh_catch_typeinfo,
12321194
rust_eh_personality,
1233-
rust_eh_register_frames,
1234-
rust_eh_unregister_frames,
1235-
rust_oom,
12361195
rustc,
12371196
rustc_allocator,
12381197
rustc_allocator_zeroed,
@@ -1305,7 +1264,6 @@ symbols! {
13051264
rustc_serialize,
13061265
rustc_skip_array_during_method_dispatch,
13071266
rustc_specialization_trait,
1308-
rustc_stable,
13091267
rustc_std_internal_symbol,
13101268
rustc_strict_coherence,
13111269
rustc_symbol_name,
@@ -1433,7 +1391,6 @@ symbols! {
14331391
static_recursion,
14341392
staticlib,
14351393
std,
1436-
std_inject,
14371394
std_panic,
14381395
std_panic_2015_macro,
14391396
std_panic_macro,
@@ -1448,7 +1405,6 @@ symbols! {
14481405
str_trim_start,
14491406
strict_provenance,
14501407
stringify,
1451-
stringify_macro,
14521408
struct_field_attributes,
14531409
struct_inherit,
14541410
struct_variant,
@@ -1476,10 +1432,8 @@ symbols! {
14761432
target_has_atomic_load_store,
14771433
target_os,
14781434
target_pointer_width,
1479-
target_target_vendor,
14801435
target_thread_local,
14811436
target_vendor,
1482-
task,
14831437
tbm_target_feature,
14841438
termination,
14851439
termination_trait,
@@ -1491,7 +1445,6 @@ symbols! {
14911445
test_removed_feature,
14921446
test_runner,
14931447
test_unstable_lint,
1494-
then_with,
14951448
thread,
14961449
thread_local,
14971450
thread_local_macro,
@@ -1523,7 +1476,6 @@ symbols! {
15231476
try_trait_v2,
15241477
tt,
15251478
tuple,
1526-
tuple_from_req,
15271479
tuple_indexing,
15281480
tuple_trait,
15291481
two_phase,
@@ -1567,7 +1519,6 @@ symbols! {
15671519
unreachable_2015,
15681520
unreachable_2015_macro,
15691521
unreachable_2021,
1570-
unreachable_2021_macro,
15711522
unreachable_code,
15721523
unreachable_display,
15731524
unreachable_macro,
@@ -1586,7 +1537,6 @@ symbols! {
15861537
from crates.io via `Cargo.toml` instead?",
15871538
untagged_unions,
15881539
unused_imports,
1589-
unused_qualifications,
15901540
unwind,
15911541
unwind_attributes,
15921542
unwind_safe_trait,

library/core/src/fmt/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,6 @@ pub trait UpperHex {
10541054
pub trait Pointer {
10551055
/// Formats the value using the given formatter.
10561056
#[stable(feature = "rust1", since = "1.0.0")]
1057-
#[rustc_diagnostic_item = "pointer_trait_fmt"]
10581057
fn fmt(&self, f: &mut Formatter<'_>) -> Result;
10591058
}
10601059

0 commit comments

Comments
 (0)