Teach map_type_params to handle Self correctly.
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
People
(Reporter: emilio, Assigned: emilio)
Details
Attachments
(1 file)
47 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-esr78+
|
Details | Review |
Assignee | ||
Comment 1•5 years ago
|
||
Consider the following:
struct Complex<T> {
something: T,
#[compute(field_bound)]
something_else: Generic<Self, T>,
}
That will generate:
impl<T> ToComputedValue for Complex<T>
where
T: ToComputedValue,
Generic<Self, T>: ToComputedValue<ComputedValue = Generic<Self, <T as ToComputedValue>::ComputedValue>>,
{
// ...
}
That last clause is obviously incorrect. map_type_params correctly maps
the T, but it should know also about Self.
Ideally we could just do the same as for T and do:
<Self as ToComputedValue>::ComputedValue
But that doesn't quite work, because we are in that implementation of
the trait, and the compiler rightfully complains about we don't yet
knowing the computed type. So we need to pass it explicitly, which is
simple enough, if a bit annoying.
Comment 3•5 years ago
|
||
bugherder |
Assignee | ||
Comment 4•4 years ago
|
||
Comment on attachment 9164088 [details]
Bug 1653339 - Teach style_derive's map_type_params about mapping self correctly. r=boris,#style
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Build fix for new rust compiler versions
- User impact if declined: none
- Fix Landed on Version: 80
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Build-only code change
- String or UUID changes made by this patch: none
Comment 5•4 years ago
|
||
Fwiw https://hg.mozilla.org/mozilla-central/rev/da77d5528a08 doesnt apply as is on esr78
Comment 6•4 years ago
|
||
Comment on attachment 9164088 [details]
Bug 1653339 - Teach style_derive's map_type_params about mapping self correctly. r=boris,#style
approved for 78.4esr
Comment 7•4 years ago
|
||
bugherder uplift |
Comment 8•4 years ago
|
||
Re comment 5, it applied fine after the one patch from bug 1643201.
Description
•