Skip to content

Commit 30ddb5a

Browse files
committed
Auto merge of #67828 - JohnTitor:rollup-qmswkkl, r=JohnTitor
Rollup of 10 pull requests Successful merges: - #67450 (Allow for setting a ThinLTO import limit during bootstrap) - #67595 (Suggest adding a lifetime constraint for opaque type) - #67636 (allow rustfmt key in [build] section) - #67736 (Less-than is asymmetric, not antisymmetric) - #67762 (Add missing links for insecure_time) - #67783 (Warn for bindings named same as variants when matching against a borrow) - #67796 (Ensure that we process projections during MIR inlining) - #67807 (Use drop instead of the toilet closure `|_| ()`) - #67816 (Clean up err codes) - #67825 (Minor: change take() docs grammar to match other docs) Failed merges: r? @ghost
2 parents 4877e16 + 14c96ce commit 30ddb5a

Some content is hidden

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

52 files changed

+269
-68
lines changed

config.toml.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@
138138
# specified, use this rustc binary instead as the stage0 snapshot compiler.
139139
#rustc = "/path/to/bin/rustc"
140140

141+
# Instead of download the src/stage0.txt version of rustfmt specified,
142+
# use this rustfmt binary instead as the stage0 snapshot rustfmt.
143+
#rustfmt = "/path/to/bin/rustfmt"
144+
141145
# Flag to specify whether any documentation is built. If false, rustdoc and
142146
# friends will still be compiled but they will not be used to generate any
143147
# documentation.
@@ -406,6 +410,13 @@
406410
# Whether to verify generated LLVM IR
407411
#verify-llvm-ir = false
408412

413+
# Compile the compiler with a non-default ThinLTO import limit. This import
414+
# limit controls the maximum size of functions imported by ThinLTO. Decreasing
415+
# will make code compile faster at the expense of lower runtime performance.
416+
# If `incremental` is set to true above, the import limit will default to 10
417+
# instead of LLVM's default of 100.
418+
#thin-lto-import-instr-limit = 100
419+
409420
# Map all debuginfo paths for libstd and crates to `/rust/$sha/$crate/...`,
410421
# generally only set for releases
411422
#remap-debuginfo = false

src/bootstrap/builder.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,21 @@ impl<'a> Builder<'a> {
11831183
rustflags.arg("-Cprefer-dynamic");
11841184
}
11851185

1186+
// When building incrementally we default to a lower ThinLTO import limit
1187+
// (unless explicitly specified otherwise). This will produce a somewhat
1188+
// slower code but give way better compile times.
1189+
{
1190+
let limit = match self.config.rust_thin_lto_import_instr_limit {
1191+
Some(limit) => Some(limit),
1192+
None if self.config.incremental => Some(10),
1193+
_ => None,
1194+
};
1195+
1196+
if let Some(limit) = limit {
1197+
rustflags.arg(&format!("-Cllvm-args=-import-instr-limit={}", limit));
1198+
}
1199+
}
1200+
11861201
Cargo { command: cargo, rustflags }
11871202
}
11881203

