-
Notifications
You must be signed in to change notification settings - Fork 13k
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: new resolution failures in 1.74 #117056
Comments
I bisected to something different (if my bisection is correct): rollup eb76764 and specifically it says "Regression in rust-lang-ci@7e4f5ec" so cc @jhpratt ? searched nightlies: from nightly-2023-04-30 to nightly-2023-10-23 bisected with cargo-bisect-rustc v0.6.7Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc 2023-04-30 --regress error -- check |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
@apiraino That rollup landed in 1.72. |
As mark suggests there are different sources here. I haven't checked all of them, but the last 3 look like this:
|
I haven't had anything land in this release cycle, so a bisection that leads to me must be incorrect. |
I'll investigate |
thanks @lqd (and sorry for the wrong bisection and ping) |
No worries! |
thanks @wesleywiser. Also tagging @bvanjoi about this beta regression since author of #115269 |
Also cc reviewer @petrochenkov, if you two could also weigh in on the first 3 regressions, which didn't appear in the crater run for #115269:
Felix has been doing some digging on the regressions themselves in this zulip thread. |
reduced for mod b {
pub mod instruction {
pub fn b() {}
}
}
use b::*;
macro_rules! m {
() => {
pub mod instruction {
pub fn a() {}
}
};
}
// the `hamesterswap-program` uses a procedural macro to generate the instruction module.
// I believe its effect is similar to that of declarative macros
m!();
mod mm {
use crate::*;
fn f() {
instruction::b();
}
} I think this is the expected behavior. |
reduced for // rustc code.rs --cfg 'feature="cpi"'
mod common {
pub mod cpi {
pub fn a() {}
}
pub mod macros {
#[macro_export]
macro_rules! g {
() => {
cpi::a()
}
}
}
}
use common::*;
macro_rules! m {
() => {
#[cfg(feature = "cpi")]
pub mod cpi {
pub fn b() {}
}
};
}
m!();
mod instructions {
mod stake {
use crate::*;
fn f() {
g!()
}
}
} I also think that this is the anticipated behavior Moreover, |
…try> Make sure that predicates with unmentioned bound vars are still considered global in the old solver In the old solver, we consider predicates with late-bound vars to not be "global": https://github.com/rust-lang/rust/blob/9c8a2694fadf3900c4d7880f6357cee60e9aa39b/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1840-L1844 The implementation of `has_late_bound_vars` was modified in rust-lang#115834 so that we'd properly anonymize binders that had late-bound vars but didn't reference them. This fixed an ICE. However, this also led to a behavioral change in rust-lang#117056 (comment) for a couple of crates, which now consider `for<'a> GL33: Shader` (note the binder var that is *not* used in the predicate) to not be "global". This forces associated types to not be normalizable due to the old trait solver being dumb. This PR distinguishes types which *reference* late-bound vars and binders which *have* late-bound vars. The latter is represented with the new type flag `TypeFlags::HAS_BINDER_VARS`, which is used when we only care about knowing whether binders have vars in their bound var list (even if they're not used, like for binder anonymization). This should fix (after beta backport) the `luminance-gl` and `luminance-webgl` crates in rust-lang#117056. r? types **(priority is kinda high on a review here given beta becomes stable on November 16.)**
…try> Make sure that predicates with unmentioned bound vars are still considered global in the old solver In the old solver, we consider predicates with late-bound vars to not be "global": https://github.com/rust-lang/rust/blob/9c8a2694fadf3900c4d7880f6357cee60e9aa39b/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1840-L1844 The implementation of `has_late_bound_vars` was modified in rust-lang#115834 so that we'd properly anonymize binders that had late-bound vars but didn't reference them. This fixed an ICE. However, this also led to a behavioral change in rust-lang#117056 (comment) for a couple of crates, which now consider `for<'a> GL33: Shader` (note the binder var that is *not* used in the predicate) to not be "global". This forces associated types to not be normalizable due to the old trait solver being dumb. This PR distinguishes types which *reference* late-bound vars and binders which *have* late-bound vars. The latter is represented with the new type flag `TypeFlags::HAS_BINDER_VARS`, which is used when we only care about knowing whether binders have vars in their bound var list (even if they're not used, like for binder anonymization). This should fix (after beta backport) the `luminance-gl` and `luminance-webgl` crates in rust-lang#117056. r? types **(priority is kinda high on a review here given beta becomes stable on November 16.)**
…ackh726 Make sure that predicates with unmentioned bound vars are still considered global in the old solver In the old solver, we consider predicates with late-bound vars to not be "global": https://github.com/rust-lang/rust/blob/9c8a2694fadf3900c4d7880f6357cee60e9aa39b/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1840-L1844 The implementation of `has_late_bound_vars` was modified in rust-lang#115834 so that we'd properly anonymize binders that had late-bound vars but didn't reference them. This fixed an ICE. However, this also led to a behavioral change in rust-lang#117056 (comment) for a couple of crates, which now consider `for<'a> GL33: Shader` (note the binder var that is *not* used in the predicate) to not be "global". This forces associated types to not be normalizable due to the old trait solver being dumb. This PR distinguishes types which *reference* late-bound vars and binders which *have* late-bound vars. The latter is represented with the new type flag `TypeFlags::HAS_BINDER_VARS`, which is used when we only care about knowing whether binders have vars in their bound var list (even if they're not used, like for binder anonymization). This should fix (after beta backport) the `luminance-gl` and `luminance-webgl` crates in rust-lang#117056. r? types **(priority is kinda high on a review here given beta becomes stable on November 16.)**
Make sure that predicates with unmentioned bound vars are still considered global in the old solver In the old solver, we consider predicates with late-bound vars to not be "global": https://github.com/rust-lang/rust/blob/9c8a2694fadf3900c4d7880f6357cee60e9aa39b/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1840-L1844 The implementation of `has_late_bound_vars` was modified in #115834 so that we'd properly anonymize binders that had late-bound vars but didn't reference them. This fixed an ICE. However, this also led to a behavioral change in rust-lang/rust#117056 (comment) for a couple of crates, which now consider `for<'a> GL33: Shader` (note the binder var that is *not* used in the predicate) to not be "global". This forces associated types to not be normalizable due to the old trait solver being dumb. This PR distinguishes types which *reference* late-bound vars and binders which *have* late-bound vars. The latter is represented with the new type flag `TypeFlags::HAS_BINDER_VARS`, which is used when we only care about knowing whether binders have vars in their bound var list (even if they're not used, like for binder anonymization). This should fix (after beta backport) the `luminance-gl` and `luminance-webgl` crates in #117056. r? types **(priority is kinda high on a review here given beta becomes stable on November 16.)**
A few fixes landed since a few weeks. Can this issue be closed? |
Make sure that predicates with unmentioned bound vars are still considered global in the old solver In the old solver, we consider predicates with late-bound vars to not be "global": https://github.com/rust-lang/rust/blob/9c8a2694fadf3900c4d7880f6357cee60e9aa39b/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1840-L1844 The implementation of `has_late_bound_vars` was modified in #115834 so that we'd properly anonymize binders that had late-bound vars but didn't reference them. This fixed an ICE. However, this also led to a behavioral change in rust-lang/rust#117056 (comment) for a couple of crates, which now consider `for<'a> GL33: Shader` (note the binder var that is *not* used in the predicate) to not be "global". This forces associated types to not be normalizable due to the old trait solver being dumb. This PR distinguishes types which *reference* late-bound vars and binders which *have* late-bound vars. The latter is represented with the new type flag `TypeFlags::HAS_BINDER_VARS`, which is used when we only care about knowing whether binders have vars in their bound var list (even if they're not used, like for binder anonymization). This should fix (after beta backport) the `luminance-gl` and `luminance-webgl` crates in #117056. r? types **(priority is kinda high on a review here given beta becomes stable on November 16.)**
Make sure that predicates with unmentioned bound vars are still considered global in the old solver In the old solver, we consider predicates with late-bound vars to not be "global": https://github.com/rust-lang/rust/blob/9c8a2694fadf3900c4d7880f6357cee60e9aa39b/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1840-L1844 The implementation of `has_late_bound_vars` was modified in #115834 so that we'd properly anonymize binders that had late-bound vars but didn't reference them. This fixed an ICE. However, this also led to a behavioral change in rust-lang/rust#117056 (comment) for a couple of crates, which now consider `for<'a> GL33: Shader` (note the binder var that is *not* used in the predicate) to not be "global". This forces associated types to not be normalizable due to the old trait solver being dumb. This PR distinguishes types which *reference* late-bound vars and binders which *have* late-bound vars. The latter is represented with the new type flag `TypeFlags::HAS_BINDER_VARS`, which is used when we only care about knowing whether binders have vars in their bound var list (even if they're not used, like for binder anonymization). This should fix (after beta backport) the `luminance-gl` and `luminance-webgl` crates in #117056. r? types **(priority is kinda high on a review here given beta becomes stable on November 16.)**
I'm grouping these together but we should make sure all of them are fixed / tested before closing this:
HasTypeFlagsVisitor
#115834HasTypeFlagsVisitor
#115834cc #117053 which is a similar-looking problem, maybe duplicate of this
The text was updated successfully, but these errors were encountered: