fix(init): Use detected project kind in status message#16791
fix(init): Use detected project kind in status message#16791cuiweixie wants to merge 2 commits intorust-lang:masterfrom
Conversation
When `cargo init` auto-detects the project kind, the shell status previously showed the user-selected kind from options instead of the resolved kind. Print the computed kind so the message matches the actual package type being created.
|
r? @epage rustbot has assigned @epage. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Thanks! If this didn't change an existing test, we'd expect a new test to be written. We've found it helpful to add the tests in a commit before the fix, reproducing the problem. We have notes on this in our contrib guide but I'm experimenting with a longer description at https://epage.github.io/dev/pr-style/#c-test |
|
@cuiweixie it looks like this did impact existing tests. Could you run |
| [DOWNLOADING] crates ... | ||
| [DOWNLOADED] foo v0.0.1 (registry `dummy-registry`) | ||
| [INSTALLING] foo v0.0.1 | ||
| [WARNING] default toolchain implicitly overridden with `1.94.0-[HOST_TARGET]` by rustup directory override |
There was a problem hiding this comment.
You should not have directory override when running snapshots, run SNAPSHOTS=overwrite rustup run +1.94.0 cargo test --test testsuite and try again
There was a problem hiding this comment.
These toolchain warning snapshot shouldn't have been updated.
|
Reminder, once the PR becomes ready for a review, use |
What
When
cargo initauto-detects the project kind, the shell status line previously printed the kind from CLI options (opts.kind) instead of the resolvedkindafter detection.Change
Use the computed
kindin theCreating … packagestatus so the message matches the package type actually being created.Testing
cargo initin a directory where kind is auto-detected shows the correct kind in the status message.