src/bootstrap/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ pub struct Config {
108108
pub rust_dist_src: bool,
109109
pub rust_codegen_backends: Vec<Interned<String>>,
110110
pub rust_verify_llvm_ir: bool,
111+
pub rust_thin_lto_import_instr_limit: Option<u32>,
111112
pub rust_remap_debuginfo: bool,
112113

113114
pub build: Interned<String>,
@@ -202,6 +203,7 @@ struct Build {
202203
target: Vec<String>,
203204
cargo: Option<String>,
204205
rustc: Option<String>,
206+
rustfmt: Option<String>, /* allow bootstrap.py to use rustfmt key */
205207
docs: Option<bool>,
206208
compiler_docs: Option<bool>,
207209
submodules: Option<bool>,
@@ -325,6 +327,7 @@ struct Rust {
325327
deny_warnings: Option<bool>,
326328
backtrace_on_ice: Option<bool>,
327329
verify_llvm_ir: Option<bool>,
330+
thin_lto_import_instr_limit: Option<u32>,
328331
remap_debuginfo: Option<bool>,
329332
jemalloc: Option<bool>,
330333
test_compare_mode: Option<bool>,
@@ -569,6 +572,7 @@ impl Config {
569572
set(&mut config.deny_warnings, flags.deny_warnings.or(rust.deny_warnings));
570573
set(&mut config.backtrace_on_ice, rust.backtrace_on_ice);
571574
set(&mut config.rust_verify_llvm_ir, rust.verify_llvm_ir);
575+
config.rust_thin_lto_import_instr_limit = rust.thin_lto_import_instr_limit;
572576
set(&mut config.rust_remap_debuginfo, rust.remap_debuginfo);
573577

574578
if let Some(ref backends) = rust.codegen_backends {

src/ci/docker/x86_64-gnu-llvm-7/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ RUN sh /scripts/sccache.sh
2525
ENV RUST_CONFIGURE_ARGS \
2626
--build=x86_64-unknown-linux-gnu \
2727
--llvm-root=/usr/lib/llvm-7 \
28-
--enable-llvm-link-shared
28+
--enable-llvm-link-shared \
29+
--set rust.thin-lto-import-instr-limit=10
30+
2931
ENV SCRIPT python2.7 ../x.py test src/tools/tidy && python2.7 ../x.py test
3032

3133
# The purpose of this container isn't to test with debug assertions and

src/liballoc/tests/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn shared_from_iter_trustedlen_normal() {
142142

143143
// Try a ZST to make sure it is handled well.
144144
{
145-
let iter = (0..SHARED_ITER_MAX).map(|_| ());
145+
let iter = (0..SHARED_ITER_MAX).map(drop);
146146
let vec = iter.clone().collect::<Vec<_>>();
147147
let rc = iter.collect::<Rc<[_]>>();
148148
assert_eq!(&*vec, &*rc);

src/liballoc/tests/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fn shared_from_iter_trustedlen_normal() {
138138

139139
// Try a ZST to make sure it is handled well.
140140
{
141-
let iter = (0..SHARED_ITER_MAX).map(|_| ());
141+
let iter = (0..SHARED_ITER_MAX).map(drop);
142142
let vec = iter.clone().collect::<Vec<_>>();
143143
let rc = iter.collect::<Rc<[_]>>();
144144
assert_eq!(&*vec, &*rc);

src/libcore/cmp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ impl<T: Ord> Ord for Reverse<T> {
495495
///
496496
/// An order is a total order if it is (for all `a`, `b` and `c`):
497497
///
498-
/// - total and antisymmetric: exactly one of `a < b`, `a == b` or `a > b` is true; and
498+
/// - total and asymmetric: exactly one of `a < b`, `a == b` or `a > b` is true; and
499499
/// - transitive, `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
500500
///
501501
/// ## Derivable
@@ -674,7 +674,7 @@ impl PartialOrd for Ordering {
674674
///
675675
/// The comparison must satisfy, for all `a`, `b` and `c`:
676676
///
677-
/// - antisymmetry: if `a < b` then `!(a > b)`, as well as `a > b` implying `!(a < b)`; and
677+
/// - asymmetry: if `a < b` then `!(a > b)`, as well as `a > b` implying `!(a < b)`; and
678678
/// - transitivity: `a < b` and `b < c` implies `a < c`. The same must hold for both `==` and `>`.
679679
///
680680
/// Note that these requirements mean that the trait itself must be implemented symmetrically and

src/libcore/mem/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
557557
}
558558
}
559559

560-
/// Replace `dest` with the default value of `T`, and return the previous `dest` value.
560+
/// Replaces `dest` with the default value of `T`, returning the previous `dest` value.
561561
///
562562
/// # Examples
563563
///

src/librustc/infer/error_reporting/nice_region_error/static_impl_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
5454
err.span_suggestion(
5555
fn_return_span,
5656
&format!(
57-
"you can add a constraint to the return type to make it last \
57+
"you can add a bound to the return type to make it last \
5858
less than `'static` and match {}",
5959
lifetime,
6060
),

src/librustc_error_codes/error_codes/E0130.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
You declared a pattern as an argument in a foreign function declaration.
1+
A pattern was declared as an argument in a foreign function declaration.
22

33
Erroneous code example:
44

@@ -9,7 +9,7 @@ extern {
99
}
1010
```
1111

12-
Please replace the pattern argument with a regular one. Example:
12+
To fix this error, replace the pattern argument with a regular one. Example:
1313

1414
```
1515
struct SomeStruct {

0 commit comments

Comments
 (0)