-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
HRTB can't prove some trivially true statements #42114
Labels
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Note this also works: trait Prove<'a> : 'a {}
impl<'a> Prove<'a> for &'a () {}
fn does_work()
where for<'a> &'a (): Prove<'a>
{} but attaching a where bound to the trait impl makes it fail! trait Prove<'a> : 'a {}
impl<'a> Prove<'a> for &'a () where Self: 'a {}
fn doesnt_work()
where for<'a> &'a (): Prove<'a>
{} |
Mark-Simulacrum
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Jun 23, 2017
Triage: original example still does not compile |
Triage: Both examples compile on rust stable 1.66.0 Seems related to #27113, which should also be closed. |
Merged
JohnTitor
pushed a commit
to JohnTitor/rust
that referenced
this issue
Jan 11, 2023
remove E0280 After looking at rust-lang#61137 I tried my hand at E0280. I'm unable to find a reasonable example that emits the error. There are a couple of old examples that compile with the current compiler ([rust-lang#26217](rust-lang#26217), [rust-lang#42114](rust-lang#42114), [rust-lang#27113](rust-lang#27113)) and there is a [bug with chalk](https://github.com/rust-lang/rust/blob/b7cdb635c4b973572307ad288466fba64533369c/src/test/ui/chalkify/bugs/async.rs) that makes it emit the error, with a couple more chalk bugs on zulip. It seems like the error is supposed to be emitted from unfulfilled where bounds, of which two are related to borrow checking (error in where T: 'a or where 'a: 'b) and thus tend to emit errors like "lifetime may not live long enough" from borrow checking instead. The final case is with type equality constraints (where <T as Iterator>::Item == u32), which is unimplemented ([rust-lang#20041](rust-lang#20041)). That such different problems are supposed to have the same error code also seems strange to me. Since the error seems to only be emitted when using chalk I propose to remove it and replace it with an ICE instead. A crater run might be warranted. Pinging `@jackh726` due to removal of chalk test that now ICEs.
@rustbot label +E-needs-test |
rustbot
added
the
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
label
Jan 12, 2023
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this issue
Jan 14, 2023
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jan 15, 2023
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#106072 (fix: misleading "add dyn keyword before derive macro" suggestion) - rust-lang#106859 (Suggestion for type mismatch when we need a u8 but the programmer wrote a char literal) - rust-lang#106863 (Remove various double spaces in compiler source comments.) - rust-lang#106865 (Add explanation comment for GUI test) - rust-lang#106867 (Fix the stability attributes for `std::os::fd`.) - rust-lang#106878 (Add regression test for rust-lang#92157) - rust-lang#106879 (Add regression test for rust-lang#42114) - rust-lang#106880 (doc: fix typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Was trying to demonstrate lifetimes of references fulfilling the
'a
lifetime bound - but then came across this. The bound can be proven easily for a specific'a
- but for some reason not for the higher-ranked version. The error fordoesnt_work
looks like this:The text was updated successfully, but these errors were encountered: