From 1b7efb5ade628b9fa8de1dd5d73f88a31dbd6ec4 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Tue, 27 Jun 2023 22:11:54 +0900 Subject: [PATCH 1/2] remove an unused struct `ForbiddenNonLifetimeParam` --- compiler/rustc_ast_passes/src/errors.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/compiler/rustc_ast_passes/src/errors.rs b/compiler/rustc_ast_passes/src/errors.rs index 82fe2a21d08..ab8015c4a43 100644 --- a/compiler/rustc_ast_passes/src/errors.rs +++ b/compiler/rustc_ast_passes/src/errors.rs @@ -77,13 +77,6 @@ pub struct ForbiddenLifetimeBound { pub spans: Vec, } -#[derive(Diagnostic)] -#[diag(ast_passes_forbidden_non_lifetime_param)] -pub struct ForbiddenNonLifetimeParam { - #[primary_span] - pub spans: Vec, -} - #[derive(Diagnostic)] #[diag(ast_passes_fn_param_too_many)] pub struct FnParamTooMany { From 8352c02fc29720d7bed8b0e59d7bc2ffae3c4f00 Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Tue, 27 Jun 2023 22:12:29 +0900 Subject: [PATCH 2/2] avoid using `format!("{}", ..)` --- .../rustc_infer/src/infer/error_reporting/note_and_explain.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs b/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs index 2a32f0b5047..7293de4c6c5 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/note_and_explain.rs @@ -139,7 +139,7 @@ pub fn note_and_explain_type_err( tcx, generics, diag, - &format!("{}", proj.self_ty()), + &proj.self_ty().to_string(), &path, None, matching_span, @@ -153,7 +153,7 @@ pub fn note_and_explain_type_err( tcx, generics, diag, - &format!("{}", proj.self_ty()), + &proj.self_ty().to_string(), &path, None, matching_span,