@@ -27,7 +27,8 @@ pub struct Cargo {
27
27
}
28
28
29
29
impl Cargo {
30
- /// Calls `Builder::cargo` and `Cargo::configure_linker` to prepare an invocation of `cargo` to be run.
30
+ /// Calls [`Builder::cargo`] and [`Cargo::configure_linker`] to prepare an invocation of `cargo`
31
+ /// to be run.
31
32
pub fn new (
32
33
builder : & Builder < ' _ > ,
33
34
compiler : Compiler ,
@@ -54,7 +55,8 @@ impl Cargo {
54
55
self . into ( )
55
56
}
56
57
57
- /// Same as `Cargo::new` except this one doesn't configure the linker with `Cargo::configure_linker`
58
+ /// Same as [`Cargo::new`] except this one doesn't configure the linker with
59
+ /// [`Cargo::configure_linker`].
58
60
pub fn new_for_mir_opt_tests (
59
61
builder : & Builder < ' _ > ,
60
62
compiler : Compiler ,
@@ -92,8 +94,10 @@ impl Cargo {
92
94
self
93
95
}
94
96
97
+ /// Add an env var to the cargo command instance. Note that `RUSTFLAGS`/`RUSTDOCFLAGS` must go
98
+ /// through [`Cargo::rustdocflags`] and [`Cargo::rustflags`] because inconsistent `RUSTFLAGS`
99
+ /// and `RUSTDOCFLAGS` usages will trigger spurious rebuilds.
95
100
pub fn env ( & mut self , key : impl AsRef < OsStr > , value : impl AsRef < OsStr > ) -> & mut Cargo {
96
- // These are managed through rustflag/rustdocflag interfaces.
97
101
assert_ne ! ( key. as_ref( ) , "RUSTFLAGS" ) ;
98
102
assert_ne ! ( key. as_ref( ) , "RUSTDOCFLAGS" ) ;
99
103
self . command . env ( key. as_ref ( ) , value. as_ref ( ) ) ;
@@ -111,8 +115,8 @@ impl Cargo {
111
115
112
116
/// Adds nightly-only features that this invocation is allowed to use.
113
117
///
114
- /// By default, all nightly features are allowed. Once this is called, it
115
- /// will be restricted to the given set.
118
+ /// By default, all nightly features are allowed. Once this is called, it will be restricted to
119
+ /// the given set.
116
120
pub fn allow_features ( & mut self , features : & str ) -> & mut Cargo {
117
121
if !self . allow_features . is_empty ( ) {
118
122
self . allow_features . push ( ',' ) ;
@@ -280,7 +284,7 @@ impl From<Cargo> for BootstrapCommand {
280
284
}
281
285
282
286
impl Builder < ' _ > {
283
- /// Like ` cargo`, but only passes flags that are valid for all commands.
287
+ /// Like [`Builder:: cargo`] , but only passes flags that are valid for all commands.
284
288
pub fn bare_cargo (
285
289
& self ,
286
290
compiler : Compiler ,
@@ -358,12 +362,11 @@ impl Builder<'_> {
358
362
cargo
359
363
}
360
364
361
- /// This will create a `Command` that represents a pending execution of
362
- /// Cargo. This cargo will be configured to use `compiler` as the actual
363
- /// rustc compiler, its output will be scoped by `mode`'s output directory,
364
- /// it will pass the `--target` flag for the specified `target`, and will be
365
- /// executing the Cargo command `cmd`. `cmd` can be `miri-cmd` for commands
366
- /// to be run with Miri.
365
+ /// This will create a [`BootstrapCommand`] that represents a pending execution of cargo. This
366
+ /// cargo will be configured to use `compiler` as the actual rustc compiler, its output will be
367
+ /// scoped by `mode`'s output directory, it will pass the `--target` flag for the specified
368
+ /// `target`, and will be executing the Cargo command `cmd`. `cmd` can be `miri-cmd` for
369
+ /// commands to be run with Miri.
367
370
fn cargo (
368
371
& self ,
369
372
compiler : Compiler ,
0 commit comments