Migrate MutDeref, TransientMutBorrow diagnostics
This commit is contained in:
parent
584e5d4c4f
commit
f97f2a47ff
4 changed files with 69 additions and 19 deletions
|
@ -2,7 +2,7 @@ use crate::cgu_reuse_tracker::CguReuseTracker;
|
|||
use crate::code_stats::CodeStats;
|
||||
pub use crate::code_stats::{DataTypeKind, FieldInfo, SizeKind, VariantInfo};
|
||||
use crate::config::{self, CrateType, OutputType, SwitchWithOptPath};
|
||||
use crate::parse::ParseSess;
|
||||
use crate::parse::{add_feature_diagnostics, ParseSess};
|
||||
use crate::search_paths::{PathKind, SearchPath};
|
||||
use crate::{filesearch, lint};
|
||||
|
||||
|
@ -458,6 +458,15 @@ impl Session {
|
|||
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||
self.parse_sess.create_err(err)
|
||||
}
|
||||
pub fn create_feature_err<'a>(
|
||||
&'a self,
|
||||
err: impl SessionDiagnostic<'a>,
|
||||
feature: Symbol,
|
||||
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||
let mut err = self.parse_sess.create_err(err);
|
||||
add_feature_diagnostics(&mut err, &self.parse_sess, feature);
|
||||
err
|
||||
}
|
||||
pub fn emit_err<'a>(&'a self, err: impl SessionDiagnostic<'a>) -> ErrorGuaranteed {
|
||||
self.parse_sess.emit_err(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue