Skip to content

Commit d7caea1

Browse files
committed
Add warn(unreachable_pub) to rustc_ty_utils.
1 parent 3e09c45 commit d7caea1

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

compiler/rustc_ty_utils/src/errors.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ use rustc_span::Span;
77

88
#[derive(Diagnostic)]
99
#[diag(ty_utils_needs_drop_overflow)]
10-
pub struct NeedsDropOverflow<'tcx> {
10+
pub(crate) struct NeedsDropOverflow<'tcx> {
1111
pub query_ty: Ty<'tcx>,
1212
}
1313

1414
#[derive(Diagnostic)]
1515
#[diag(ty_utils_generic_constant_too_complex)]
1616
#[help]
17-
pub struct GenericConstantTooComplex {
17+
pub(crate) struct GenericConstantTooComplex {
1818
#[primary_span]
1919
pub span: Span,
2020
#[note(ty_utils_maybe_supported)]
@@ -24,7 +24,7 @@ pub struct GenericConstantTooComplex {
2424
}
2525

2626
#[derive(Subdiagnostic)]
27-
pub enum GenericConstantTooComplexSub {
27+
pub(crate) enum GenericConstantTooComplexSub {
2828
#[label(ty_utils_borrow_not_supported)]
2929
BorrowNotSupported(#[primary_span] Span),
3030
#[label(ty_utils_address_and_deref_not_supported)]
@@ -71,40 +71,40 @@ pub enum GenericConstantTooComplexSub {
7171

7272
#[derive(Diagnostic)]
7373
#[diag(ty_utils_unexpected_fnptr_associated_item)]
74-
pub struct UnexpectedFnPtrAssociatedItem {
74+
pub(crate) struct UnexpectedFnPtrAssociatedItem {
7575
#[primary_span]
7676
pub span: Span,
7777
}
7878

7979
#[derive(Diagnostic)]
8080
#[diag(ty_utils_zero_length_simd_type)]
81-
pub struct ZeroLengthSimdType<'tcx> {
81+
pub(crate) struct ZeroLengthSimdType<'tcx> {
8282
pub ty: Ty<'tcx>,
8383
}
8484

8585
#[derive(Diagnostic)]
8686
#[diag(ty_utils_multiple_array_fields_simd_type)]
87-
pub struct MultipleArrayFieldsSimdType<'tcx> {
87+
pub(crate) struct MultipleArrayFieldsSimdType<'tcx> {
8888
pub ty: Ty<'tcx>,
8989
}
9090

9191
#[derive(Diagnostic)]
9292
#[diag(ty_utils_oversized_simd_type)]
93-
pub struct OversizedSimdType<'tcx> {
93+
pub(crate) struct OversizedSimdType<'tcx> {
9494
pub ty: Ty<'tcx>,
9595
pub max_lanes: u64,
9696
}
9797

9898
#[derive(Diagnostic)]
9999
#[diag(ty_utils_non_primitive_simd_type)]
100-
pub struct NonPrimitiveSimdType<'tcx> {
100+
pub(crate) struct NonPrimitiveSimdType<'tcx> {
101101
pub ty: Ty<'tcx>,
102102
pub e_ty: Ty<'tcx>,
103103
}
104104

105105
#[derive(Diagnostic)]
106106
#[diag(ty_utils_impl_trait_duplicate_arg)]
107-
pub struct DuplicateArg<'tcx> {
107+
pub(crate) struct DuplicateArg<'tcx> {
108108
pub arg: GenericArg<'tcx>,
109109
#[primary_span]
110110
#[label]
@@ -115,7 +115,7 @@ pub struct DuplicateArg<'tcx> {
115115

116116
#[derive(Diagnostic)]
117117
#[diag(ty_utils_impl_trait_not_param, code = E0792)]
118-
pub struct NotParam<'tcx> {
118+
pub(crate) struct NotParam<'tcx> {
119119
pub arg: GenericArg<'tcx>,
120120
#[primary_span]
121121
#[label]

compiler/rustc_ty_utils/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#![feature(let_chains)]
1717
#![feature(never_type)]
1818
#![feature(rustdoc_internals)]
19+
#![warn(unreachable_pub)]
1920
// tidy-alphabetical-end
2021

2122
use rustc_middle::query::Providers;

0 commit comments

Comments
 (0)