Skip to content

Commit d981633

Browse files
committed
Auto merge of #94290 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini
Bump bootstrap to 1.60 This bumps the bootstrap compiler to 1.60 and cleans up cfgs and Span's rustc_pass_by_value (enabled by the bootstrap bump).
2 parents 6cbc6c3 + 3c62f2f commit d981633

File tree

63 files changed

+429
-503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+429
-503
lines changed

compiler/rustc_ast_lowering/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#![feature(let_else)]
3636
#![feature(never_type)]
3737
#![recursion_limit = "256"]
38-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
38+
#![allow(rustc::potential_query_instability)]
3939

4040
use rustc_ast::token::{self, Token};
4141
use rustc_ast::tokenstream::{CanSynthesizeMissingTokens, TokenStream, TokenTree};

compiler/rustc_ast_passes/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#![feature(box_patterns)]
99
#![feature(let_else)]
1010
#![recursion_limit = "256"]
11-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
11+
#![allow(rustc::potential_query_instability)]
1212

1313
pub mod ast_validation;
1414
pub mod feature_gate;

compiler/rustc_borrowck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#![feature(trusted_step)]
1010
#![feature(try_blocks)]
1111
#![recursion_limit = "256"]
12-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
12+
#![allow(rustc::potential_query_instability)]
1313

1414
#[macro_use]
1515
extern crate rustc_middle;

compiler/rustc_builtin_macros/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#![feature(proc_macro_internals)]
1414
#![feature(proc_macro_quote)]
1515
#![recursion_limit = "256"]
16-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
16+
#![allow(rustc::potential_query_instability)]
1717

1818
extern crate proc_macro;
1919

compiler/rustc_codegen_llvm/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#![feature(once_cell)]
1313
#![feature(nll)]
1414
#![recursion_limit = "256"]
15-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
15+
#![allow(rustc::potential_query_instability)]
1616

1717
#[macro_use]
1818
extern crate rustc_macros;

compiler/rustc_codegen_ssa/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![feature(nll)]
88
#![feature(associated_type_bounds)]
99
#![recursion_limit = "256"]
10-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
10+
#![allow(rustc::potential_query_instability)]
1111

1212
//! This crate contains codegen code that is used by all codegen backends (LLVM and others).
1313
//! The backend-agnostic functions of this crate use functions defined in various traits that

compiler/rustc_const_eval/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Rust MIR: a lowered representation of Rust.
2222
#![feature(trusted_step)]
2323
#![feature(try_blocks)]
2424
#![recursion_limit = "256"]
25-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
25+
#![allow(rustc::potential_query_instability)]
2626

2727
#[macro_use]
2828
extern crate tracing;

compiler/rustc_data_structures/src/intern.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mod private {
2020
/// but you can only construct a `Interned` with `new_unchecked`, and not
2121
/// directly.
2222
#[derive(Debug)]
23-
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
23+
#[rustc_pass_by_value]
2424
pub struct Interned<'a, T>(pub &'a T, pub private::PrivateZst);
2525

