1

allow eq constraints on associated constants by JulianKnodt · Pull Request #8764...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/87648
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Copy link

Collaborator

rust-highfive commented on Jul 30, 2021

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

Some changes occurred in src/tools/rustfmt.

cc @calebcartwright

Copy link

Collaborator

rust-highfive commented on Jul 30, 2021

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

This comment has been hidden.

Copy link

Contributor

oli-obk commented on Jul 31, 2021

I have been musing about "just" adding a TyKind::Const and removing all the duplication we have around const generics vs type generics. Since this would also simplify our representation of associated const vs associated type as visible in this PR, maybe that's something we should pursue?

I'll give this PR a closer review on monday, but my fingers are still itching for TyKind::Const

Copy link

Contributor

Author

JulianKnodt commented on Jul 31, 2021

Hmmmm, I think if it's a useful tool to simplify implementations, then it's probably useful, but at the same time I can't really picture what a TyKind::Const means. Is it an instance of a type which is const? Or does it represent an abstract const instantiation of a type?

This comment has been hidden.

JulianKnodt

force-pushed the const_eq_constrain

branch 2 times, most recently from 33ffbf3 to 58c97a9 6 months ago

This comment has been hidden.

This comment has been hidden.

This comment has been hidden.

This comment has been hidden.

This comment has been hidden.

Copy link

Contributor

oli-obk commented on Aug 2, 2021

Hmmmm, I think if it's a useful tool to simplify implementations, then it's probably useful, but at the same time I can't really picture what a TyKind::Const means. Is it an instance of a type which is const? Or does it represent an abstract const instantiation of a type?

it is essentially the equivalent of a built-in struct Foo<T, const C: T>; without the struct/Adt.

think about it this way: before const generics we had typenum, this is essentially typenum but directly supported by the compiler. typenum encodes constants in the type system, with TyKind::Const we do the same thing. We don't have to support any surface syntax for this, so users can't impl Trait for 42 {}, but the type system would support constants as first class types.

If we want to we could even represent it as such. So not even adding a TyKind::Const, but having Foo be a lang item in libcore that all const generics desugar to, but I fear that is just as much of a problem as making bool an enum bool { true, false } lang item. Nice from a cleanliness perspective, but impractical and a performance problem.

Copy link

Contributor

Author

JulianKnodt commented on Aug 3, 2021

I've never heard of typenum, I've not been working on rustc long enough to have seen it joy. If you're going to implement it, tag me in the changes and I'll hold off on this change until that's done?

Copy link

Contributor

oli-obk commented on Aug 5, 2021

I'm going to do an MCP, and if it is declined, we go with your PR, if not, I'll implement TyKind::Const

Note: typenum is just a regular crate on crates.io, nothing rustc specific. It was the go-to workaround for lack of const generics and still is the go-to workaround for lack of const_evaluatable_checked.

Copy link

Contributor

Author

JulianKnodt commented on Aug 5, 2021

Sounds good, please cc in the MCP as well, I'm interested in those changes as well!

Copy link

Contributor

bors commented on Aug 18, 2021

umbrella The latest upstream changes (presumably #86860) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link

Contributor

jackh726 commented on Oct 21, 2021

Copy link

Contributor

klensy commented 11 days ago

Changes to llvm and cargo looks like not intended, bad rebase?

Copy link

Collaborator

rust-timer commented 11 days ago

Finished benchmarking commit (7bc7be8): comparison url.

Summary: This change led to moderate relevant mixed results shrug in compiler performance.

  • Moderate improvement in instruction counts (up to -1.2% on incr-unchanged builds of deeply-nested-async check)
  • Small regression in instruction counts (up to 0.3% on full builds of diesel check)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

Copy link

Contributor

klensy commented 11 days ago

Changes to llvm and cargo looks like not intended, bad rebase?

@JulianKnodt @oli-obk

Copy link

Contributor

oli-obk commented 11 days ago

I don't see any submodule changes... is the mobile app hiding them from me?

Copy link

Contributor

Author

JulianKnodt commented 11 days ago

hmmm well the cargo lock file would fail CI if I didn't update @klensy, so I just put it in, not sure what caused it to change

Copy link

Contributor

oli-obk commented 11 days ago

Oof yea, the app just bails on me on these links... I guess no more reviews in the app :(

Please revert the submodule changes and the lockfile changes!

Copy link

Contributor

Author

JulianKnodt commented 11 days ago

edited

Do I have permission to revert the PR? I can push to the branch again but since it's already merged

edit: or what exactly should I do?

Copy link

Contributor

oli-obk commented 11 days ago

You can revert the PR locally and open a new PR with the revert.

Revert all commits, squash the reverts, and only keep the reverts of the submodules and cargo lock, the functional changes can stay

Copy link

Contributor

Author

JulianKnodt commented 10 days ago

@oli-obk I think there was another commit already for updating cargo, and the linked PR should revert the llvm change.
bfacc5c

Copy link

Contributor

Urgau commented 9 days ago

edited

This PR changed the crate rustdoc-json-types which is a public API (nightly, but still) without increasing the format version and without pinging a rustdoc maintainer. I've send #93132 to fix the format version.

cc @CraftSpider (as rustdoc json maintainer)

Copy link

Contributor

klensy commented 9 days ago

@Urgau simply bumping version is wrong, as this pr should be reverted.

Copy link

Contributor

klensy commented 9 days ago

edited

rustdoc hitted too, btw.

Or it expected changes? Idk.

Copy link

Contributor

oli-obk commented 9 days ago

The changes are expected from this PR, yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK