@@ -336,8 +336,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
336336 | sym:: warn
337337 | sym:: deny
338338 | sym:: forbid
339- | sym:: cfg
340- | sym:: cfg_attr
341339 // need to be fixed
342340 | sym:: patchable_function_entry // FIXME(patchable_function_entry)
343341 | sym:: deprecated_safe // FIXME(deprecated_safe)
@@ -346,7 +344,54 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
346344 | sym:: panic_handler
347345 | sym:: lang
348346 | sym:: needs_allocator
349- | sym:: default_lib_allocator,
347+ | sym:: default_lib_allocator
348+ | sym:: rustc_diagnostic_item
349+ | sym:: rustc_no_mir_inline
350+ | sym:: rustc_insignificant_dtor
351+ | sym:: rustc_nonnull_optimization_guaranteed
352+ | sym:: rustc_intrinsic
353+ | sym:: rustc_inherit_overflow_checks
354+ | sym:: rustc_intrinsic_const_stable_indirect
355+ | sym:: rustc_trivial_field_reads
356+ | sym:: rustc_on_unimplemented
357+ | sym:: rustc_do_not_const_check
358+ | sym:: rustc_reservation_impl
359+ | sym:: rustc_doc_primitive
360+ | sym:: rustc_allocator
361+ | sym:: rustc_deallocator
362+ | sym:: rustc_reallocator
363+ | sym:: rustc_conversion_suggestion
364+ | sym:: rustc_allocator_zeroed
365+ | sym:: rustc_allocator_zeroed_variant
366+ | sym:: rustc_deprecated_safe_2024
367+ | sym:: rustc_test_marker
368+ | sym:: rustc_abi
369+ | sym:: rustc_layout
370+ | sym:: rustc_proc_macro_decls
371+ | sym:: rustc_dump_def_parents
372+ | sym:: rustc_never_type_options
373+ | sym:: rustc_autodiff
374+ | sym:: rustc_capture_analysis
375+ | sym:: rustc_regions
376+ | sym:: rustc_strict_coherence
377+ | sym:: rustc_dump_predicates
378+ | sym:: rustc_variance
379+ | sym:: rustc_variance_of_opaques
380+ | sym:: rustc_hidden_type_of_opaques
381+ | sym:: rustc_mir
382+ | sym:: rustc_dump_user_args
383+ | sym:: rustc_effective_visibility
384+ | sym:: rustc_outlives
385+ | sym:: rustc_symbol_name
386+ | sym:: rustc_evaluate_where_clauses
387+ | sym:: rustc_dump_vtable
388+ | sym:: rustc_delayed_bug_from_inside_query
389+ | sym:: rustc_dump_item_bounds
390+ | sym:: rustc_def_path
391+ | sym:: rustc_partition_reused
392+ | sym:: rustc_partition_codegened
393+ | sym:: rustc_expected_cgu_reuse
394+ | sym:: rustc_nounwind,
350395 ..
351396 ] => { }
352397 [ name, rest@..] => {
@@ -361,15 +406,10 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
361406 continue
362407 }
363408
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- }
409+ span_bug ! (
410+ attr. span( ) ,
411+ "builtin attribute {name:?} not handled by `CheckAttrVisitor`"
412+ )
373413 }
374414 None => ( ) ,
375415 }
0 commit comments