Skip to content

Commit 34c42c8

Browse files
committed
do not allow stage > 0 on x fmt
Signed-off-by: onur-ozkan <[email protected]>
1 parent 3ef8e64 commit 34c42c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bootstrap/src/core/build_steps/format.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::sync::mpsc::SyncSender;
99
use build_helper::git::get_git_modified_files;
1010
use ignore::WalkBuilder;
1111

12-
use crate::core::builder::Builder;
12+
use crate::core::builder::{Builder, Kind};
1313
use crate::utils::build_stamp::BuildStamp;
1414
use crate::utils::exec::command;
1515
use crate::utils::helpers::{self, t};
@@ -122,6 +122,11 @@ fn print_paths(verb: &str, adjective: Option<&str>, paths: &[String]) {
122122
}
123123

124124
pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
125+
if build.kind == Kind::Format && build.top_stage != 0 {
126+
eprintln!("ERROR: `x fmt` only supports stage 0.");
127+
crate::exit!(1);
128+
}
129+
125130
if !paths.is_empty() {
126131
eprintln!(
127132
"fmt error: path arguments are no longer accepted; use `--all` to format everything"

0 commit comments

Comments
 (0)