forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Field projections dev PR #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bc6c00c to
40daa48
Compare
40daa48 to
51c0b3e
Compare
c534568 to
29437c5
Compare
BennoLossin
pushed a commit
that referenced
this pull request
Sep 2, 2025
…=jieyouxu Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#1 of Batch rust-lang#2] Part of rust-lang#133895 Methodology: 1. Refer to the previously written `tests/ui/SUMMARY.md` 2. Find an appropriate category for the test, using the original issue thread and the test contents. 3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers) 4. Rename the tests to make their purpose clearer Inspired by the methodology that `@Kivooeo` was using. r? `@jieyouxu`
a3635bf to
42db8e9
Compare
2403ca7 to
ae6b21d
Compare
2bd0ff4 to
a6b191a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Decisions
Decisions made during the experiment:
field representing types are uninhabited and have the same layout as
!users may implement any trait for field representing type they want (if either one is local)
DropandField/UnalignedField. The former because copying the drop impl data sturctures from ADTs is a lot of code duplication & people aren't going to want to drop field types in the first place. The latter two since they are already implemented by the compiler automatically.field representing types are considered local by the orphan check if and only if:
So
field_of!(Foo, bar.baz)is local ifFooandBarare local (Bazis allowed to be foreign). Except for tuples, fundamental types are not handled specially. Tuples are allowed as intermediate bases, as long as the first one isn't a tuple. Sofield_of!(Foo, bar.0.baz)is considered local ifFoois local &barhas type(Bar0, Bar1, ..., BarN)withBar0also being local.TODOs
In the PR the following bigger items still need to be decided/implemented:
Drop. Relevant files:compiler/rustc_ty_utils/src/needs_drop.rscompiler/rustc_trait_selection/src/traits/effects.rscompiler/rustc_trait_selection/src/traits/query/dropck_outlives.rscompiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rscompiler/rustc_middle/src/ty/significant_drop_order.rs.when printing the type.compiler/rustc_const_eval/src/util/type_name.rscompiler/rustc_middle/src/ty/print/pretty.rscompiler/rustc_middle/src/ty/field_path.rsthe base? or also the last one?
compiler/rustc_middle/src/ty/structural_impls.rslower_field_pathinItemCtxt?!compiler/rustc_hir_analysis/src/collect.rsUnalignedField/Fieldfor a FRTFieldwhen the base is notrepr(packed)!compiler/rustc_symbol_mangling/src/v0.rscompiler/rustc_symbol_mangling/src/export.rscompiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/transform.rscompiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rsoffset_of!lowering changed, now we have a newbug!in theThirBuildCx:compiler/rustc_mir_build/src/thir/cx/expr.rs. should this be handled differently?src/librustdoc/passes/collect_intra_doc_links.rssrc/librustdoc/json/conversions.rssrc/librustdoc/clean/mod.rsNote that there are some other todos as well, but those are probably smaller