Skip to content

Commit da57320

Browse files
committed
Auto merge of #58728 - Centril:rollup, r=Centril
Rollup of 10 pull requests Successful merges: - #55632 (Deny the `overflowing_literals` lint for all editions) - #58687 (Reduce Miri Code Repetition like `(n << amt) >> amt`) - #58690 (Reduce a Code Repetition like `(n << amt) >> amt`) - #58718 (Apply docs convention: Replace # Unsafety with # Safety in docs) - #58719 (librustc_codegen_llvm: #![deny(elided_lifetimes_in_paths)]) - #58720 (librustc_codegen_ssa: #![deny(elided_lifetimes_in_paths)]) - #58722 (librustc_typeck: deny(elided_lifetimes_in_paths)) - #58723 (librustc: deny(elided_lifetimes_in_paths)) - #58725 (Test that binop subtyping in rustc_typeck fixes #27949) - #58727 (bootstrap: deny(rust_2018_idioms)) Failed merges: r? @ghost
2 parents 31eb0e2 + d6de1e9 commit da57320

Some content is hidden

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

87 files changed

+625
-524
lines changed

src/bootstrap/builder.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,21 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash {
6262

6363
/// Primary function to execute this rule. Can call `builder.ensure()`
6464
/// with other steps to run those.
65-
fn run(self, builder: &Builder) -> Self::Output;
65+
fn run(self, builder: &Builder<'_>) -> Self::Output;
6666

6767
/// When bootstrap is passed a set of paths, this controls whether this rule
6868
/// will execute. However, it does not get called in a "default" context
6969
/// when we are not passed any paths; in that case, `make_run` is called
7070
/// directly.
71-
fn should_run(run: ShouldRun) -> ShouldRun;
71+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_>;
7272

7373
/// Builds up a "root" rule, either as a default rule or from a path passed
7474
/// to us.
7575
///
7676
/// When path is `None`, we are executing in a context where no paths were
7777
/// passed. When `./x.py build` is run, for example, this rule could get
7878
/// called if it is in the correct list below with a path of `None`.
79-
fn make_run(_run: RunConfig) {
79+
fn make_run(_run: RunConfig<'_>) {
8080
// It is reasonable to not have an implementation of make_run for rules
8181
// who do not want to get called from the root context. This means that
8282
// they are likely dependencies (e.g., sysroot creation) or similar, and
@@ -95,8 +95,8 @@ pub struct RunConfig<'a> {
9595
struct StepDescription {
9696
default: bool,
9797
only_hosts: bool,
98-
should_run: fn(ShouldRun) -> ShouldRun,
99-
make_run: fn(RunConfig),
98+
should_run: fn(ShouldRun<'_>) -> ShouldRun<'_>,
99+
make_run: fn(RunConfig<'_>),
100100
name: &'static str,
101101
}
102102

@@ -124,7 +124,7 @@ impl PathSet {
124124
}
125125
}
126126

127-
fn path(&self, builder: &Builder) -> PathBuf {
127+
fn path(&self, builder: &Builder<'_>) -> PathBuf {
128128
match self {
129129
PathSet::Set(set) => set
130130
.iter()
@@ -147,7 +147,7 @@ impl StepDescription {
147147
}
148148
}
149149

150-
fn maybe_run(&self, builder: &Builder, pathset: &PathSet) {
150+
fn maybe_run(&self, builder: &Builder<'_>, pathset: &PathSet) {
151151
if builder.config.exclude.iter().any(|e| pathset.has(e)) {
152152
eprintln!("Skipping {:?} because it is excluded", pathset);
153153
return;
@@ -183,7 +183,7 @@ impl StepDescription {
183183
}
184184
}
185185

186-
fn run(v: &[StepDescription], builder: &Builder, paths: &[PathBuf]) {
186+
fn run(v: &[StepDescription], builder: &Builder<'_>, paths: &[PathBuf]) {
187187
let should_runs = v
188188
.iter()
189189
.map(|desc| (desc.should_run)(ShouldRun::new(builder)))
@@ -245,7 +245,7 @@ pub struct ShouldRun<'a> {
245245
}
246246

247247
impl<'a> ShouldRun<'a> {
248-
fn new(builder: &'a Builder) -> ShouldRun<'a> {
248+
fn new(builder: &'a Builder<'_>) -> ShouldRun<'a> {
249249
ShouldRun {
250250
builder,
251251
paths: BTreeSet::new(),
@@ -511,7 +511,7 @@ impl<'a> Builder<'a> {
511511
Some(help)
512512
}
513513

514-
pub fn new(build: &Build) -> Builder {
514+
pub fn new(build: &Build) -> Builder<'_> {
515515
let (kind, paths) = match build.config.cmd {
516516
Subcommand::Build { ref paths } => (Kind::Build, &paths[..]),
517517
Subcommand::Check { ref paths } => (Kind::Check, &paths[..]),
@@ -591,11 +591,11 @@ impl<'a> Builder<'a> {
591591
impl Step for Libdir {
592592
type Output = Interned<PathBuf>;
593593

594-
fn should_run(run: ShouldRun) -> ShouldRun {
594+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
595595
run.never()
596596
}
597597

598-
fn run(self, builder: &Builder) -> Interned<PathBuf> {
598+
fn run(self, builder: &Builder<'_>) -> Interned<PathBuf> {
599599
let compiler = self.compiler;
600600
let config = &builder.build.config;
601601
let lib = if compiler.stage >= 1 && config.libdir_relative().is_some() {

src/bootstrap/cache.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@ unsafe impl<T> Send for Interned<T> {}
6868
unsafe impl<T> Sync for Interned<T> {}
6969

7070
impl fmt::Display for Interned<String> {
71-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
71+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7272
let s: &str = &*self;
7373
f.write_str(s)
7474
}
7575
}
7676

7777
impl fmt::Debug for Interned<String> {
78-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
78+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7979
let s: &str = &*self;
8080
f.write_fmt(format_args!("{:?}", s))
8181
}
8282
}
8383
impl fmt::Debug for Interned<PathBuf> {
84-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
84+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8585
let s: &Path = &*self;
8686
f.write_fmt(format_args!("{:?}", s))
8787
}

src/bootstrap/cc_detect.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use std::path::{Path, PathBuf};
2727
use std::process::Command;
2828

2929
use build_helper::output;
30-
use cc;
3130

3231
use crate::{Build, GitRepo};
3332
use crate::config::Target;
@@ -157,7 +156,7 @@ fn set_compiler(cfg: &mut cc::Build,
157156
None => return,
158157
};
159158
match output[i + 3..].chars().next().unwrap() {
160-
'0' ... '6' => {}
159+
'0' ..= '6' => {}
161160
_ => return,
162161
}
163162
let alternative = format!("e{}", gnu_compiler);

src/bootstrap/check.rs

+36-20
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ impl Step for Std {
1717
type Output = ();
1818
const DEFAULT: bool = true;
1919

20-
fn should_run(run: ShouldRun) -> ShouldRun {
20+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
2121
run.all_krates("std")
2222
}
2323

24-
fn make_run(run: RunConfig) {
24+
fn make_run(run: RunConfig<'_>) {
2525
run.builder.ensure(Std {
2626
target: run.target,
2727
});
2828
}
2929

30-
fn run(self, builder: &Builder) {
30+
fn run(self, builder: &Builder<'_>) {
3131
let target = self.target;
3232
let compiler = builder.compiler(0, builder.config.build);
3333

@@ -56,11 +56,11 @@ impl Step for Rustc {
5656
const ONLY_HOSTS: bool = true;
5757
const DEFAULT: bool = true;
5858

59-
fn should_run(run: ShouldRun) -> ShouldRun {
59+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
6060
run.all_krates("rustc-main")
6161
}
6262

63-
fn make_run(run: RunConfig) {
63+
fn make_run(run: RunConfig<'_>) {
6464
run.builder.ensure(Rustc {
6565
target: run.target,
6666
});
@@ -71,7 +71,7 @@ impl Step for Rustc {
7171
/// This will build the compiler for a particular stage of the build using
7272
/// the `compiler` targeting the `target` architecture. The artifacts
7373
/// created will also be linked into the sysroot directory.
74-
fn run(self, builder: &Builder) {
74+
fn run(self, builder: &Builder<'_>) {
7575
let compiler = builder.compiler(0, builder.config.build);
7676
let target = self.target;
7777

@@ -103,11 +103,11 @@ impl Step for CodegenBackend {
103103
const ONLY_HOSTS: bool = true;
104104
const DEFAULT: bool = true;
105105

106-
fn should_run(run: ShouldRun) -> ShouldRun {
106+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
107107
run.all_krates("rustc_codegen_llvm")
108108
}
109109

110-
fn make_run(run: RunConfig) {
110+
fn make_run(run: RunConfig<'_>) {
111111
let backend = run.builder.config.rust_codegen_backends.get(0);
112112
let backend = backend.cloned().unwrap_or_else(|| {
113113
INTERNER.intern_str("llvm")
@@ -118,7 +118,7 @@ impl Step for CodegenBackend {
118118
});
119119
}
120120

121-
fn run(self, builder: &Builder) {
121+
fn run(self, builder: &Builder<'_>) {
122122
let compiler = builder.compiler(0, builder.config.build);
123123
let target = self.target;
124124
let backend = self.backend;
@@ -148,17 +148,17 @@ impl Step for Test {
148148
type Output = ();
149149
const DEFAULT: bool = true;
150150

151-
fn should_run(run: ShouldRun) -> ShouldRun {
151+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
152152
run.all_krates("test")
153153
}
154154

155-
fn make_run(run: RunConfig) {
155+
fn make_run(run: RunConfig<'_>) {
156156
run.builder.ensure(Test {
157157
target: run.target,
158158
});
159159
}
160160

161-
fn run(self, builder: &Builder) {
161+
fn run(self, builder: &Builder<'_>) {
162162
let compiler = builder.compiler(0, builder.config.build);
163163
let target = self.target;
164164

@@ -189,17 +189,17 @@ impl Step for Rustdoc {
189189
const ONLY_HOSTS: bool = true;
190190
const DEFAULT: bool = true;
191191

192-
fn should_run(run: ShouldRun) -> ShouldRun {
192+
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
193193
run.path("src/tools/rustdoc")
194194
}
195195

196-
fn make_run(run: RunConfig) {
196+
fn make_run(run: RunConfig<'_>) {
197197
run.builder.ensure(Rustdoc {
198198
target: run.target,
199199
});
200200
}
201201

202-
fn run(self, builder: &Builder) {
202+
fn run(self, builder: &Builder<'_>) {
203203
let compiler = builder.compiler(0, builder.config.build);
204204
let target = self.target;
205205

@@ -229,25 +229,37 @@ impl Step for Rustdoc {
229229

230230
/// Cargo's output path for the standard library in a given stage, compiled
231231
/// by a particular compiler for the specified target.
232-
pub fn libstd_stamp(builder: &Builder, compiler: Compiler, target: Interned<String>) -> PathBuf {
232+
pub fn libstd_stamp(
233+
builder: &Builder<'_>,
234+
compiler: Compiler,
235+
target: Interned<String>,
236+
) -> PathBuf {
233237
builder.cargo_out(compiler, Mode::Std, target).join(".libstd-check.stamp")
234238
}
235239

236240
/// Cargo's output path for libtest in a given stage, compiled by a particular
237241
/// compiler for the specified target.
238-
pub fn libtest_stamp(builder: &Builder, compiler: Compiler, target: Interned<String>) -> PathBuf {
242+
pub fn libtest_stamp(
243+
builder: &Builder<'_>,
244+
compiler: Compiler,
245+
target: Interned<String>,
246+
) -> PathBuf {
239247
builder.cargo_out(compiler, Mode::Test, target).join(".libtest-check.stamp")
240248
}
241249

242250
/// Cargo's output path for librustc in a given stage, compiled by a particular
243251
/// compiler for the specified target.
244-
pub fn librustc_stamp(builder: &Builder, compiler: Compiler, target: Interned<String>) -> PathBuf {
252+
pub fn librustc_stamp(
253+
builder: &Builder<'_>,
254+
compiler: Compiler,
255+
target: Interned<String>,
256+
) -> PathBuf {
245257
builder.cargo_out(compiler, Mode::Rustc, target).join(".librustc-check.stamp")
246258
}
247259

248260
/// Cargo's output path for librustc_codegen_llvm in a given stage, compiled by a particular
249261
/// compiler for the specified target and backend.
250-
fn codegen_backend_stamp(builder: &Builder,
262+
fn codegen_backend_stamp(builder: &Builder<'_>,
251263
compiler: Compiler,
252264
target: Interned<String>,
253265
backend: Interned<String>) -> PathBuf {
@@ -257,7 +269,11 @@ fn codegen_backend_stamp(builder: &Builder,
257269

258270
/// Cargo's output path for rustdoc in a given stage, compiled by a particular
259271
/// compiler for the specified target.
260-
pub fn rustdoc_stamp(builder: &Builder, compiler: Compiler, target: Interned<String>) -> PathBuf {
272+
pub fn rustdoc_stamp(
273+
builder: &Builder<'_>,
274+
compiler: Compiler,
275+
target: Interned<String>,
276+
) -> PathBuf {
261277
builder.cargo_out(compiler, Mode::ToolRustc, target)
262278
.join(".rustdoc-check.stamp")
263279
}

0 commit comments

Comments
 (0)