Prefer inherent methods in trait object method resolution#158320
Prefer inherent methods in trait object method resolution#158320Jules-Bertholet wants to merge 2 commits into
Conversation
b4baa8f to
4b8693c
Compare
| let x: &(dyn T + Send) = &0i32; | ||
| assert_eq!(x.foo(), 0); |
There was a problem hiding this comment.
This part is not so nice… ideally this would use the inherent impl too.
|
@bors try @rust-timer queue and cratering it when the try job finishes, impl lgtm |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Prefer inherent methods in trait object method resolution
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (8a2f6fe): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary -5.9%, secondary -6.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 510.446s -> 505.256s (-1.02%) |
Fixes #51402. Inherent methods on trait objects now take precedence over methods from the trait object's trait, but these last continue to take precedence over other trait impls as before.
I don't know whether this should be feature gated or insta-stable FCP, will let T-types decide that.
r? types
@rustbot label T-types A-dyn-trait