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: overflow evaluating the requirement &_ well-formed #123278

Closed
Mark-Simulacrum opened this issue Mar 31, 2024 · 9 comments
Closed

regression: overflow evaluating the requirement &_ well-formed #123278

Mark-Simulacrum opened this issue Mar 31, 2024 · 9 comments
Labels
A-inference Area: Type inference 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

Mark-Simulacrum commented Mar 31, 2024

[INFO] [stdout] error[E0275]: overflow evaluating the requirement `&_ well-formed`
[INFO] [stdout]    --> src/main.rs:155:23
[INFO] [stdout]     |
[INFO] [stdout] 155 |             let end = ns.get(1).unwrap_or(&start);
[INFO] [stdout]     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^

And probably the same for https://crater-reports.s3.amazonaws.com/beta-1.78-3/beta-2024-03-30/reg/zvariant-3.15.0/log.txt:

[INFO] [stdout] error[E0275]: overflow evaluating the requirement `NonNull<Vec<u8>>: Unpin`
[INFO] [stdout]   |
[INFO] [stdout]   = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`zvariant`)
[INFO] [stdout] note: required because it appears within the type `Unique<Vec<u8>>`
[INFO] [stdout]  --> /rustc/c1195518c8ad7f37d15ecb82f39dec3da97f9c2f/library/core/src/ptr/unique.rs:36:12
[INFO] [stdout] note: required because it appears within the type `alloc::raw_vec::RawVec<Vec<u8>>`
[INFO] [stdout]  --> /rustc/c1195518c8ad7f37d15ecb82f39dec3da97f9c2f/library/alloc/src/raw_vec.rs:69:19
[INFO] [stdout] note: required because it appears within the type `Vec<Vec<u8>>`
[INFO] [stdout]  --> /rustc/c1195518c8ad7f37d15ecb82f39dec3da97f9c2f/library/alloc/src/vec/mod.rs:398:12
[INFO] [stdout] note: required because it appears within the type `PhantomData<Vec<Vec<u8>>>`
[INFO] [stdout]  --> /rustc/c1195518c8ad7f37d15ecb82f39dec3da97f9c2f/library/core/src/marker.rs:740:12
[...]
@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. labels Mar 31, 2024
@Mark-Simulacrum Mark-Simulacrum added this to the 1.78.0 milestone Mar 31, 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 Mar 31, 2024
@compiler-errors
Copy link
Member

compiler-errors commented Mar 31, 2024

Only bisected the paint regression:

searched nightlies: from nightly-2024-01-01 to nightly-2024-03-18
regressed nightly: nightly-2024-02-23
searched commit range: 3406ada...397937d
regressed commit: 397937d

bisected with cargo-bisect-rustc v0.6.8

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start=2024-01-01 --end=2024-03-18 

Regressed in #119989 - cc @lcnr

@PatchMixolydic
Copy link
Contributor

paint regression was previously noted in #119989 (comment) and considered acceptable breakage as part of that PR's FCP.

@compiler-errors
Copy link
Member

Cool, thanks for checking!

@compiler-errors
Copy link
Member

Looks like steel-doc is also a case of the lasso regression in that PR.

@compiler-errors
Copy link
Member

compiler-errors commented Mar 31, 2024

Regarding the zvariant regression, I seem to be able to make cargo test fail with:

error[E0275]: overflow evaluating the requirement `NonNull<Vec<u8>>: Unpin`
  |
  = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`zvariant`)
note: required because it appears within the type `Unique<Vec<u8>>

since (probably before) 2024-01-01?

@VorpalBlade
Copy link

So I'm not sure how this will be handled.

  • Lasso breaks with this change. A PR was made to fix this.
  • The last activity on github from the author of lasso is from November 2023.
  • According to lib.rs the crate has 40k downloads per month and is a dependency of 63 crates (15 directly).

That is a fairly large break that doesn't appear like it will get fixed. (I'm fortunate in that I don't use the serialization feature that appears to be problematic, and I will start looking for a maintained alternative thread safe string interning library, with similar or better performance.)

But this does raise the question of how to handle regressions of more or less popular crates where the crate is (apparently) unmaintained.

@lcnr
Copy link
Contributor

lcnr commented Apr 2, 2024

Given that this breakage was expected and accepted as part of our stability policy, being both an inference change and a cleanup of underspecified language semantics, I don't think this is much more we should do here.

Closing but going to cc the rest of @rust-lang/types for their thoughts and input here. We cannot land this as a future compat lint first, so the only other alternative is to not land it at all.

@lcnr lcnr closed this as completed Apr 2, 2024
@apiraino
Copy link
Contributor

apiraino commented Apr 2, 2024

More context on the rationale of #119989 at this comment. @lcnr also fixed the breaking changes downstream (comment). Another crate (nalgebra) fixed that themself (comment).

Does this change should be mentioned in the release notes?

@lcnr
Copy link
Contributor

lcnr commented Apr 2, 2024

yeah, it's a small change to our type inference with the intent to cleanup the type system and to simplify future development.

@jieyouxu jieyouxu added A-inference Area: Type inference and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 3, 2024
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inference Area: Type inference 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

8 participants