1
Fork 0

Fixed failing tests (missing labels), added automatic error code in create_feature_err() builder

This commit is contained in:
nidnogg 2022-08-20 16:27:41 -03:00
parent d1f14ee1b0
commit 4c82845b3a
5 changed files with 17 additions and 25 deletions

View file

@ -20,8 +20,8 @@ use rustc_errors::emitter::{Emitter, EmitterWriter, HumanReadableErrorType};
use rustc_errors::json::JsonEmitter;
use rustc_errors::registry::Registry;
use rustc_errors::{
fallback_fluent_bundle, DiagnosticBuilder, DiagnosticId, DiagnosticMessage, EmissionGuarantee,
ErrorGuaranteed, FluentBundle, LazyFallbackBundle, MultiSpan,
error_code, fallback_fluent_bundle, DiagnosticBuilder, DiagnosticId, DiagnosticMessage,
EmissionGuarantee, ErrorGuaranteed, FluentBundle, LazyFallbackBundle, MultiSpan,
};
use rustc_macros::HashStable_Generic;
pub use rustc_span::def_id::StableCrateId;
@ -467,6 +467,7 @@ impl Session {
feature: Symbol,
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
let mut err = self.parse_sess.create_err(err);
err.code = std::option::Option::Some(error_code!(E0658));
add_feature_diagnostics(&mut err, &self.parse_sess, feature);
err
}