-
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
where_clauses_object_safety regression on a trait where it shouldn't trigger #106247
Comments
I think the way Is the issue serious enough for a revert? I think a forward fix is better. |
Yes I think it's serious enough for a revert. If I understand your explanation correctly, the multiple_supertrait_upcastable check gets run on every trait, which means we're now reporting scary object safety breakage warnings on literally every trait with a where-clause that mentions (Of course you're free to race to put up a forward fix before the revert gets approved.) |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-critical |
Recent nightlies broke pretty much anything that uses object safety: rust-lang/rust#106247 This (temporarily) pins to a nightly before this regression occurred so we don't have to pin nightly everywhere object safety is used.
Recent nightlies broke pretty much anything that uses object safety: rust-lang/rust#106247 This (temporarily) pins to a nightly before this regression occurred so we don't have to pin nightly everywhere object safety is used.
Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint" This is a clean revert of rust-lang#105484. I confirmed that reverting that PR fixes the regression reported in rust-lang#106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** rust-lang#106247 (comment) has an explanation of why rust-lang#105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe. FYI `@nbdd0121` `@compiler-errors`
Removing P-critical as the revert has landed in #106248. Should we reprioritize this? |
@Nilstrieb I think In addition, it's also useful in case critical regressions are fixed on the stable channel so @rustbot label P-critical |
Discussed in triage meeting. Downgrading (we do not need to revisit every week) @rustbot label: +P-high -P-critical |
further discussion led us to realize that this should just be closed due to the revert (a test landed, so we should not reinject the bug when the lint re-lands) |
Skip possible where_clause_object_safety lints when checking `multiple_supertrait_upcastable` Fix rust-lang#106247 To achieve this, I lifted the `WhereClauseReferencesSelf` out from `object_safety_violations` and move it into `is_object_safe` (which is changed to a new query). cc `@dtolnay` r? `@compiler-errors`
Revert "Implement allow-by-default `multiple_supertrait_upcastable` lint" This is a clean revert of #105484. I confirmed that reverting that PR fixes the regression reported in #106247. ~~I can't say I understand what this code is doing, but maybe it can be re-landed with a different implementation.~~ **Edit:** rust-lang/rust#106247 (comment) has an explanation of why #105484 ends up surfacing spurious `where_clause_object_safety` errors. The implementation of `where_clause_object_safety` assumes we only check whether a trait is object safe when somebody actually uses that trait with `dyn`. However the implementation of `multiple_supertrait_upcastable` added in the problematic PR involves checking *every* trait for whether it is object-safe. FYI `@nbdd0121` `@compiler-errors`
I bisected #51443 (comment). According to
cargo-bisect-rustc --start 2022-12-28 --end 2022-12-29 -- check
it bisects to 6a20f7d. This is concerning because nothing in #106209 looks remotely related towhere_clause_object_safety
so I am inferring that this is an unintentional regression.Here are the 9 PRs in the rollup:
Definitely not it:
unused_must_use
warning forBox::from_raw
#104024 — DIAGNOSTIC TEXT ONLYcore::any
docs #106184 — DOCS ONLYrustc_infer
#106205 — DEAD CODEHighly unlikely:
iter::Empty
hack #103945 — INTERNALS OF CORE::ITER::EMPTYmatch
expr in single line #105347 — MINOR DIAGNOSTIC FORMATTING TWEAK#[repr(transparent)]
onenum
#106201 — REPR(TRANSPARENT)-RELATED DIAGNOSTICSI guess that leaves:
multiple_supertrait_upcastable
lint #105484which only adds a brand new lint pass unrelated to where_clauses_object_safety, independent of any existing code. The PR is +167 -0. It seems like the only possible effect should be adding new occurrences of multiple_supertrait_upcastable, not affecting anything else.
In any case cc @nbdd0121 @compiler-errors in case you can tell what's going on.
The text was updated successfully, but these errors were encountered: