Skip to content

Commit

Permalink
Improve resolver version mismatch warning
Browse files Browse the repository at this point in the history
fixes: #12557
  • Loading branch information
eopb committed Aug 27, 2023
1 parent 2a6f7f6 commit bfb2a45
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/cargo/core/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1021,11 +1021,18 @@ impl<'cfg> Workspace<'cfg> {
.max()
{
let resolver = edition.default_resolve_behavior().to_manifest();
self.config.shell().warn(format_args!("some crates are on edition {edition} which defaults to `resolver = \"{resolver}\"`, but virtual workspaces default to `resolver = \"1\"`"))?;
self.config.shell().warn(format_args!(
"virtual workspaces defaulting to `resolver = \"1\"` despite one or more workspace members being on edition {edition} which implies `resolver = \"{resolver}\"`"
))?;
self.config.shell().note(
"to keep the current resolver, specify `workspace.resolver = \"1\"` in the workspace root's manifest",
)?;
self.config.shell().note(format_args!("to use the edition {edition} resolver, specify `workspace.resolver = \"{resolver}\"` in the workspace root's manifest"))?;
self.config.shell().note(format_args!(
"to use the edition {edition} resolver, specify `workspace.resolver = \"{resolver}\"` in the workspace root's manifest"
))?;
self.config.shell().note(
"for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions",
)?;
}
}
}
Expand Down

0 comments on commit bfb2a45

Please sign in to comment.