Skip to content

Commit 652f79e

Browse files
Download rustc component for rustfmt toolchain as well
1 parent 5b08c9f commit 652f79e

File tree

5 files changed

+137
-74
lines changed

5 files changed

+137
-74
lines changed

compiler/rustc_const_eval/src/interpret/intern.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ use super::{
3030
use crate::const_eval;
3131

3232
pub trait CompileTimeMachine<'mir, 'tcx, T> = Machine<
33-
'mir,
34-
'tcx,
35-
MemoryKind = T,
36-
Provenance = AllocId,
37-
ExtraFnVal = !,
38-
FrameExtra = (),
39-
AllocExtra = (),
40-
MemoryMap = FxIndexMap<AllocId, (MemoryKind<T>, Allocation)>,
41-
>;
33+
'mir,
34+
'tcx,
35+
MemoryKind = T,
36+
Provenance = AllocId,
37+
ExtraFnVal = !,
38+
FrameExtra = (),
39+
AllocExtra = (),
40+
MemoryMap = FxIndexMap<AllocId, (MemoryKind<T>, Allocation)>,
41+
>;
4242

4343
struct InternVisitor<'rt, 'mir, 'tcx, M: CompileTimeMachine<'mir, 'tcx, const_eval::MemoryKind>> {
4444
/// The ectx from which we intern.

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,7 @@ pub trait ForestObligation: Clone + Debug {
9595
pub trait ObligationProcessor {
9696
type Obligation: ForestObligation;
9797
type Error: Debug;
98-
type OUT: OutcomeTrait<
99-
Obligation = Self::Obligation,
100-
Error = Error<Self::Obligation, Self::Error>,
101-
>;
98+
type OUT: OutcomeTrait<Obligation = Self::Obligation, Error = Error<Self::Obligation, Self::Error>>;
10299

103100
fn needs_process_obligation(&self, obligation: &Self::Obligation) -> bool;
104101

src/bootstrap/download.rs

+16-4
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,27 @@ impl Config {
318318
let channel = format!("{version}-{date}");
319319

320320
let host = self.build;
321-
let rustfmt_path = self.initial_rustc.with_file_name(exe("rustfmt", host));
322-
let bin_root = self.out.join(host.triple).join("stage0");
321+
let bin_root = self.out.join(host.triple).join("rustfmt");
322+
let rustfmt_path = bin_root.join("bin").join(exe("rustfmt", host));
323323
let rustfmt_stamp = bin_root.join(".rustfmt-stamp");
324324
if rustfmt_path.exists() && !program_out_of_date(&rustfmt_stamp, &channel) {
325325
return Some(rustfmt_path);
326326
}
327327

328-
let filename = format!("rustfmt-{version}-{build}.tar.xz", build = host.triple);
329-
self.download_component(DownloadSource::Dist, filename, "rustfmt-preview", &date, "stage0");
328+
self.download_component(
329+
DownloadSource::Dist,
330+
format!("rustfmt-{version}-{build}.tar.xz", build = host.triple),
331+
"rustfmt-preview",
332+
&date,
333+
"rustfmt",
334+
);
335+
self.download_component(
336+
DownloadSource::Dist,
337+
format!("rustc-{version}-{build}.tar.xz", build = host.triple),
338+
"rustc",
339+
&date,
340+
"rustfmt",
341+
);
330342

331343
self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt"));
332344
self.fix_bin_or_dylib(&bin_root.join("bin").join("cargo-fmt"));

0 commit comments

Comments
 (0)