diff options
Diffstat (limited to 'compiler/rustc_mir_build/src')
| -rw-r--r-- | compiler/rustc_mir_build/src/check_unsafety.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/errors.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/check_match.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/mod.rs | 2 | 
4 files changed, 10 insertions, 10 deletions
| diff --git a/compiler/rustc_mir_build/src/check_unsafety.rs b/compiler/rustc_mir_build/src/check_unsafety.rs index e4e5844d2ef..b6cf7a40ecd 100644 --- a/compiler/rustc_mir_build/src/check_unsafety.rs +++ b/compiler/rustc_mir_build/src/check_unsafety.rs @@ -793,7 +793,7 @@ impl UnsafeOpKind { missing.iter().map(|feature| Cow::from(feature.to_string())).collect(), ), missing_target_features_count: missing.len(), - note: if build_enabled.is_empty() { None } else { Some(()) }, + note: !build_enabled.is_empty(), build_target_features: DiagArgValue::StrListSepByAnd( build_enabled .iter() @@ -958,7 +958,7 @@ impl UnsafeOpKind { missing.iter().map(|feature| Cow::from(feature.to_string())).collect(), ), missing_target_features_count: missing.len(), - note: if build_enabled.is_empty() { None } else { Some(()) }, + note: !build_enabled.is_empty(), build_target_features: DiagArgValue::StrListSepByAnd( build_enabled .iter() @@ -977,7 +977,7 @@ impl UnsafeOpKind { missing.iter().map(|feature| Cow::from(feature.to_string())).collect(), ), missing_target_features_count: missing.len(), - note: if build_enabled.is_empty() { None } else { Some(()) }, + note: !build_enabled.is_empty(), build_target_features: DiagArgValue::StrListSepByAnd( build_enabled .iter() diff --git a/compiler/rustc_mir_build/src/errors.rs b/compiler/rustc_mir_build/src/errors.rs index 34577f102d1..73e941943c3 100644 --- a/compiler/rustc_mir_build/src/errors.rs +++ b/compiler/rustc_mir_build/src/errors.rs @@ -161,7 +161,7 @@ pub(crate) struct UnsafeOpInUnsafeFnCallToFunctionWithRequiresUnsafe { pub(crate) missing_target_features: DiagArgValue, pub(crate) missing_target_features_count: usize, #[note] - pub(crate) note: Option<()>, + pub(crate) note: bool, pub(crate) build_target_features: DiagArgValue, pub(crate) build_target_features_count: usize, #[subdiagnostic] @@ -413,7 +413,7 @@ pub(crate) struct CallToFunctionWithRequiresUnsafe { pub(crate) missing_target_features: DiagArgValue, pub(crate) missing_target_features_count: usize, #[note] - pub(crate) note: Option<()>, + pub(crate) note: bool, pub(crate) build_target_features: DiagArgValue, pub(crate) build_target_features_count: usize, #[subdiagnostic] @@ -431,7 +431,7 @@ pub(crate) struct CallToFunctionWithRequiresUnsafeUnsafeOpInUnsafeFnAllowed { pub(crate) missing_target_features: DiagArgValue, pub(crate) missing_target_features_count: usize, #[note] - pub(crate) note: Option<()>, + pub(crate) note: bool, pub(crate) build_target_features: DiagArgValue, pub(crate) build_target_features_count: usize, #[subdiagnostic] @@ -623,7 +623,7 @@ pub(crate) struct LowerRangeBoundMustBeLessThanOrEqualToUpper { #[label] pub(crate) span: Span, #[note(mir_build_teach_note)] - pub(crate) teach: Option<()>, + pub(crate) teach: bool, } #[derive(Diagnostic)] @@ -865,7 +865,7 @@ pub(crate) struct PatternNotCovered<'s, 'tcx> { #[subdiagnostic] pub(crate) adt_defined_here: Option<AdtDefinedHere<'tcx>>, #[note(mir_build_privately_uninhabited)] - pub(crate) witness_1_is_privately_uninhabited: Option<()>, + pub(crate) witness_1_is_privately_uninhabited: bool, #[note(mir_build_pattern_ty)] pub(crate) _p: (), pub(crate) pattern_ty: Ty<'tcx>, diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs index bc1acd51c69..7c5f236cae9 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs @@ -718,7 +718,7 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> { uncovered: Uncovered::new(pat.span, &cx, witnesses), inform, interpreted_as_const, - witness_1_is_privately_uninhabited: witness_1_is_privately_uninhabited.then_some(()), + witness_1_is_privately_uninhabited, _p: (), pattern_ty, let_suggestion, diff --git a/compiler/rustc_mir_build/src/thir/pattern/mod.rs b/compiler/rustc_mir_build/src/thir/pattern/mod.rs index 615070034b9..d78e1f5da09 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/mod.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/mod.rs @@ -256,7 +256,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> { RangeEnd::Included => { self.tcx.dcx().emit_err(LowerRangeBoundMustBeLessThanOrEqualToUpper { span, - teach: self.tcx.sess.teach(E0030).then_some(()), + teach: self.tcx.sess.teach(E0030), }) } RangeEnd::Excluded => { | 
