@@ -98,7 +98,8 @@ pub struct Cargo {
98
98
}
99
99
100
100
impl Cargo {
101
- /// Calls `Builder::cargo` and `Cargo::configure_linker` to prepare an invocation of `cargo` to be run.
101
+ /// Calls [`Builder::cargo`] and [`Cargo::configure_linker`] to prepare an invocation of `cargo`
102
+ /// to be run.
102
103
pub fn new (
103
104
builder : & Builder < ' _ > ,
104
105
compiler : Compiler ,
@@ -125,7 +126,8 @@ impl Cargo {
125
126
self . into ( )
126
127
}
127
128
128
- /// Same as `Cargo::new` except this one doesn't configure the linker with `Cargo::configure_linker`
129
+ /// Same as [`Cargo::new`] except this one doesn't configure the linker with
130
+ /// [`Cargo::configure_linker`].
129
131
pub fn new_for_mir_opt_tests (
130
132
builder : & Builder < ' _ > ,
131
133
compiler : Compiler ,
@@ -163,8 +165,10 @@ impl Cargo {
163
165
self
164
166
}
165
167
168
+ /// Add an env var to the cargo command instance. Note that `RUSTFLAGS`/`RUSTDOCFLAGS` must go
169
+ /// through [`Cargo::rustdocflags`] and [`Cargo::rustflags`] because inconsistent `RUSTFLAGS`
170
+ /// and `RUSTDOCFLAGS` usages will trigger spurious rebuilds.
166
171
pub fn env ( & mut self , key : impl AsRef < OsStr > , value : impl AsRef < OsStr > ) -> & mut Cargo {
167
- // These are managed through rustflag/rustdocflag interfaces.
168
172
assert_ne ! ( key. as_ref( ) , "RUSTFLAGS" ) ;
169
173
assert_ne ! ( key. as_ref( ) , "RUSTDOCFLAGS" ) ;
170
174
self . command . env ( key. as_ref ( ) , value. as_ref ( ) ) ;
@@ -182,8 +186,8 @@ impl Cargo {
182
186
183
187
/// Adds nightly-only features that this invocation is allowed to use.
184
188
///
185
- /// By default, all nightly features are allowed. Once this is called, it
186
- /// will be restricted to the given set.
189
+ /// By default, all nightly features are allowed. Once this is called, it will be restricted to
190
+ /// the given set.
187
191
pub fn allow_features ( & mut self , features : & str ) -> & mut Cargo {
188
192
if !self . allow_features . is_empty ( ) {
189
193
self . allow_features . push ( ',' ) ;
@@ -351,7 +355,7 @@ impl From<Cargo> for BootstrapCommand {
351
355
}
352
356
353
357
impl Builder < ' _ > {
354
- /// Like ` cargo`, but only passes flags that are valid for all commands.
358
+ /// Like [`Builder:: cargo`] , but only passes flags that are valid for all commands.
355
359
pub fn bare_cargo (
356
360
& self ,
357
361
compiler : Compiler ,
@@ -429,12 +433,11 @@ impl Builder<'_> {
429
433
cargo
430
434
}
431
435
432
- /// This will create a `Command` that represents a pending execution of
433
- /// Cargo. This cargo will be configured to use `compiler` as the actual
434
- /// rustc compiler, its output will be scoped by `mode`'s output directory,
435
- /// it will pass the `--target` flag for the specified `target`, and will be
436
- /// executing the Cargo command `cmd`. `cmd` can be `miri-cmd` for commands
437
- /// to be run with Miri.
436
+ /// This will create a [`BootstrapCommand`] that represents a pending execution of cargo. This
437
+ /// cargo will be configured to use `compiler` as the actual rustc compiler, its output will be
438
+ /// scoped by `mode`'s output directory, it will pass the `--target` flag for the specified
439
+ /// `target`, and will be executing the Cargo command `cmd`. `cmd` can be `miri-cmd` for
440
+ /// commands to be run with Miri.
438
441
fn cargo (
439
442
& self ,
440
443
compiler : Compiler ,
0 commit comments