diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index bc275b7fc745c2b903aca80eec1cc71b5d757345..a8b43ad3c3080f7e015eb0508a293f599b49ab91 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -21,9 +21,10 @@ use std::collections::HashMap; use std::env; use std::ffi::{OsString, OsStr}; -use std::fs; -use std::process::Command; +use std::fs::{self, File}; +use std::io::Read; use std::path::PathBuf; +use std::process::Command; use build_helper::output; @@ -234,4 +235,14 @@ pub fn check(build: &mut Build) { if let Some(ref s) = build.config.ccache { cmd_finder.must_have(s); } + + if build.config.channel == "stable" { + let mut stage0 = String::new(); + t!(t!(File::open(build.src.join("src/stage0.txt"))) + .read_to_string(&mut stage0)); + if stage0.contains("\ndev:") { + panic!("bootstrapping from a dev compiler in a stable release, but \ + should only be bootstrapping from a released compiler!"); + } + } }