MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / check_mod_attrs

Function check_mod_attrs

crates/rustc_codegen_spirv/src/attr.rs:487–497  ·  view source on GitHub ↗

FIXME(eddyb) DRY this somehow and make it reusable from somewhere in `rustc`.

(tcx: TyCtxt<'_>, module_def_id: LocalDefId)

Source from the content-addressed store, hash-verified

485
486// FIXME(eddyb) DRY this somehow and make it reusable from somewhere in `rustc`.
487fn check_mod_attrs(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
488 let check_spirv_attr_visitor = &mut CheckSpirvAttrVisitor {
489 tcx,
490 sym: Symbols::get(),
491 };
492 tcx.hir()
493 .visit_item_likes_in_module(module_def_id, check_spirv_attr_visitor);
494 if module_def_id.is_top_level_module() {
495 check_spirv_attr_visitor.check_spirv_attributes(CRATE_HIR_ID, Target::Mod);
496 }
497}
498
499pub(crate) fn provide(providers: &mut Providers) {
500 *providers = Providers {

Callers 1

provideFunction · 0.85

Calls 1

Tested by

no test coverage detected