Skip to content

Commit ccac98e

Browse files
Auto merge of #147571 - cuviper:beta-next, r=<try>
[beta] backports try-job: x86_64-gnu-distcheck
2 parents 21cd82a + ac49332 commit ccac98e

File tree

14 files changed

+252
-106
lines changed

14 files changed

+252
-106
lines changed

compiler/rustc_attr_parsing/src/attributes/link_attrs.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,14 @@ impl<S: Stage> SingleAttributeParser<S> for LinkSectionParser {
466466
const PATH: &[Symbol] = &[sym::link_section];
467467
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost;
468468
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
469-
const ALLOWED_TARGETS: AllowedTargets =
470-
AllowedTargets::AllowListWarnRest(&[Allow(Target::Static), Allow(Target::Fn)]);
469+
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowListWarnRest(&[
470+
Allow(Target::Static),
471+
Allow(Target::Fn),
472+
Allow(Target::Method(MethodKind::Inherent)),
473+
Allow(Target::Method(MethodKind::Trait { body: false })),
474+
Allow(Target::Method(MethodKind::Trait { body: true })),
475+
Allow(Target::Method(MethodKind::TraitImpl)),
476+
]);
471477
const TEMPLATE: AttributeTemplate = template!(
472478
NameValueStr: "name",
473479
"https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute"

compiler/rustc_trait_selection/src/traits/select/confirmation.rs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -423,19 +423,24 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
423423
constituents.types,
424424
);
425425

426-
// FIXME(coroutine_clone): We could uplift this into `collect_predicates_for_types`
427-
// and do this for `Copy`/`Clone` too, but that's feature-gated so it doesn't really
428-
// matter yet.
429-
for assumption in constituents.assumptions {
430-
let assumption = normalize_with_depth_to(
431-
self,
432-
obligation.param_env,
433-
cause.clone(),
434-
obligation.recursion_depth + 1,
435-
assumption,
436-
&mut obligations,
437-
);
438-
self.infcx.register_region_assumption(assumption);
426+
// Only normalize these goals if `-Zhigher-ranked-assumptions` is enabled, since
427+
// we don't want to cause ourselves to do extra work if we're not even able to
428+
// take advantage of these assumption clauses.
429+
if self.tcx().sess.opts.unstable_opts.higher_ranked_assumptions {
430+
// FIXME(coroutine_clone): We could uplift this into `collect_predicates_for_types`
431+
// and do this for `Copy`/`Clone` too, but that's feature-gated so it doesn't really
432+
// matter yet.
433+
for assumption in constituents.assumptions {
434+
let assumption = normalize_with_depth_to(
435+
self,
436+
obligation.param_env,
437+
cause.clone(),
438+
obligation.recursion_depth + 1,
439+
assumption,
440+
&mut obligations,
441+
);
442+
self.infcx.register_region_assumption(assumption);
443+
}
439444
}
440445

441446
Ok(obligations)

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, cargo: &mut Car
519519
// Query rustc for the deployment target, and the associated env var.
520520
// The env var is one of the standard `*_DEPLOYMENT_TARGET` vars, i.e.
521521
// `MACOSX_DEPLOYMENT_TARGET`, `IPHONEOS_DEPLOYMENT_TARGET`, etc.
522-
let mut cmd = command(builder.rustc(cargo.compiler()));
522+
let mut cmd = builder.rustc_cmd(cargo.compiler());
523523
cmd.arg("--target").arg(target.rustc_target_arg());
524524
cmd.arg("--print=deployment-target");
525525
let output = cmd.run_capture_stdout(builder).stdout();

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ fn generate_target_spec_json_schema(builder: &Builder<'_>, sysroot: &Path) {
625625
// We do this by using the stage 1 compiler, which is always compiled for the host,
626626
// even in a cross build.
627627
let stage1_host = builder.compiler(1, builder.host_target);
628-
let mut rustc = command(builder.rustc(stage1_host)).fail_fast();
628+
let mut rustc = builder.rustc_cmd(stage1_host).fail_fast();
629629
rustc
630630
.env("RUSTC_BOOTSTRAP", "1")
631631
.args(["--print=target-spec-json-schema", "-Zunstable-options"]);

src/bootstrap/src/core/build_steps/synthetic_targets.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use crate::Compiler;
1111
use crate::core::builder::{Builder, ShouldRun, Step};
1212
use crate::core::config::TargetSelection;
13-
use crate::utils::exec::command;
1413

1514
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1615
pub(crate) struct MirOptPanicAbortSyntheticTarget {
@@ -55,7 +54,7 @@ fn create_synthetic_target(
5554
return TargetSelection::create_synthetic(&name, path.to_str().unwrap());
5655
}
5756

58-
let mut cmd = command(builder.rustc(compiler));
57+
let mut cmd = builder.rustc_cmd(compiler);
5958
cmd.arg("--target").arg(base.rustc_target_arg());
6059
cmd.args(["-Zunstable-options", "--print", "target-spec-json"]);
6160

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,6 +3263,8 @@ fn distcheck_plain_source_tarball(builder: &Builder<'_>, plain_src_dir: &Path) {
32633263
.env("GITHUB_ACTIONS", "0")
32643264
.current_dir(plain_src_dir)
32653265
.run(builder);
3266+
// Mitigate pressure on small-capacity disks.
3267+
fs::remove_dir_all(plain_src_dir).unwrap();
32663268
}
32673269

32683270
/// Check that rust-src has all of libstd's dependencies
@@ -3288,6 +3290,8 @@ fn distcheck_rust_src(builder: &Builder<'_>, src_dir: &Path) {
32883290
.arg(&toml)
32893291
.current_dir(src_dir)
32903292
.run(builder);
3293+
// Mitigate pressure on small-capacity disks.
3294+
fs::remove_dir_all(src_dir).unwrap();
32913295
}
32923296

32933297
/// Check that rustc-dev's compiler crate source code can be loaded with `cargo metadata`
@@ -3312,6 +3316,8 @@ fn distcheck_rustc_dev(builder: &Builder<'_>, dir: &Path) {
33123316
.env("RUSTC", &builder.initial_rustc)
33133317
.current_dir(dir)
33143318
.run(builder);
3319+
// Mitigate pressure on small-capacity disks.
3320+
fs::remove_dir_all(dir).unwrap();
33153321
}
33163322

33173323
#[derive(Debug, Clone, PartialEq, Eq, Hash)]

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,10 +722,8 @@ impl Builder<'_> {
722722
// Build proc macros both for the host and the target unless proc-macros are not
723723
// supported by the target.
724724
if target != compiler.host && cmd_kind != Kind::Check {
725-
let mut rustc_cmd = command(self.rustc(compiler));
726-
self.add_rustc_lib_path(compiler, &mut rustc_cmd);
727-
728-
let error = rustc_cmd
725+
let error = self
726+
.rustc_cmd(compiler)
729727
.arg("--target")
730728
.arg(target.rustc_target_arg())
731729
.arg("--print=file-names")

src/bootstrap/src/core/builder/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,14 @@ Alternatively, you can set `build.local-rebuild=true` and use a stage0 compiler
15911591
}
15921592
}
15931593

1594+
/// Gets a command to run the compiler specified, including the dynamic library
1595+
/// path in case the executable has not been build with `rpath` enabled.
1596+
pub fn rustc_cmd(&self, compiler: Compiler) -> BootstrapCommand {
1597+
let mut cmd = command(self.rustc(compiler));
1598+
self.add_rustc_lib_path(compiler, &mut cmd);
1599+
cmd
1600+
}
1601+
15941602
/// Gets the paths to all of the compiler's codegen backends.
15951603
fn codegen_backends(&self, compiler: Compiler) -> impl Iterator<Item = PathBuf> {
15961604
fs::read_dir(self.sysroot_codegen_backends(compiler))

src/llvm-project

Submodule llvm-project updated 68 files
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//@ revisions: stock hr
2+
//@[hr] compile-flags: -Zhigher-ranked-assumptions
3+
//@ edition: 2024
4+
//@ check-pass
5+
6+
// Test that we don't normalize the higher-ranked assumptions of an auto trait goal
7+
// unless we have `-Zhigher-ranked-assumptions`, since obligations that result from
8+
// this normalization may lead to higher-ranked lifetime errors when the flag is not
9+
// enabled.
10+
11+
// Regression test for <https://github.com/rust-lang/rust/issues/147244>.
12+
13+
pub fn a() -> impl Future + Send {
14+
async {
15+
let queries = core::iter::empty().map(Thing::f);
16+
b(queries).await;
17+
}
18+
}
19+
20+
async fn b(queries: impl IntoIterator) {
21+
c(queries).await;
22+
}
23+
24+
fn c<'a, I>(_queries: I) -> impl Future
25+
where
26+
I: IntoIterator,
27+
I::IntoIter: 'a,
28+
{
29+
async {}
30+
}
31+
32+
pub struct Thing<'a>(pub &'a ());
33+
34+
impl Thing<'_> {
35+
fn f(_: &Self) {}
36+
}
37+
38+
fn main() {}

0 commit comments

Comments
 (0)