From e26ef01743eedecd7e011a7ef8b2235fb001e3ac Mon Sep 17 00:00:00 2001
From: Eric Huss
Date: Sat, 27 Jul 2019 16:21:24 -0700
Subject: [PATCH 01/29] Refactor resolve `Method`
---
crates/resolver-tests/src/lib.rs | 6 +-
src/cargo/core/compiler/layout.rs | 2 +-
src/cargo/core/resolver/context.rs | 30 ++--
src/cargo/core/resolver/dep_cache.rs | 75 ++++------
src/cargo/core/resolver/encode.rs | 9 ++
src/cargo/core/resolver/mod.rs | 24 ++--
src/cargo/core/resolver/resolve.rs | 20 ++-
src/cargo/core/resolver/types.rs | 50 +++++--
src/cargo/core/workspace.rs | 4 +-
src/cargo/ops/cargo_compile.rs | 14 +-
src/cargo/ops/cargo_doc.rs | 11 +-
src/cargo/ops/cargo_generate_lockfile.rs | 17 ++-
src/cargo/ops/cargo_install.rs | 6 +-
src/cargo/ops/cargo_output_metadata.rs | 12 +-
src/cargo/ops/cargo_package.rs | 7 +-
src/cargo/ops/mod.rs | 3 +-
src/cargo/ops/resolve.rs | 170 ++++++++++++-----------
17 files changed, 248 insertions(+), 212 deletions(-)
diff --git a/crates/resolver-tests/src/lib.rs b/crates/resolver-tests/src/lib.rs
index 6d349a69b..dce94689e 100644
--- a/crates/resolver-tests/src/lib.rs
+++ b/crates/resolver-tests/src/lib.rs
@@ -8,7 +8,7 @@ use std::rc::Rc;
use std::time::Instant;
use cargo::core::dependency::Kind;
-use cargo::core::resolver::{self, Method};
+use cargo::core::resolver::{self, ResolveOpts};
use cargo::core::source::{GitReference, SourceId};
use cargo::core::Resolve;
use cargo::core::{Dependency, PackageId, Registry, Summary};
@@ -175,10 +175,10 @@ pub fn resolve_with_config_raw(
false,
)
.unwrap();
- let method = Method::Everything;
+ let opts = ResolveOpts::everything();
let start = Instant::now();
let resolve = resolver::resolve(
- &[(summary, method)],
+ &[(summary, opts)],
&[],
&mut registry,
&HashSet::new(),
diff --git a/src/cargo/core/compiler/layout.rs b/src/cargo/core/compiler/layout.rs
index cc48a41ad..40140e8ce 100644
--- a/src/cargo/core/compiler/layout.rs
+++ b/src/cargo/core/compiler/layout.rs
@@ -3,7 +3,7 @@
//! The directory layout is a little tricky at times, hence a separate file to
//! house this logic. The current layout looks like this:
//!
-//! ```ignore
+//! ```text
//! # This is the root directory for all output, the top-level package
//! # places all of its output here.
//! target/
diff --git a/src/cargo/core/resolver/context.rs b/src/cargo/core/resolver/context.rs
index 58a86342d..27b9a0585 100644
--- a/src/cargo/core/resolver/context.rs
+++ b/src/cargo/core/resolver/context.rs
@@ -13,7 +13,7 @@ use crate::util::CargoResult;
use crate::util::Graph;
use super::dep_cache::RegistryQueryer;
-use super::types::{ConflictMap, FeaturesSet, Method};
+use super::types::{ConflictMap, FeaturesSet, ResolveOpts};
pub use super::encode::Metadata;
pub use super::encode::{EncodableDependency, EncodablePackageId, EncodableResolve};
@@ -103,11 +103,11 @@ impl Context {
/// cased `summary` to get activated. This may not be present for the root
/// crate, for example.
///
- /// Returns `true` if this summary with the given method is already activated.
+ /// Returns `true` if this summary with the given features is already activated.
pub fn flag_activated(
&mut self,
summary: &Summary,
- method: &Method,
+ opts: &ResolveOpts,
parent: Option<(&Summary, &Dependency)>,
) -> CargoResult {
let id = summary.package_id();
@@ -158,25 +158,21 @@ impl Context {
}
}
debug!("checking if {} is already activated", summary.package_id());
- let (features, use_default) = match method {
- Method::Everything
- | Method::Required {
- all_features: true, ..
- } => return Ok(false),
- Method::Required {
- features,
- uses_default_features,
- ..
- } => (features, uses_default_features),
- };
+ if opts.all_features {
+ return Ok(false);
+ }
let has_default_feature = summary.features().contains_key("default");
Ok(match self.resolve_features.get(&id) {
Some(prev) => {
- features.is_subset(prev)
- && (!use_default || prev.contains("default") || !has_default_feature)
+ opts.features.is_subset(prev)
+ && (!opts.uses_default_features
+ || prev.contains("default")
+ || !has_default_feature)
+ }
+ None => {
+ opts.features.is_empty() && (!opts.uses_default_features || !has_default_feature)
}
- None => features.is_empty() && (!use_default || !has_default_feature),
})
}
diff --git a/src/cargo/core/resolver/dep_cache.rs b/src/cargo/core/resolver/dep_cache.rs
index 58b52a617..e20a78a66 100644
--- a/src/cargo/core/resolver/dep_cache.rs
+++ b/src/cargo/core/resolver/dep_cache.rs
@@ -20,7 +20,7 @@ use crate::core::{Dependency, FeatureValue, PackageId, PackageIdSpec, Registry,
use crate::util::errors::CargoResult;
use crate::core::resolver::types::{ConflictReason, DepInfo, FeaturesSet};
-use crate::core::resolver::{ActivateResult, Method};
+use crate::core::resolver::{ActivateResult, ResolveOpts};
pub struct RegistryQueryer<'a> {
pub registry: &'a mut (dyn Registry + 'a),
@@ -34,7 +34,7 @@ pub struct RegistryQueryer<'a> {
registry_cache: HashMap>>,
/// a cache of `Dependency`s that are required for a `Summary`
summary_cache: HashMap<
- (Option, Summary, Method),
+ (Option, Summary, ResolveOpts),
Rc<(HashSet, Rc>)>,
>,
/// all the cases we ended up using a supplied replacement
@@ -192,20 +192,20 @@ impl<'a> RegistryQueryer<'a> {
}
/// Find out what dependencies will be added by activating `candidate`,
- /// with features described in `method`. Then look up in the `registry`
+ /// with features described in `opts`. Then look up in the `registry`
/// the candidates that will fulfil each of these dependencies, as it is the
/// next obvious question.
pub fn build_deps(
&mut self,
parent: Option,
candidate: &Summary,
- method: &Method,
+ opts: &ResolveOpts,
) -> ActivateResult, Rc>)>> {
// if we have calculated a result before, then we can just return it,
// as it is a "pure" query of its arguments.
if let Some(out) = self
.summary_cache
- .get(&(parent, candidate.clone(), method.clone()))
+ .get(&(parent, candidate.clone(), opts.clone()))
.cloned()
{
return Ok(out);
@@ -213,7 +213,7 @@ impl<'a> RegistryQueryer<'a> {
// First, figure out our set of dependencies based on the requested set
// of features. This also calculates what features we're going to enable
// for our own dependencies.
- let (used_features, deps) = resolve_features(parent, candidate, method)?;
+ let (used_features, deps) = resolve_features(parent, candidate, opts)?;
// Next, transform all dependencies into a list of possible candidates
// which can satisfy that dependency.
@@ -236,7 +236,7 @@ impl<'a> RegistryQueryer<'a> {
// If we succeed we add the result to the cache so we can use it again next time.
// We dont cache the failure cases as they dont impl Clone.
self.summary_cache
- .insert((parent, candidate.clone(), method.clone()), out.clone());
+ .insert((parent, candidate.clone(), opts.clone()), out.clone());
Ok(out)
}
@@ -247,18 +247,13 @@ impl<'a> RegistryQueryer<'a> {
pub fn resolve_features<'b>(
parent: Option,
s: &'b Summary,
- method: &'b Method,
+ opts: &'b ResolveOpts,
) -> ActivateResult<(HashSet, Vec<(Dependency, FeaturesSet)>)> {
- let dev_deps = match *method {
- Method::Everything => true,
- Method::Required { dev_deps, .. } => dev_deps,
- };
-
// First, filter by dev-dependencies.
let deps = s.dependencies();
- let deps = deps.iter().filter(|d| d.is_transitive() || dev_deps);
+ let deps = deps.iter().filter(|d| d.is_transitive() || opts.dev_deps);
- let reqs = build_requirements(s, method)?;
+ let reqs = build_requirements(s, opts)?;
let mut ret = Vec::new();
let mut used_features = HashSet::new();
let default_dep = (false, BTreeSet::new());
@@ -336,52 +331,34 @@ pub fn resolve_features<'b>(
Ok((reqs.into_used(), ret))
}
-/// Takes requested features for a single package from the input `Method` and
+/// Takes requested features for a single package from the input `ResolveOpts` and
/// recurses to find all requested features, dependencies and requested
/// dependency features in a `Requirements` object, returning it to the resolver.
fn build_requirements<'a, 'b: 'a>(
s: &'a Summary,
- method: &'b Method,
+ opts: &'b ResolveOpts,
) -> CargoResult> {
let mut reqs = Requirements::new(s);
- match method {
- Method::Everything
- | Method::Required {
- all_features: true, ..
- } => {
- for key in s.features().keys() {
- reqs.require_feature(*key)?;
- }
- for dep in s.dependencies().iter().filter(|d| d.is_optional()) {
- reqs.require_dependency(dep.name_in_toml());
- }
+ if opts.all_features {
+ for key in s.features().keys() {
+ reqs.require_feature(*key)?;
}
- Method::Required {
- all_features: false,
- features: requested,
- ..
- } => {
- for &f in requested.iter() {
- reqs.require_value(&FeatureValue::new(f, s))?;
- }
+ for dep in s.dependencies().iter().filter(|d| d.is_optional()) {
+ reqs.require_dependency(dep.name_in_toml());
+ }
+ } else {
+ for &f in opts.features.iter() {
+ reqs.require_value(&FeatureValue::new(f, s))?;
}
}
- match *method {
- Method::Everything
- | Method::Required {
- uses_default_features: true,
- ..
- } => {
- if s.features().contains_key("default") {
- reqs.require_feature(InternedString::new("default"))?;
- }
+
+ if opts.uses_default_features {
+ if s.features().contains_key("default") {
+ reqs.require_feature(InternedString::new("default"))?;
}
- Method::Required {
- uses_default_features: false,
- ..
- } => {}
}
+
Ok(reqs)
}
diff --git a/src/cargo/core/resolver/encode.rs b/src/cargo/core/resolver/encode.rs
index d605b5e0c..b60b3a207 100644
--- a/src/cargo/core/resolver/encode.rs
+++ b/src/cargo/core/resolver/encode.rs
@@ -105,6 +105,7 @@ use crate::util::{internal, Graph};
use super::{Resolve, ResolveVersion};
+/// The `Cargo.lock` structure.
#[derive(Serialize, Deserialize, Debug)]
pub struct EncodableResolve {
package: Option>,
@@ -123,6 +124,14 @@ struct Patch {
pub type Metadata = BTreeMap;
impl EncodableResolve {
+ /// Convert a `Cargo.lock` to a Resolve.
+ ///
+ /// Note that this `Resolve` is not "complete". For example, the
+ /// dependencies do not know the difference between regular/dev/build
+ /// dependencies, so they are not filled in. It also does not include
+ /// `features`. Care should be taken when using this Resolve. One of the
+ /// primary uses is to be used with `resolve_with_previous` to guide the
+ /// resolver to create a complete Resolve.
pub fn into_resolve(self, ws: &Workspace<'_>) -> CargoResult {
let path_deps = build_path_deps(ws);
let mut checksums = HashMap::new();
diff --git a/src/cargo/core/resolver/mod.rs b/src/cargo/core/resolver/mod.rs
index b7fa8b213..4aaa7eeaf 100644
--- a/src/cargo/core/resolver/mod.rs
+++ b/src/cargo/core/resolver/mod.rs
@@ -69,7 +69,7 @@ pub use self::encode::Metadata;
pub use self::encode::{EncodableDependency, EncodablePackageId, EncodableResolve};
pub use self::errors::{ActivateError, ActivateResult, ResolveError};
pub use self::resolve::{Resolve, ResolveVersion};
-pub use self::types::Method;
+pub use self::types::ResolveOpts;
mod conflict_cache;
mod context;
@@ -120,7 +120,7 @@ mod types;
/// When we have a decision for how to implement is without breaking existing functionality
/// this flag can be removed.
pub fn resolve(
- summaries: &[(Summary, Method)],
+ summaries: &[(Summary, ResolveOpts)],
replacements: &[(PackageIdSpec, Dependency)],
registry: &mut dyn Registry,
try_to_use: &HashSet,
@@ -169,7 +169,7 @@ pub fn resolve(
fn activate_deps_loop(
mut cx: Context,
registry: &mut RegistryQueryer<'_>,
- summaries: &[(Summary, Method)],
+ summaries: &[(Summary, ResolveOpts)],
config: Option<&Config>,
) -> CargoResult {
let mut backtrack_stack = Vec::new();
@@ -180,9 +180,9 @@ fn activate_deps_loop(
let mut past_conflicting_activations = conflict_cache::ConflictCache::new();
// Activate all the initial summaries to kick off some work.
- for &(ref summary, ref method) in summaries {
+ for &(ref summary, ref opts) in summaries {
debug!("initial activation: {}", summary.package_id());
- let res = activate(&mut cx, registry, None, summary.clone(), method.clone());
+ let res = activate(&mut cx, registry, None, summary.clone(), opts.clone());
match res {
Ok(Some((frame, _))) => remaining_deps.push(frame),
Ok(None) => (),
@@ -366,7 +366,7 @@ fn activate_deps_loop(
};
let pid = candidate.package_id();
- let method = Method::Required {
+ let opts = ResolveOpts {
dev_deps: false,
features: Rc::clone(&features),
all_features: false,
@@ -379,7 +379,7 @@ fn activate_deps_loop(
dep.package_name(),
candidate.version()
);
- let res = activate(&mut cx, registry, Some((&parent, &dep)), candidate, method);
+ let res = activate(&mut cx, registry, Some((&parent, &dep)), candidate, opts);
let successfully_activated = match res {
// Success! We've now activated our `candidate` in our context
@@ -583,7 +583,7 @@ fn activate_deps_loop(
/// Attempts to activate the summary `candidate` in the context `cx`.
///
/// This function will pull dependency summaries from the registry provided, and
-/// the dependencies of the package will be determined by the `method` provided.
+/// the dependencies of the package will be determined by the `opts` provided.
/// If `candidate` was activated, this function returns the dependency frame to
/// iterate through next.
fn activate(
@@ -591,7 +591,7 @@ fn activate(
registry: &mut RegistryQueryer<'_>,
parent: Option<(&Summary, &Dependency)>,
candidate: Summary,
- method: Method,
+ opts: ResolveOpts,
) -> ActivateResult
--message-formatFMT
-
The output format for diagnostic messages. Valid values:
+
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
human (default): Display in a human-readable text format.
+
short: Emit shorter, human-readable text messages.
+
+
json: Emit JSON messages to stdout.
-
short: Emit shorter, human-readable text messages.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc.
+
+
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc’s default color
+scheme.
+
+
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
+coming from rustc are still emitted.
The output format for diagnostic messages. Valid values:
+
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
human (default): Display in a human-readable text format.
+
short: Emit shorter, human-readable text messages.
+
+
json: Emit JSON messages to stdout.
-
short: Emit shorter, human-readable text messages.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc.
+
+
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc’s default color
+scheme.
+
+
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
+coming from rustc are still emitted.
The output format for diagnostic messages. Valid values:
+
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
human (default): Display in a human-readable text format.
+
short: Emit shorter, human-readable text messages.
+
+
json: Emit JSON messages to stdout.
-
short: Emit shorter, human-readable text messages.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc.
+
+
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc’s default color
+scheme.
+
+
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
+coming from rustc are still emitted.
The output format for diagnostic messages. Valid values:
+
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
human (default): Display in a human-readable text format.
+
short: Emit shorter, human-readable text messages.
+
+
json: Emit JSON messages to stdout.
-
short: Emit shorter, human-readable text messages.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc.
+
+
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc’s default color
+scheme.
+
+
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
+coming from rustc are still emitted.
The output format for diagnostic messages. Valid values:
+
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
human (default): Display in a human-readable text format.
+
short: Emit shorter, human-readable text messages.
+
+
json: Emit JSON messages to stdout.
-
short: Emit shorter, human-readable text messages.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc.
+
+
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc’s default color
+scheme.
+
+
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
+coming from rustc are still emitted.
diff --git a/src/doc/man/generated/cargo-metadata.html b/src/doc/man/generated/cargo-metadata.html
index 9a0cfc7d3..2598013e7 100644
--- a/src/doc/man/generated/cargo-metadata.html
+++ b/src/doc/man/generated/cargo-metadata.html
@@ -35,7 +35,7 @@ for a Rust API for reading the metadata.
-
{
+
{
/* Array of all packages in the workspace.
It also includes all feature-enabled dependencies unless --no-deps is used.
*/
diff --git a/src/doc/man/generated/cargo-run.html b/src/doc/man/generated/cargo-run.html
index abadc739f..608568ce6 100644
--- a/src/doc/man/generated/cargo-run.html
+++ b/src/doc/man/generated/cargo-run.html
@@ -168,17 +168,33 @@ terminal.
--message-formatFMT
-
The output format for diagnostic messages. Valid values:
+
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
human (default): Display in a human-readable text format.
+
short: Emit shorter, human-readable text messages.
+
+
json: Emit JSON messages to stdout.
-
short: Emit shorter, human-readable text messages.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc.
+
+
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc’s default color
+scheme.
+
+
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
+coming from rustc are still emitted.
The output format for diagnostic messages. Valid values:
+
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
human (default): Display in a human-readable text format.
+
short: Emit shorter, human-readable text messages.
+
+
json: Emit JSON messages to stdout.
-
short: Emit shorter, human-readable text messages.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc.
+
+
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc’s default color
+scheme.
+
+
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
+coming from rustc are still emitted.
The output format for diagnostic messages. Valid values:
+
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
human (default): Display in a human-readable text format.
+
short: Emit shorter, human-readable text messages.
+
+
json: Emit JSON messages to stdout.
-
short: Emit shorter, human-readable text messages.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc.
+
+
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc’s default color
+scheme.
+
+
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
+coming from rustc are still emitted.
The output format for diagnostic messages. Valid values:
+
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
human (default): Display in a human-readable text format.
+
short: Emit shorter, human-readable text messages.
+
+
json: Emit JSON messages to stdout.
-
short: Emit shorter, human-readable text messages.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc.
+
+
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc’s default color
+scheme.
+
+
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo’s own JSON diagnostics and others
+coming from rustc are still emitted.
diff --git a/src/doc/man/options-message-format.adoc b/src/doc/man/options-message-format.adoc
index 6da9c26bd..fa5922a5d 100644
--- a/src/doc/man/options-message-format.adoc
+++ b/src/doc/man/options-message-format.adoc
@@ -1,6 +1,16 @@
*--message-format* _FMT_::
- The output format for diagnostic messages. Valid values:
+ The output format for diagnostic messages. Can be specified multiple times
+ and consists of comma-separated values. Valid values:
+
- `human` (default): Display in a human-readable text format.
-- `json`: Emit JSON messages to stdout.
- `short`: Emit shorter, human-readable text messages.
+- `json`: Emit JSON messages to stdout.
+- `json-diagnostic-short`: Ensure the `rendered` field of JSON messages contains
+ the "short" rendering from rustc.
+- `json-diagnostic-rendered-ansi`: Ensure the `rendered` field of JSON messages
+ contains embedded ANSI color codes for respecting rustc's default color
+ scheme.
+- `json-render-diagnostics`: Instruct Cargo to not include rustc diagnostics in
+ in JSON messages printed, but instead Cargo itself should render the
+ JSON diagnostics coming from rustc. Cargo's own JSON diagnostics and others
+ coming from rustc are still emitted.
diff --git a/src/etc/man/cargo-bench.1 b/src/etc/man/cargo-bench.1
index 629273951..82b30f1cf 100644
--- a/src/etc/man/cargo-bench.1
+++ b/src/etc/man/cargo-bench.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-bench
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-05-08
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-BENCH" "1" "2019-05-08" "\ \&" "\ \&"
+.TH "CARGO\-BENCH" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -347,7 +347,8 @@ May also be specified with the \fBterm.color\fP
.sp
\fB\-\-message\-format\fP \fIFMT\fP
.RS 4
-The output format for diagnostic messages. Valid values:
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
.sp
.RS 4
.ie n \{\
@@ -368,6 +369,17 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
+\fBshort\fP: Emit shorter, human\-readable text messages.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
\fBjson\fP: Emit JSON messages to stdout.
.RE
.sp
@@ -379,7 +391,35 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
-\fBshort\fP: Emit shorter, human\-readable text messages.
+\fBjson\-diagnostic\-short\fP: Ensure the \fBrendered\fP field of JSON messages contains
+the "short" rendering from rustc.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-diagnostic\-rendered\-ansi\fP: Ensure the \fBrendered\fP field of JSON messages
+contains embedded ANSI color codes for respecting rustc\(cqs default color
+scheme.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-render\-diagnostics\fP: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo\(cqs own JSON diagnostics and others
+coming from rustc are still emitted.
.RE
.RE
.SS "Manifest Options"
diff --git a/src/etc/man/cargo-build.1 b/src/etc/man/cargo-build.1
index eeb3d9805..86b91a895 100644
--- a/src/etc/man/cargo-build.1
+++ b/src/etc/man/cargo-build.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-build
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-05-08
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-BUILD" "1" "2019-05-08" "\ \&" "\ \&"
+.TH "CARGO\-BUILD" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -256,7 +256,8 @@ May also be specified with the \fBterm.color\fP
.sp
\fB\-\-message\-format\fP \fIFMT\fP
.RS 4
-The output format for diagnostic messages. Valid values:
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
.sp
.RS 4
.ie n \{\
@@ -277,6 +278,17 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
+\fBshort\fP: Emit shorter, human\-readable text messages.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
\fBjson\fP: Emit JSON messages to stdout.
.RE
.sp
@@ -288,7 +300,35 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
-\fBshort\fP: Emit shorter, human\-readable text messages.
+\fBjson\-diagnostic\-short\fP: Ensure the \fBrendered\fP field of JSON messages contains
+the "short" rendering from rustc.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-diagnostic\-rendered\-ansi\fP: Ensure the \fBrendered\fP field of JSON messages
+contains embedded ANSI color codes for respecting rustc\(cqs default color
+scheme.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-render\-diagnostics\fP: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo\(cqs own JSON diagnostics and others
+coming from rustc are still emitted.
.RE
.RE
.sp
diff --git a/src/etc/man/cargo-check.1 b/src/etc/man/cargo-check.1
index 2ae71dea3..43bf72a35 100644
--- a/src/etc/man/cargo-check.1
+++ b/src/etc/man/cargo-check.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-check
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-CHECK" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-CHECK" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -256,7 +256,8 @@ May also be specified with the \fBterm.color\fP
.sp
\fB\-\-message\-format\fP \fIFMT\fP
.RS 4
-The output format for diagnostic messages. Valid values:
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
.sp
.RS 4
.ie n \{\
@@ -277,6 +278,17 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
+\fBshort\fP: Emit shorter, human\-readable text messages.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
\fBjson\fP: Emit JSON messages to stdout.
.RE
.sp
@@ -288,7 +300,35 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
-\fBshort\fP: Emit shorter, human\-readable text messages.
+\fBjson\-diagnostic\-short\fP: Ensure the \fBrendered\fP field of JSON messages contains
+the "short" rendering from rustc.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-diagnostic\-rendered\-ansi\fP: Ensure the \fBrendered\fP field of JSON messages
+contains embedded ANSI color codes for respecting rustc\(cqs default color
+scheme.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-render\-diagnostics\fP: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo\(cqs own JSON diagnostics and others
+coming from rustc are still emitted.
.RE
.RE
.SS "Manifest Options"
diff --git a/src/etc/man/cargo-clean.1 b/src/etc/man/cargo-clean.1
index 1afb47c2d..74412bee6 100644
--- a/src/etc/man/cargo-clean.1
+++ b/src/etc/man/cargo-clean.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-clean
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-CLEAN" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-CLEAN" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-doc.1 b/src/etc/man/cargo-doc.1
index 26a91320f..91f176e69 100644
--- a/src/etc/man/cargo-doc.1
+++ b/src/etc/man/cargo-doc.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-doc
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-DOC" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-DOC" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -213,7 +213,8 @@ May also be specified with the \fBterm.color\fP
.sp
\fB\-\-message\-format\fP \fIFMT\fP
.RS 4
-The output format for diagnostic messages. Valid values:
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
.sp
.RS 4
.ie n \{\
@@ -234,6 +235,17 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
+\fBshort\fP: Emit shorter, human\-readable text messages.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
\fBjson\fP: Emit JSON messages to stdout.
.RE
.sp
@@ -245,7 +257,35 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
-\fBshort\fP: Emit shorter, human\-readable text messages.
+\fBjson\-diagnostic\-short\fP: Ensure the \fBrendered\fP field of JSON messages contains
+the "short" rendering from rustc.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-diagnostic\-rendered\-ansi\fP: Ensure the \fBrendered\fP field of JSON messages
+contains embedded ANSI color codes for respecting rustc\(cqs default color
+scheme.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-render\-diagnostics\fP: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo\(cqs own JSON diagnostics and others
+coming from rustc are still emitted.
.RE
.RE
.SS "Manifest Options"
diff --git a/src/etc/man/cargo-fetch.1 b/src/etc/man/cargo-fetch.1
index 1fb8c1c17..6eec525ed 100644
--- a/src/etc/man/cargo-fetch.1
+++ b/src/etc/man/cargo-fetch.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-fetch
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-05-12
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-FETCH" "1" "2019-05-12" "\ \&" "\ \&"
+.TH "CARGO\-FETCH" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-fix.1 b/src/etc/man/cargo-fix.1
index 25ac7e7e7..48dbe6d52 100644
--- a/src/etc/man/cargo-fix.1
+++ b/src/etc/man/cargo-fix.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-fix
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-FIX" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-FIX" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -326,7 +326,8 @@ May also be specified with the \fBterm.color\fP
.sp
\fB\-\-message\-format\fP \fIFMT\fP
.RS 4
-The output format for diagnostic messages. Valid values:
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
.sp
.RS 4
.ie n \{\
@@ -347,6 +348,17 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
+\fBshort\fP: Emit shorter, human\-readable text messages.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
\fBjson\fP: Emit JSON messages to stdout.
.RE
.sp
@@ -358,7 +370,35 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
-\fBshort\fP: Emit shorter, human\-readable text messages.
+\fBjson\-diagnostic\-short\fP: Ensure the \fBrendered\fP field of JSON messages contains
+the "short" rendering from rustc.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-diagnostic\-rendered\-ansi\fP: Ensure the \fBrendered\fP field of JSON messages
+contains embedded ANSI color codes for respecting rustc\(cqs default color
+scheme.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-render\-diagnostics\fP: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo\(cqs own JSON diagnostics and others
+coming from rustc are still emitted.
.RE
.RE
.SS "Manifest Options"
diff --git a/src/etc/man/cargo-generate-lockfile.1 b/src/etc/man/cargo-generate-lockfile.1
index 107b8c45e..b43dd9f66 100644
--- a/src/etc/man/cargo-generate-lockfile.1
+++ b/src/etc/man/cargo-generate-lockfile.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-generate-lockfile
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-GENERATE\-LOCKFILE" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-GENERATE\-LOCKFILE" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-help.1 b/src/etc/man/cargo-help.1
index 30e036d5a..17a5a9636 100644
--- a/src/etc/man/cargo-help.1
+++ b/src/etc/man/cargo-help.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-help
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2018-12-20
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-HELP" "1" "2018-12-20" "\ \&" "\ \&"
+.TH "CARGO\-HELP" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-init.1 b/src/etc/man/cargo-init.1
index 1a55f5c57..300d76818 100644
--- a/src/etc/man/cargo-init.1
+++ b/src/etc/man/cargo-init.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-init
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-01-23
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-INIT" "1" "2019-01-23" "\ \&" "\ \&"
+.TH "CARGO\-INIT" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-install.1 b/src/etc/man/cargo-install.1
index 73998642f..4b76a9a88 100644
--- a/src/etc/man/cargo-install.1
+++ b/src/etc/man/cargo-install.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-install
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-06-10
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-07-15
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-INSTALL" "1" "2019-06-10" "\ \&" "\ \&"
+.TH "CARGO\-INSTALL" "1" "2019-07-15" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-locate-project.1 b/src/etc/man/cargo-locate-project.1
index 9d5dca9f3..731ef6d3f 100644
--- a/src/etc/man/cargo-locate-project.1
+++ b/src/etc/man/cargo-locate-project.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-locate-project
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2018-12-20
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-LOCATE\-PROJECT" "1" "2018-12-20" "\ \&" "\ \&"
+.TH "CARGO\-LOCATE\-PROJECT" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-login.1 b/src/etc/man/cargo-login.1
index 2f9ec810b..0da2cd739 100644
--- a/src/etc/man/cargo-login.1
+++ b/src/etc/man/cargo-login.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-login
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-01-23
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-LOGIN" "1" "2019-01-23" "\ \&" "\ \&"
+.TH "CARGO\-LOGIN" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-metadata.1 b/src/etc/man/cargo-metadata.1
index 46ab46658..6792e538b 100644
--- a/src/etc/man/cargo-metadata.1
+++ b/src/etc/man/cargo-metadata.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-metadata
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-05-20
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-METADATA" "1" "2019-05-20" "\ \&" "\ \&"
+.TH "CARGO\-METADATA" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-new.1 b/src/etc/man/cargo-new.1
index 894b5ab6e..b8266140c 100644
--- a/src/etc/man/cargo-new.1
+++ b/src/etc/man/cargo-new.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-new
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-01-23
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-NEW" "1" "2019-01-23" "\ \&" "\ \&"
+.TH "CARGO\-NEW" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-owner.1 b/src/etc/man/cargo-owner.1
index 8e798a3b2..d0eda6c84 100644
--- a/src/etc/man/cargo-owner.1
+++ b/src/etc/man/cargo-owner.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-owner
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-02-05
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-OWNER" "1" "2019-02-05" "\ \&" "\ \&"
+.TH "CARGO\-OWNER" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-package.1 b/src/etc/man/cargo-package.1
index dfd592e24..b27d7bc83 100644
--- a/src/etc/man/cargo-package.1
+++ b/src/etc/man/cargo-package.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-package
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-06-10
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-07-15
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-PACKAGE" "1" "2019-06-10" "\ \&" "\ \&"
+.TH "CARGO\-PACKAGE" "1" "2019-07-15" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-pkgid.1 b/src/etc/man/cargo-pkgid.1
index 1b80afa3c..3a54667fa 100644
--- a/src/etc/man/cargo-pkgid.1
+++ b/src/etc/man/cargo-pkgid.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-pkgid
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-PKGID" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-PKGID" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-publish.1 b/src/etc/man/cargo-publish.1
index c457a003c..f0f686855 100644
--- a/src/etc/man/cargo-publish.1
+++ b/src/etc/man/cargo-publish.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-publish
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-05-08
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-PUBLISH" "1" "2019-05-08" "\ \&" "\ \&"
+.TH "CARGO\-PUBLISH" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-run.1 b/src/etc/man/cargo-run.1
index da42337d2..c40844fa4 100644
--- a/src/etc/man/cargo-run.1
+++ b/src/etc/man/cargo-run.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-run
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-06-21
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-07-15
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-RUN" "1" "2019-06-21" "\ \&" "\ \&"
+.TH "CARGO\-RUN" "1" "2019-07-15" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -176,7 +176,8 @@ May also be specified with the \fBterm.color\fP
.sp
\fB\-\-message\-format\fP \fIFMT\fP
.RS 4
-The output format for diagnostic messages. Valid values:
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
.sp
.RS 4
.ie n \{\
@@ -197,6 +198,17 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
+\fBshort\fP: Emit shorter, human\-readable text messages.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
\fBjson\fP: Emit JSON messages to stdout.
.RE
.sp
@@ -208,7 +220,35 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
-\fBshort\fP: Emit shorter, human\-readable text messages.
+\fBjson\-diagnostic\-short\fP: Ensure the \fBrendered\fP field of JSON messages contains
+the "short" rendering from rustc.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-diagnostic\-rendered\-ansi\fP: Ensure the \fBrendered\fP field of JSON messages
+contains embedded ANSI color codes for respecting rustc\(cqs default color
+scheme.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-render\-diagnostics\fP: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo\(cqs own JSON diagnostics and others
+coming from rustc are still emitted.
.RE
.RE
.SS "Manifest Options"
diff --git a/src/etc/man/cargo-rustc.1 b/src/etc/man/cargo-rustc.1
index f4cdd997f..a97628142 100644
--- a/src/etc/man/cargo-rustc.1
+++ b/src/etc/man/cargo-rustc.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-rustc
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-RUSTC" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-RUSTC" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -245,7 +245,8 @@ May also be specified with the \fBterm.color\fP
.sp
\fB\-\-message\-format\fP \fIFMT\fP
.RS 4
-The output format for diagnostic messages. Valid values:
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
.sp
.RS 4
.ie n \{\
@@ -266,6 +267,17 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
+\fBshort\fP: Emit shorter, human\-readable text messages.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
\fBjson\fP: Emit JSON messages to stdout.
.RE
.sp
@@ -277,7 +289,35 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
-\fBshort\fP: Emit shorter, human\-readable text messages.
+\fBjson\-diagnostic\-short\fP: Ensure the \fBrendered\fP field of JSON messages contains
+the "short" rendering from rustc.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-diagnostic\-rendered\-ansi\fP: Ensure the \fBrendered\fP field of JSON messages
+contains embedded ANSI color codes for respecting rustc\(cqs default color
+scheme.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-render\-diagnostics\fP: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo\(cqs own JSON diagnostics and others
+coming from rustc are still emitted.
.RE
.RE
.SS "Manifest Options"
diff --git a/src/etc/man/cargo-rustdoc.1 b/src/etc/man/cargo-rustdoc.1
index 4e1cc3693..ef322c0b6 100644
--- a/src/etc/man/cargo-rustdoc.1
+++ b/src/etc/man/cargo-rustdoc.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-rustdoc
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-RUSTDOC" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-RUSTDOC" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -253,7 +253,8 @@ May also be specified with the \fBterm.color\fP
.sp
\fB\-\-message\-format\fP \fIFMT\fP
.RS 4
-The output format for diagnostic messages. Valid values:
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
.sp
.RS 4
.ie n \{\
@@ -274,6 +275,17 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
+\fBshort\fP: Emit shorter, human\-readable text messages.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
\fBjson\fP: Emit JSON messages to stdout.
.RE
.sp
@@ -285,7 +297,35 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
-\fBshort\fP: Emit shorter, human\-readable text messages.
+\fBjson\-diagnostic\-short\fP: Ensure the \fBrendered\fP field of JSON messages contains
+the "short" rendering from rustc.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-diagnostic\-rendered\-ansi\fP: Ensure the \fBrendered\fP field of JSON messages
+contains embedded ANSI color codes for respecting rustc\(cqs default color
+scheme.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-render\-diagnostics\fP: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo\(cqs own JSON diagnostics and others
+coming from rustc are still emitted.
.RE
.RE
.SS "Manifest Options"
diff --git a/src/etc/man/cargo-search.1 b/src/etc/man/cargo-search.1
index a789ac6c0..9672a58f3 100644
--- a/src/etc/man/cargo-search.1
+++ b/src/etc/man/cargo-search.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-search
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-01-23
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-SEARCH" "1" "2019-01-23" "\ \&" "\ \&"
+.TH "CARGO\-SEARCH" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-test.1 b/src/etc/man/cargo-test.1
index c856952c4..241101ab2 100644
--- a/src/etc/man/cargo-test.1
+++ b/src/etc/man/cargo-test.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-test
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-05-08
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-TEST" "1" "2019-05-08" "\ \&" "\ \&"
+.TH "CARGO\-TEST" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -389,7 +389,8 @@ May also be specified with the \fBterm.color\fP
.sp
\fB\-\-message\-format\fP \fIFMT\fP
.RS 4
-The output format for diagnostic messages. Valid values:
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
.sp
.RS 4
.ie n \{\
@@ -410,6 +411,17 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
+\fBshort\fP: Emit shorter, human\-readable text messages.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
\fBjson\fP: Emit JSON messages to stdout.
.RE
.sp
@@ -421,7 +433,35 @@ The output format for diagnostic messages. Valid values:
. sp -1
. IP \(bu 2.3
.\}
-\fBshort\fP: Emit shorter, human\-readable text messages.
+\fBjson\-diagnostic\-short\fP: Ensure the \fBrendered\fP field of JSON messages contains
+the "short" rendering from rustc.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-diagnostic\-rendered\-ansi\fP: Ensure the \fBrendered\fP field of JSON messages
+contains embedded ANSI color codes for respecting rustc\(cqs default color
+scheme.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+. sp -1
+. IP \(bu 2.3
+.\}
+\fBjson\-render\-diagnostics\fP: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo\(cqs own JSON diagnostics and others
+coming from rustc are still emitted.
.RE
.RE
.SS "Manifest Options"
diff --git a/src/etc/man/cargo-uninstall.1 b/src/etc/man/cargo-uninstall.1
index 36ea8a806..277bc824d 100644
--- a/src/etc/man/cargo-uninstall.1
+++ b/src/etc/man/cargo-uninstall.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-uninstall
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2018-12-20
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-UNINSTALL" "1" "2018-12-20" "\ \&" "\ \&"
+.TH "CARGO\-UNINSTALL" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-update.1 b/src/etc/man/cargo-update.1
index 835e6c314..fc302c112 100644
--- a/src/etc/man/cargo-update.1
+++ b/src/etc/man/cargo-update.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-update
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-UPDATE" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-UPDATE" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-vendor.1 b/src/etc/man/cargo-vendor.1
index 3937cc949..495f13645 100644
--- a/src/etc/man/cargo-vendor.1
+++ b/src/etc/man/cargo-vendor.1
@@ -2,12 +2,12 @@
.\" Title: cargo-vendor
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.8
-.\" Date: 2019-04-29
+.\" Date: 2019-07-15
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-VENDOR" "1" "2019-04-29" "\ \&" "\ \&"
+.TH "CARGO\-VENDOR" "1" "2019-07-15" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -149,6 +149,23 @@ These may be used in environments where you want to assert that the
\fBCargo.lock\fP file is up\-to\-date (such as a CI build) or want to avoid network
access.
.RE
+.sp
+\fB\-\-offline\fP
+.RS 4
+Prevents Cargo from accessing the network for any reason. Without this
+flag, Cargo will stop with an error if it needs to access the network and
+the network is not available. With this flag, Cargo will attempt to
+proceed without the network if possible.
+.sp
+Beware that this may result in different dependency resolution than online
+mode. Cargo will restrict itself to crates that are downloaded locally, even
+if there might be a newer version as indicated in the local copy of the index.
+See the \fBcargo\-fetch\fP(1) command to download dependencies before going
+offline.
+.sp
+May also be specified with the \fBnet.offline\fP \c
+.URL "https://doc.rust\-lang.org/cargo/reference/config.html" "config value" "."
+.RE
.SH "ENVIRONMENT"
.sp
See \c
diff --git a/src/etc/man/cargo-verify-project.1 b/src/etc/man/cargo-verify-project.1
index a39501340..96e59cc8f 100644
--- a/src/etc/man/cargo-verify-project.1
+++ b/src/etc/man/cargo-verify-project.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-verify-project
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-04-16
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-VERIFY\-PROJECT" "1" "2019-04-16" "\ \&" "\ \&"
+.TH "CARGO\-VERIFY\-PROJECT" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-version.1 b/src/etc/man/cargo-version.1
index 4527d1490..676392752 100644
--- a/src/etc/man/cargo-version.1
+++ b/src/etc/man/cargo-version.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-version
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2018-12-20
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-VERSION" "1" "2018-12-20" "\ \&" "\ \&"
+.TH "CARGO\-VERSION" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo-yank.1 b/src/etc/man/cargo-yank.1
index c3a637c7a..591d92d22 100644
--- a/src/etc/man/cargo-yank.1
+++ b/src/etc/man/cargo-yank.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo-yank
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-01-23
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO\-YANK" "1" "2019-01-23" "\ \&" "\ \&"
+.TH "CARGO\-YANK" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
diff --git a/src/etc/man/cargo.1 b/src/etc/man/cargo.1
index 757510051..94f590748 100644
--- a/src/etc/man/cargo.1
+++ b/src/etc/man/cargo.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: cargo
.\" Author: [see the "AUTHOR(S)" section]
-.\" Generator: Asciidoctor 1.5.8
-.\" Date: 2019-05-20
+.\" Generator: Asciidoctor 2.0.8
+.\" Date: 2019-06-07
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "CARGO" "1" "2019-05-20" "\ \&" "\ \&"
+.TH "CARGO" "1" "2019-06-07" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@@ -487,4 +487,4 @@ See \c
for issues.
.SH "SEE ALSO"
.sp
-\fBrustc\fP(1), \fBrustdoc\fP(1)
+\fBrustc\fP(1), \fBrustdoc\fP(1)
\ No newline at end of file
diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs
index 7c6323425..c80e528df 100644
--- a/tests/testsuite/build.rs
+++ b/tests/testsuite/build.rs
@@ -3264,11 +3264,10 @@ fn wrong_message_format_option() {
.build();
p.cargo("build --message-format XML")
- .with_status(1)
+ .with_status(101)
.with_stderr_contains(
"\
-error: 'XML' isn't a valid value for '--message-format '
-[possible values: human, json, short]
+error: invalid message format specifier: `xml`
",
)
.run();
diff --git a/tests/testsuite/fix.rs b/tests/testsuite/fix.rs
index 225362ac1..3f3f1228a 100644
--- a/tests/testsuite/fix.rs
+++ b/tests/testsuite/fix.rs
@@ -937,7 +937,7 @@ fn both_edition_migrate_flags() {
error: The argument '--edition' cannot be used with '--prepare-for '
USAGE:
- cargo[..] fix --edition --message-format
+ cargo[..] fix --edition
For more information try --help
";
diff --git a/tests/testsuite/main.rs b/tests/testsuite/main.rs
index 618c92ceb..a3b212459 100644
--- a/tests/testsuite/main.rs
+++ b/tests/testsuite/main.rs
@@ -57,6 +57,7 @@ mod local_registry;
mod lockfile_compat;
mod login;
mod member_errors;
+mod message_format;
mod metabuild;
mod metadata;
mod net_config;
diff --git a/tests/testsuite/message_format.rs b/tests/testsuite/message_format.rs
new file mode 100644
index 000000000..06969e7a6
--- /dev/null
+++ b/tests/testsuite/message_format.rs
@@ -0,0 +1,126 @@
+use crate::support::{basic_manifest, project};
+
+#[cargo_test]
+fn cannot_specify_two() {
+ if !crate::support::is_nightly() {
+ return;
+ }
+
+ let p = project()
+ .file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
+ .file("src/main.rs", "fn main() {}")
+ .build();
+
+ let formats = ["human", "json", "short"];
+
+ let two_kinds = "error: cannot specify two kinds of `message-format` arguments\n";
+ for a in formats.iter() {
+ for b in formats.iter() {
+ p.cargo(&format!("build --message-format {},{}", a, b))
+ .with_status(101)
+ .with_stderr(two_kinds)
+ .run();
+ }
+ }
+}
+
+#[cargo_test]
+fn double_json_works() {
+ if !crate::support::is_nightly() {
+ return;
+ }
+
+ let p = project()
+ .file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
+ .file("src/main.rs", "fn main() {}")
+ .build();
+
+ p.cargo("build --message-format json,json-render-diagnostics")
+ .run();
+ p.cargo("build --message-format json,json-diagnostic-short")
+ .run();
+ p.cargo("build --message-format json,json-diagnostic-rendered-ansi")
+ .run();
+ p.cargo("build --message-format json --message-format json-diagnostic-rendered-ansi")
+ .run();
+ p.cargo("build --message-format json-diagnostic-rendered-ansi")
+ .run();
+ p.cargo("build --message-format json-diagnostic-short,json-diagnostic-rendered-ansi")
+ .run();
+}
+
+#[cargo_test]
+fn cargo_renders() {
+ if !crate::support::is_nightly() {
+ return;
+ }
+
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = 'foo'
+ version = '0.1.0'
+
+ [dependencies]
+ bar = { path = 'bar' }
+ "#,
+ )
+ .file("src/main.rs", "")
+ .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0"))
+ .file("bar/src/lib.rs", "")
+ .build();
+
+ p.cargo("build --message-format json-render-diagnostics")
+ .with_status(101)
+ .with_stdout("{\"reason\":\"compiler-artifact\",[..]")
+ .with_stderr_contains(
+ "\
+[COMPILING] bar [..]
+[COMPILING] foo [..]
+error[..]`main`[..]
+",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn cargo_renders_short() {
+ if !crate::support::is_nightly() {
+ return;
+ }
+
+ let p = project()
+ .file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
+ .file("src/main.rs", "")
+ .build();
+
+ p.cargo("build --message-format json-render-diagnostics,json-diagnostic-short")
+ .with_status(101)
+ .with_stderr_contains(
+ "\
+[COMPILING] foo [..]
+error[..]`main`[..]
+",
+ )
+ .with_stderr_does_not_contain("note:")
+ .run();
+}
+
+#[cargo_test]
+fn cargo_renders_ansi() {
+ if !crate::support::is_nightly() {
+ return;
+ }
+
+ let p = project()
+ .file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
+ .file("src/main.rs", "")
+ .build();
+
+ p.cargo("build --message-format json-diagnostic-rendered-ansi")
+ .with_status(101)
+ .with_stdout_contains("[..]\\u001b[38;5;9merror[..]")
+ .run();
+}
From ec9222a345281853cd15baf95683c8d1776cb13f Mon Sep 17 00:00:00 2001
From: Eric Huss
Date: Tue, 6 Aug 2019 09:00:43 -0700
Subject: [PATCH 25/29] Fix remap-path-prefix from failing.
---
src/cargo/core/compiler/fingerprint.rs | 5 ++-
tests/testsuite/rustflags.rs | 44 ++++++++++++++++++++++++--
2 files changed, 46 insertions(+), 3 deletions(-)
diff --git a/src/cargo/core/compiler/fingerprint.rs b/src/cargo/core/compiler/fingerprint.rs
index e7cccc818..9940db7d5 100644
--- a/src/cargo/core/compiler/fingerprint.rs
+++ b/src/cargo/core/compiler/fingerprint.rs
@@ -1581,8 +1581,11 @@ pub fn translate_dep_info(
for file in deps {
// The path may be absolute or relative, canonical or not. Make sure
// it is canonicalized so we are comparing the same kinds of paths.
- let canon_file = rustc_cwd.join(file).canonicalize()?;
let abs_file = rustc_cwd.join(file);
+ // If canonicalization fails, just use the abs path. There is currently
+ // a bug where --remap-path-prefix is affecting .d files, causing them
+ // to point to non-existent paths.
+ let canon_file = abs_file.canonicalize().unwrap_or_else(|_| abs_file.clone());
let (ty, path) = if let Ok(stripped) = canon_file.strip_prefix(&target_root) {
(DepInfoPathType::TargetRootRelative, stripped)
diff --git a/tests/testsuite/rustflags.rs b/tests/testsuite/rustflags.rs
index 008bee0f4..0589b49ac 100644
--- a/tests/testsuite/rustflags.rs
+++ b/tests/testsuite/rustflags.rs
@@ -1,8 +1,10 @@
use std::fs::{self, File};
use std::io::Write;
-use crate::support::rustc_host;
-use crate::support::{basic_lib_manifest, basic_manifest, paths, project, project_in_home};
+use crate::support::registry::Package;
+use crate::support::{
+ basic_lib_manifest, basic_manifest, paths, project, project_in_home, rustc_host,
+};
#[cargo_test]
fn env_rustflags_normal_source() {
@@ -1393,3 +1395,41 @@ fn remap_path_prefix_ignored() {
.run();
check_metadata_same();
}
+
+#[cargo_test]
+fn remap_path_prefix_works() {
+ // Check that remap-path-prefix works.
+ Package::new("bar", "0.1.0")
+ .file("src/lib.rs", "pub fn f() -> &'static str { file!() }")
+ .publish();
+
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.1.0"
+
+ [dependencies]
+ bar = "0.1"
+ "#,
+ )
+ .file(
+ "src/main.rs",
+ r#"
+ fn main() {
+ println!("{}", bar::f());
+ }
+ "#,
+ )
+ .build();
+
+ p.cargo("run")
+ .env(
+ "RUSTFLAGS",
+ format!("--remap-path-prefix={}=/foo", paths::root().display()),
+ )
+ .with_stdout("/foo/home/.cargo/registry/src/[..]/bar-0.1.0/src/lib.rs")
+ .run();
+}
From f3d4c6b8f5727992ccbcd7a8f8f264b7ac73d358 Mon Sep 17 00:00:00 2001
From: Eric Huss
Date: Wed, 7 Aug 2019 07:49:28 -0700
Subject: [PATCH 26/29] Bump rustfix
---
Cargo.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Cargo.toml b/Cargo.toml
index 2fce01b9e..604df2968 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -48,7 +48,7 @@ num_cpus = "1.0"
opener = "0.4"
percent-encoding = "2.0"
remove_dir_all = "0.5.2"
-rustfix = "0.4.4"
+rustfix = "0.4.6"
same-file = "1"
semver = { version = "0.9.0", features = ["serde"] }
serde = { version = "1.0.82", features = ['derive'] }
From c26e52c6d6a16a75bfcbbbae054f8f057ea02bd4 Mon Sep 17 00:00:00 2001
From: Alexander Sieg
Date: Wed, 7 Aug 2019 21:19:06 +0200
Subject: [PATCH 27/29] enable progress bar for FreeBSD
As FreeBSD uses a unsigned long for the IOCTL syscall this code would
previously fail to compile. Adding a call to into() fixes this problem.
This code should still work on other platfroms as into() is able to
'convert' an u32 into a u32.
Also change the cfg attributes so that the working code is used.
This may also work on other not yet supported platforms, but it was not
tested.
---
src/cargo/core/shell.rs | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs
index 3f1d86003..860d35d10 100644
--- a/src/cargo/core/shell.rs
+++ b/src/cargo/core/shell.rs
@@ -366,7 +366,7 @@ impl ColorChoice {
}
}
-#[cfg(any(target_os = "linux", target_os = "macos"))]
+#[cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))]
mod imp {
use std::mem;
@@ -377,7 +377,7 @@ mod imp {
pub fn stderr_width() -> Option {
unsafe {
let mut winsize: libc::winsize = mem::zeroed();
- if libc::ioctl(libc::STDERR_FILENO, libc::TIOCGWINSZ, &mut winsize) < 0 {
+ if libc::ioctl(libc::STDERR_FILENO, libc::TIOCGWINSZ.into(), &mut winsize) < 0 {
return None;
}
if winsize.ws_col > 0 {
@@ -396,7 +396,10 @@ mod imp {
}
}
-#[cfg(all(unix, not(any(target_os = "linux", target_os = "macos"))))]
+#[cfg(all(
+ unix,
+ not(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))
+))]
mod imp {
pub(super) use super::default_err_erase_line as err_erase_line;
From c5c7227e42d545f08a35d73696e7b5a08a163a75 Mon Sep 17 00:00:00 2001
From: Alexander Sieg
Date: Wed, 7 Aug 2019 21:40:41 +0200
Subject: [PATCH 28/29] fixed unused code warning
In the commit c26e52c6d6a16a75bfcbbbae054f8f057ea02bd4 one cfg attribute
was forgotten. Here we fix this.
---
src/cargo/core/shell.rs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/cargo/core/shell.rs b/src/cargo/core/shell.rs
index 860d35d10..c0c9b1390 100644
--- a/src/cargo/core/shell.rs
+++ b/src/cargo/core/shell.rs
@@ -464,7 +464,13 @@ mod imp {
}
}
-#[cfg(any(all(unix, not(any(target_os = "linux", target_os = "macos"))), windows,))]
+#[cfg(any(
+ all(
+ unix,
+ not(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))
+ ),
+ windows,
+))]
fn default_err_erase_line(shell: &mut Shell) {
if let Some(max_width) = imp::stderr_width() {
let blank = " ".repeat(max_width);
From 16f8cc39c814bf46a2b69d87c3f07c34f3b4efb3 Mon Sep 17 00:00:00 2001
From: Eric Huss
Date: Thu, 8 Aug 2019 12:33:51 -0700
Subject: [PATCH 29/29] Layout docs and cleanup.
---
.../compiler/build_context/target_info.rs | 13 +-
src/cargo/core/compiler/compilation.rs | 1 +
.../compiler/context/compilation_files.rs | 11 +-
src/cargo/core/compiler/layout.rs | 168 ++++++++++++------
src/cargo/core/compiler/mod.rs | 1 +
src/doc/src/reference/manifest.md | 2 +-
6 files changed, 123 insertions(+), 73 deletions(-)
diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs
index 81a2d622c..cff55cf6f 100644
--- a/src/cargo/core/compiler/build_context/target_info.rs
+++ b/src/cargo/core/compiler/build_context/target_info.rs
@@ -53,14 +53,17 @@ pub struct FileType {
/// The kind of file.
pub flavor: FileFlavor,
/// The suffix for the file (for example, `.rlib`).
+ /// This is an empty string for executables on Unix-like platforms.
suffix: String,
/// The prefix for the file (for example, `lib`).
+ /// This is an empty string for things like executables.
prefix: String,
- // Wasm bin target will generate two files in deps such as
- // "web-stuff.js" and "web_stuff.wasm". Note the different usages of
- // "-" and "_". should_replace_hyphens is a flag to indicate that
- // we need to convert the stem "web-stuff" to "web_stuff", so we
- // won't miss "web_stuff.wasm".
+ /// Flag to convert hyphen to underscore.
+ ///
+ /// wasm bin targets will generate two files in deps such as
+ /// "web-stuff.js" and "web_stuff.wasm". Note the different usages of "-"
+ /// and "_". This flag indicates that the stem "web-stuff" should be
+ /// converted to "web_stuff".
should_replace_hyphens: bool,
}
diff --git a/src/cargo/core/compiler/compilation.rs b/src/cargo/core/compiler/compilation.rs
index 8c24c2e28..c3a92f335 100644
--- a/src/cargo/core/compiler/compilation.rs
+++ b/src/cargo/core/compiler/compilation.rs
@@ -22,6 +22,7 @@ pub struct Doctest {
/// A structure returning the result of a compilation.
pub struct Compilation<'cfg> {
/// An array of all tests created during this compilation.
+ /// `(package, target, path_to_test_exe)`
pub tests: Vec<(Package, Target, PathBuf)>,
/// An array of all binaries created.
diff --git a/src/cargo/core/compiler/context/compilation_files.rs b/src/cargo/core/compiler/context/compilation_files.rs
index caf7c5f8b..f7e0ee7cf 100644
--- a/src/cargo/core/compiler/context/compilation_files.rs
+++ b/src/cargo/core/compiler/context/compilation_files.rs
@@ -145,7 +145,7 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
/// target.
pub fn out_dir(&self, unit: &Unit<'a>) -> PathBuf {
if unit.mode.is_doc() {
- self.layout(unit.kind).root().parent().unwrap().join("doc")
+ self.layout(unit.kind).doc().to_path_buf()
} else if unit.mode.is_doc_test() {
panic!("doc tests do not have an out dir");
} else if unit.target.is_custom_build() {
@@ -169,11 +169,6 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
}
}
- /// Returns the root of the build output tree for the target
- pub fn target_root(&self) -> &Path {
- self.target.as_ref().unwrap_or(&self.host).dest()
- }
-
/// Returns the root of the build output tree for the host
pub fn host_root(&self) -> &Path {
self.host.dest()
@@ -261,8 +256,8 @@ impl<'a, 'cfg: 'a> CompilationFiles<'a, 'cfg> {
/// (eg a dependent lib).
fn link_stem(&self, unit: &Unit<'a>) -> Option<(PathBuf, String)> {
let out_dir = self.out_dir(unit);
- let bin_stem = self.bin_stem(unit);
- let file_stem = self.file_stem(unit);
+ let bin_stem = self.bin_stem(unit); // Stem without metadata.
+ let file_stem = self.file_stem(unit); // Stem with metadata.
// We currently only lift files up from the `deps` directory. If
// it was compiled into something like `example/` or `doc/` then
diff --git a/src/cargo/core/compiler/layout.rs b/src/cargo/core/compiler/layout.rs
index e4ae2bc51..e5361b679 100644
--- a/src/cargo/core/compiler/layout.rs
+++ b/src/cargo/core/compiler/layout.rs
@@ -8,71 +8,123 @@
//! # places all of its output here.
//! target/
//!
-//! # This is the root directory for all output of *dependencies*
-//! deps/
+//! # Cache of `rustc -Vv` output for performance.
+//! .rustc-info.json
//!
-//! # Root directory for all compiled examples
-//! examples/
+//! # All final artifacts are linked into this directory from `deps`.
+//! debug/ # or release/
+//!
+//! # File used to lock the directory to prevent multiple cargo processes
+//! # from using it at the same time.
+//! .cargo-lock
+//!
+//! # Hidden directory that holds all of the fingerprint files for all
+//! # packages
+//! .fingerprint/
+//! # Each package is in a separate directory.
+//! $pkgname-$META/
+//! # Set of source filenames for this package.
+//! dep-lib-$pkgname-$META
+//! # Timestamp when this package was last built.
+//! invoked.timestamp
+//! # The fingerprint hash.
+//! lib-$pkgname-$META
+//! # Detailed information used for logging the reason why
+//! # something is being recompiled.
+//! lib-$pkgname-$META.json
+//!
+//! # This is the root directory for all rustc artifacts except build
+//! # scripts, examples, and test and bench executables. Almost every
+//! # artifact should have a metadata hash added to its filename to
+//! # prevent collisions. One notable exception is dynamic libraries.
+//! deps/
+//!
+//! # Root directory for all compiled examples.
+//! examples/
+//!
+//! # Directory used to store incremental data for the compiler (when
+//! # incremental is enabled.
+//! incremental/
//!
//! # This is the location at which the output of all custom build
-//! # commands are rooted
+//! # commands are rooted.
//! build/
//!
//! # Each package gets its own directory where its build script and
//! # script output are placed
-//! $pkg1/
-//! $pkg2/
-//! $pkg3/
+//! $pkgname-$META/ # For the build script itself.
+//! # The build script executable (name may be changed by user).
+//! build-script-build-$META
+//! # Hard link to build-script-build-$META.
+//! build-script-build
+//! # Dependency information generated by rustc.
+//! build-script-build-$META.d
+//! # Debug information, depending on platform and profile
+//! # settings.
+//!
//!
-//! # Each directory package has a `out` directory where output
-//! # is placed.
+//! # The package shows up twice with two different metadata hashes.
+//! $pkgname-$META/ # For the output of the build script.
+//! # Timestamp when the build script was last executed.
+//! invoked.timestamp
+//! # Directory where script can output files ($OUT_DIR).
//! out/
+//! # Output from the build script.
+//! output
+//! # Path to `out`, used to help when the target directory is
+//! # moved.
+//! root-output
+//! # Stderr output from the build script.
+//! stderr
//!
-//! # This is the location at which the output of all old custom build
-//! # commands are rooted
-//! native/
+//! # Output from rustdoc
+//! doc/
//!
-//! # Each package gets its own directory for where its output is
-//! # placed. We can't track exactly what's getting put in here, so
-//! # we just assume that all relevant output is in these
-//! # directories.
-//! $pkg1/
-//! $pkg2/
-//! $pkg3/
+//! # Used by `cargo package` and `cargo publish` to build a `.crate` file.
+//! package/
//!
-//! # Directory used to store incremental data for the compiler (when
-//! # incremental is enabled.
-//! incremental/
-//!
-//! # Hidden directory that holds all of the fingerprint files for all
-//! # packages
-//! .fingerprint/
+//! # Experimental feature for generated build scripts.
+//! .metabuild/
//! ```
+//!
+//! When cross-compiling, the layout is the same, except it appears in
+//! `target/$TRIPLE`.
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use crate::core::Workspace;
-use crate::util::{CargoResult, Config, FileLock, Filesystem};
+use crate::util::{CargoResult, FileLock};
/// Contains the paths of all target output locations.
///
/// See module docs for more information.
pub struct Layout {
+ /// The root directory: `/path/to/target`.
+ /// If cross compiling: `/path/to/target/$TRIPLE`.
root: PathBuf,
+ /// The final artifact destination: `$root/debug` (or `release`).
+ dest: PathBuf,
+ /// The directory with rustc artifacts: `$dest/deps`
deps: PathBuf,
- native: PathBuf,
+ /// The directory for build scripts: `$dest/build`
build: PathBuf,
+ /// The directory for incremental files: `$dest/incremental`
incremental: PathBuf,
+ /// The directory for fingerprints: `$dest/.fingerprint`
fingerprint: PathBuf,
+ /// The directory for examples: `$dest/examples`
examples: PathBuf,
- /// The lock file for a build, will be unlocked when this struct is `drop`ped.
+ /// The directory for rustdoc output: `$root/doc`
+ doc: PathBuf,
+ /// The lockfile for a build (`.cargo-lock`). Will be unlocked when this
+ /// struct is `drop`ped.
_lock: FileLock,
}
pub fn is_bad_artifact_name(name: &str) -> bool {
- ["deps", "examples", "build", "native", "incremental"]
+ ["deps", "examples", "build", "incremental"]
.iter()
.any(|&reserved| reserved == name)
}
@@ -82,55 +134,50 @@ impl Layout {
///
/// This function will block if the directory is already locked.
///
- /// Differs from `at` in that this calculates the root path from the workspace target directory,
- /// adding the target triple and the profile (debug, release, ...).
+ /// `dest` should be the final artifact directory name. Currently either
+ /// "debug" or "release".
pub fn new(ws: &Workspace<'_>, triple: Option<&str>, dest: &str) -> CargoResult {
- let mut path = ws.target_dir();
+ let mut root = ws.target_dir();
// Flexible target specifications often point at json files, so interpret
// the target triple as a Path and then just use the file stem as the
// component for the directory name in that case.
if let Some(triple) = triple {
let triple = Path::new(triple);
if triple.extension().and_then(|s| s.to_str()) == Some("json") {
- path.push(
+ root.push(
triple
.file_stem()
.ok_or_else(|| failure::format_err!("invalid target"))?,
);
} else {
- path.push(triple);
+ root.push(triple);
}
}
- path.push(dest);
- Layout::at(ws.config(), path)
- }
-
- /// Calculate the paths for build output, lock the build directory, and return as a Layout.
- ///
- /// This function will block if the directory is already locked.
- pub fn at(config: &Config, root: Filesystem) -> CargoResult {
+ let dest = root.join(dest);
// If the root directory doesn't already exist go ahead and create it
// here. Use this opportunity to exclude it from backups as well if the
// system supports it since this is a freshly created folder.
- if !root.as_path_unlocked().exists() {
- root.create_dir()?;
- exclude_from_backups(root.as_path_unlocked());
+ if !dest.as_path_unlocked().exists() {
+ dest.create_dir()?;
+ exclude_from_backups(dest.as_path_unlocked());
}
// For now we don't do any more finer-grained locking on the artifact
// directory, so just lock the entire thing for the duration of this
// compile.
- let lock = root.open_rw(".cargo-lock", config, "build directory")?;
+ let lock = dest.open_rw(".cargo-lock", ws.config(), "build directory")?;
let root = root.into_path_unlocked();
+ let dest = dest.into_path_unlocked();
Ok(Layout {
- deps: root.join("deps"),
- native: root.join("native"),
- build: root.join("build"),
- incremental: root.join("incremental"),
- fingerprint: root.join(".fingerprint"),
- examples: root.join("examples"),
+ deps: dest.join("deps"),
+ build: dest.join("build"),
+ incremental: dest.join("incremental"),
+ fingerprint: dest.join(".fingerprint"),
+ examples: dest.join("examples"),
+ doc: root.join("doc"),
root,
+ dest,
_lock: lock,
})
}
@@ -138,7 +185,6 @@ impl Layout {
/// Makes sure all directories stored in the Layout exist on the filesystem.
pub fn prepare(&mut self) -> io::Result<()> {
mkdir(&self.deps)?;
- mkdir(&self.native)?;
mkdir(&self.incremental)?;
mkdir(&self.fingerprint)?;
mkdir(&self.examples)?;
@@ -154,9 +200,9 @@ impl Layout {
}
}
- /// Fetch the root path.
+ /// Fetch the destination path for final artifacts (`/…/target/debug`).
pub fn dest(&self) -> &Path {
- &self.root
+ &self.dest
}
/// Fetch the deps path.
pub fn deps(&self) -> &Path {
@@ -166,7 +212,11 @@ impl Layout {
pub fn examples(&self) -> &Path {
&self.examples
}
- /// Fetch the root path.
+ /// Fetch the doc path.
+ pub fn doc(&self) -> &Path {
+ &self.doc
+ }
+ /// Fetch the root path (`/…/target`).
pub fn root(&self) -> &Path {
&self.root
}
@@ -178,7 +228,7 @@ impl Layout {
pub fn fingerprint(&self) -> &Path {
&self.fingerprint
}
- /// Fetch the build path.
+ /// Fetch the build script path.
pub fn build(&self) -> &Path {
&self.build
}
diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs
index 58763d975..14e2f60ad 100644
--- a/src/cargo/core/compiler/mod.rs
+++ b/src/cargo/core/compiler/mod.rs
@@ -480,6 +480,7 @@ fn link_targets<'a, 'cfg>(
}))
}
+/// Hardlink (file) or symlink (dir) src to dst if possible, otherwise copy it.
fn hardlink_or_copy(src: &Path, dst: &Path) -> CargoResult<()> {
debug!("linking {} to {}", src.display(), dst.display());
if is_same_file(src, dst).unwrap_or(false) {
diff --git a/src/doc/src/reference/manifest.md b/src/doc/src/reference/manifest.md
index ea60e8c55..4839be125 100644
--- a/src/doc/src/reference/manifest.md
+++ b/src/doc/src/reference/manifest.md
@@ -628,7 +628,7 @@ dependencies residing in the workspace directory become members. You can add
additional packages to the workspace by listing them in the `members` key. Note
that members of the workspaces listed explicitly will also have their path
dependencies included in the workspace. Sometimes a package may have a lot of
-workspace members and it can be onerous to keep up to date. The path dependency
+workspace members and it can be onerous to keep up to date. The `members` list
can also use [globs][globs] to match multiple paths. Finally, the `exclude`
key can be used to blacklist paths from being included in a workspace. This can
be useful if some path dependencies aren't desired to be in the workspace at