Skip to content

Commit 9672b5e

Browse files
committed
Auto merge of rust-lang#73756 - Manishearth:rollup-aehswb2, r=Manishearth
Rollup of 13 pull requests Successful merges: - rust-lang#72620 (Omit DW_AT_linkage_name when it is the same as DW_AT_name) - rust-lang#72967 (Don't move cursor in search box when using arrows to navigate results) - rust-lang#73102 (proc_macro: Stop flattening groups with dummy spans) - rust-lang#73297 (Support configurable deny-warnings for all in-tree crates.) - rust-lang#73507 (Cleanup MinGW LLVM linkage workaround) - rust-lang#73588 (Fix handling of reserved registers for ARM inline asm) - rust-lang#73597 (Record span of `const` kw in GenericParamKind) - rust-lang#73629 (Make AssocOp Copy) - rust-lang#73681 (Update Chalk to 0.14) - rust-lang#73707 (Fix links in `SliceIndex` documentation) - rust-lang#73719 (emitter: column width defaults to 140) - rust-lang#73729 (disable collectionbenches for android) - rust-lang#73748 (Add code block to code in documentation of `List::rebase_onto`) Failed merges: r? @ghost
2 parents 14e65d5 + a7eee3c commit 9672b5e

File tree

79 files changed

+644
-293
lines changed

Some content is hidden

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

79 files changed

+644
-293
lines changed

Cargo.lock

