Skip to content

Rollup of 14 pull requests #130010

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1ef4f5d
clarify that addr_of creates read-only pointers
RalfJung Aug 27, 2024
b5bd0fe
addr_of on places derived from raw pointers should preserve permissions
RalfJung Aug 27, 2024
21edc73
bootstrap: Try to track down why `initial_libdir` sometimes fails
Zalathar Aug 30, 2024
39e3add
Make `./x.py <cmd> compiler/<crate>` aware of the crate's features
Veykril Aug 30, 2024
0402394
Add an internal lint that warns when accessing untracked data
Nadrieril Aug 9, 2024
b5d07fd
copy rustc rustlib artifacts from ci-rustc
onur-ozkan Sep 3, 2024
98f74b4
explain why Rvalue::Len still exists
RalfJung Sep 3, 2024
f3efe3d
Add compat note for trait solver change
Mark-Simulacrum Sep 3, 2024
e2484be
docs: add digit separators in `Duration` examples
LiterallyVoid Sep 3, 2024
4df28b8
forward linker option to lint-docs
chenx97 Sep 4, 2024
93b4b2d
Temporarily remove fmease from the review rotation
fmease Sep 4, 2024
f7679d0
propagate `tainted_by_errors` in `MirBorrowckCtxt::emit_errors`
folkertdev Sep 4, 2024
49e3b9a
fix ICE when `asm_const` and `const_refs_to_static` are combined
folkertdev Aug 23, 2024
e8472e8
Check unnormalized signature on pointer cast
compiler-errors Aug 13, 2024
67804c5
Adjust tests
compiler-errors Aug 25, 2024
a551ccc
Remove wasm32-wasip2's tier 2 status from release notes
alexcrichton Sep 5, 2024
f6e8a84
Make `Ty::boxed_ty` return an `Option`
GrigorenkoPV Sep 4, 2024
1acf3ad
Rollup merge of #128919 - Nadrieril:lint-query-leaks, r=cjgillot
workingjubilee Sep 6, 2024
26c61fa
Rollup merge of #129021 - compiler-errors:ptr-cast-outlives, r=lcnr
workingjubilee Sep 6, 2024
d72feff
Rollup merge of #129472 - folkertdev:const-refs-to-static-asm-const, …
workingjubilee Sep 6, 2024
7ef8e13
Rollup merge of #129653 - RalfJung:addr-of-read-only, r=scottmcm
workingjubilee Sep 6, 2024
fc7b063
Rollup merge of #129775 - Zalathar:initial-libdir, r=albertlarsan68
workingjubilee Sep 6, 2024
0c5c4a7
Rollup merge of #129781 - Veykril:lw-x-py-compiler-features, r=albert…
workingjubilee Sep 6, 2024
9764c4e
Rollup merge of #129939 - RalfJung:rvalue-len, r=compiler-errors
workingjubilee Sep 6, 2024
c8106c3
Rollup merge of #129942 - onur-ozkan:building-rustc-tools, r=Kobzol
workingjubilee Sep 6, 2024
4ff170c
Rollup merge of #129944 - Mark-Simulacrum:relnotes-tweak, r=pietroalbini
workingjubilee Sep 6, 2024
3859f67
Rollup merge of #129947 - LiterallyVoid:duration-docs-digit-separator…
workingjubilee Sep 6, 2024
9f67f07
Rollup merge of #129955 - fmease:fmease-break, r=fmease
workingjubilee Sep 6, 2024
a125ac0
Rollup merge of #129957 - chenx97:lint-docs-linker-opt, r=albertlarsan68
workingjubilee Sep 6, 2024
9481bfe
Rollup merge of #129969 - GrigorenkoPV:boxed-ty, r=compiler-errors
workingjubilee Sep 6, 2024
5731877
Rollup merge of #129995 - alexcrichton:remove-wasm32-wasip2-release-n…
workingjubilee Sep 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make ./x.py <cmd> compiler/<crate> aware of the crate's features
  • Loading branch information
Veykril committed Aug 30, 2024
commit 39e3adda53a01a90056392c1d75308a48a40024b
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl Step for Rustc {
self.override_build_kind.unwrap_or(builder.kind),
);

rustc_cargo(builder, &mut cargo, target, &compiler);
rustc_cargo(builder, &mut cargo, target, &compiler, &self.crates);

// For ./x.py clippy, don't run with --all-targets because
// linting tests and benchmarks can produce very noisy results
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/clippy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl Step for Rustc {
Kind::Clippy,
);

rustc_cargo(builder, &mut cargo, target, &compiler);
rustc_cargo(builder, &mut cargo, target, &compiler, &self.crates);

