Emit a note that static bounds from HRTBs are a bug#101433
Emit a note that static bounds from HRTBs are a bug#101433bors merged 4 commits intorust-lang:masterfrom
Conversation
|
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
There was a problem hiding this comment.
@estebank maybe you have some thoughts on how to make this point to the whole clause?
There was a problem hiding this comment.
I thought a bit about this since you had mentioned it earlier -- it's probably not generalizable to point to the whole clause because we can have things like where Ty: Trait + OtherTrait -- the choice for the spans in predicates_of to point to just the trait part was probably made for that reason.
There was a problem hiding this comment.
Right, it's not simply enough to say "point to the entire clause. Instead, I'm imagining something like:
for<'a> T: Trait<'a>
^^^^^^^^^^^^^^^^^^^^
for<'a> T: Send + Trait<'a>
^^^^^^^^^^ ^^^^^^^^^
for<'a> T: Trait<'a> + Send
^^^^^^^^^^^^^^^^^^^^
There was a problem hiding this comment.
The problem is that we currently have no way (that I know of) to even get that span info from an InstantiatedPredicate. We lose that when generating the GenericPredicates, and there's no mapping back, AFAICT. I was looking a bit at instead storing like the owner and which predicate it is, but that also doesn't quite work, since lowering is done in a bit more complicated fashion.
There was a problem hiding this comment.
Yeah, we do lose too much metadata when dealing with predicates :-/
Ideally the spans should be something along the lines of
for<'a> T: Send + Trait<'a>
^^^^^^^ ^^^^^^^^^
but it's perfectly fine to land as is.
|
☔ The latest upstream changes (presumably #101560) made this pull request unmergeable. Please resolve the merge conflicts. |
compiler-errors
left a comment
There was a problem hiding this comment.
r=me after rebased past conflict
There was a problem hiding this comment.
nit: there's some trivial lift macro i think
There was a problem hiding this comment.
There is not (that I could find)
There was a problem hiding this comment.
TrivialTypeTraversalAndLiftImpls is what it's called, which itself uses CloneLiftImpls if you don't want to derive the traversal/folder traits. But up to you to keep this manual impl.
96e6985 to
6fd6283
Compare
6fd6283 to
bdd64c6
Compare
|
I'm going to wait for the stabilization PR to merge, since they're going to conflict and this will be easier to rebase. |
bdd64c6 to
cdd18af
Compare
cdd18af to
aae37f8
Compare
|
@bors r=compiler-errors |
Rollup of 6 pull requests Successful merges: - rust-lang#101433 (Emit a note that static bounds from HRTBs are a bug) - rust-lang#101684 (smol grammar changes to README.md) - rust-lang#101769 (rustdoc: remove redundant CSS `.out-of-band > span.since { position }`) - rust-lang#101772 (Also replace the placeholder for the stable_features lint) - rust-lang#101773 (rustdoc: remove outdated CSS `.content table` etc) - rust-lang#101779 (Update test output for drop tracking) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…=nikomatsakis Partially revert rust-lang#101433 reverts rust-lang#101433 to fix rust-lang#101844 We should get this into the beta cut, since the ICE is getting hit quite a bit.
|
Marking as a perf regression per results from this PR's merge in the rollup (#101805 (comment)). (For clarity: the results are from just this PR in that comment, and match the effects of the rollup as a whole). It looks like we partially reverted in #101902, but that didn't fully recover the performance here. |
This note isn't perfect, but opening this to either 1) land as is or 2) get some feedback on how to improve it
Let r? @compiler-errors and cc. @nikomatsakis