Add warn(unreachable_pub)
to rustc_hir_analysis
.
This commit is contained in:
parent
bffa2244ed
commit
5acf4e7b4b
27 changed files with 155 additions and 145 deletions
|
@ -3,7 +3,7 @@ use rustc_span::Span;
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_pattern_type_wild_pat)]
|
||||
pub struct WildPatTy {
|
||||
pub(crate) struct WildPatTy {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ use rustc_span::{Span, Symbol};
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_param_not_captured)]
|
||||
#[note]
|
||||
pub struct ParamNotCaptured {
|
||||
pub(crate) struct ParamNotCaptured {
|
||||
#[primary_span]
|
||||
pub opaque_span: Span,
|
||||
#[label]
|
||||
|
@ -15,7 +15,7 @@ pub struct ParamNotCaptured {
|
|||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_self_ty_not_captured)]
|
||||
#[note]
|
||||
pub struct SelfTyNotCaptured {
|
||||
pub(crate) struct SelfTyNotCaptured {
|
||||
#[primary_span]
|
||||
pub opaque_span: Span,
|
||||
#[label]
|
||||
|
@ -24,7 +24,7 @@ pub struct SelfTyNotCaptured {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_lifetime_not_captured)]
|
||||
pub struct LifetimeNotCaptured {
|
||||
pub(crate) struct LifetimeNotCaptured {
|
||||
#[primary_span]
|
||||
pub use_span: Span,
|
||||
#[label(hir_analysis_param_label)]
|
||||
|
@ -35,7 +35,7 @@ pub struct LifetimeNotCaptured {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_bad_precise_capture)]
|
||||
pub struct BadPreciseCapture {
|
||||
pub(crate) struct BadPreciseCapture {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
pub kind: &'static str,
|
||||
|
@ -44,7 +44,7 @@ pub struct BadPreciseCapture {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_precise_capture_self_alias)]
|
||||
pub struct PreciseCaptureSelfAlias {
|
||||
pub(crate) struct PreciseCaptureSelfAlias {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[label]
|
||||
|
@ -54,7 +54,7 @@ pub struct PreciseCaptureSelfAlias {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_duplicate_precise_capture)]
|
||||
pub struct DuplicatePreciseCapture {
|
||||
pub(crate) struct DuplicatePreciseCapture {
|
||||
#[primary_span]
|
||||
pub first_span: Span,
|
||||
pub name: Symbol,
|
||||
|
@ -64,7 +64,7 @@ pub struct DuplicatePreciseCapture {
|
|||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_lifetime_must_be_first)]
|
||||
pub struct LifetimesMustBeFirst {
|
||||
pub(crate) struct LifetimesMustBeFirst {
|
||||
#[primary_span]
|
||||
pub lifetime_span: Span,
|
||||
pub name: Symbol,
|
||||
|
|
|
@ -8,7 +8,7 @@ use rustc_span::def_id::DefId;
|
|||
use GenericArgsInfo::*;
|
||||
|
||||
/// Handles the `wrong number of type / lifetime / ... arguments` family of error messages.
|
||||
pub struct WrongNumberOfGenericArgs<'a, 'tcx> {
|
||||
pub(crate) struct WrongNumberOfGenericArgs<'a, 'tcx> {
|
||||
pub(crate) tcx: TyCtxt<'tcx>,
|
||||
|
||||
pub(crate) angle_brackets: AngleBrackets,
|
||||
|
@ -49,7 +49,7 @@ pub(crate) enum AngleBrackets {
|
|||
|
||||
// Information about the kind of arguments that are either missing or are unexpected
|
||||
#[derive(Debug)]
|
||||
pub enum GenericArgsInfo {
|
||||
pub(crate) enum GenericArgsInfo {
|
||||
MissingLifetimes {
|
||||
num_missing_args: usize,
|
||||
},
|
||||
|
@ -87,7 +87,7 @@ pub enum GenericArgsInfo {
|
|||
}
|
||||
|
||||
impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
|
||||
pub fn new(
|
||||
pub(crate) fn new(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
gen_args_info: GenericArgsInfo,
|
||||
path_segment: &'a hir::PathSegment<'_>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue