Skip to content

Commit

Permalink
Auto merge of rust-lang#98673 - pietroalbini:pa-bootstrap-update, r=M…
Browse files Browse the repository at this point in the history
…ark-Simulacrum

Bump bootstrap compiler

r? `@Mark-Simulacrum`
  • Loading branch information
bors committed Jul 3, 2022
2 parents 8c52a83 + d8bfae4 commit ada8c80
Show file tree
Hide file tree
Showing 27 changed files with 423 additions and 559 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/borrowck_errors.rs
Expand Up @@ -478,7 +478,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
struct_span_err!(self, span, E0716, "temporary value dropped while borrowed",)
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
fn struct_span_err_with_code<S: Into<MultiSpan>>(
&self,
sp: S,
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_errors/src/diagnostic.rs
Expand Up @@ -286,7 +286,7 @@ impl Diagnostic {
///
/// This span is *not* considered a ["primary span"][`MultiSpan`]; only
/// the `Span` supplied when creating the diagnostic is primary.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_label(&mut self, span: Span, label: impl Into<SubdiagnosticMessage>) -> &mut Self {
self.span.push_span_label(span, self.subdiagnostic_message_to_diagnostic_message(label));
self
Expand Down Expand Up @@ -405,7 +405,7 @@ impl Diagnostic {
}

/// Add a note attached to this diagnostic.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn note(&mut self, msg: impl Into<SubdiagnosticMessage>) -> &mut Self {
self.sub(Level::Note, msg, MultiSpan::new(), None);
self
Expand All @@ -428,7 +428,7 @@ impl Diagnostic {

/// Prints the span with a note above it.
/// This is like [`Diagnostic::note()`], but it gets its own span.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_note<S: Into<MultiSpan>>(
&mut self,
sp: S,
Expand All @@ -450,15 +450,15 @@ impl Diagnostic {
}

/// Add a warning attached to this diagnostic.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn warn(&mut self, msg: impl Into<SubdiagnosticMessage>) -> &mut Self {
self.sub(Level::Warning(None), msg, MultiSpan::new(), None);
self
}

/// Prints the span with a warning above it.
/// This is like [`Diagnostic::warn()`], but it gets its own span.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_warn<S: Into<MultiSpan>>(
&mut self,
sp: S,
Expand All @@ -469,7 +469,7 @@ impl Diagnostic {
}

/// Add a help message attached to this diagnostic.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn help(&mut self, msg: impl Into<SubdiagnosticMessage>) -> &mut Self {
self.sub(Level::Help, msg, MultiSpan::new(), None);
self
Expand All @@ -483,7 +483,7 @@ impl Diagnostic {

/// Prints the span with some help above it.
/// This is like [`Diagnostic::help()`], but it gets its own span.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_help<S: Into<MultiSpan>>(
&mut self,
sp: S,
Expand Down
44 changes: 22 additions & 22 deletions compiler/rustc_errors/src/lib.rs
Expand Up @@ -649,7 +649,7 @@ impl Handler {
/// Attempting to `.emit()` the builder will only emit if either:
/// * `can_emit_warnings` is `true`
/// * `is_force_warn` was set in `DiagnosticId::Lint`
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_span_warn(
&self,
span: impl Into<MultiSpan>,
Expand Down Expand Up @@ -678,7 +678,7 @@ impl Handler {
}

/// Construct a builder at the `Allow` level at the given `span` and with the `msg`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_span_allow(
&self,
span: impl Into<MultiSpan>,
Expand All @@ -691,7 +691,7 @@ impl Handler {

/// Construct a builder at the `Warning` level at the given `span` and with the `msg`.
/// Also include a code.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_span_warn_with_code(
&self,
span: impl Into<MultiSpan>,
Expand All @@ -708,7 +708,7 @@ impl Handler {
/// Attempting to `.emit()` the builder will only emit if either:
/// * `can_emit_warnings` is `true`
/// * `is_force_warn` was set in `DiagnosticId::Lint`
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_warn(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
DiagnosticBuilder::new(self, Level::Warning(None), msg)
}
Expand All @@ -728,13 +728,13 @@ impl Handler {
}

/// Construct a builder at the `Allow` level with the `msg`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_allow(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
DiagnosticBuilder::new(self, Level::Allow, msg)
}

/// Construct a builder at the `Expect` level with the `msg`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_expect(
&self,
msg: impl Into<DiagnosticMessage>,
Expand All @@ -744,7 +744,7 @@ impl Handler {
}

/// Construct a builder at the `Error` level at the given `span` and with the `msg`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_span_err(
&self,
span: impl Into<MultiSpan>,
Expand All @@ -756,7 +756,7 @@ impl Handler {
}

/// Construct a builder at the `Error` level at the given `span`, with the `msg`, and `code`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_span_err_with_code(
&self,
span: impl Into<MultiSpan>,
Expand All @@ -770,7 +770,7 @@ impl Handler {

/// Construct a builder at the `Error` level with the `msg`.
// FIXME: This method should be removed (every error should have an associated error code).
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_err(
&self,
msg: impl Into<DiagnosticMessage>,
Expand All @@ -785,7 +785,7 @@ impl Handler {
}

/// Construct a builder at the `Error` level with the `msg` and the `code`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_err_with_code(
&self,
msg: impl Into<DiagnosticMessage>,
Expand All @@ -797,7 +797,7 @@ impl Handler {
}

/// Construct a builder at the `Warn` level with the `msg` and the `code`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_warn_with_code(
&self,
msg: impl Into<DiagnosticMessage>,
Expand All @@ -809,7 +809,7 @@ impl Handler {
}

/// Construct a builder at the `Fatal` level at the given `span` and with the `msg`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_span_fatal(
&self,
span: impl Into<MultiSpan>,
Expand All @@ -821,7 +821,7 @@ impl Handler {
}

/// Construct a builder at the `Fatal` level at the given `span`, with the `msg`, and `code`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_span_fatal_with_code(
&self,
span: impl Into<MultiSpan>,
Expand All @@ -834,33 +834,33 @@ impl Handler {
}

/// Construct a builder at the `Error` level with the `msg`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_fatal(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, !> {
DiagnosticBuilder::new_fatal(self, msg)
}

/// Construct a builder at the `Help` level with the `msg`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_help(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
DiagnosticBuilder::new(self, Level::Help, msg)
}

/// Construct a builder at the `Note` level with the `msg`.
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_note_without_error(
&self,
msg: impl Into<DiagnosticMessage>,
) -> DiagnosticBuilder<'_, ()> {
DiagnosticBuilder::new(self, Level::Note, msg)
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_fatal(&self, span: impl Into<MultiSpan>, msg: impl Into<DiagnosticMessage>) -> ! {
self.emit_diag_at_span(Diagnostic::new(Fatal, msg), span);
FatalError.raise()
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_fatal_with_code(
&self,
span: impl Into<MultiSpan>,
Expand All @@ -871,7 +871,7 @@ impl Handler {
FatalError.raise()
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_err(
&self,
span: impl Into<MultiSpan>,
Expand All @@ -880,7 +880,7 @@ impl Handler {
self.emit_diag_at_span(Diagnostic::new(Error { lint: false }, msg), span).unwrap()
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_err_with_code(
&self,
span: impl Into<MultiSpan>,
Expand All @@ -893,12 +893,12 @@ impl Handler {
);
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_warn(&self, span: impl Into<MultiSpan>, msg: impl Into<DiagnosticMessage>) {
self.emit_diag_at_span(Diagnostic::new(Warning(None), msg), span);
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_warn_with_code(
&self,
span: impl Into<MultiSpan>,
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_expand/src/base.rs
Expand Up @@ -1077,7 +1077,7 @@ impl<'a> ExtCtxt<'a> {
self.current_expansion.id.expansion_cause()
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_span_err<S: Into<MultiSpan>>(
&self,
sp: S,
Expand All @@ -1102,11 +1102,11 @@ impl<'a> ExtCtxt<'a> {
///
/// Compilation will be stopped in the near future (at the end of
/// the macro expansion phase).
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_err<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
self.sess.parse_sess.span_diagnostic.span_err(sp, msg);
}
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
self.sess.parse_sess.span_diagnostic.span_warn(sp, msg);
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_parse/src/parser/diagnostics.rs
Expand Up @@ -357,7 +357,7 @@ impl<'a> DerefMut for SnapshotParser<'a> {
}

impl<'a> Parser<'a> {
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub(super) fn span_err<S: Into<MultiSpan>>(
&self,
sp: S,
Expand All @@ -366,7 +366,7 @@ impl<'a> Parser<'a> {
err.span_err(sp, self.diagnostic())
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_span_err<S: Into<MultiSpan>>(
&self,
sp: S,
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_resolve/src/lib.rs
Expand Up @@ -13,7 +13,6 @@
#![feature(let_chains)]
#![feature(let_else)]
#![feature(never_type)]
#![cfg_attr(bootstrap, feature(nll))]
#![recursion_limit = "256"]
#![allow(rustdoc::private_intra_doc_links)]
#![allow(rustc::potential_query_instability)]
Expand Down
43 changes: 0 additions & 43 deletions compiler/rustc_session/src/config.rs
Expand Up @@ -1102,49 +1102,6 @@ impl CrateCheckConfig {
.extend(atomic_values);

// Target specific values
#[cfg(bootstrap)]
{
for target in TARGETS
.iter()
.map(|target| Target::expect_builtin(&TargetTriple::from_triple(target)))
{
self.values_valid
.entry(sym::target_os)
.or_default()
.insert(Symbol::intern(&target.options.os));
self.values_valid
.entry(sym::target_family)
.or_default()
.extend(target.options.families.iter().map(|family| Symbol::intern(family)));
self.values_valid
.entry(sym::target_arch)
.or_default()
.insert(Symbol::intern(&target.arch));
self.values_valid
.entry(sym::target_endian)
.or_default()
.insert(Symbol::intern(&target.options.endian.as_str()));
self.values_valid
.entry(sym::target_env)
.or_default()
.insert(Symbol::intern(&target.options.env));
self.values_valid
.entry(sym::target_abi)
.or_default()
.insert(Symbol::intern(&target.options.abi));
self.values_valid
.entry(sym::target_vendor)
.or_default()
.insert(Symbol::intern(&target.options.vendor));
self.values_valid
.entry(sym::target_pointer_width)
.or_default()
.insert(sym::integer(target.pointer_width));
}
}

// Target specific values
#[cfg(not(bootstrap))]
{
const VALUES: [&Symbol; 8] = [
&sym::target_os,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/lib.rs
Expand Up @@ -6,7 +6,7 @@
#![feature(once_cell)]
#![feature(option_get_or_insert_default)]
#![feature(rustc_attrs)]
#![cfg_attr(not(bootstrap), feature(map_many_mut))]
#![feature(map_many_mut)]
#![recursion_limit = "256"]
#![allow(rustc::potential_query_instability)]

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_session/src/parse.rs
Expand Up @@ -311,15 +311,15 @@ impl ParseSess {
self.create_warning(warning).emit()
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_err(
&self,
msg: impl Into<DiagnosticMessage>,
) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
self.span_diagnostic.struct_err(msg)
}

#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
#[rustc_lint_diagnostics]
pub fn struct_warn(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
self.span_diagnostic.struct_warn(msg)
}
Expand Down

0 comments on commit ada8c80

Please sign in to comment.