Skip to content

improve PassMode docs #115654

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 4 commits into from
Sep 17, 2023
Merged

improve PassMode docs #115654

merged 4 commits into from
Sep 17, 2023

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Sep 7, 2023

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Sep 7, 2023

r? @compiler-errors

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 7, 2023
@rustbot
Copy link
Collaborator

rustbot commented Sep 8, 2023

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@RalfJung RalfJung changed the title explain PassMode::Cast improve PassMode docs Sep 8, 2023
@bors
Copy link
Collaborator

bors commented Sep 8, 2023

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

@RalfJung
Copy link
Member Author

RalfJung commented Sep 8, 2023

Is it correct that PassMode::Indirect with meta_attrs set is the only mode that supports unsized types?

I found some cases where mips64 produces PassMode::Cast for unsized types, but I'm fairly sure that is bogus, so I'd like to add an assertion in the LLVM backend.

@RalfJung RalfJung force-pushed the pass-mode-cast branch 2 times, most recently from c9e3096 to d1c8f66 Compare September 9, 2023 05:31
@RalfJung
Copy link
Member Author

RalfJung commented Sep 9, 2023

I've added an assertion against unsized casts.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bjorn3
Copy link
Member

bjorn3 commented Sep 9, 2023

Is it correct that PassMode::Indirect with meta_attrs set is the only mode that supports unsized types?

extern { type Foo; } has meta_attrs unset afaik. They do still use PassMode::Indirect though. I don't think any other pass mode is possible for unsized types.

@RalfJung
Copy link
Member Author

RalfJung commented Sep 9, 2023

Wait, it's possible to pass extern types by-val? I made Miri ICE in that case as that seems completely ludicrous...

@RalfJung
Copy link
Member Author

RalfJung commented Sep 9, 2023

Turns out yes, that is possible: #115709.

This PR will make that code ICE. But I think that's fine, it shouldn't have built in the first place...

@compiler-errors
Copy link
Member

This PR will make that code ICE. But I think that's fine, it shouldn't have built in the first place...

Agreed

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 16, 2023

📌 Commit 3ee65c2 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 16, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2023
Rollup of 6 pull requests

Successful merges:

 - rust-lang#114965 (Remove Drop impl of mpsc Receiver and (Sync)Sender)
 - rust-lang#115434 (make `Debug` impl for `ascii::Char` match that of `char`)
 - rust-lang#115477 (Stabilize the `Saturating` type)
 - rust-lang#115611 (add diagnostic for raw identifiers in format string)
 - rust-lang#115654 (improve PassMode docs)
 - rust-lang#115862 (Migrate `compiler/rustc_hir_typeck/src/callee.rs` to translatable diagnostics)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0c5f5b6 into rust-lang:master Sep 17, 2023
@rustbot rustbot added this to the 1.74.0 milestone Sep 17, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2023
Rollup merge of rust-lang#115654 - RalfJung:pass-mode-cast, r=compiler-errors

improve PassMode docs
@RalfJung RalfJung deleted the pass-mode-cast branch September 19, 2023 08:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants