Skip to content

Added more queries to AdtDef in rustc_public to check for rust language types - #166012

Merged
rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
adpthegreat:add_more_adtdef_queries
Nov 22, 2026
Merged

rust-bors[bot] merged 6 commits into
rust-lang:mainfrom
adpthegreat:add_more_adtdef_queries

Conversation

@adpthegreat

@adpthegreat adpthegreat commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

Closes rust-lang/rustc_public#86 was redirected to make a pr to this repo here rust-lang/rustc_public#133

No llm was used in the generation of this PR

Also i'm having troubles finding an AdtDef query for is_anonymous all my research leads me to anonymous lifetimes which are not ADTs

Also more AdtDef queries such as is_fundamental is_unsafe_pinned is_pin is_pin_project is_field_representing_type can be added to add support for more language items, can i add them too?

@makai410 @celinval

@rustbot

rustbot commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

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 Nov 15, 2026
@rustbot

rustbot commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @scottmcm (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

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

@rust-log-analyzer

This comment has been minimized.

@makai410 makai410 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.

Could you please also add a ui test to tests/ui-fulldeps/rustc_public? Thanks!

View changes since this review

@makai410

Copy link
Copy Markdown
Member

r? me

@rustbot rustbot assigned makai410 and unassigned scottmcm Nov 16, 2026
@adpthegreat

Copy link
Copy Markdown
Contributor Author

@makai410 i've added the test, also referring to the rest of my first comment

"Also i'm having troubles finding an AdtDef query for is_anonymous all my research leads me to anonymous lifetimes which are not ADTs

Also more AdtDef queries such as is_fundamental is_unsafe_pinned is_pin is_pin_project is_field_representing_type can be added to add support for more language items, can i add them too?"

@rust-log-analyzer

This comment has been minimized.

@makai410

Copy link
Copy Markdown
Member

"Also i'm having troubles finding an AdtDef query for is_anonymous all my research leads me to anonymous lifetimes which are not ADTs

I suspect that was a typo or something in the issue.

Also more AdtDef queries such as is_fundamental is_unsafe_pinned is_pin is_pin_project is_field_representing_type can be added to add support for more language items, can i add them too?"

We can add those later when there's a request.

@makai410

Copy link
Copy Markdown
Member

CI wants some formatting. Fyi you can do ./x fmt

@adpthegreat

Copy link
Copy Markdown
Contributor Author

Ok i will do that rn @makai410 do i also need to rebase?

@rust-log-analyzer

This comment has been minimized.

@makai410 makai410 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.

Looks good! Thanks!

View changes since this review

@makai410

Copy link
Copy Markdown
Member

We need to squash these commits, let's use some bors magic

@bors squash message="feat: add more AdtDef queries"

@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

🔨 5 commits were squashed into 3ee6c6f.

@rust-bors
rust-bors Bot force-pushed the add_more_adtdef_queries branch from 2f5945c to 3ee6c6f Compare November 20, 2026 11:08
@makai410

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3ee6c6f has been tentatively approved by makai410

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 20, 2026
@adpthegreat
adpthegreat force-pushed the add_more_adtdef_queries branch from 3ee6c6f to 45426d2 Compare November 20, 2026 15:22
@adpthegreat

Copy link
Copy Markdown
Contributor Author

@makai410 @JonathanBrouwer CI fixed, it was test-tidy detecting trailing whitespace

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors r=makai410

@rust-bors

rust-bors Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 45426d2 has been tentatively approved by makai410

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot 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 Nov 20, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 20, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 20, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #166266 (miri subtree update)
 - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`)
 - #165930 (Add red-green mark when dumping dep graph. Show DefIds if available)
 - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types)
 - #166269 (libcore: Revert some comment changes)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 21, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 22, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #166266 (miri subtree update)
 - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`)
 - #165008 (Support `NonNull` pointers as `asm!` input operands)
 - #165892 (`rustc_builtin_macros` cleanup, part 10)
 - #165930 (Add red-green mark when dumping dep graph. Show DefIds if available)
 - #166280 (std: also mark doctests with skip_unsupported_miri_tests)
 - #166295 (use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`)
 - #165618 (Implement RangeIntersect on core::range types)
 - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types)
 - #166142 (Lower to `hir::Param`s for extern functions)
 - #166259 (fmt: Improve `Debug` for `FormattingOptions`)
 - #166269 (libcore: Revert some comment changes)
 - #166287 (Use `core::ptr` in `implicit_provenance_casts` help for `no_std` crates)
 - #166306 (bootstrap: Stop passing `-Ztrim-paths` to cargo now that it's stable in beta)
