1
Fork 0

Implement a Method to Seal DiagInner's Suggestions

This commit is contained in:
Veera 2024-09-08 15:59:05 -04:00
parent adaff5368b
commit 741005792e
13 changed files with 102 additions and 53 deletions

View file

@ -1,6 +1,6 @@
use core::ops::ControlFlow;
use rustc_errors::{Applicability, StashKey};
use rustc_errors::{Applicability, StashKey, Suggestions};
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::HirId;
@ -670,7 +670,7 @@ fn infer_placeholder_type<'tcx>(
// The parser provided a sub-optimal `HasPlaceholders` suggestion for the type.
// We are typeck and have the real type, so remove that and suggest the actual type.
if let Ok(suggestions) = &mut err.suggestions {
if let Suggestions::Enabled(suggestions) = &mut err.suggestions {
suggestions.clear();
}