-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Backport new sized-hierarchy trait bounds in old ways #20100
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
Backport new sized-hierarchy trait bounds in old ways #20100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Did you check this indeed solves the type mismatches etc.? Also, can you measure the perf impact, just to be sure?
@@ -52,7 +54,7 @@ pub(crate) fn generate_enum_is_method(acc: &mut Assists, ctx: &AssistContext<'_> | |||
let fn_name = format!("is_{}", &to_lower_snake_case(&variant_name.text())); | |||
|
|||
// Return early if we've found an existing new fn | |||
let impl_def = find_struct_impl(ctx, &parent_enum, &[fn_name.clone()])?; | |||
let impl_def = find_struct_impl(ctx, &parent_enum, slice::from_ref(&fn_name))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an application of a new Clippy lint or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure because this is from Lukas's commit in his minicore adjust branch but this looks better anyway 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it was (hard erroring clippy lint)
I haven't tested this thoroughly but based on the result in CI's analysis-stats, most of the inference regressions are gone, but still some MIR evaluation failures on self and some perf regression on body lowering. |
1c63a26
to
ad12633
Compare
ad12633
to
953e9d1
Compare
Without this PR on
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay let's merge this then!
Not an ideal approach but this quickly mitigates #20090 as we discussed on zulip#t-compiler/rust-analyzer > rustc's new Sized Hierarchy: Part I @ 💬