diff options
Diffstat (limited to 'compiler/rustc_trait_selection/src')
3 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs index f6dd7898fb2..173671059ca 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs @@ -382,7 +382,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { infer_subdiags, multi_suggestions, bad_label, - was_written: None, + was_written: false, path: Default::default(), }), TypeAnnotationNeeded::E0283 => self.dcx().create_err(AmbiguousImpl { @@ -393,7 +393,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { infer_subdiags, multi_suggestions, bad_label, - was_written: None, + was_written: false, path: Default::default(), }), TypeAnnotationNeeded::E0284 => self.dcx().create_err(AmbiguousReturn { @@ -404,7 +404,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { infer_subdiags, multi_suggestions, bad_label, - was_written: None, + was_written: false, path: Default::default(), }), } @@ -586,7 +586,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { infer_subdiags, multi_suggestions, bad_label: None, - was_written: path.as_ref().map(|_| ()), + was_written: path.is_some(), path: path.unwrap_or_default(), }), TypeAnnotationNeeded::E0283 => self.dcx().create_err(AmbiguousImpl { @@ -597,7 +597,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { infer_subdiags, multi_suggestions, bad_label: None, - was_written: path.as_ref().map(|_| ()), + was_written: path.is_some(), path: path.unwrap_or_default(), }), TypeAnnotationNeeded::E0284 => self.dcx().create_err(AmbiguousReturn { @@ -608,7 +608,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { infer_subdiags, multi_suggestions, bad_label: None, - was_written: path.as_ref().map(|_| ()), + was_written: path.is_some(), path: path.unwrap_or_default(), }), } diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs index 78f1f7d9b9b..5384084f6d7 100644 --- a/compiler/rustc_trait_selection/src/errors.rs +++ b/compiler/rustc_trait_selection/src/errors.rs @@ -203,7 +203,7 @@ pub struct AnnotationRequired<'a> { #[subdiagnostic] pub multi_suggestions: Vec<SourceKindMultiSuggestion<'a>>, #[note(trait_selection_full_type_written)] - pub was_written: Option<()>, + pub was_written: bool, pub path: PathBuf, } @@ -224,7 +224,7 @@ pub struct AmbiguousImpl<'a> { #[subdiagnostic] pub multi_suggestions: Vec<SourceKindMultiSuggestion<'a>>, #[note(trait_selection_full_type_written)] - pub was_written: Option<()>, + pub was_written: bool, pub path: PathBuf, } @@ -245,7 +245,7 @@ pub struct AmbiguousReturn<'a> { #[subdiagnostic] pub multi_suggestions: Vec<SourceKindMultiSuggestion<'a>>, #[note(trait_selection_full_type_written)] - pub was_written: Option<()>, + pub was_written: bool, pub path: PathBuf, } diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs index 29f78f9d5f0..38d338598a1 100644 --- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs +++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs @@ -770,7 +770,7 @@ impl<'tcx> AutoTraitFinder<'tcx> { let reported = tcx.dcx().emit_err(UnableToConstructConstantValue { span: tcx.def_span(unevaluated.def), - unevaluated: unevaluated, + unevaluated, }); Err(ErrorHandled::Reported(reported.into(), tcx.def_span(unevaluated.def))) } |
