@@ -6,7 +6,7 @@ use crate::core::{profiles::ProfileRoot, PackageId};
6
6
use crate :: util:: errors:: CargoResult ;
7
7
use crate :: util:: machine_message:: { self , Message } ;
8
8
use crate :: util:: { internal, profile} ;
9
- use anyhow:: Context as _;
9
+ use anyhow:: { bail , Context as _} ;
10
10
use cargo_platform:: Cfg ;
11
11
use cargo_util:: paths;
12
12
use std:: collections:: hash_map:: { Entry , HashMap } ;
@@ -543,7 +543,7 @@ impl BuildOutput {
543
543
let ( key, value) = match ( key, value) {
544
544
( Some ( a) , Some ( b) ) => ( a, b. trim_end ( ) ) ,
545
545
// Line started with `cargo:` but didn't match `key=value`.
546
- _ => anyhow :: bail!( "Wrong output in {}: `{}`" , whence, line) ,
546
+ _ => bail ! ( "Wrong output in {}: `{}`" , whence, line) ,
547
547
} ;
548
548
549
549
// This will rewrite paths if the target directory has been moved.
@@ -552,7 +552,7 @@ impl BuildOutput {
552
552
script_out_dir. to_str ( ) . unwrap ( ) ,
553
553
) ;
554
554
555
- // Keep in sync with TargetConfig::new .
555
+ // Keep in sync with TargetConfig::parse_links_overrides .
556
556
match key {
557
557
"rustc-flags" => {
558
558
let ( paths, links) = BuildOutput :: parse_rustc_flags ( & value, & whence) ?;
@@ -632,7 +632,7 @@ impl BuildOutput {
632
632
} else {
633
633
// Setting RUSTC_BOOTSTRAP would change the behavior of the crate.
634
634
// Abort with an error.
635
- anyhow :: bail!( "Cannot set `RUSTC_BOOTSTRAP={}` from {}.\n \
635
+ bail ! ( "Cannot set `RUSTC_BOOTSTRAP={}` from {}.\n \
636
636
note: Crates cannot set `RUSTC_BOOTSTRAP` themselves, as doing so would subvert the stability guarantees of Rust for your project.\n \
637
637
help: If you're sure you want to do this in your project, set the environment variable `RUSTC_BOOTSTRAP={}` before running cargo instead.",
638
638
val,
@@ -683,7 +683,7 @@ impl BuildOutput {
683
683
if value. is_empty ( ) {
684
684
value = match flags_iter. next ( ) {
685
685
Some ( v) => v,
686
- None => anyhow :: bail! {
686
+ None => bail ! {
687
687
"Flag in rustc-flags has no value in {}: {}" ,
688
688
whence,
689
689
value
@@ -699,7 +699,7 @@ impl BuildOutput {
699
699
_ => unreachable ! ( ) ,
700
700
} ;
701
701
} else {
702
- anyhow :: bail!(
702
+ bail ! (
703
703
"Only `-l` and `-L` flags are allowed in {}: `{}`" ,
704
704
whence,
705
705
value
@@ -715,7 +715,7 @@ impl BuildOutput {
715
715
let val = iter. next ( ) ;
716
716
match ( name, val) {
717
717
( Some ( n) , Some ( v) ) => Ok ( ( n. to_owned ( ) , v. to_owned ( ) ) ) ,
718
- _ => anyhow :: bail!( "Variable rustc-env has no value in {}: {}" , whence, value) ,
718
+ _ => bail ! ( "Variable rustc-env has no value in {}: {}" , whence, value) ,
719
719
}
720
720
}
721
721
}
0 commit comments