You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: emit a warning when both package.publish and --index are specified (#16268)
Partially adresses #16231.
### What does this PR try to resolve?
`cargo publish` will fail, if `--registry` is passed and that index
isn't included in `package.publish` in Cargo.toml. However, as described
in linked issue, `--index` bypasses that check and may cause unexpected
publication of packages.
This PR implements warning that is shown when `--index` and
`package.publish` is set at the same time.
if registry_is_specified_by_any_package && registry_or_index.is_index(){
813
+
opts.gctx.shell().warn(r#"`--index` will ignore registries set by `package.publish` in Cargo.toml, and may cause unexpected push to prohibited registry
814
+
help: use `--registry` instead or set `publish = true` in Cargo.toml to suppress this warning"#)?;
0 commit comments