Fix auto-application of associated generic functions with placeholders#101990
Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
|
I notice that even when the type is known and this isn't an issue (e.g) fn main() {
let b = Box::new("abc");
let ptr = b.into_raw();
}Applying the fix results in incorrect code: |
I think so, yes. |
|
Currently working on automatically adjusting the arguments, but not sure how to handle the case of struct GenericAssocMethod<T>(T);
impl<T> GenericAssocMethod<T> {
fn default_hello() {}
}
let x = GenericAssocMethod(33);
x.default_hello();Where the generic arguments can't be inferred in the |
|
I've temporarily commented out the problematic test case since this seems like incorrect behaviour from Cargo |
There was a problem hiding this comment.
Can you be explicit about needing more information? If this isn't a MachineApplicable diagnostic, then it shouldn't be marked MachineApplicable I think.
There was a problem hiding this comment.
The case of x.default_hello() (or any case where the type can't be inferred) emits a HasPlaceholders diagnostic and suggests GenericAssocMethod::<_>::default_hello()
Then this suggestion should probably not be |
|
Marking this as |
|
☔ The latest upstream changes (presumably #102306) made this pull request unmergeable. Please resolve the merge conflicts. |
40c6828 to
45f61a2
Compare
|
@rustbot label -S-waiting-on-author +S-waiting-on-review |
|
☔ The latest upstream changes (presumably #102875) made this pull request unmergeable. Please resolve the merge conflicts. |
45f61a2 to
6851f75
Compare
|
Some changes occurred in src/tools/cargo cc @ehuss |
|
🤔 Sorry about the ping, I think I might have made a mistake while rebasing |
6851f75 to
f490cff
Compare
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #103310) made this pull request unmergeable. Please resolve the merge conflicts. |
5a19cb1 to
6686074
Compare
|
☔ The latest upstream changes (presumably #103978) made this pull request unmergeable. Please resolve the merge conflicts. |
6686074 to
7df4b0b
Compare
|
@bors r+ |
|
Why didn't bors respond, lol @bors r+ |
|
☀️ Test successful - checks-actions |
1 similar comment
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (5eef9b2): comparison URL. Overall result: ❌ regressions - no action needed@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.
CyclesThis benchmark run did not return any relevant results for this metric. |
…lder-method, r=compiler-errors Fix auto-application of associated generic functions with placeholders Fixes rust-lang#101920
Fixes #101920