Skip to content

Use wide pointers consistenly across the compiler - #131202

Merged
bors merged 1 commit into
rust-lang:masterfrom
Urgau:wide-ptrs-compiler
Oct 4, 2024
Merged

Use wide pointers consistenly across the compiler#131202
bors merged 1 commit into
rust-lang:masterfrom
Urgau:wide-ptrs-compiler

Conversation

@Urgau

@UrgauUrgau commented Oct 3, 2024

Copy link
Copy Markdown
Member

This PR replace every use of "fat pointer" for the more recent "wide pointer" terminology.

As T-lang as preferred the "wide pointer" terminology, as can be seen on the last RFCs, on some lints, but also in the reference.

Currently we have a mix of both (including in error messages), which isn't great, but with this PR no more.

r? @jieyouxu (feel free to re-roll)

@rustbotrustbot 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 Oct 3, 2024
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

This PR changes Stable MIR

cc @oli-obk, @celinval, @ouz-a

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

@jieyouxu

Copy link
Copy Markdown
Member

@Urgau is there any kind of meeting or decision we can look at that shows T-lang preferred "wide pointers" over "fat pointers"?

@Urgau

Urgau commented Oct 3, 2024

Copy link
Copy Markdown
MemberAuthor

A part from the indirect usage described in the PR description, I don't think so (at least I haven't found one). I think it just sort of happened.

cc @traviscross

@jieyouxu

jieyouxu commented Oct 3, 2024

Copy link
Copy Markdown
Member

A part from the indirect usage described in the PR description, I don't think so (at least I haven't found one). I think it just sort of happened.

Yeah personally I'm fine with sticking with one of "wide pointers" or "fat pointers" instead of mixing both terms, but I think we want this to be an explicit T-lang decision of migrating over to "wide pointers" with a clear definition in the reference that users can look at if they want clarity of what that concretely means.

For T-lang

Do we want to use "wide pointers" terminology over "fat pointers"? Is this term documented in the Reference?

Note that the Reference seems to use "wide pointers" in at least https://doc.rust-lang.org/reference/expressions/operator-expr.html?highlight=wide#semantics.

@rustbot label +I-lang-nominated +I-lang-easy-decision

If @traviscross knows that T-lang already prefers "wide pointers" over "fat pointers" then this is fine.

@jieyouxujieyouxu added T-lang Relevant to the language team I-lang-nominated Nominated for discussion during a lang team meeting. I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy; this does not imply nomination S-waiting-on-team and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 3, 2024
@Urgau
Urgauforce-pushed the wide-ptrs-compiler branch from 25a1bd3 to 2de4f21CompareOctober 3, 2024 14:39
@Urgau

Urgau commented Oct 3, 2024

Copy link
Copy Markdown
MemberAuthor

@jieyouxu actually, T-lang explicitly discussed fat vs wide for the naming of the ambiguous_wide_pointer_comparison lint in #117758 (comment), #117758 (comment), #117758 (comment) and they FCP-ed it

@jieyouxu

Copy link
Copy Markdown
Member

Ok great, in that case this seems fine.

@jieyouxujieyouxu added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed I-lang-nominated Nominated for discussion during a lang team meeting. I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy; this does not imply nomination T-lang Relevant to the language team S-waiting-on-team labels Oct 3, 2024

@jieyouxujieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some nits, incl. consts and enums that still refers to FAT_PTR.

Comment threadcompiler/rustc_codegen_llvm/src/debuginfo/metadata.rs Outdated
Comment threadcompiler/rustc_codegen_llvm/src/debuginfo/metadata.rs Outdated
Comment threadcompiler/rustc_middle/src/ty/layout.rs Outdated
@jieyouxu

Copy link
Copy Markdown
Member

@rustbot author

@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 3, 2024
Comment threadcompiler/rustc_hir_typeck/messages.ftl Outdated
Comment threadcompiler/rustc_middle/src/ty/adjustment.rs Outdated
Comment threadcompiler/rustc_middle/src/ty/adjustment.rs Outdated
@Urgau
Urgauforce-pushed the wide-ptrs-compiler branch from 2de4f21 to c2f8071CompareOctober 4, 2024 07:45
@Urgau

Urgau commented Oct 4, 2024

Copy link
Copy Markdown
MemberAuthor

@rustbot ready

@rustbotrustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 4, 2024
@rustbotrustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2024

@jieyouxujieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jieyouxu

Copy link
Copy Markdown
Member

@bors r+ rollup

@bors

bors commented Oct 4, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit c2f8071 has been approved by jieyouxu

It is now in the queue for this repository.

@borsbors 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 Oct 4, 2024
@jieyouxu

Copy link
Copy Markdown
Member

@bors rollup=maybe

Comment threadcompiler/rustc_codegen_gcc/src/type_of.rs Outdated
@jieyouxu

Copy link
Copy Markdown
Member

Ah yeah.
@bors r-
Feel free to r=me after the tiny nit.

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 4, 2024
@Urgau
Urgauforce-pushed the wide-ptrs-compiler branch from c2f8071 to 018ba05CompareOctober 4, 2024 12:16
@Urgau

Urgau commented Oct 4, 2024

Copy link
Copy Markdown
MemberAuthor

@bors r=@jieyouxu

@bors

bors commented Oct 4, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 018ba05 has been approved by jieyouxu

It is now in the queue for this repository.

@borsbors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 4, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 4, 2024
…llaumeGomez
Rollup of 4 pull requests
Successful merges:
- rust-lang#131034 (Implement RFC3695 Allow boolean literals as cfg predicates)
- rust-lang#131202 (Use wide pointers consistenly across the compiler)
- rust-lang#131230 (Enable `--no-sandbox` option by default for rustdoc GUI tests)
- rust-lang#131232 (Week off of reviews to focus on docs)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit ba94a2a into rust-lang:masterOct 4, 2024
@rustbotrustbot added this to the 1.83.0 milestone Oct 4, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 4, 2024
Rollup merge of rust-lang#131202 - Urgau:wide-ptrs-compiler, r=jieyouxu
Use wide pointers consistenly across the compiler
This PR replace every use of "fat pointer" for the more recent "wide pointer" terminology.
Since some time T-lang as preferred the "wide pointer" terminology, as can be seen on [the last RFCs](https://github.com/search?q=repo%3Arust-lang%2Frfcs+%22wide+pointer%22&type=code), on some [lints](https://doc.rust-lang.org/rustc/lints/listing/warn-by-default.html#ambiguous-wide-pointer-comparisons), but also in [the reference](https://doc.rust-lang.org/stable/reference/expressions/operator-expr.html?highlight=wide%20pointer#pointer-to-pointer-cast).
Currently we have a [mix of both](https://github.com/search?q=repo%3Arust-lang%2Frust+%22wide+pointer%22&type=code) (including in error messages), which isn't great, but with this PR no more.
r? `@jieyouxu` (feel free to re-roll)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

5 participants

@Urgau@rustbot@jieyouxu@bors@lqd