Skip to content

Implement rustc_public::CrateDef{,Type} for FieldDef#157410

Open
erickt wants to merge 1 commit into
rust-lang:mainfrom
erickt:rustc-public
Open

Implement rustc_public::CrateDef{,Type} for FieldDef#157410
erickt wants to merge 1 commit into
rust-lang:mainfrom
erickt:rustc-public

Conversation

@erickt
Copy link
Copy Markdown
Contributor

@erickt erickt commented Jun 4, 2026

This migrates FieldDef to implement CrateDef and CrateDefType, which matches the other DefId wrappers. This allows access to field info, like the underlying DefId, the name, and any tool attributes on the field.

This migrates FieldDef to implement CrateDef and CrateDefType,
which matches the other DefId wrappers. This allows access to field
info, like the underlying DefId, the name, and any tool attributes on
the field.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 4, 2026

This PR changes rustc_public

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

@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 Jun 4, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jun 4, 2026

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: project-stable-mir
  • project-stable-mir expanded to celinval, makai410, oli-obk, scottmcm
  • Random selection from celinval, makai410, oli-obk, scottmcm

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui-fulldeps/rustc_public/check_ty_fold.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui-fulldeps/rustc_public/check_ty_fold.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/rustc_public/check_ty_fold/a" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "--edition=2021"
stdout: none
--- stderr -------------------------------
error[E0599]: no method named `ty_with_args` found for reference `&rustc_public::ty::FieldDef` in the current scope
##[error]  --> /checkout/tests/ui-fulldeps/rustc_public/check_ty_fold.rs:52:30
   |
LL |     let field_ty = field_def.ty_with_args(&args);
   |                              ^^^^^^^^^^^^ method not found in `&rustc_public::ty::FieldDef`
   |
   = help: items from traits can only be used if the trait is in scope
help: trait `CrateDefType` which provides `ty_with_args` is implemented but not in scope; perhaps you want to import it
   |
LL + use crate::rustc_public::CrateDefType;

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants