Skip to content

Commit

Permalink
Add warn(unreachable_pub) to rustc_ty_utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Sep 1, 2024
1 parent 22e8476 commit d22e076
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
20 changes: 10 additions & 10 deletions compiler/rustc_ty_utils/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ use rustc_span::Span;

#[derive(Diagnostic)]
#[diag(ty_utils_needs_drop_overflow)]
pub struct NeedsDropOverflow<'tcx> {
pub(crate) struct NeedsDropOverflow<'tcx> {
pub query_ty: Ty<'tcx>,
}

#[derive(Diagnostic)]
#[diag(ty_utils_generic_constant_too_complex)]
#[help]
pub struct GenericConstantTooComplex {
pub(crate) struct GenericConstantTooComplex {
#[primary_span]
pub span: Span,
#[note(ty_utils_maybe_supported)]
Expand All @@ -24,7 +24,7 @@ pub struct GenericConstantTooComplex {
}

#[derive(Subdiagnostic)]
pub enum GenericConstantTooComplexSub {
pub(crate) enum GenericConstantTooComplexSub {
#[label(ty_utils_borrow_not_supported)]
BorrowNotSupported(#[primary_span] Span),
#[label(ty_utils_address_and_deref_not_supported)]
Expand Down Expand Up @@ -71,40 +71,40 @@ pub enum GenericConstantTooComplexSub {

#[derive(Diagnostic)]
#[diag(ty_utils_unexpected_fnptr_associated_item)]
pub struct UnexpectedFnPtrAssociatedItem {
pub(crate) struct UnexpectedFnPtrAssociatedItem {
#[primary_span]
pub span: Span,
}

#[derive(Diagnostic)]
#[diag(ty_utils_zero_length_simd_type)]
pub struct ZeroLengthSimdType<'tcx> {
pub(crate) struct ZeroLengthSimdType<'tcx> {
pub ty: Ty<'tcx>,
}

#[derive(Diagnostic)]
#[diag(ty_utils_multiple_array_fields_simd_type)]
pub struct MultipleArrayFieldsSimdType<'tcx> {
pub(crate) struct MultipleArrayFieldsSimdType<'tcx> {
pub ty: Ty<'tcx>,
}

#[derive(Diagnostic)]
#[diag(ty_utils_oversized_simd_type)]
pub struct OversizedSimdType<'tcx> {
pub(crate) struct OversizedSimdType<'tcx> {
pub ty: Ty<'tcx>,
pub max_lanes: u64,
}

#[derive(Diagnostic)]
#[diag(ty_utils_non_primitive_simd_type)]
pub struct NonPrimitiveSimdType<'tcx> {
pub(crate) struct NonPrimitiveSimdType<'tcx> {
pub ty: Ty<'tcx>,
pub e_ty: Ty<'tcx>,
}

#[derive(Diagnostic)]
#[diag(ty_utils_impl_trait_duplicate_arg)]
pub struct DuplicateArg<'tcx> {
pub(crate) struct DuplicateArg<'tcx> {
pub arg: GenericArg<'tcx>,
#[primary_span]
#[label]
Expand All @@ -115,7 +115,7 @@ pub struct DuplicateArg<'tcx> {

#[derive(Diagnostic)]
#[diag(ty_utils_impl_trait_not_param, code = E0792)]
pub struct NotParam<'tcx> {
pub(crate) struct NotParam<'tcx> {
pub arg: GenericArg<'tcx>,
#[primary_span]
#[label]
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ty_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#![feature(let_chains)]
#![feature(never_type)]
#![feature(rustdoc_internals)]
#![warn(unreachable_pub)]
// tidy-alphabetical-end

use rustc_middle::query::Providers;
Expand Down

0 comments on commit d22e076

Please sign in to comment.