Skip to content
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

Simple modification of non_lifetime_binders's diagnostic information to adapt to type binders #119154

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

surechen
Copy link
Contributor

fixes #119067

Replace diagnostic information "lifetime bounds cannot be used in this context" to "bounds cannot be used in this context".

#![allow(incomplete_features)]
#![feature(non_lifetime_binders)]

trait Trait {}

trait Trait2
    where for <T: Trait> ():{}
//~^ ERROR bounds cannot be used in this context

@rustbot
Copy link
Collaborator

rustbot commented Dec 20, 2023

r? @compiler-errors

(rustbot has picked a reviewer for you, use r? to override)

@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 20, 2023
@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

Thanks! I have one nit and one suggestion. After that, it's good to go. Lastly, could you update the PR title to something more descriptive? It's pretty general right now.
r? fmease

@rustbot rustbot assigned fmease and unassigned compiler-errors Dec 20, 2023
Copy link
Member

@fmease fmease Dec 20, 2023

Choose a reason for hiding this comment

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

I think it would be better to split this test file or to move it somewhere else since it not only contains non_lifetime_binders but also closure_lifetime_binder (tests for the latter are usually placed in tests/ui/closures/binder). Note that there already exist tests for for<T> Trait<T> as well as for for<T> || -> (), maybe you can extend them instead of creating new files (you can add a comment above the new test cases in the form of // Regression test for issue #NNN)?

Also the name of this test isn't super descriptive, maybe call it bounds-on-type-binders.rs (for NLB) and bounds-on-closure-type-binders.rs (for CLB)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you.
According to the suggestion, split it into two files.

@fmease fmease 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-review Status: Awaiting review from the assignee but also interested parties. labels Dec 20, 2023
@surechen surechen changed the title Simple modification of diagnostic information Simple modification of non_lifetime_binders's diagnostic information to adapt to type binders Dec 21, 2023
@surechen
Copy link
Contributor Author

Thanks! I have one nit and one suggestion. After that, it's good to go. Lastly, could you update the PR title to something more descriptive? It's pretty general right now. r? fmease

Thank you very much. Modified according to the comments, please help review again.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 21, 2023
@fmease
Copy link
Member

fmease commented Dec 21, 2023

Thanks a lot!
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 21, 2023

📌 Commit 4897d5e has been approved by fmease

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 21, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#118729 (Add release notes for 1.75.0)
 - rust-lang#119124 (don't build `rust-analyzer-proc-macro-srv` on def config )
 - rust-lang#119154 (Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders)
 - rust-lang#119176 (Fix name error in aarch64_apple_watchos tier 3 target)
 - rust-lang#119182 (Update sysinfo version to 0.30.0)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#118729 (Add release notes for 1.75.0)
 - rust-lang#119124 (don't build `rust-analyzer-proc-macro-srv` on def config )
 - rust-lang#119154 (Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders)
 - rust-lang#119176 (Fix name error in aarch64_apple_watchos tier 3 target)
 - rust-lang#119182 (Update sysinfo version to 0.30.0)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2b48e7d into rust-lang:master Dec 21, 2023
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Dec 21, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 21, 2023
Rollup merge of rust-lang#119154 - surechen:fix_119067, r=fmease

Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders

fixes rust-lang#119067

Replace diagnostic information "lifetime bounds cannot be used in this context" to "bounds cannot be used in this context".

```rust
#![allow(incomplete_features)]
#![feature(non_lifetime_binders)]

trait Trait {}

trait Trait2
    where for <T: Trait> ():{}
//~^ ERROR bounds cannot be used in this context
```
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.

non_lifetime_binders falsely recognizes (and rejects) trait as lifetime
6 participants