-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
error on incorrect implied bounds in wfcheck except for Bevy dependents #118553
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
Conversation
|
@bors try |
lint incorrect implied bounds in wfcheck except for Bevy dependents Rebase of rust-lang#109763 Additionally, special cases Bevy `ParamSet` types to not trigger the lint. Opening for crater r? `@ghost`
This comment has been minimized.
This comment has been minimized.
|
☀️ Try build successful - checks-actions |
|
@craterbot run mode=check-only crates=https://crater-reports.s3.amazonaws.com/pr-109482-1/retry-regressed-list.txt |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
|
|
@bors try |
This comment has been minimized.
This comment has been minimized.
|
☀️ Try build successful - checks-actions |
|
@craterbot run mode=check-only crates=https://crater-reports.s3.amazonaws.com/pr-109482-1/retry-regressed-list.txt |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
|
|
Great, now for everything. @craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
Finished benchmarking commit (a34faab): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 665.735s -> 666.175s (0.07%) |
|
FYI, MIRI runs just started failing for us after this was merged: https://github.com/bevyengine/bevy/actions/runs/7578583138/job/20641401467 We'll turn it off as a mandatory CI check for now, and look at prioritizing a fix (but probably not backporting). |
|
Interesting, an MCVE would be good. I'll try to look into it. |
|
I unsuccessfully tried to reproduce the CI error: pub trait WorldQuery {}
impl<T> WorldQuery for &T {}
impl<T> WorldQuery for & mut T {}
pub struct Query<Q: WorldQuery>(Q);
pub trait SystemParam {
type State;
}
impl<Q: WorldQuery + 'static> SystemParam for Query<Q> {
type State = ();
}
impl<P0, P1> SystemParam for (P0, P1)
where
P0: SystemParam,
P1: SystemParam,
{
type State = (<P0 as SystemParam>::State, <P1 as SystemParam>::State);
}
pub struct ParamSet<T: SystemParam>(T) where T::State: Sized;
struct A;
fn sys(mut _set: ParamSet<(Query<&mut A>, Query<&A>)>) {}
fn main() {} |
|
I'm guessing it has to do with the rest of the test function. reference for later:
Probably need to pull out those impls into the test. |
pub trait WorldQuery {}
impl<T> WorldQuery for &T {}
impl<T> WorldQuery for & mut T {}
pub struct Query<Q: WorldQuery>(Q);
pub trait SystemParam {
type State;
}
impl<Q: WorldQuery + 'static> SystemParam for Query<Q> {
type State = ();
}
impl<P0, P1> SystemParam for (P0, P1)
where
P0: SystemParam,
P1: SystemParam,
{
type State = (<P0 as SystemParam>::State, <P1 as SystemParam>::State);
}
pub struct ParamSet<T: SystemParam>(T) where T::State: Sized;
struct A;
fn sys(_set1: ParamSet<(Query<&mut A>, Query<&A>)>) {
let _: ParamSet<_> = _set1;
}
fn main() {}I think the error happens because MIR borrowck uses the new implied bounds computation instead of the old one. So while WF check passes, MIR borrowck does not. |
|
We're getting new users reporting that this error is surfacing in clean builds of Bevy on nightly. Swapping back to I can reproduce it both when building Bevy itself, and in an empty project with a dependency on Bevy 0.12.1, with: The error: |
|
I don't understand how this wasn't caught. did nobody try to compile bevy with this PR to make sure nothing broke? |
|
It was missed because the Bevy test that was previously added didn't adequately cover this. I made changes (to move MIR borrowck to non-compat) after the crater run, and that's what caused the regression. This happens and is why we have nightly. |
|
The problem will be fixed after #120123 lands (which should be in the next few hours). |
|
If I had to guess, between this and #120123, perf is a bit of a wash. |

Rebase of #109763
Additionally, special cases Bevy
ParamSettypes to not trigger the lint. This is tracked in #119956.Fixes #109628
Fixes #109799