@@ -346,7 +346,54 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
346346 | sym:: panic_handler
347347 | sym:: lang
348348 | sym:: needs_allocator
349- | sym:: default_lib_allocator,
349+ | sym:: default_lib_allocator
350+ | sym:: rustc_diagnostic_item
351+ | sym:: rustc_no_mir_inline
352+ | sym:: rustc_insignificant_dtor
353+ | sym:: rustc_nonnull_optimization_guaranteed
354+ | sym:: rustc_intrinsic
355+ | sym:: rustc_inherit_overflow_checks
356+ | sym:: rustc_intrinsic_const_stable_indirect
357+ | sym:: rustc_trivial_field_reads
358+ | sym:: rustc_on_unimplemented
359+ | sym:: rustc_do_not_const_check
360+ | sym:: rustc_reservation_impl
361+ | sym:: rustc_doc_primitive
362+ | sym:: rustc_allocator
363+ | sym:: rustc_deallocator
364+ | sym:: rustc_reallocator
365+ | sym:: rustc_conversion_suggestion
366+ | sym:: rustc_allocator_zeroed
367+ | sym:: rustc_allocator_zeroed_variant
368+ | sym:: rustc_deprecated_safe_2024
369+ | sym:: rustc_test_marker
370+ | sym:: rustc_abi
371+ | sym:: rustc_layout
372+ | sym:: rustc_proc_macro_decls
373+ | sym:: rustc_dump_def_parents
374+ | sym:: rustc_never_type_options
375+ | sym:: rustc_autodiff
376+ | sym:: rustc_capture_analysis
377+ | sym:: rustc_regions
378+ | sym:: rustc_strict_coherence
379+ | sym:: rustc_dump_predicates
380+ | sym:: rustc_variance
381+ | sym:: rustc_variance_of_opaques
382+ | sym:: rustc_hidden_type_of_opaques
383+ | sym:: rustc_mir
384+ | sym:: rustc_dump_user_args
385+ | sym:: rustc_effective_visibility
386+ | sym:: rustc_outlives
387+ | sym:: rustc_symbol_name
388+ | sym:: rustc_evaluate_where_clauses
389+ | sym:: rustc_dump_vtable
390+ | sym:: rustc_delayed_bug_from_inside_query
391+ | sym:: rustc_dump_item_bounds
392+ | sym:: rustc_def_path
393+ | sym:: rustc_partition_reused
394+ | sym:: rustc_partition_codegened
395+ | sym:: rustc_expected_cgu_reuse
396+ | sym:: rustc_nounwind,
350397 ..
351398 ] => { }
352399 [ name, rest@..] => {
@@ -361,15 +408,10 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
361408 continue
362409 }
363410
364- // FIXME: differentiate between unstable and internal attributes just
365- // like we do with features instead of just accepting `rustc_`
366- // attributes by name. That should allow trimming the above list, too.
367- if !name. as_str ( ) . starts_with ( "rustc_" ) {
368- span_bug ! (
369- attr. span( ) ,
370- "builtin attribute {name:?} not handled by `CheckAttrVisitor`"
371- )
372- }
411+ span_bug ! (
412+ attr. span( ) ,
413+ "builtin attribute {name:?} not handled by `CheckAttrVisitor`"
414+ )
373415 }
374416 None => ( ) ,
375417 }
0 commit comments