Merged
Conversation
Checking that they really do use thin pointers.
- Add some explanatory comments. - Rename `OpaqueListContents` as `ExternTy`. I've always found both the "opaque" and "contents" parts of this name to be confusing. Calling it `ExternTy` makes it clear that all that matters is it's an extern type.
- Merge the `List` and `ListWithCachedTypeInfo` impls by referring to the shared underlying type, `RawList`. This required increasing the visibility of `RawList`. - Explain why a separate impl is needed for `RawList`. - Remove an incorrect FIXME comment. Fat reference types will always need a separate impl. (To be sure, one could use `T: ?Sized` to merge the impls for `&T` and `&[T]` and it would compile but it would behave incorrectly because `&T` needs one word of storage and `&[T]` needs two words of storage. I tried it and it did not go well.)
Member
|
Works for me! @bors r+ |
Contributor
Zalathar
reviewed
Apr 1, 2026
Comment on lines
-112
to
-113
| // FIXME(#151565): Using `T: ?Sized` here should let us remove the separate | ||
| // impls for fat reference types. |
Member
There was a problem hiding this comment.
Here I was thinking we could replace size_of::<&'_ ()>() with size_of::<&'_ T>() and just get the correct size automatically, but that appears to not actually work smoothly since it then complains about needing #![feature(generic_const_exprs)].
So removing this FIXME is probably the right call.
rust-bors bot
pushed a commit
that referenced
this pull request
Apr 1, 2026
Rollup of 5 pull requests Successful merges: - #152935 (c-variadic: error when we can't guarantee that the backend does the right thing) - #153207 (std::net: clamp linger timeout value to prevent silent truncation.) - #154592 (Fix `mismatched_lifetime_syntaxes` suggestions for hidden path lifetimes) - #154643 (fix pin docs) - #154648 (Clarify `ty::List`)
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
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.
ty::Listis an unusual type. This commit clarifies some things about it. Details in individual commits.r? @cuviper