Skip to content

Conversation

@SciMind2460
Copy link
Contributor

@SciMind2460 SciMind2460 commented Nov 4, 2025

In #145457, @WaffleLapkin has shown that it may be OK for rust to break backwards compatibility for #61415, i.e. ([T; N]: Default where T: Default.
This lint makes it so that [T; 0]: Default where T: !Default is warned against.

Please review, I am new to the rustc process and would love to correct errors!

@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 Nov 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 4, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
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

@rustbot
Copy link
Collaborator

rustbot commented Nov 4, 2025

⚠️ Warning ⚠️

  • The following commits have merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

    You can start a rebase with the following commands:

    $ # rebase
    $ git pull --rebase https://github.com/rust-lang/rust.git master
    $ git push --force-with-lease
    

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 4, 2025
@SciMind2460
Copy link
Contributor Author

Apparently there are merge commits. Closing so a fresh PR without merge commits can be made.

@SciMind2460 SciMind2460 closed this Nov 4, 2025
@rustbot rustbot removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 4, 2025
@rust-log-analyzer
Copy link
Collaborator

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
fmt check
error: expected `{`, found keyword `if`
##[error]  --> /checkout/compiler/rustc_lint/src/impl_default_on_zero_size_nondefault_arrays.rs:87:33
   |
87 | ...                   if let Some(0) = len_const.try_eval_usize(cx.tcx, cx.param_env) {
   |                       ^^ expected `{`
   |
note: the `if` expression is missing a block after this condition
  --> /checkout/compiler/rustc_lint/src/impl_default_on_zero_size_nondefault_arrays.rs:86:32
   |
86 | ...                   if let ty::tyKind::Array(t_ty, len_const) = ty.kind()
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: you might have meant to write this as part of a block
   |
87 ~                                 { if let Some(0) = len_const.try_eval_usize(cx.tcx, cx.param_env) {
88 |                                     if !cx.tcx.infer_ctxt().type_implements_trait(default_id, [t_ty], cx.param_env)  {
...
95 |                                     }
96 ~                                } }
   |

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

Labels

has-merge-commits PR has merge commits, merge with caution. 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.

4 participants