[ty] Remove `AssertUnwindSafe` requirement from `ProgressReporter` (#19637)

This commit is contained in:
Micha Reiser 2025-07-30 14:46:44 +02:00 committed by GitHub
parent feaedb1812
commit 70d4b271da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View File

@ -1,5 +1,5 @@
use std::fmt::Formatter;
use std::panic::{AssertUnwindSafe, RefUnwindSafe};
use std::panic::RefUnwindSafe;
use std::sync::Arc;
use std::{cmp, fmt};
@ -87,9 +87,7 @@ impl ProjectDatabase {
///
/// [`set_check_mode`]: ProjectDatabase::set_check_mode
pub fn check(&self) -> Vec<Diagnostic> {
let mut reporter = DummyReporter;
let reporter = AssertUnwindSafe(&mut reporter as &mut dyn ProgressReporter);
self.project().check(self, reporter)
self.project().check(self, &mut DummyReporter)
}
/// Checks the files in the project and its dependencies, using the given reporter.
@ -98,7 +96,6 @@ impl ProjectDatabase {
///
/// [`set_check_mode`]: ProjectDatabase::set_check_mode
pub fn check_with_reporter(&self, reporter: &mut dyn ProgressReporter) -> Vec<Diagnostic> {
let reporter = AssertUnwindSafe(reporter);
self.project().check(self, reporter)
}

View File

@ -228,7 +228,7 @@ impl Project {
pub(crate) fn check(
self,
db: &ProjectDatabase,
mut reporter: AssertUnwindSafe<&mut dyn ProgressReporter>,
reporter: &mut dyn ProgressReporter,
) -> Vec<Diagnostic> {
let project_span = tracing::debug_span!("Project::check");
let _span = project_span.enter();