Skip to content

Add common trait for crate definitions - #118215

Merged
bors merged 3 commits into
rust-lang:masterfrom
celinval:smir-def-paths
Nov 24, 2023
Merged

Add common trait for crate definitions#118215
bors merged 3 commits into
rust-lang:masterfrom
celinval:smir-def-paths

Conversation

@celinval

@celinval celinval commented Nov 23, 2023

Copy link
Copy Markdown
Contributor

In stable mir, we specialize DefId, however some functionality is the same for every definition, such as def paths, and getting their crate. Use a trait to implement those.

This will allow users to use rustc span messages to display user
friendly messages.
@rustbot

rustbot commented Nov 23, 2023

Copy link
Copy Markdown
Collaborator

r? @spastorino

(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 Nov 23, 2023
@rustbot

rustbot commented Nov 23, 2023

Copy link
Copy Markdown
Collaborator

This PR changes Stable MIR

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

@rust-log-analyzer

This comment has been minimized.

@ouz-a ouz-a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

few nits, this is very nice change thanks!

Comment thread compiler/stable_mir/src/mir/mono.rs
Comment thread compiler/stable_mir/src/crate_def.rs Outdated
Comment thread compiler/rustc_smir/src/rustc_smir/mod.rs
@ouz-a ouz-a self-assigned this Nov 24, 2023
@ouz-a

ouz-a commented Nov 24, 2023

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Nov 24, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit b6e9772 has been approved by ouz-a

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 Nov 24, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 24, 2023
…mpiler-errors

Rollup of 7 pull requests

Successful merges:

 - rust-lang#118187 (Recompile LLVM when it changes in the git sources)
 - rust-lang#118210 (intercrate ambiguity causes: ignore candidates which don't apply)
 - rust-lang#118215 (Add common trait for crate definitions)
 - rust-lang#118238 (memcpy assumptions: update GCC link)
 - rust-lang#118243 (EvalCtxt::commit_if_ok don't inherit nested goals)
 - rust-lang#118245 (Add `Span` to `TraitBoundModifier`)
 - rust-lang#118246 (Remove a hack for effects)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 8294352 into rust-lang:master Nov 24, 2023
@rustbot rustbot added this to the 1.76.0 milestone Nov 24, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 24, 2023
Rollup merge of rust-lang#118215 - celinval:smir-def-paths, r=ouz-a

Add common trait for crate definitions

In stable mir, we specialize DefId, however some functionality is the same for every definition, such as def paths, and getting their crate. Use a trait to implement those.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

7 participants