-
Notifications
You must be signed in to change notification settings - Fork 13.8k
add mem::conjure_zst #146479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add mem::conjure_zst #146479
Conversation
r? libs |
Per rust-lang/libs-team#292 (comment), this should come with a compiler error if attempting to use with a concrete type that isn't a ZST. |
How should that be implemented? Should I make |
It would probably be good to find an existing lint that fires on concrete types but ignores generics (the behavior specified in the ACP), and then basically mirror this logic. Think this should just need a diagnostic item, which is more lightweight than lang items. But I also don't know this area all that well, asking on Zulip t-compiler/help may be a good idea. I'm still planning to review this as-is, it's easier to have the lint in a separate PR anyway. Just wanted to make sure it's on the radar. |
Presumably the best method would be to just have an intrinsic From my understanding, these effectively boil down to a panic when the type is invalid, which means that in the concrete case it'll throw an unconditional panic warning and in the generic case it'll just panic at runtime instead. |
I think that stabilization might need to wait for such a lint, but I'd still encourage that we do it over multiple PRs. We can add the API first, then any linting after. |
@bors r+ rollup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did have a couple small things here
@bors r- |
2dec553
to
113ca95
Compare
113ca95
to
a9ab29c
Compare
Thanks! @bors r=scottmcm,tgross35 rollup |
…cm,tgross35 add mem::conjure_zst Tracking issue: rust-lang#95383
Rollup of 14 pull requests Successful merges: - #142670 (Document fully-qualified syntax in `as`' keyword doc) - #144908 (Fix doctest output json) - #145685 (add CloneFromCell and Cell::get_cloned) - #146330 (Bump unicode_data and printables to version 17.0.0) - #146451 (Fix atan2 inaccuracy in documentation) - #146479 (add mem::conjure_zst) - #147190 (std: `sys::net` cleanups) - #147245 (only replace the intended comma in pattern suggestions) - #147251 (Do not assert that a change in global cache only happens when concurrent) - #147269 (Add regression test for 123953) - #147277 (Extract common logic for iterating over features) - #147280 (Return to needs-llvm-components being info-only) - #147292 (Respect `-Z` unstable options in `rustdoc --test`) - #147300 (Add xtensa arch to object file creation) r? `@ghost` `@rustbot` modify labels: rollup
…cm,tgross35 add mem::conjure_zst Tracking issue: rust-lang#95383
…cm,tgross35 add mem::conjure_zst Tracking issue: rust-lang#95383
…cm,tgross35 add mem::conjure_zst Tracking issue: rust-lang#95383
…cm,tgross35 add mem::conjure_zst Tracking issue: rust-lang#95383
Rollup of 14 pull requests Successful merges: - #142670 (Document fully-qualified syntax in `as`' keyword doc) - #145685 (add CloneFromCell and Cell::get_cloned) - #146330 (Bump unicode_data and printables to version 17.0.0) - #146451 (Fix atan2 inaccuracy in documentation) - #146479 (add mem::conjure_zst) - #146874 (compiler: Hint at multiple crate versions if trait impl is for wrong ADT ) - #147117 (interpret `#[used]` as `#[used(compiler)]` on illumos) - #147190 (std: `sys::net` cleanups) - #147251 (Do not assert that a change in global cache only happens when concurrent) - #147280 (Return to needs-llvm-components being info-only) - #147288 (compiletest: Make `DirectiveLine` responsible for name/value splitting) - #147309 (Add documentation about unwinding to wasm targets) - #147315 (bless autodiff batching test) - #147323 (Fix top level ui tests check in tidy) r? `@ghost` `@rustbot` modify labels: rollup
…cm,tgross35 add mem::conjure_zst Tracking issue: rust-lang#95383
Rollup of 11 pull requests Successful merges: - #142670 (Document fully-qualified syntax in `as`' keyword doc) - #145685 (add CloneFromCell and Cell::get_cloned) - #146330 (Bump unicode_data and printables to version 17.0.0) - #146451 (Fix atan2 inaccuracy in documentation) - #146479 (add mem::conjure_zst) - #147117 (interpret `#[used]` as `#[used(compiler)]` on illumos) - #147190 (std: `sys::net` cleanups) - #147251 (Do not assert that a change in global cache only happens when concurrent) - #147280 (Return to needs-llvm-components being info-only) - #147288 (compiletest: Make `DirectiveLine` responsible for name/value splitting) - #147315 (bless autodiff batching test) r? `@ghost` `@rustbot` modify labels: rollup
…cm,tgross35 add mem::conjure_zst Tracking issue: rust-lang#95383
Rollup of 10 pull requests Successful merges: - #142670 (Document fully-qualified syntax in `as`' keyword doc) - #145685 (add CloneFromCell and Cell::get_cloned) - #146330 (Bump unicode_data and printables to version 17.0.0) - #146451 (Fix atan2 inaccuracy in documentation) - #146479 (add mem::conjure_zst) - #147117 (interpret `#[used]` as `#[used(compiler)]` on illumos) - #147190 (std: `sys::net` cleanups) - #147251 (Do not assert that a change in global cache only happens when concurrent) - #147280 (Return to needs-llvm-components being info-only) - #147315 (bless autodiff batching test) r? `@ghost` `@rustbot` modify labels: rollup
Tracking issue: #95383