From ab11b4389e9236bec5f8fa679900ca7156567a7f Mon Sep 17 00:00:00 2001 From: IQuant Date: Fri, 3 Mar 2023 23:33:39 +0300 Subject: [PATCH] FailureCode::Error0038 is unreachable, so can be removed --- compiler/rustc_infer/src/infer/error_reporting/mod.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index a4345d3ab21..de9aa45c315 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -54,7 +54,6 @@ use crate::errors::TupleTrailingCommaSuggestion; use crate::infer; use crate::infer::error_reporting::nice_region_error::find_anon_type::find_anon_type; use crate::infer::ExpectedFound; -use crate::traits::error_reporting::report_object_safety_error; use crate::traits::{ IfExpressionCause, MatchExpressionArmCause, ObligationCause, ObligationCauseCode, PredicateObligation, @@ -1912,10 +1911,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { let span = trace.cause.span(); let failure_code = trace.cause.as_failure_code(terr); let mut diag = match failure_code { - FailureCode::Error0038(did) => { - let violations = self.tcx.object_safety_violations(did); - report_object_safety_error(self.tcx, span, did, violations) - } FailureCode::Error0317(failure_str) => { struct_span_err!(self.tcx.sess, span, E0317, "{}", failure_str) } @@ -2825,7 +2820,6 @@ impl<'tcx> InferCtxt<'tcx> { } pub enum FailureCode { - Error0038(DefId), Error0317(&'static str), Error0580(&'static str), Error0308(&'static str),