2626
impl<'a, T> Interned<'a, T> {

compiler/rustc_data_structures/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#![feature(vec_into_raw_parts)]
2929
#![allow(rustc::default_hash_types)]
3030
#![deny(unaligned_references)]
31-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
31+
#![allow(rustc::potential_query_instability)]
3232

3333
#[macro_use]
3434
extern crate tracing;

compiler/rustc_driver/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#![feature(let_else)]
1010
#![feature(once_cell)]
1111
#![recursion_limit = "256"]
12-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
12+
#![allow(rustc::potential_query_instability)]
1313

1414
#[macro_use]
1515
extern crate tracing;

compiler/rustc_errors/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#![feature(if_let_guard)]
99
#![feature(let_else)]
1010
#![feature(nll)]
11-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
1211
#![feature(adt_const_params)]
1312
#![allow(incomplete_features)]
13+
#![allow(rustc::potential_query_instability)]
1414

1515
#[macro_use]
1616
extern crate rustc_macros;

compiler/rustc_expand/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#![feature(proc_macro_span)]
1010
#![feature(try_blocks)]
1111
#![recursion_limit = "256"]
12-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
12+
#![allow(rustc::potential_query_instability)]
1313

1414
#[macro_use]
1515
extern crate rustc_macros;

compiler/rustc_incremental/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![feature(let_else)]
66
#![feature(nll)]
77
#![recursion_limit = "256"]
8-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
8+
#![allow(rustc::potential_query_instability)]
99

1010
#[macro_use]
1111
extern crate rustc_middle;

compiler/rustc_infer/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#![feature(min_specialization)]
2424
#![feature(label_break_value)]
2525
#![recursion_limit = "512"] // For rustdoc
26-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
26+
#![allow(rustc::potential_query_instability)]
2727

2828
#[macro_use]
2929
extern crate rustc_macros;

compiler/rustc_interface/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![feature(nll)]
77
#![feature(once_cell)]
88
#![recursion_limit = "256"]
9-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
9+
#![allow(rustc::potential_query_instability)]
1010

1111
mod callbacks;
1212
pub mod interface;

compiler/rustc_lint/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl LintStore {
147147
&'t self,
148148
) -> impl Iterator<Item = (&'static str, Vec<LintId>, bool)> + 't {
149149
// This function is not used in a way which observes the order of lints.
150-
#[cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
150+
#[allow(rustc::potential_query_instability)]
151151
self.lint_groups
152152
.iter()
153153
.filter(|(_, LintGroup { depr, .. })| {

compiler/rustc_lint/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#![feature(nll)]
3939
#![feature(control_flow_enum)]
4040
#![recursion_limit = "256"]
41-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
41+
#![allow(rustc::potential_query_instability)]
4242

4343
#[macro_use]
4444
extern crate rustc_middle;

compiler/rustc_metadata/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#![feature(try_blocks)]
1010
#![feature(never_type)]
1111
#![recursion_limit = "256"]
12-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
12+
#![allow(rustc::potential_query_instability)]
1313

1414
extern crate proc_macro;
1515

compiler/rustc_middle/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#![feature(unwrap_infallible)]
5858
#![feature(decl_macro)]
5959
#![recursion_limit = "512"]
60-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
60+
#![allow(rustc::potential_query_instability)]
6161

6262
#[macro_use]
6363
extern crate bitflags;

compiler/rustc_middle/src/mir/visit.rs

+6
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ macro_rules! make_mir_visitor {
162162
self.super_constant(constant, location);
163163
}
164164

165+
// The macro results in a false positive of sorts, where &mut Span
166+
// is fine, but &Span is not; just allow the lint.
167+
#[allow(rustc::pass_by_value)]
165168
fn visit_span(&mut self,
166169
span: & $($mutability)? Span) {
167170
self.super_span(span);
@@ -869,6 +872,9 @@ macro_rules! make_mir_visitor {
869872
}
870873
}
871874

875+
// The macro results in a false positive of sorts, where &mut Span
876+
// is fine, but &Span is not; just allow the lint.
877+
#[allow(rustc::pass_by_value)]
872878
fn super_span(&mut self, _span: & $($mutability)? Span) {
873879
}
874880

compiler/rustc_middle/src/ty/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub use valtree::*;
2121

2222
/// Use this rather than `ConstS`, whenever possible.
2323
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)]
24-
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
24+
#[rustc_pass_by_value]
2525
pub struct Const<'tcx>(pub Interned<'tcx, ConstS<'tcx>>);
2626

2727
impl<'tcx> fmt::Debug for Const<'tcx> {

compiler/rustc_middle/src/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ pub struct FreeRegionInfo {
970970
/// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/ty.html
971971
#[derive(Copy, Clone)]
972972
#[rustc_diagnostic_item = "TyCtxt"]
973-
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
973+
#[rustc_pass_by_value]
974974
pub struct TyCtxt<'tcx> {
975975
gcx: &'tcx GlobalCtxt<'tcx>,
976976
}

compiler/rustc_middle/src/ty/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ static_assert_size!(TyS<'_>, 40);
433433
/// Use this rather than `TyS`, whenever possible.
434434
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
435435
#[rustc_diagnostic_item = "Ty"]
436-
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
436+
#[rustc_pass_by_value]
437437
pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>);
438438

439439
// Statics only used for internal testing.
@@ -486,7 +486,7 @@ static_assert_size!(PredicateS<'_>, 56);
486486

487487
/// Use this rather than `PredicateS`, whenever possible.
488488
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
489-
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
489+
#[rustc_pass_by_value]
490490
pub struct Predicate<'tcx>(Interned<'tcx, PredicateS<'tcx>>);
491491

492492
impl<'tcx> Predicate<'tcx> {

compiler/rustc_middle/src/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ impl ParamConst {
13961396

13971397
/// Use this rather than `TyKind`, whenever possible.
13981398
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, HashStable)]
1399-
#[cfg_attr(not(bootstrap), rustc_pass_by_value)]
1399+
#[rustc_pass_by_value]
14001400
pub struct Region<'tcx>(pub Interned<'tcx, RegionKind>);
14011401

14021402
impl<'tcx> Deref for Region<'tcx> {

compiler/rustc_mir_build/src/build/scope.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
671671
// a Coverage code region can be generated, `continue` needs no `Assign`; but
672672
// without one, the `InstrumentCoverage` MIR pass cannot generate a code region for
673673
// `continue`. Coverage will be missing unless we add a dummy `Assign` to MIR.
674-
self.add_dummy_assignment(&span, block, source_info);
674+
self.add_dummy_assignment(span, block, source_info);
675675
}
676676
}
677677

@@ -730,8 +730,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
730730

731731
// Add a dummy `Assign` statement to the CFG, with the span for the source code's `continue`
732732
// statement.
733-
fn add_dummy_assignment(&mut self, span: &Span, block: BasicBlock, source_info: SourceInfo) {
734-
let local_decl = LocalDecl::new(self.tcx.mk_unit(), *span).internal();
733+
fn add_dummy_assignment(&mut self, span: Span, block: BasicBlock, source_info: SourceInfo) {
734+
let local_decl = LocalDecl::new(self.tcx.mk_unit(), span).internal();
735735
let temp_place = Place::from(self.local_decls.push(local_decl));
736736
self.cfg.push_assign_unit(block, source_info, temp_place, self.tcx);
737737
}

compiler/rustc_mir_build/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#![feature(once_cell)]
1010
#![feature(min_specialization)]
1111
#![recursion_limit = "256"]
12-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
12+
#![allow(rustc::potential_query_instability)]
1313

1414
#[macro_use]
1515
extern crate tracing;

compiler/rustc_mir_transform/src/coverage/spans.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ impl CoverageStatement {
4747
}
4848
}
4949

50-
pub fn span(&self) -> &Span {
50+
pub fn span(&self) -> Span {
5151
match self {
52-
Self::Statement(_, span, _) | Self::Terminator(_, span) => span,
52+
Self::Statement(_, span, _) | Self::Terminator(_, span) => *span,
5353
}
5454
}
5555
}

compiler/rustc_mir_transform/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#![feature(trusted_step)]
1111
#![feature(try_blocks)]
1212
#![recursion_limit = "256"]
13-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
13+
#![allow(rustc::potential_query_instability)]
1414

1515
#[macro_use]
1616
extern crate tracing;

compiler/rustc_monomorphize/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![feature(control_flow_enum)]
55
#![feature(let_else)]
66
#![recursion_limit = "256"]
7-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
7+
#![allow(rustc::potential_query_instability)]
88

99
#[macro_use]
1010
extern crate tracing;

compiler/rustc_passes/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#![feature(nll)]
1414
#![feature(try_blocks)]
1515
#![recursion_limit = "256"]
16-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
16+
#![allow(rustc::potential_query_instability)]
1717

1818
#[macro_use]
1919
extern crate rustc_middle;

compiler/rustc_privacy/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![feature(try_blocks)]
55
#![feature(associated_type_defaults)]
66
#![recursion_limit = "256"]
7-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
7+
#![allow(rustc::potential_query_instability)]
88

99
use rustc_ast::MacroDef;
1010
use rustc_attr as attr;

compiler/rustc_query_impl/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![feature(once_cell)]
88
#![feature(rustc_attrs)]
99
#![recursion_limit = "256"]
10-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
10+
#![allow(rustc::potential_query_instability)]
1111

1212
#[macro_use]
1313
extern crate rustc_macros;

compiler/rustc_query_system/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#![feature(let_else)]
66
#![feature(min_specialization)]
77
#![feature(extern_types)]
8-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
8+
#![allow(rustc::potential_query_instability)]
99

1010
#[macro_use]
1111
extern crate tracing;

compiler/rustc_resolve/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#![feature(nll)]
1919
#![recursion_limit = "256"]
2020
#![allow(rustdoc::private_intra_doc_links)]
21-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
21+
#![allow(rustc::potential_query_instability)]
2222

2323
#[macro_use]
2424
extern crate tracing;

compiler/rustc_save_analysis/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![feature(nll)]
44
#![feature(let_else)]
55
#![recursion_limit = "256"]
6-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
6+
#![allow(rustc::potential_query_instability)]
77

88
mod dump_visitor;
99
mod dumper;

compiler/rustc_session/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![feature(min_specialization)]
55
#![feature(once_cell)]
66
#![recursion_limit = "256"]
7-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
7+
#![allow(rustc::potential_query_instability)]
88

99
#[macro_use]
1010
extern crate rustc_macros;

compiler/rustc_span/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
#![feature(negative_impls)]
2323
#![feature(nll)]
2424
#![feature(min_specialization)]
25-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
25+
#![feature(rustc_attrs)]
26+
#![allow(rustc::potential_query_instability)]
2627

2728
#[macro_use]
2829
extern crate rustc_macros;

compiler/rustc_span/src/span_encoding.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,7 @@ use rustc_data_structures::fx::FxIndexSet;
6161
/// using the callback `SPAN_TRACK` to access the query engine.
6262
///
6363
#[derive(Clone, Copy, Eq, PartialEq, Hash)]
64-
// FIXME(@lcnr): Enable this attribute once the bootstrap
65-
// compiler knows of `rustc_pass_by_value`.
66-
//
67-
// Right now, this lint would only trigger when compiling the
68-
// stage 2 compiler, which is fairly annoying as there are
69-
// a lot of places using `&Span` right now. After the next bootstrap bump,
70-
// the lint will already trigger when using stage 1, which is a lot less annoying.
71-
//
72-
// #[cfg_attr(not(bootstrap), rustc_pass_by_value)]
64+
#[rustc_pass_by_value]
7365
pub struct Span {
7466
base_or_index: u32,
7567
len_or_tag: u16,

compiler/rustc_symbol_mangling/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
#![feature(never_type)]
9292
#![feature(nll)]
9393
#![recursion_limit = "256"]
94-
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
94+
#![allow(rustc::potential_query_instability)]
9595

9696
#[macro_use]
9797
extern crate rustc_middle;

0 commit comments

Comments
 (0)