@Zalathar

Copy link
Copy Markdown
Member

@bors try jobs=test-x86_64-rust-for-linux

rust-bors Bot pushed a commit that referenced this pull request Nov 22, 2026
Added more queries to AdtDef in rustc_public to check for rust language types


try-job: test-x86_64-rust-for-linux
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 030d3a1 (030d3a1f76917c47b0cad74fa2b49d6f5fcb9bf9)
Base parent: 342d744 (342d74463af7dd3018ef6aa04dd5500c2deb5bd1)

Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 22, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 22, 2026
Rollup of 15 pull requests

Successful merges:

 - #166266 (miri subtree update)
 - #165720 (windows: remove redundant prefix parsing in `PathBuf::_push`)
 - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`)
 - #165008 (Support `NonNull` pointers as `asm!` input operands)
 - #165892 (`rustc_builtin_macros` cleanup, part 10)
 - #164485 (Stabilize unchecked `nonzero_ops`)
 - #165618 (Implement RangeIntersect on core::range types)
 - #165833 (Deallocate with the right provenance on Windows)
 - #165834 (Implement tidy alphabetical --bless on Windows)
 - #165889 (Fix docs of alloc fn: Allocator API stabilized)
 - #165923 (Don't load/store a LLVM aggregate type when returning an array from a generic SIMD intrinsic)
 - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types)
 - #166216 (Stop using #![no_core] in profiler_builtins)
 - #166259 (fmt: Improve `Debug` for `FormattingOptions`)
 - #166263 (Show slice split results for empty and singleton slices)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 22, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 22, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 22, 2026
…uwer

Rollup of 19 pull requests

Successful merges:

 - #166266 (miri subtree update)
 - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`)
 - #165008 (Support `NonNull` pointers as `asm!` input operands)
 - #165892 (`rustc_builtin_macros` cleanup, part 10)
 - #165930 (Add red-green mark when dumping dep graph. Show DefIds if available)
 - #166280 (std: also mark doctests with skip_unsupported_miri_tests)
 - #166295 (use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`)
 - #164485 (Stabilize unchecked `nonzero_ops`)
 - #165618 (Implement RangeIntersect on core::range types)
 - #165782 (Make unsafe unknown diagnostic attributes an error again)
 - #165833 (Deallocate with the right provenance on Windows)
 - #165834 (Implement tidy alphabetical --bless on Windows)
 - #165889 (Fix docs of alloc fn: Allocator API stabilized)
 - #165923 (Don't load/store a LLVM aggregate type when returning an array from a generic SIMD intrinsic)
 - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types)
 - #166186 (OpenOptions::append: clarify docs)
 - #166216 (Stop using #![no_core] in profiler_builtins)
 - #166259 (fmt: Improve `Debug` for `FormattingOptions`)
 - #166263 (Show slice split results for empty and singleton slices)
rust-bors Bot pushed a commit that referenced this pull request Nov 22, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`)
 - #165008 (Support `NonNull` pointers as `asm!` input operands)
 - #165892 (`rustc_builtin_macros` cleanup, part 10)
 - #165930 (Add red-green mark when dumping dep graph. Show DefIds if available)
 - #166280 (std: also mark doctests with skip_unsupported_miri_tests)
 - #166295 (use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`)
 - #164485 (Stabilize unchecked `nonzero_ops`)
 - #165618 (Implement RangeIntersect on core::range types)
 - #165782 (Make unsafe unknown diagnostic attributes an error again)
 - #165833 (Deallocate with the right provenance on Windows)
 - #165834 (Implement tidy alphabetical --bless on Windows)
 - #165889 (Fix docs of alloc fn: Allocator API stabilized)
 - #165923 (Don't load/store a LLVM aggregate type when returning an array from a generic SIMD intrinsic)
 - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types)
 - #166186 (OpenOptions::append: clarify docs)
 - #166216 (Stop using #![no_core] in profiler_builtins)
 - #166259 (fmt: Improve `Debug` for `FormattingOptions`)
 - #166263 (Show slice split results for empty and singleton slices)
