Skip to content

Commit 0deeea8

Browse files
committed
Remove unnecessary clones, document out_dir
1 parent e4a65b9 commit 0deeea8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/cargo/core/compiler/context/compilation_files.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
191191
/// Returns the directory where the artifacts for the given unit are
192192
/// initially created.
193193
pub fn out_dir(&self, unit: &Unit) -> PathBuf {
194+
// Docscrape units need to have doc/ set as the out_dir so sources for reverse-dependencies
195+
// will be put into doc/ and not into deps/ where the *.examples files are stored.
194196
if unit.mode.is_doc() || unit.mode.is_doc_scrape() {
195197
self.layout(unit.kind).doc().to_path_buf()
196198
} else if unit.mode.is_doc_test() {

src/cargo/ops/cargo_compile.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ impl Packages {
229229
}
230230
}
231231

232-
#[derive(Debug, PartialEq, Eq, Clone)]
232+
#[derive(Debug, PartialEq, Eq)]
233233
pub enum LibRule {
234234
/// Include the library, fail if not present
235235
True,
@@ -239,13 +239,13 @@ pub enum LibRule {
239239
False,
240240
}
241241

242-
#[derive(Debug, Clone)]
242+
#[derive(Debug)]
243243
pub enum FilterRule {
244244
All,
245245
Just(Vec<String>),
246246
}
247247

248-
#[derive(Debug, Clone)]
248+
#[derive(Debug)]
249249
pub enum CompileFilter {
250250
Default {
251251
/// Flag whether targets can be safely skipped when required-features are not satisfied.

0 commit comments

Comments
 (0)