Skip to content

Commit

Permalink
Download rustc component for rustfmt toolchain as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Jan 31, 2023
1 parent 5b08c9f commit 652f79e
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 74 deletions.
18 changes: 9 additions & 9 deletions compiler/rustc_const_eval/src/interpret/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ use super::{
use crate::const_eval;

pub trait CompileTimeMachine<'mir, 'tcx, T> = Machine<
'mir,
'tcx,
MemoryKind = T,
Provenance = AllocId,
ExtraFnVal = !,
FrameExtra = (),
AllocExtra = (),
MemoryMap = FxIndexMap<AllocId, (MemoryKind<T>, Allocation)>,
>;
'mir,
'tcx,
MemoryKind = T,
Provenance = AllocId,
ExtraFnVal = !,
FrameExtra = (),
AllocExtra = (),
MemoryMap = FxIndexMap<AllocId, (MemoryKind<T>, Allocation)>,
>;

struct InternVisitor<'rt, 'mir, 'tcx, M: CompileTimeMachine<'mir, 'tcx, const_eval::MemoryKind>> {
/// The ectx from which we intern.
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_data_structures/src/obligation_forest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ pub trait ForestObligation: Clone + Debug {
pub trait ObligationProcessor {
type Obligation: ForestObligation;
type Error: Debug;
type OUT: OutcomeTrait<
Obligation = Self::Obligation,
Error = Error<Self::Obligation, Self::Error>,
>;
type OUT: OutcomeTrait<Obligation = Self::Obligation, Error = Error<Self::Obligation, Self::Error>>;

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

Expand Down
20 changes: 16 additions & 4 deletions src/bootstrap/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,27 @@ impl Config {
let channel = format!("{version}-{date}");

let host = self.build;
let rustfmt_path = self.initial_rustc.with_file_name(exe("rustfmt", host));
let bin_root = self.out.join(host.triple).join("stage0");
let bin_root = self.out.join(host.triple).join("rustfmt");
let rustfmt_path = bin_root.join("bin").join(exe("rustfmt", host));
let rustfmt_stamp = bin_root.join(".rustfmt-stamp");
if rustfmt_path.exists() && !program_out_of_date(&rustfmt_stamp, &channel) {
return Some(rustfmt_path);
}

let filename = format!("rustfmt-{version}-{build}.tar.xz", build = host.triple);
self.download_component(DownloadSource::Dist, filename, "rustfmt-preview", &date, "stage0");
self.download_component(
DownloadSource::Dist,
format!("rustfmt-{version}-{build}.tar.xz", build = host.triple),
"rustfmt-preview",
&date,
"rustfmt",
);
self.download_component(
DownloadSource::Dist,
format!("rustc-{version}-{build}.tar.xz", build = host.triple),
"rustc",
&date,
"rustfmt",
);

self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt"));
self.fix_bin_or_dylib(&bin_root.join("bin").join("cargo-fmt"));
Expand Down
Loading

0 comments on commit 652f79e

Please sign in to comment.