Skip to content

Commit

Permalink
boostrap: dist: if a file cannot be installed because it does not exi…
Browse files Browse the repository at this point in the history
…st, print its name in the error message.
  • Loading branch information
matthiaskrgr committed Oct 13, 2018
1 parent 8f19cad commit da1c75c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,9 @@ impl Build {
t!(fs::create_dir_all(dstdir));
drop(fs::remove_file(&dst));
{
if !src.exists() {
panic!("Error: File \"{}\" not found!", src.display());
}
let mut s = t!(fs::File::open(&src));
let mut d = t!(fs::File::create(&dst));
io::copy(&mut s, &mut d).expect("failed to copy");
Expand Down

0 comments on commit da1c75c

Please sign in to comment.