diff --git a/crates/cargo-test-support/src/lib.rs b/crates/cargo-test-support/src/lib.rs
index c0df4ea10c5..0d61d5931d9 100644
--- a/crates/cargo-test-support/src/lib.rs
+++ b/crates/cargo-test-support/src/lib.rs
@@ -806,9 +806,14 @@ impl Execs {
p.build_command()
}
- pub fn masquerade_as_nightly_cargo(&mut self) -> &mut Self {
+ /// Enables nightly features for testing
+ ///
+ /// The list of reasons should be why nightly cargo is needed. If it is
+ /// becuase of an unstable feature put the name of the feature as the reason,
+ /// e.g. `&["print-im-a-teapot"]`
+ pub fn masquerade_as_nightly_cargo(&mut self, reasons: &[&str]) -> &mut Self {
if let Some(ref mut p) = self.process_builder {
- p.masquerade_as_nightly_cargo();
+ p.masquerade_as_nightly_cargo(reasons);
}
self
}
@@ -1139,17 +1144,20 @@ fn _process(t: &OsStr) -> ProcessBuilder {
/// Enable nightly features for testing
pub trait ChannelChanger {
- fn masquerade_as_nightly_cargo(self) -> Self;
+ /// The list of reasons should be why nightly cargo is needed. If it is
+ /// becuase of an unstable feature put the name of the feature as the reason,
+ /// e.g. `&["print-im-a-teapot"]`.
+ fn masquerade_as_nightly_cargo(self, _reasons: &[&str]) -> Self;
}
impl ChannelChanger for &mut ProcessBuilder {
- fn masquerade_as_nightly_cargo(self) -> Self {
+ fn masquerade_as_nightly_cargo(self, _reasons: &[&str]) -> Self {
self.env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "nightly")
}
}
impl ChannelChanger for snapbox::cmd::Command {
- fn masquerade_as_nightly_cargo(self) -> Self {
+ fn masquerade_as_nightly_cargo(self, _reasons: &[&str]) -> Self {
self.env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "nightly")
}
}
diff --git a/crates/resolver-tests/src/lib.rs b/crates/resolver-tests/src/lib.rs
index eae6469545d..fd190fe6b3b 100644
--- a/crates/resolver-tests/src/lib.rs
+++ b/crates/resolver-tests/src/lib.rs
@@ -12,7 +12,7 @@ use std::time::Instant;
use cargo::core::dependency::DepKind;
use cargo::core::resolver::{self, ResolveOpts, VersionPreferences};
-use cargo::core::source::{GitReference, SourceId};
+use cargo::core::source::{GitReference, QueryKind, SourceId};
use cargo::core::Resolve;
use cargo::core::{Dependency, PackageId, Registry, Summary};
use cargo::util::{CargoResult, Config, Graph, IntoUrl};
@@ -128,11 +128,15 @@ pub fn resolve_with_config_raw(
fn query(
&mut self,
dep: &Dependency,
+ kind: QueryKind,
f: &mut dyn FnMut(Summary),
- fuzzy: bool,
) -> Poll> {
for summary in self.list.iter() {
- if fuzzy || dep.matches(summary) {
+ let matched = match kind {
+ QueryKind::Exact => dep.matches(summary),
+ QueryKind::Fuzzy => true,
+ };
+ if matched {
self.used.insert(summary.package_id());
f(summary.clone());
}
diff --git a/src/bin/cargo/commands/add.rs b/src/bin/cargo/commands/add.rs
index 32c7699e775..1ff2aad1944 100644
--- a/src/bin/cargo/commands/add.rs
+++ b/src/bin/cargo/commands/add.rs
@@ -7,6 +7,7 @@ use cargo::ops::cargo_add::add;
use cargo::ops::cargo_add::AddOptions;
use cargo::ops::cargo_add::DepOp;
use cargo::ops::cargo_add::DepTable;
+use cargo::ops::resolve_ws;
use cargo::util::command_prelude::*;
use cargo::util::interning::InternedString;
use cargo::CargoResult;
@@ -193,6 +194,12 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
};
add(&ws, &options)?;
+ if !dry_run {
+ // Reload the workspace since we've changed dependencies
+ let ws = args.workspace(config)?;
+ resolve_ws(&ws)?;
+ }
+
Ok(())
}
diff --git a/src/bin/cargo/commands/install.rs b/src/bin/cargo/commands/install.rs
index e409d85fc86..8416cdfa57c 100644
--- a/src/bin/cargo/commands/install.rs
+++ b/src/bin/cargo/commands/install.rs
@@ -55,7 +55,10 @@ pub fn cli() -> App {
.arg(flag("no-track", "Do not save tracking information"))
.arg_features()
.arg_profile("Install artifacts with the specified profile")
- .arg(flag("debug", "Build in debug mode instead of release mode"))
+ .arg(flag(
+ "debug",
+ "Build in debug mode (with the 'dev' profile) instead of release mode",
+ ))
.arg_targets_bins_examples(
"Install only the specified binary",
"Install all binaries",
diff --git a/src/bin/cargo/commands/rustc.rs b/src/bin/cargo/commands/rustc.rs
index 84970185e5c..098fe6b1cee 100644
--- a/src/bin/cargo/commands/rustc.rs
+++ b/src/bin/cargo/commands/rustc.rs
@@ -39,7 +39,7 @@ pub fn cli() -> App {
.arg(multi_opt(
CRATE_TYPE_ARG_NAME,
"CRATE-TYPE",
- "Comma separated list of types of crates for the compiler to emit (unstable)",
+ "Comma separated list of types of crates for the compiler to emit",
))
.arg_target_dir()
.arg_manifest_path()
@@ -88,9 +88,6 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
compile_opts.target_rustc_crate_types = if crate_types.is_empty() {
None
} else {
- config
- .cli_unstable()
- .fail_if_stable_opt(CRATE_TYPE_ARG_NAME, 10083)?;
Some(crate_types)
};
ops::compile(&ws, &compile_opts)?;
diff --git a/src/cargo/core/compiler/compile_kind.rs b/src/cargo/core/compiler/compile_kind.rs
index 9f6271ce0a9..7ab19ae1ccf 100644
--- a/src/cargo/core/compiler/compile_kind.rs
+++ b/src/cargo/core/compiler/compile_kind.rs
@@ -2,7 +2,7 @@ use crate::core::Target;
use crate::util::errors::CargoResult;
use crate::util::interning::InternedString;
use crate::util::{Config, StableHasher};
-use anyhow::{bail, Context as _};
+use anyhow::Context as _;
use serde::Serialize;
use std::collections::BTreeSet;
use std::fs;
@@ -65,9 +65,6 @@ impl CompileKind {
};
if !targets.is_empty() {
- if targets.len() > 1 && !config.cli_unstable().multitarget {
- bail!("specifying multiple `--target` flags requires `-Zmultitarget`")
- }
return dedup(targets);
}
diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs
index c814842dff7..61b2c47fd87 100644
--- a/src/cargo/core/compiler/future_incompat.rs
+++ b/src/cargo/core/compiler/future_incompat.rs
@@ -1,7 +1,7 @@
//! Support for future-incompatible warning reporting.
use crate::core::compiler::BuildContext;
-use crate::core::{Dependency, PackageId, Workspace};
+use crate::core::{Dependency, PackageId, QueryKind, Workspace};
use crate::sources::SourceConfigMap;
use crate::util::{iter_join, CargoResult, Config};
use anyhow::{bail, format_err, Context};
@@ -293,7 +293,7 @@ fn get_updates(ws: &Workspace<'_>, package_ids: &BTreeSet) -> Option<
Ok(dep) => dep,
Err(_) => return false,
};
- match source.query_vec(&dep) {
+ match source.query_vec(&dep, QueryKind::Exact) {
Poll::Ready(Ok(sum)) => {
summaries.push((pkg_id, sum));
false
diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs
index 2a9b32e8ca3..0400e89a1e4 100644
--- a/src/cargo/core/features.rs
+++ b/src/cargo/core/features.rs
@@ -86,7 +86,9 @@
//! `CliUnstable. Remove the `(unstable)` note in the clap help text if
//! necessary.
//! 2. Remove `masquerade_as_nightly_cargo` from any tests, and remove
-//! `cargo-features` from `Cargo.toml` test files if any.
+//! `cargo-features` from `Cargo.toml` test files if any. You can
+//! quickly find what needs to be removed by searching for the name
+//! of the feature, e.g. `print_im_a_teapot`
//! 3. Update the docs in unstable.md to move the section to the bottom
//! and summarize it similar to the other entries. Update the rest of the
//! documentation to add the new feature.
@@ -414,7 +416,7 @@ features! {
(unstable, profile_rustflags, "", "reference/unstable.html#profile-rustflags-option"),
// Allow specifying rustflags directly in a profile
- (unstable, workspace_inheritance, "", "reference/unstable.html#workspace-inheritance"),
+ (stable, workspace_inheritance, "1.64", "reference/unstable.html#workspace-inheritance"),
}
pub struct Feature {
@@ -720,6 +722,8 @@ const STABILISED_NAMESPACED_FEATURES: &str = "Namespaced features are now always
const STABILIZED_TIMINGS: &str = "The -Ztimings option has been stabilized as --timings.";
+const STABILISED_MULTITARGET: &str = "Multiple `--target` options are now always available.";
+
fn deserialize_build_std<'de, D>(deserializer: D) -> Result
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-build.md b/src/doc/src/commands/cargo-build.md
index 753cf9c4d62..444a3fef151 100644
--- a/src/doc/src/commands/cargo-build.md
+++ b/src/doc/src/commands/cargo-build.md
@@ -1,6 +1,7 @@
# cargo-build(1)
+
## NAME
cargo-build - Compile the current package
@@ -182,7 +183,7 @@ be specified multiple times, which enables all specified features.
--targettriple
Build for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-check.md b/src/doc/src/commands/cargo-check.md
index ec713d3a742..e1a4b97f4b2 100644
--- a/src/doc/src/commands/cargo-check.md
+++ b/src/doc/src/commands/cargo-check.md
@@ -1,6 +1,7 @@
# cargo-check(1)
+
## NAME
cargo-check - Check the current package
@@ -177,7 +178,7 @@ be specified multiple times, which enables all specified features.
--targettriple
Check for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-clean.md b/src/doc/src/commands/cargo-clean.md
index d2e46620471..eee69854dc6 100644
--- a/src/doc/src/commands/cargo-clean.md
+++ b/src/doc/src/commands/cargo-clean.md
@@ -1,6 +1,7 @@
# cargo-clean(1)
+
## NAME
cargo-clean - Remove generated artifacts
@@ -59,7 +60,7 @@ Defaults to target in the root of the workspace.
--targettriple
Clean for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-doc.md b/src/doc/src/commands/cargo-doc.md
index eee17d3fd70..d11b01b9559 100644
--- a/src/doc/src/commands/cargo-doc.md
+++ b/src/doc/src/commands/cargo-doc.md
@@ -1,6 +1,7 @@
# cargo-doc(1)
+
## NAME
cargo-doc - Build a package's documentation
@@ -155,7 +156,7 @@ be specified multiple times, which enables all specified features.
--targettriple
Document for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-fetch.md b/src/doc/src/commands/cargo-fetch.md
index 7cdd4543e13..9248fb98aeb 100644
--- a/src/doc/src/commands/cargo-fetch.md
+++ b/src/doc/src/commands/cargo-fetch.md
@@ -2,6 +2,7 @@
+
## NAME
cargo-fetch - Fetch dependencies of a package from the network
@@ -34,7 +35,7 @@ you plan to use Cargo without a network with the `--offline` flag.
--targettriple
Fetch for the given architecture. The default is all architectures. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-fix.md b/src/doc/src/commands/cargo-fix.md
index e1fcc76236f..de2a5436f6f 100644
--- a/src/doc/src/commands/cargo-fix.md
+++ b/src/doc/src/commands/cargo-fix.md
@@ -1,6 +1,7 @@
# cargo-fix(1)
+
## NAME
cargo-fix - Automatically fix lint warnings reported by rustc
@@ -257,7 +258,7 @@ be specified multiple times, which enables all specified features.
--targettriple
Fix for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-package.md b/src/doc/src/commands/cargo-package.md
index bfae8c1691d..13d08741892 100644
--- a/src/doc/src/commands/cargo-package.md
+++ b/src/doc/src/commands/cargo-package.md
@@ -2,6 +2,7 @@
+
## NAME
cargo-package - Assemble the local package into a distributable tarball
@@ -133,7 +134,7 @@ single quotes or double quotes around each pattern.
--targettriple
Package for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-publish.md b/src/doc/src/commands/cargo-publish.md
index 133d7619bc5..9b8f47f8bc8 100644
--- a/src/doc/src/commands/cargo-publish.md
+++ b/src/doc/src/commands/cargo-publish.md
@@ -1,6 +1,7 @@
# cargo-publish(1)
+
## NAME
cargo-publish - Upload a package to the registry
@@ -99,7 +100,7 @@ format.
--targettriple
Publish for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-rustc.md b/src/doc/src/commands/cargo-rustc.md
index ba42ca43e2e..fea0de2b57f 100644
--- a/src/doc/src/commands/cargo-rustc.md
+++ b/src/doc/src/commands/cargo-rustc.md
@@ -1,6 +1,7 @@
# cargo-rustc(1)
+
## NAME
cargo-rustc - Compile the current package, and pass extra options to the compiler
@@ -169,7 +170,7 @@ be specified multiple times, which enables all specified features.
--targettriple
Build for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
@@ -226,6 +227,17 @@ information about timing information.
+
--crate-typecrate-type
+
Build for the given crate type. This flag accepts a comma-separated list of
+1 or more crate types, of which the allowed values are the same as crate-type
+field in the manifest for configurating a Cargo target. See
+crate-type field
+for possible values.
+
If the manifest contains a list, and --crate-type is provided,
+the command-line argument value will override what is in the manifest.
+
This flag only works when building a lib or example library target.
+
+
### Output Options
@@ -412,5 +424,9 @@ details on environment variables that Cargo reads.
cargo rustc --lib -- -Z print-type-sizes
+3. Override `crate-type` field in Cargo.toml with command-line option:
+
+ cargo rustc --lib --crate-type lib,cdylib
+
## SEE ALSO
[cargo(1)](cargo.html), [cargo-build(1)](cargo-build.html), [rustc(1)](https://doc.rust-lang.org/rustc/index.html)
diff --git a/src/doc/src/commands/cargo-rustdoc.md b/src/doc/src/commands/cargo-rustdoc.md
index 5ae475d7972..3e1a4b8615b 100644
--- a/src/doc/src/commands/cargo-rustdoc.md
+++ b/src/doc/src/commands/cargo-rustdoc.md
@@ -1,6 +1,7 @@
# cargo-rustdoc(1)
+
## NAME
cargo-rustdoc - Build a package's documentation, using specified custom flags
@@ -174,7 +175,7 @@ be specified multiple times, which enables all specified features.
--targettriple
Document for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/commands/cargo-test.md b/src/doc/src/commands/cargo-test.md
index ca40d80f6ab..783523bb40f 100644
--- a/src/doc/src/commands/cargo-test.md
+++ b/src/doc/src/commands/cargo-test.md
@@ -2,6 +2,7 @@
+
## NAME
cargo-test - Execute unit and integration tests of a package
@@ -269,7 +270,7 @@ be specified multiple times, which enables all specified features.
--targettriple
Test for the given architecture. The default is the host architecture. The general format of the triple is
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for a
-list of supported targets.
+list of supported targets. This flag may be specified multiple times.
This may also be specified with the build.targetconfig value.
Note that specifying this flag makes Cargo run in a different mode where the
diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md
index 552a0b5b820..ee330b6e198 100644
--- a/src/doc/src/reference/config.md
+++ b/src/doc/src/reference/config.md
@@ -363,7 +363,8 @@ Sets the executable to use for `rustc`.
* Environment: `CARGO_BUILD_RUSTC_WRAPPER` or `RUSTC_WRAPPER`
Sets a wrapper to execute instead of `rustc`. The first argument passed to the
-wrapper is the path to the actual `rustc`.
+wrapper is the path to the actual executable to use
+(i.e., `build.rustc`, if that is set, or `"rustc"` otherwise).
##### `build.rustc-workspace-wrapper`
* Type: string (program path)
@@ -371,7 +372,8 @@ wrapper is the path to the actual `rustc`.
* Environment: `CARGO_BUILD_RUSTC_WORKSPACE_WRAPPER` or `RUSTC_WORKSPACE_WRAPPER`
Sets a wrapper to execute instead of `rustc`, for workspace members only.
-The first argument passed to the wrapper is the path to the actual `rustc`.
+The first argument passed to the wrapper is the path to the actual
+executable to use (i.e., `build.rustc`, if that is set, or `"rustc"` otherwise).
It affects the filename hash so that artifacts produced by the wrapper are cached separately.
##### `build.rustdoc`
@@ -382,16 +384,25 @@ It affects the filename hash so that artifacts produced by the wrapper are cache
Sets the executable to use for `rustdoc`.
##### `build.target`
-* Type: string
+* Type: string or array of strings
* Default: host platform
* Environment: `CARGO_BUILD_TARGET`
-The default target platform triple to compile to.
+The default target platform triples to compile to.
-This may also be a relative path to a `.json` target spec file.
+This allows passing either a string or an array of strings. Each string value
+is a target platform triple. The selected build targets will be built for each
+of the selected architectures.
+
+The string value may also be a relative path to a `.json` target spec file.
Can be overridden with the `--target` CLI option.
+```toml
+[build]
+target = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
+```
+
##### `build.target-dir`
* Type: string (path)
* Default: "target"
diff --git a/src/doc/src/reference/environment-variables.md b/src/doc/src/reference/environment-variables.md
index fc184e3b427..b1a5db4c4e4 100644
--- a/src/doc/src/reference/environment-variables.md
+++ b/src/doc/src/reference/environment-variables.md
@@ -21,15 +21,18 @@ system:
* `RUSTC` — Instead of running `rustc`, Cargo will execute this specified
compiler instead. See [`build.rustc`] to set via config.
* `RUSTC_WRAPPER` — Instead of simply running `rustc`, Cargo will execute this
- specified wrapper instead, passing as its command-line arguments the rustc
- invocation, with the first argument being `rustc`. Useful to set up a build
- cache tool such as `sccache`. See [`build.rustc-wrapper`] to set via config.
-* `RUSTC_WORKSPACE_WRAPPER` — Instead of simply running `rustc`, Cargo will
- execute this specified wrapper instead for workspace members only, passing
+ specified wrapper, passing as its command-line arguments the rustc
+ invocation, with the first argument being the path to the actual rustc.
+ Useful to set up a build cache tool such as `sccache`. See
+ [`build.rustc-wrapper`] to set via config. Setting this to the empty string
+ overwrites the config and resets cargo to not use a wrapper.
+* `RUSTC_WORKSPACE_WRAPPER` — Instead of simply running `rustc`, for workspace
+ members Cargo will execute this specified wrapper, passing
as its command-line arguments the rustc invocation, with the first argument
- being `rustc`. It affects the filename hash so that artifacts produced by
- the wrapper are cached separately. See [`build.rustc-workspace-wrapper`]
- to set via config.
+ being the path to the actual rustc. It affects the filename hash
+ so that artifacts produced by the wrapper are cached separately.
+ See [`build.rustc-workspace-wrapper`] to set via config. Setting this to the empty string
+ overwrites the config and resets cargo to not use a wrapper for workspace members.
* `RUSTDOC` — Instead of running `rustdoc`, Cargo will execute this specified
`rustdoc` instance instead. See [`build.rustdoc`] to set via config.
* `RUSTDOCFLAGS` — A space-separated list of custom flags to pass to all `rustdoc`
diff --git a/src/doc/src/reference/future-incompat-report.md b/src/doc/src/reference/future-incompat-report.md
index 703536ed35e..b72f117572a 100644
--- a/src/doc/src/reference/future-incompat-report.md
+++ b/src/doc/src/reference/future-incompat-report.md
@@ -1,24 +1,37 @@
### Future incompat report
-Cargo checks for future-incompatible warnings in all dependencies. These are warnings for
+Cargo checks for future-incompatible warnings in all dependencies. These are warnings for
changes that may become hard errors in the future, causing the dependency to
stop building in a future version of rustc. If any warnings are found, a small
notice is displayed indicating that the warnings were found, and provides
instructions on how to display a full report.
+For example, you may see something like this at the end of a build:
+
+```text
+warning: the following packages contain code that will be rejected by a future
+ version of Rust: rental v0.5.5
+note: to see what the problems were, use the option `--future-incompat-report`,
+ or run `cargo report future-incompatibilities --id 1`
+```
+
A full report can be displayed with the `cargo report future-incompatibilities
--id ID` command, or by running the build again with
the `--future-incompat-report` flag. The developer should then update their
dependencies to a version where the issue is fixed, or work with the
developers of the dependencies to help resolve the issue.
-This feature can be configured through a `[future-incompat-report]`
-section in `.cargo/config`. Currently, the supported options are:
+## Configuration
-```
+This feature can be configured through a [`[future-incompat-report]`][config]
+section in `.cargo/config.toml`. Currently, the supported options are:
+
+```toml
[future-incompat-report]
-frequency = FREQUENCY
+frequency = "always"
```
-The supported values for `FREQUENCY` are `always` and `never`, which control
+The supported values for the frequency are `"always"` and `"never"`, which control
whether or not a message is printed out at the end of `cargo build` / `cargo check`.
+
+[config]: config.md#future-incompat-report
diff --git a/src/doc/src/reference/profiles.md b/src/doc/src/reference/profiles.md
index 6885f04ffd4..326be46fab2 100644
--- a/src/doc/src/reference/profiles.md
+++ b/src/doc/src/reference/profiles.md
@@ -246,7 +246,7 @@ whether or not [`rpath`] is enabled.
#### dev
The `dev` profile is used for normal development and debugging. It is the
-default for build commands like [`cargo build`].
+default for build commands like [`cargo build`], and is used for `cargo install --debug`.
The default settings for the `dev` profile are:
diff --git a/src/doc/src/reference/registries.md b/src/doc/src/reference/registries.md
index 45af03236f4..0289524b3d7 100644
--- a/src/doc/src/reference/registries.md
+++ b/src/doc/src/reference/registries.md
@@ -320,9 +320,10 @@ visit the registry's website to obtain a token, and Cargo can store the token
using the [`cargo login`] command, or by passing the token on the
command-line.
-Responses use a 200 response code for both success and errors. Cargo looks at
-the JSON response to determine if there was success or failure. Failure
-responses have a JSON object with the following structure:
+Responses use the 200 response code for success.
+Errors should use an appropriate response code, such as 404.
+Failure
+responses should have a JSON object with the following structure:
```javascript
{
@@ -336,10 +337,10 @@ responses have a JSON object with the following structure:
}
```
-Servers may also respond with a 404 response code to indicate the requested
-resource is not found (for example, an unknown crate name). However, using a
-200 response with an `errors` object allows a registry to provide a more
-detailed error message if desired.
+If the response has this structure Cargo will display the detailed message to the user, even if the response code is 200.
+If the response code indicates an error and the content does not have this structure, Cargo will display to the user a
+ message intended to help debugging the server error. A server returning an `errors` object allows a registry to provide a more
+detailed or user-centric error message.
For backwards compatibility, servers should ignore any unexpected query
parameters or JSON fields. If a JSON field is missing, it should be assumed to
diff --git a/src/doc/src/reference/specifying-dependencies.md b/src/doc/src/reference/specifying-dependencies.md
index f1188f6d6fb..36ddf0dbb5a 100644
--- a/src/doc/src/reference/specifying-dependencies.md
+++ b/src/doc/src/reference/specifying-dependencies.md
@@ -454,8 +454,44 @@ following to the above manifest:
log-debug = ['bar/log-debug'] # using 'foo/log-debug' would be an error!
```
+### Inheriting a dependency from a workspace
+
+Dependencies can be inherited from a workspace by specifying the
+dependency in the workspace's [`[workspace.dependencies]`][workspace.dependencies] table.
+After that add it to the `[dependencies]` table with `workspace = true`.
+
+Along with the `workspace` key, dependencies can also include these keys:
+- [`optional`][optional]: Note that the`[workspace.dependencies]` table is not allowed to specify `optional`.
+- [`features`][features]: These are additive with the features declared in the `[workspace.dependencies]`
+
+Other than `optional` and `features`, inherited dependencies cannot use any other
+dependency key (such as `version` or `default-features`).
+
+Dependencies in the `[dependencies]`, `[dev-dependencies]`, `[build-dependencies]`, and
+`[target."...".dependencies]` sections support the ability to reference the
+`[workspace.dependencies]` definition of dependencies.
+
+```toml
+[project]
+name = "bar"
+version = "0.2.0"
+
+[dependencies]
+regex = { workspace = true, features = ["unicode"] }
+
+[build-dependencies]
+cc.workspace = true
+
+[dev-dependencies]
+rand = { workspace = true, optional = true }
+```
+
+
[crates.io]: https://crates.io/
[dev-dependencies]: #development-dependencies
+[workspace.dependencies]: workspaces.md#the-workspacedependencies-table
+[optional]: features.md#optional-dependencies
+[features]: features.md