Add suggestion to upgrade the compiler

This commit is contained in:
George-lewis 2023-12-16 16:23:18 -05:00
parent 1d8d7b16cb
commit b55faad314
3 changed files with 22 additions and 0 deletions

View file

@ -30,6 +30,22 @@ pub struct FeatureDiagnosticForIssue {
pub n: NonZeroU32,
}
#[derive(Subdiagnostic)]
#[note(session_feature_suggest_upgrade_compiler)]
pub struct SuggestUpgradeCompiler {
version: &'static str,
date: &'static str,
}
impl SuggestUpgradeCompiler {
pub fn new() -> Self {
let version = option_env!("CFG_VERSION").unwrap_or("unknown");
let date = option_env!("CFG_VER_DATE").unwrap_or("unknown");
Self { version, date }
}
}
#[derive(Subdiagnostic)]
#[help(session_feature_diagnostic_help)]
pub struct FeatureDiagnosticHelp {