Skip to content

Conversation

@workingjubilee
Copy link
Member

@workingjubilee workingjubilee commented Dec 16, 2025

Pointing out they can set the crate's name is non-actionable: their problem is they found out how and set it incorrectly. Remove extraneous information that can only confuse the matter.

Fixes #150023

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 16, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jieyouxu
Copy link
Member

r? me
r=me once PR CI is green.

@rustbot rustbot assigned jieyouxu and unassigned fee1-dead Dec 16, 2025
@fmease
Copy link
Member

fmease commented Dec 16, 2025

Did you mean to link this PR to issue #150023?

@workingjubilee
Copy link
Member Author

Yes!

@workingjubilee
Copy link
Member Author

@bors r=jieyouxu rollup

@bors
Copy link
Collaborator

bors commented Dec 16, 2025

📌 Commit b19d781 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 16, 2025
bors added a commit that referenced this pull request Dec 16, 2025
…uwer

Rollup of 11 pull requests

Successful merges:

 - #147939 (Make `const BorrowMut` require `const Borrow` and make `const Fn` require `const FnMut`)
 - #149734 (Mirror GCC 9.5.0)
 - #149767 (Tidying up tests/ui/issues 33 tests [4/N])
 - #149804 (chore: fix some minor issues in the comments)
 - #149967 (custom `VaList` layout for Hexagon)
 - #150025 (dont create unnecessary `DefId`s under mgca)
 - #150032 (Use annotate-snippet as default emitter on stable)
 - #150033 (Add try_as_dyn and try_as_dyn_mut)
 - #150042 (rustc-dev-guide subtree update)
 - #150063 (Remove deny of manual-let-else)
 - #150064 (std: io: error: Add comment for UEFI unpacked repr use)

Failed merges:

 - #150044 (Avoid unhelpful suggestion when crate name is invalid)

r? `@ghost`
`@rustbot` modify labels: rollup
@jieyouxu
Copy link
Member

Unfortunately this accrued a merge conflict in the mean time.
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 17, 2025
@bors
Copy link
Collaborator

bors commented Dec 17, 2025

☔ The latest upstream changes (presumably #150068) made this pull request unmergeable. Please resolve the merge conflicts.

@workingjubilee
Copy link
Member Author

RIP

Pointing out they can set the crate's name is non-actionable:
their problem is they found out how and set it incorrectly.
Remove extraneous information that can only confuse the matter.
@workingjubilee workingjubilee force-pushed the avoid-suggesting-irrelevant-rename branch from b19d781 to 25cc98f Compare December 17, 2025 04:43
@rustbot
Copy link
Collaborator

rustbot commented Dec 17, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@workingjubilee
Copy link
Member Author

@bors r=jieyouxu

@bors
Copy link
Collaborator

bors commented Dec 17, 2025

📌 Commit 25cc98f has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 17, 2025
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Dec 17, 2025
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#147939 (Make `const BorrowMut` require `const Borrow` and make `const Fn` require `const FnMut`)
 - rust-lang/rust#149734 (Mirror GCC 9.5.0)
 - rust-lang/rust#149767 (Tidying up tests/ui/issues 33 tests [4/N])
 - rust-lang/rust#149804 (chore: fix some minor issues in the comments)
 - rust-lang/rust#149967 (custom `VaList` layout for Hexagon)
 - rust-lang/rust#150025 (dont create unnecessary `DefId`s under mgca)
 - rust-lang/rust#150032 (Use annotate-snippet as default emitter on stable)
 - rust-lang/rust#150033 (Add try_as_dyn and try_as_dyn_mut)
 - rust-lang/rust#150042 (rustc-dev-guide subtree update)
 - rust-lang/rust#150063 (Remove deny of manual-let-else)
 - rust-lang/rust#150064 (std: io: error: Add comment for UEFI unpacked repr use)

Failed merges:

 - rust-lang/rust#150044 (Avoid unhelpful suggestion when crate name is invalid)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Dec 17, 2025
…uwer

Rollup of 3 pull requests

Successful merges:

 - #150008 (Implement va_arg for Hexagon targets)
 - #150044 (Avoid unhelpful suggestion when crate name is invalid)
 - #150086 (Port `#[rustc_never_returns_null_ptr]` to attribute parser)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 093d175 into rust-lang:main Dec 17, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 17, 2025
rust-timer added a commit that referenced this pull request Dec 17, 2025
Rollup merge of #150044 - workingjubilee:avoid-suggesting-irrelevant-rename, r=jieyouxu

Avoid unhelpful suggestion when crate name is invalid

Pointing out they can set the crate's name is non-actionable: their problem is they found out how and set it incorrectly. Remove extraneous information that can only confuse the matter.
@workingjubilee workingjubilee deleted the avoid-suggesting-irrelevant-rename branch December 17, 2025 18:46
@schuelermine
Copy link
Contributor

The documentation should also be updated to reflect the fact that name has to be a valid crate name in the first place. This is not mentioned in the documentation. The documentation only says that the [lib] target uses the name property as Rust identifier.

@workingjubilee
Copy link
Member Author

@schuelermine Er, can you elaborate on what is missing?

@schuelermine
Copy link
Contributor

Cargo name field on targets, Screenshot 2026-02-08 at 23-37-20 Cargo Targets - The Cargo Book

https://doc.rust-lang.org/cargo/reference/cargo-targets.html#the-name-field

This is the only part of the Cargo docs I could find that talks about the name field, and it does not mention at all that it has to be a valid Rust identifier.

It does (implicitly) state that it has to be a valid Rust identifier for libraries, with the sentence “For a library, this is the crate name that dependencies will use to reference it.”, but there is nothing in here that would make me expect that e.g. ??? is an invalid name for a [[bin]] target.

@fmease
Copy link
Member

fmease commented Feb 8, 2026

This docs issue should be submitted to Cargo's issue tracker (https://github.com/rust-lang/cargo/issues) unless it's already been reported over there. This repository doesn't really track Cargo-specific matters.

@fmease
Copy link
Member

fmease commented Feb 8, 2026

Although the rustc book (https://doc.rust-lang.org/rustc/index.html) has a similar issue, it doesn't precisely specify what constitutes a valid crate name for e.g., --crate-name (see https://doc.rust-lang.org/rustc/command-line-arguments.html#--crate-name-specify-the-name-of-the-crate-being-built) or --extern (https://doc.rust-lang.org/rustc/command-line-arguments.html#--crate-name-specify-the-name-of-the-crate-being-built).

That could be worth opening issue for, here in r-l/r (unless one already exists). Fun fact, --crate-name and --extern understand something different by crate name (the former also admits digit-prefixed names and the latter only admits "ASCII identifiers").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bogus suggestion of #![crate_name = "…"] when trying to build binary like "udpinject.rs"

7 participants