[WIP] Support param bounds on non-lifetime binders#115362
[WIP] Support param bounds on non-lifetime binders#115362compiler-errors wants to merge 5 commits intorust-lang:mainfrom
Conversation
|
@bors try @rust-timer queue |
|
⌛ Trying commit 3471faa6dbd43943bb8dc2e3bdedf59fab546439 with merge ff357375eca19961c0e26a765585b8cf4b3a1b3c... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
☔ The latest upstream changes (presumably #115361) made this pull request unmergeable. Please resolve the merge conflicts. |
3471faa to
c915474
Compare
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #115751) made this pull request unmergeable. Please resolve the merge conflicts. |
c915474 to
53c5310
Compare
This comment has been minimized.
This comment has been minimized.
53c5310 to
cbe1bbd
Compare
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #116885) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Obviously, this is still WIP. Here's one observation I made while playing around with this patch: trait Trait<T> {}
fn f(_: impl for<T: ?Sized> Trait<T>) {}This successfully compiles ( |
cbe1bbd to
82ae54c
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…where-clauses, r=<try> [WIP] Support param bounds on non-lifetime binders 👀 r? `@ghost`
compiler/rustc_middle/src/ty/sty.rs
Outdated
| // tidy-alphabetical-start | ||
| static_assert_size!(ty::RegionKind<'_>, 24); | ||
| static_assert_size!(ty::TyKind<'_>, 24); | ||
| static_assert_size!(ty::TyKind<'_>, 32); |
There was a problem hiding this comment.
I am personally not a big fan of supporting where-bounds inside of types and would like to only allow them in where-bounds. I also believe that this is where pretty much all of the perf regression is coming from.
I do expect that playing around with this feature is more annoying and ugly if we have to split binder for it, so 🤷 i guess i don't mind too much
|
Currently don't have the mental capacity to review changes related to this feature in-depth r? oli-obk maybe 🤔 |
|
w.r.t. perf: we have a lot of size assertions in the codebase, but the one on |
|
Maybe I can intern the pair of clauses lists into one or something 🤔 Ideas would be helpful |
|
☔ The latest upstream changes (presumably #138965) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Since the type size regression comes solely from |
|
Well, we also have to intern unsafe binders 🤔 |
058f940 to
f3652c5
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…where-clauses, r=<try> [WIP] Support param bounds on non-lifetime binders This PR adds resolution and AST lowering for where clauses on binders. The meaning for `for<T>` now becomes `for<T: Sized>` like regular generics positions, and you are now able to write `for<T: Trait>` (and `for<T: ?Sized>`). Binder predicates are only considered in the new solver today. Since non-lifetime binders is an incomplete feature, I don't think we need to do any messaging to tell people that they don't work correctly in the old solver, but I'll see to that in a follow-up. This PR then adds a new `List<ty::Clause>` to binders. Most places in the compiler shouldn't care about them existing, but eventually as support for non-lifetime binders gets fleshed out we should be more careful about asserting that they're handled. This will not happen in this PR. Tracking: * rust-lang#108185
|
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (e985804): comparison URL. Overall result: ❌ regressions - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 0.1%, secondary 2.2%)This 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.
CyclesResults (primary 1.4%, secondary 1.9%)This 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 777.207s -> 792.224s (1.93%) |
|
why was this closed? |
|
EDIT (previously contained a personal rant): The PR is something we should revive if we find a dev for it. |
|
how do big companies have an influence over single feature PRs in rust nightly? |
View all comments
This PR adds resolution and AST lowering for where clauses on binders. The meaning for
for<T>now becomesfor<T: Sized>like regular generics positions, and you are now able to writefor<T: Trait>(andfor<T: ?Sized>). Binder predicates are only considered in the new solver today. Since non-lifetime binders is an incomplete feature, I don't think we need to do any messaging to tell people that they don't work correctly in the old solver, but I'll see to that in a follow-up.This PR then adds a new
List<ty::Clause>to binders. Most places in the compiler shouldn't care about them existing, but eventually as support for non-lifetime binders gets fleshed out we should be more careful about asserting that they're handled. This will not happen in this PR.Tracking: