Rollup merge of #98657 - compiler-errors:rustc-const-eval-session-diagnostic-1, r=davidtwco
Migrate some diagnostics from `rustc_const_eval` to `SessionDiagnostic` I'm still trying to get the hang of this, so it doesn't migrate _all_ of `rustc_const_eval`. Working on that later. r? `@davidtwco`
This commit is contained in:
commit
dbae8309a0
13 changed files with 188 additions and 89 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