// Explicitly pass -p for all compiler crates -- this will force cargo
// to also lint the tests/benches/examples for these crates, rather
Expand Down
5 changes: 3 additions & 2 deletions src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ impl Step for Rustc {
Kind::Build,
);

rustc_cargo(builder, &mut cargo, target, &compiler);
rustc_cargo(builder, &mut cargo, target, &compiler, &self.crates);

// NB: all RUSTFLAGS should be added to `rustc_cargo()` so they will be
// consistently applied by check/doc/test modes too.
Expand Down Expand Up @@ -1042,10 +1042,11 @@ pub fn rustc_cargo(
cargo: &mut Cargo,
target: TargetSelection,
compiler: &Compiler,
crates: &[String],
) {
cargo
.arg("--features")
.arg(builder.rustc_features(builder.kind, target))
.arg(builder.rustc_features(builder.kind, target, crates))
.arg("--manifest-path")
.arg(builder.src.join("compiler/rustc/Cargo.toml"));

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ impl Step for Rustc {
// see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
// cargo.rustdocflag("--generate-link-to-definition");

compile::rustc_cargo(builder, &mut cargo, target, &compiler);
compile::rustc_cargo(builder, &mut cargo, target, &compiler, &self.crates);
cargo.arg("-Zskip-rustdoc-fingerprint");

// Only include compiler crates, no dependencies of those, such as `libc`.
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2692,7 +2692,7 @@ impl Step for Crate {
}
}
Mode::Rustc => {
compile::rustc_cargo(builder, &mut cargo, target, &compiler);
compile::rustc_cargo(builder, &mut cargo, target, &compiler, &self.crates);
}
_ => panic!("can only test libraries"),
};
Expand Down
10 changes: 9 additions & 1 deletion src/bootstrap/src/core/metadata.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::collections::BTreeMap;
use std::path::PathBuf;

use serde_derive::Deserialize;
Expand All @@ -21,6 +22,7 @@ struct Package {
manifest_path: String,
dependencies: Vec<Dependency>,
targets: Vec<Target>,
features: BTreeMap<String, Vec<String>>,
}

/// For more information, see the output of
Expand Down Expand Up @@ -51,7 +53,13 @@ pub fn build(build: &mut Build) {
.map(|dep| dep.name)
.collect();
let has_lib = package.targets.iter().any(|t| t.kind.iter().any(|k| k == "lib"));
let krate = Crate { name: name.clone(), deps, path, has_lib };
let krate = Crate {
name: name.clone(),
deps,
path,
has_lib,
features: package.features.keys().cloned().collect(),
};
let relative_path = krate.local_path(build);
build.crates.insert(name.clone(), krate);
let existing_path = build.crate_paths.insert(relative_path, name);
Expand Down
19 changes: 14 additions & 5 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ struct Crate {
deps: HashSet<String>,
path: PathBuf,
has_lib: bool,
features: Vec<String>,
}

impl Crate {
Expand Down Expand Up @@ -666,16 +667,24 @@ impl Build {
}

/// Gets the space-separated set of activated features for the compiler.
fn rustc_features(&self, kind: Kind, target: TargetSelection) -> String {
fn rustc_features(&self, kind: Kind, target: TargetSelection, crates: &[String]) -> String {
let possible_features_by_crates: HashSet<_> = crates
.iter()
.flat_map(|krate| &self.crates[krate].features)
.map(std::ops::Deref::deref)
.collect();
let check = |feature: &str| -> bool {
crates.is_empty() || possible_features_by_crates.contains(feature)
};
let mut features = vec![];
if self.config.jemalloc {
if self.config.jemalloc && check("jemalloc") {
features.push("jemalloc");
}
if self.config.llvm_enabled(target) || kind == Kind::Check {
if (self.config.llvm_enabled(target) || kind == Kind::Check) && check("llvm") {
features.push("llvm");
}
// keep in sync with `bootstrap/compile.rs:rustc_cargo_env`
if self.config.rustc_parallel {
if self.config.rustc_parallel && check("rustc_use_parallel_compiler") {
features.push("rustc_use_parallel_compiler");
}

Expand All @@ -684,7 +693,7 @@ impl Build {
// which is everything (including debug/trace/etc.)
// if its unset, if debug_assertions is on, then debug_logging will also be on
// as well as tracing *ignoring* this feature when debug_assertions is on
if !self.config.rust_debug_logging {
if !self.config.rust_debug_logging && check("max_level_info") {
features.push("max_level_info");
}

Expand Down
Loading