+41-8
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ dependencies = [
434434

435435
[[package]]
436436
name = "chalk-derive"
437-
version = "0.11.0"
437+
version = "0.14.0"
438438
source = "registry+https://github.com/rust-lang/crates.io-index"
439-
checksum = "5b9bd01eab87277d973183a1d2e56bace1c11f8242c52c20636fb7dddf343ac9"
439+
checksum = "d463e01905d607e181de72e8608721d3269f29176c9a14ce037011316ae7131d"
440440
dependencies = [
441441
"proc-macro2 1.0.3",
442442
"quote 1.0.2",
@@ -446,30 +446,31 @@ dependencies = [
446446

447447
[[package]]
448448
name = "chalk-engine"
449-
version = "0.11.0"
449+
version = "0.14.0"
450450
source = "registry+https://github.com/rust-lang/crates.io-index"
451-
checksum = "6c7a637c3d17ed555aef16e16952a5d1e127bd55178cc30be22afeb92da90c7d"
451+
checksum = "efaf428f5398d36284f79690cf988762b7c091249f50a6c11db613a46c057000"
452452
dependencies = [
453453
"chalk-derive",
454454
"chalk-ir",
455455
"rustc-hash",
456+
"tracing",
456457
]
457458

458459
[[package]]
459460
name = "chalk-ir"
460-
version = "0.11.0"
461+
version = "0.14.0"
461462
source = "registry+https://github.com/rust-lang/crates.io-index"
462-
checksum = "595e5735ded16c3f3dc348f7b15bbb2521a0080b1863cac38ad5271589944670"
463+
checksum = "fd3fdc1e9f68498ffe80f4a23b0b95f1ca6fb21d5a4c9b0c085fab3ca712bdbe"
463464
dependencies = [
464465
"chalk-derive",
465466
"lazy_static",
466467
]
467468

468469
[[package]]
469470
name = "chalk-solve"
470-
version = "0.11.0"
471+
version = "0.14.0"
471472
source = "registry+https://github.com/rust-lang/crates.io-index"
472-
checksum = "5d9d938139db425867a30cc0cfec0269406d8238d0571d829041eaa7a8455d11"
473+
checksum = "5b9fd4102807b7ebe8fb034fa0f488c5656e1966d3261b558b81a08d519cdb29"
473474
dependencies = [
474475
"chalk-derive",
475476
"chalk-engine",
@@ -478,6 +479,7 @@ dependencies = [
478479
"itertools 0.9.0",
479480
"petgraph",
480481
"rustc-hash",
482+
"tracing",
481483
]
482484

483485
[[package]]
@@ -5332,6 +5334,37 @@ dependencies = [
53325334
"syn 0.15.35",
53335335
]
53345336

5337+
[[package]]
5338+
name = "tracing"
5339+
version = "0.1.15"
5340+
source = "registry+https://github.com/rust-lang/crates.io-index"
5341+
checksum = "a41f40ed0e162c911ac6fcb53ecdc8134c46905fdbbae8c50add462a538b495f"
5342+
dependencies = [
5343+
"cfg-if",
5344+
"tracing-attributes",
5345+
"tracing-core",
5346+
]
5347+
5348+
[[package]]
5349+
name = "tracing-attributes"
5350+
version = "0.1.8"
5351+
source = "registry+https://github.com/rust-lang/crates.io-index"
5352+
checksum = "99bbad0de3fd923c9c3232ead88510b783e5a4d16a6154adffa3d53308de984c"
5353+
dependencies = [
5354+
"proc-macro2 1.0.3",
5355+
"quote 1.0.2",
5356+
"syn 1.0.11",
5357+
]
5358+
5359+
[[package]]
5360+
name = "tracing-core"
5361+
version = "0.1.10"
5362+
source = "registry+https://github.com/rust-lang/crates.io-index"
5363+
checksum = "0aa83a9a47081cd522c09c81b31aec2c9273424976f922ad61c053b58350b715"
5364+
dependencies = [
5365+
"lazy_static",
5366+
]
5367+
53355368
[[package]]
53365369
name = "try-lock"
53375370
version = "0.2.2"

src/bootstrap/builder.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use crate::install;
2323
use crate::native;
2424
use crate::run;
2525
use crate::test;
26-
use crate::tool;
26+
use crate::tool::{self, SourceType};
2727
use crate::util::{self, add_dylib_path, add_link_lib_path, exe, libdir};
2828
use crate::{Build, DocTests, GitRepo, Mode};
2929

@@ -759,6 +759,7 @@ impl<'a> Builder<'a> {
759759
&self,
760760
compiler: Compiler,
761761
mode: Mode,
762+
source_type: SourceType,
762763
target: Interned<String>,
763764
cmd: &str,
764765
) -> Cargo {
@@ -1125,7 +1126,7 @@ impl<'a> Builder<'a> {
11251126

11261127
cargo.env("RUSTC_VERBOSE", self.verbosity.to_string());
11271128

1128-
if !mode.is_tool() {
1129+
if source_type == SourceType::InTree {
11291130
// When extending this list, add the new lints to the RUSTFLAGS of the
11301131
// build_bootstrap function of src/bootstrap/bootstrap.py as well as
11311132
// some code doesn't go through this `rustc` wrapper.

src/bootstrap/check.rs

+22-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ impl Step for Std {
4444
let target = self.target;
4545
let compiler = builder.compiler(0, builder.config.build);
4646

47-
let mut cargo = builder.cargo(compiler, Mode::Std, target, cargo_subcommand(builder.kind));
47+
let mut cargo = builder.cargo(
48+
compiler,
49+
Mode::Std,
50+
SourceType::InTree,
51+
target,
52+
cargo_subcommand(builder.kind),
53+
);
4854
std_cargo(builder, target, compiler.stage, &mut cargo);
4955

5056
builder.info(&format!("Checking std artifacts ({} -> {})", &compiler.host, target));
@@ -92,8 +98,13 @@ impl Step for Rustc {
9298

9399
builder.ensure(Std { target });
94100

95-
let mut cargo =
96-
builder.cargo(compiler, Mode::Rustc, target, cargo_subcommand(builder.kind));
101+
let mut cargo = builder.cargo(
102+
compiler,
103+
Mode::Rustc,
104+
SourceType::InTree,
105+
target,
106+
cargo_subcommand(builder.kind),
107+
);
97108
rustc_cargo(builder, &mut cargo, target);
98109

99110
builder.info(&format!("Checking compiler artifacts ({} -> {})", &compiler.host, target));
@@ -113,7 +124,7 @@ impl Step for Rustc {
113124
}
114125

115126
macro_rules! tool_check_step {
116-
($name:ident, $path:expr) => {
127+
($name:ident, $path:expr, $source_type:expr) => {
117128
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
118129
pub struct $name {
119130
pub target: Interned<String>,
@@ -145,7 +156,7 @@ macro_rules! tool_check_step {
145156
target,
146157
cargo_subcommand(builder.kind),
147158
$path,
148-
SourceType::InTree,
159+
$source_type,
149160
&[],
150161
);
151162

@@ -184,8 +195,12 @@ macro_rules! tool_check_step {
184195
};
185196
}
186197

187-
tool_check_step!(Rustdoc, "src/tools/rustdoc");
188-
tool_check_step!(Clippy, "src/tools/clippy");
198+
tool_check_step!(Rustdoc, "src/tools/rustdoc", SourceType::InTree);
199+
// Clippy is a hybrid. It is an external tool, but uses a git subtree instead
200+
// of a submodule. Since the SourceType only drives the deny-warnings
201+
// behavior, treat it as in-tree so that any new warnings in clippy will be
202+
// rejected.
203+
tool_check_step!(Clippy, "src/tools/clippy", SourceType::InTree);
189204

190205
/// Cargo's output path for the standard library in a given stage, compiled
191206
/// by a particular compiler for the specified target.

src/bootstrap/compile.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ use filetime::FileTime;
2020
use serde::Deserialize;
2121

2222
use crate::builder::Cargo;
23+
use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
24+
use crate::cache::{Interned, INTERNER};
2325
use crate::dist;
2426
use crate::native;
27+
use crate::tool::SourceType;
2528
use crate::util::{exe, is_dylib, symlink_dir};
2629
use crate::{Compiler, DependencyType, GitRepo, Mode};
2730

28-
use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
29-
use crate::cache::{Interned, INTERNER};
30-
3131
#[derive(Debug, PartialOrd, Ord, Copy, Clone, PartialEq, Eq, Hash)]
3232
pub struct Std {
3333
pub target: Interned<String>,
@@ -87,7 +87,7 @@ impl Step for Std {
8787
target_deps.extend(copy_third_party_objects(builder, &compiler, target));
8888
target_deps.extend(copy_self_contained_objects(builder, &compiler, target));
8989

90-
let mut cargo = builder.cargo(compiler, Mode::Std, target, "build");
90+
let mut cargo = builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "build");
9191
std_cargo(builder, target, compiler.stage, &mut cargo);
9292

9393
builder.info(&format!(
@@ -513,7 +513,7 @@ impl Step for Rustc {
513513
target: builder.config.build,
514514
});
515515

516-
let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "build");
516+
let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "build");
517517
rustc_cargo(builder, &mut cargo, target);
518518

519519
builder.info(&format!(

src/bootstrap/doc.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ impl Step for Std {
435435
t!(fs::copy(builder.src.join("src/doc/rust.css"), out.join("rust.css")));
436436

437437
let run_cargo_rustdoc_for = |package: &str| {
438-
let mut cargo = builder.cargo(compiler, Mode::Std, target, "rustdoc");
438+
let mut cargo =
439+
builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "rustdoc");
439440
compile::std_cargo(builder, target, compiler.stage, &mut cargo);
440441

441442
// Keep a whitelist so we do not build internal stdlib crates, these will be
@@ -534,7 +535,7 @@ impl Step for Rustc {
534535
t!(symlink_dir_force(&builder.config, &out, &out_dir));
535536

536537
// Build cargo command.
537-
let mut cargo = builder.cargo(compiler, Mode::Rustc, target, "doc");
538+
let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "doc");
538539
cargo.env(
539540
"RUSTDOCFLAGS",
540541
"--document-private-items \

src/bootstrap/lib.rs

+12-7
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,21 @@ pub enum Mode {
301301
/// Build codegen libraries, placing output in the "stageN-codegen" directory
302302
Codegen,
303303

304-
/// Build some tools, placing output in the "stageN-tools" directory. The
305-
/// "other" here is for miscellaneous sets of tools that are built using the
306-
/// bootstrap compiler in its entirety (target libraries and all).
307-
/// Typically these tools compile with stable Rust.
304+
/// Build a tool, placing output in the "stage0-bootstrap-tools"
305+
/// directory. This is for miscellaneous sets of tools that are built
306+
/// using the bootstrap stage0 compiler in its entirety (target libraries
307+
/// and all). Typically these tools compile with stable Rust.
308308
ToolBootstrap,
309309

310-
/// Compile a tool which uses all libraries we compile (up to rustc).
311-
/// Doesn't use the stage0 compiler libraries like "other", and includes
312-
/// tools like rustdoc, cargo, rls, etc.
310+
/// Build a tool which uses the locally built std, placing output in the
311+
/// "stageN-tools" directory. Its usage is quite rare, mainly used by
312+
/// compiletest which needs libtest.
313313
ToolStd,
314+
315+
/// Build a tool which uses the locally built rustc and the target std,
316+
/// placing the output in the "stageN-tools" directory. This is used for
317+
/// anything that needs a fully functional rustc, such as rustdoc, clippy,
318+
/// cargo, rls, rustfmt, miri, etc.
314319
ToolRustc,
315320
}
316321

src/bootstrap/test.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ impl Step for Miri {
367367
extra_features: Vec::new(),
368368
});
369369
if let (Some(miri), Some(_cargo_miri)) = (miri, cargo_miri) {
370-
let mut cargo = builder.cargo(compiler, Mode::ToolRustc, host, "install");
370+
let mut cargo =
371+
builder.cargo(compiler, Mode::ToolRustc, SourceType::Submodule, host, "install");
371372
cargo.arg("xargo");
372373
// Configure `cargo install` path. cargo adds a `bin/`.
373374
cargo.env("CARGO_INSTALL_ROOT", &builder.out);
@@ -1696,7 +1697,8 @@ impl Step for Crate {
16961697
// we're working with automatically.
16971698
let compiler = builder.compiler_for(compiler.stage, compiler.host, target);
16981699

1699-
let mut cargo = builder.cargo(compiler, mode, target, test_kind.subcommand());
1700+
let mut cargo =
1701+
builder.cargo(compiler, mode, SourceType::InTree, target, test_kind.subcommand());
17001702
match mode {
17011703
Mode::Std => {
17021704
compile::std_cargo(builder, target, compiler.stage, &mut cargo);

src/bootstrap/tool.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::util::{add_dylib_path, exe, CiEnv};
1616
use crate::Compiler;
1717
use crate::Mode;
1818

19-
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
19+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2020
pub enum SourceType {
2121
InTree,
2222
Submodule,
@@ -226,14 +226,10 @@ pub fn prepare_tool_cargo(
226226
source_type: SourceType,
227227
extra_features: &[String],
228228
) -> CargoCommand {
229-
let mut cargo = builder.cargo(compiler, mode, target, command);
229+
let mut cargo = builder.cargo(compiler, mode, source_type, target, command);
230230
let dir = builder.src.join(path);
231231
cargo.arg("--manifest-path").arg(dir.join("Cargo.toml"));
232232

233-
if source_type == SourceType::Submodule {
234-
cargo.env("RUSTC_EXTERNAL_TOOL", "1");
235-
}
236-
237233
let mut features = extra_features.to_vec();
238234
if builder.build.config.cargo_native_static {
239235
if path.ends_with("cargo")
@@ -596,6 +592,7 @@ macro_rules! tool_extended {
596592
$path:expr,
597593
$tool_name:expr,
598594
stable = $stable:expr,
595+
$(in_tree = $in_tree:expr,)*
599596
$extra_deps:block;)+) => {
600597
$(
601598
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
@@ -647,7 +644,11 @@ macro_rules! tool_extended {
647644
path: $path,
648645
extra_features: $sel.extra_features,
649646
is_optional_tool: true,
650-
source_type: SourceType::Submodule,
647+
source_type: if false $(|| $in_tree)* {
648+
SourceType::InTree
649+
} else {
650+
SourceType::Submodule
651+
},
651652
})
652653
}
653654
}
@@ -659,8 +660,8 @@ macro_rules! tool_extended {
659660
// to make `./x.py build <tool>` work.
660661
tool_extended!((self, builder),
661662
Cargofmt, rustfmt, "src/tools/rustfmt", "cargo-fmt", stable=true, {};
662-
CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", stable=true, {};
663-
Clippy, clippy, "src/tools/clippy", "clippy-driver", stable=true, {};
663+
CargoClippy, clippy, "src/tools/clippy", "cargo-clippy", stable=true, in_tree=true, {};
664+
Clippy, clippy, "src/tools/clippy", "clippy-driver", stable=true, in_tree=true, {};
664665
Miri, miri, "src/tools/miri", "miri", stable=false, {};
665666
CargoMiri, miri, "src/tools/miri/cargo-miri", "cargo-miri", stable=false, {};
666667
Rls, rls, "src/tools/rls", "rls", stable=true, {

src/doc/unstable-book/src/library-features/asm.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ Here is the list of currently supported register classes:
474474
| AArch64 | `reg` | `x[0-28]`, `x30` | `r` |
475475
| AArch64 | `vreg` | `v[0-31]` | `w` |
476476
| AArch64 | `vreg_low16` | `v[0-15]` | `x` |
477-
| ARM | `reg` | `r[0-r10]`, `r12`, `r14` | `r` |
477+
| ARM | `reg` | `r[0-5]` `r7`\*, `r[8-10]`, `r11`\*, `r12`, `r14` | `r` |
478478
| ARM (Thumb) | `reg_thumb` | `r[0-r7]` | `l` |
479479
| ARM (ARM) | `reg_thumb` | `r[0-r10]`, `r12`, `r14` | `l` |
480480
| ARM | `sreg` | `s[0-31]` | `t` |
@@ -497,6 +497,8 @@ Here is the list of currently supported register classes:
497497
> Note #2: On x86-64 the high byte registers (e.g. `ah`) are only available when used as an explicit register. Specifying the `reg_byte` register class for an operand will always allocate a low byte register.
498498
>
499499
> Note #3: NVPTX doesn't have a fixed register set, so named registers are not supported.
500+
>
501+
> Note #4: On ARM the frame pointer is either `r7` or `r11` depending on the platform.
500502
501503
Additional register classes may be added in the future based on demand (e.g. MMX, x87, etc).
502504

@@ -591,7 +593,9 @@ Some registers cannot be used for input or output operands:
591593
| Architecture | Unsupported register | Reason |
592594
| ------------ | -------------------- | ------ |
593595
| All | `sp` | The stack pointer must be restored to its original value at the end of an asm code block. |
594-
| All | `bp` (x86), `r11` (ARM), `x29` (AArch64), `x8` (RISC-V), `fr` (Hexagon) | The frame pointer cannot be used as an input or output. |
596+
| All | `bp` (x86), `x29` (AArch64), `x8` (RISC-V), `fr` (Hexagon) | The frame pointer cannot be used as an input or output. |
597+
| ARM | `r7` or `r11` | On ARM the frame pointer can be either `r7` or `r11` depending on the target. The frame pointer cannot be used as an input or output. |
598+
| ARM | `r6` | `r6` is used internally by LLVM as a base pointer and therefore cannot be used as an input or output. |
595599
| x86 | `k0` | This is a constant zero register which can't be modified. |
596600
| x86 | `ip` | This is the program counter, not a real register. |
597601
| x86 | `mm[0-7]` | MMX registers are not currently supported (but may be in the future). |

src/liballoc/benches/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Disabling on android for the time being
2+
// See https://github.com/rust-lang/rust/issues/73535#event-3477699747
3+
#![cfg(not(target_os = "android"))]
14
#![feature(btree_drain_filter)]
25
#![feature(map_first_last)]
36
#![feature(repr_simd)]

src/libcore/slice/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2817,6 +2817,7 @@ pub trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
28172817
/// performing any bounds checking.
28182818
/// Calling this method with an out-of-bounds index is *[undefined behavior]*
28192819
/// even if the resulting reference is not used.
2820+
///
28202821
/// [undefined behavior]: ../../reference/behavior-considered-undefined.html
28212822
#[unstable(feature = "slice_index_methods", issue = "none")]
28222823
unsafe fn get_unchecked(self, slice: &T) -> &Self::Output;
@@ -2825,6 +2826,7 @@ pub trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
28252826
/// performing any bounds checking.
28262827
/// Calling this method with an out-of-bounds index is *[undefined behavior]*
28272828
/// even if the resulting reference is not used.
2829+
///
28282830
/// [undefined behavior]: ../../reference/behavior-considered-undefined.html
28292831
#[unstable(feature = "slice_index_methods", issue = "none")]
28302832
unsafe fn get_unchecked_mut(self, slice: &mut T) -> &mut Self::Output;

0 commit comments

Comments
 (0)