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

regression: cannot infer lifetime #119873

Closed
Mark-Simulacrum opened this issue Jan 12, 2024 · 4 comments
Closed

regression: cannot infer lifetime #119873

Mark-Simulacrum opened this issue Jan 12, 2024 · 4 comments
Labels
E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

INFO] [stdout] error[E0495]: cannot infer an appropriate lifetime for lifetime parameter '_ in generic type due to conflicting requirements
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/assertor-0.0.1/src/assertions/map.rs:121:5
[INFO] [stdout]     |
[INFO] [stdout] 121 |     fn key_set(&self) -> Subject<'a, Keys<K, V>, (), R> {
[INFO] [stdout]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout]     |
[INFO] [stdout] note: first, the lifetime cannot outlive the anonymous lifetime defined here...
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/assertor-0.0.1/src/assertions/map.rs:78:16
[INFO] [stdout]     |
[INFO] [stdout] 78  |     fn key_set(&self) -> Subject<Keys<K, V>, (), R>;
[INFO] [stdout]     |                ^^^^^
[INFO] [stdout] note: ...so that the method type is compatible with trait
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/assertor-0.0.1/src/assertions/map.rs:121:5
[INFO] [stdout]     |
[INFO] [stdout] 121 |     fn key_set(&self) -> Subject<'a, Keys<K, V>, (), R> {
[INFO] [stdout]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout]     = note: expected `fn(&Subject<'_, _, _, _>) -> Subject<'_, std::collections::hash_map::Keys<'_, _, _>, _, _>`
[INFO] [stdout]                found `fn(&Subject<'_, _, _, _>) -> Subject<'a, std::collections::hash_map::Keys<'_, _, _>, _, _>`
[INFO] [stdout] note: but, the lifetime must be valid for the lifetime `'a` as defined here...
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/assertor-0.0.1/src/assertions/map.rs:81:6
[INFO] [stdout]     |
[INFO] [stdout] 81  | impl<'a, K, V, R> MapAssertion<'a, K, V, R> for Subject<'a, HashMap<K, V>, (), R>
[INFO] [stdout]     |      ^^
[INFO] [stdout] note: ...so that the type `std::collections::hash_map::Keys<'_, K, V>` will meet its required lifetime bounds...
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/assertor-0.0.1/src/assertions/map.rs:121:5
[INFO] [stdout]     |
[INFO] [stdout] 121 |     fn key_set(&self) -> Subject<'a, Keys<K, V>, (), R> {
[INFO] [stdout]     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] note: ...that is required by this bound
[INFO] [stdout]    --> /opt/rustwide/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/assertor-0.0.1/src/base.rs:111:14
[INFO] [stdout]     |
[INFO] [stdout] 111 |     Borrowed(&'a S),
[INFO] [stdout]     |              ^^^^^
[INFO] [stdout] 

https://crater-reports.s3.amazonaws.com/beta-1.76-3/beta-2024-01-09/gh/penso.ex/log.txt

@Mark-Simulacrum Mark-Simulacrum added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Jan 12, 2024
@Mark-Simulacrum Mark-Simulacrum added this to the 1.76.0 milestone Jan 12, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 12, 2024
@compiler-errors

This comment was marked as off-topic.

@compiler-errors
Copy link
Member

Whoops wrong issue!

@compiler-errors
Copy link
Member

compiler-errors commented Jan 12, 2024

Well, this also is expected fallout from making the IMPLIED_BOUNDS_ENTAILMENT lint into a hard error. lcnr also tried to fix this, google/assertor#1 but the PR was never accepted.

@Mark-Simulacrum
Copy link
Member Author

Closing as won't fix then. Thanks!

@Mark-Simulacrum Mark-Simulacrum closed this as not planned Won't fix, can't repro, duplicate, stale Jan 12, 2024
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 15, 2024
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants