1
Fork 0

give a hint which feature is missing

This commit is contained in:
Ralf Jung 2024-11-09 23:32:06 +01:00
parent 822762c966
commit f235b6f9c6
6 changed files with 36 additions and 19 deletions

View file

@ -155,6 +155,7 @@ pub fn feature_warn_issue(
}
/// Adds the diagnostics for a feature to an existing error.
/// Must be a language feature!
pub fn add_feature_diagnostics<G: EmissionGuarantee>(
err: &mut Diag<'_, G>,
sess: &Session,

View file

@ -300,6 +300,7 @@ impl Session {
self.opts.test
}
/// `feature` must be a language feature.
#[track_caller]
pub fn create_feature_err<'a>(&'a self, err: impl Diagnostic<'a>, feature: Symbol) -> Diag<'a> {
let mut err = self.dcx().create_err(err);