@@ -207,11 +207,14 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
207207 let is_question_mark = matches ! (
208208 root_obligation. cause. code( ) . peel_derives( ) ,
209209 ObligationCauseCode :: QuestionMark ,
210- ) && !(
211- self . tcx . is_diagnostic_item ( sym:: FromResidual , main_trait_predicate. def_id ( ) )
212- || self . tcx . is_diagnostic_item ( sym:: FromOutput , main_trait_predicate. def_id ( ) )
213- || self . tcx . is_lang_item ( main_trait_predicate. def_id ( ) , LangItem :: Try )
214- ) ;
210+ ) && !( self
211+ . tcx
212+ . is_diagnostic_item ( sym:: FromResidual , main_trait_predicate. def_id ( ) )
213+ || self . tcx . is_diagnostic_item (
214+ sym:: FromOutput ,
215+ main_trait_predicate. def_id ( ) ,
216+ )
217+ || self . tcx . is_lang_item ( main_trait_predicate. def_id ( ) , LangItem :: Try ) ) ;
215218 let is_unsize =
216219 self . tcx . is_lang_item ( leaf_trait_predicate. def_id ( ) , LangItem :: Unsize ) ;
217220 let question_mark_message = "the question mark operation (`?`) implicitly \
@@ -400,10 +403,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
400403 // `std::marker::Sized` is not implemented for `T`" as we will point
401404 // at the type param with a label to suggest constraining it.
402405 && !self . tcx . is_diagnostic_item ( sym:: FromResidual , leaf_trait_predicate. def_id ( ) )
403- ==== BASE ====
404- // Don't say "the trait `FromResidual<Option<Infallible>>` is
405- // not implemented for `Result<T, E>`".
406- ==== BASE ====
406+ // Don't say "the trait `FromResidual<Option<Infallible>>` is
407+ // not implemented for `Result<T, E>`".
407408 {
408409 // We do this just so that the JSON output's `help` position is the
409410 // right one and not `file.rs:1:1`. The render is the same.
0 commit comments