Minimize visibilities.

This makes it much clearer which things are used outside the crate.
This commit is contained in:
Nicholas Nethercote 2024-09-05 15:16:55 +10:00
parent 04a318787b
commit bdacdfe95f
24 changed files with 188 additions and 179 deletions

View file

@ -15,7 +15,7 @@ use rustc_span::Span;
use crate::errors;
pub fn from_target_feature(
pub(crate) fn from_target_feature(
tcx: TyCtxt<'_>,
attr: &ast::Attribute,
supported_target_features: &UnordMap<String, Option<Symbol>>,
@ -146,7 +146,7 @@ fn asm_target_features(tcx: TyCtxt<'_>, did: DefId) -> &FxIndexSet<Symbol> {
/// Checks the function annotated with `#[target_feature]` is not a safe
/// trait method implementation, reporting an error if it is.
pub fn check_target_feature_trait_unsafe(tcx: TyCtxt<'_>, id: LocalDefId, attr_span: Span) {
pub(crate) fn check_target_feature_trait_unsafe(tcx: TyCtxt<'_>, id: LocalDefId, attr_span: Span) {
if let DefKind::AssocFn = tcx.def_kind(id) {
let parent_id = tcx.local_parent(id);
if let DefKind::Trait | DefKind::Impl { of_trait: true } = tcx.def_kind(parent_id) {