rust-bors Bot pushed a commit that referenced this pull request Nov 22, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #164878 (Don't require `extern "llvm-intrinsic"` return structs to be `#[repr(packed)]`)
 - #165008 (Support `NonNull` pointers as `asm!` input operands)
 - #165892 (`rustc_builtin_macros` cleanup, part 10)
 - #165930 (Add red-green mark when dumping dep graph. Show DefIds if available)
 - #166280 (std: also mark doctests with skip_unsupported_miri_tests)
 - #166295 (use `cfg!(overflow_checks)` in `overflow_checks` intrinsic instead of `cfg!(debug_assertions)`)
 - #164485 (Stabilize unchecked `nonzero_ops`)
 - #165618 (Implement RangeIntersect on core::range types)
 - #165782 (Make unsafe unknown diagnostic attributes an error again)
 - #165833 (Deallocate with the right provenance on Windows)
 - #165834 (Implement tidy alphabetical --bless on Windows)
 - #165889 (Fix docs of alloc fn: Allocator API stabilized)
 - #165923 (Don't load/store a LLVM aggregate type when returning an array from a generic SIMD intrinsic)
 - #166012 (Added more queries to AdtDef in rustc_public to check for rust language types)
 - #166186 (OpenOptions::append: clarify docs)
 - #166216 (Stop using #![no_core] in profiler_builtins)
 - #166259 (fmt: Improve `Debug` for `FormattingOptions`)
 - #166263 (Show slice split results for empty and singleton slices)
@rust-bors
rust-bors Bot merged commit 4e740c9 into rust-lang:main Nov 22, 2026
15 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 22, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 22, 2026
Rollup merge of #166012 - adpthegreat:add_more_adtdef_queries, r=makai410

Added more queries to AdtDef in rustc_public to check for rust language types

Closes  rust-lang/rustc_public#86 was redirected to make a pr to this repo here rust-lang/rustc_public#133

No llm was used in the generation of this PR

Also i'm having troubles finding an `AdtDef` query for `is_anonymous` all my research leads me to anonymous lifetimes which are not `ADT`s

Also [more](https://github.com/rust-lang/rust/blob/1a4d65fa9d3ff3990d766c52e741c7027ffa4fc6/compiler/rustc_middle/src/ty/adt.rs#L524) AdtDef queries such as [is_fundamental](https://github.com/rust-lang/rust/blob/1a4d65fa9d3ff3990d766c52e741c7027ffa4fc6/compiler/rustc_middle/src/ty/adt.rs#L500) [is_unsafe_pinned](https://github.com/rust-lang/rust/blob/1a4d65fa9d3ff3990d766c52e741c7027ffa4fc6/compiler/rustc_middle/src/ty/adt.rs#L524) [is_pin](https://github.com/rust-lang/rust/blob/1a4d65fa9d3ff3990d766c52e741c7027ffa4fc6/compiler/rustc_middle/src/ty/adt.rs#L536) [is_pin_project](https://github.com/rust-lang/rust/blob/1a4d65fa9d3ff3990d766c52e741c7027ffa4fc6/compiler/rustc_middle/src/ty/adt.rs#L543) [is_field_representing_type](https://github.com/rust-lang/rust/blob/1a4d65fa9d3ff3990d766c52e741c7027ffa4fc6/compiler/rustc_middle/src/ty/adt.rs#L547) can be added to add support for more language items, can i add them too?

@makai410 @celinval
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.

Add more queries to AdtDef to check for rust language types

7 participants