Skip to content

Reduce kw::Empty usage, part 3 #138924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add a test with an empty crate name.
This error was untested.
  • Loading branch information
nnethercote committed Mar 25, 2025
commit 1a6266340e53e3f663b49f71a14461dafa47de47
5 changes: 5 additions & 0 deletions tests/ui/attributes/crate-name-empty.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Ensure we reject `#![crate_name = ""]`.

#![crate_name = ""] //~ ERROR crate name must not be empty

fn main() {}
8 changes: 8 additions & 0 deletions tests/ui/attributes/crate-name-empty.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: crate name must not be empty
--> $DIR/crate-name-empty.rs:3:1
|
LL | #![crate_name = ""]
| ^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error