-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Implement RFC 2580: Pointer metadata & VTable #81172
Conversation
r? @cramertj (rust-highfive has picked a reviewer for you, use r? to override) |
What’s the correct syntax for intra-doc links to a method of a primitive type? error: unresolved link to `to_raw_parts`
--> library/core/src/ptr/metadata.rs:51:6
|
51 | /// [`to_raw_parts`]: <*const _>::to_raw_parts
| ^^^^^^^^^^^^^^ no item named `to_raw_parts` in scope |
This comment has been minimized.
This comment has been minimized.
22c6615
to
13f0913
Compare
This was just implemented a few weeks ago and isn't available on beta: #80181 |
Thanks! Tests in that PR show that the answer (to the question I should have asked about the syntax for raw pointers specifically) is
That’s fine, the item with that doc-comment has |
This comment has been minimized.
This comment has been minimized.
Note that pointers are about to be put behind a feature gate because there's no way to distinguish |
Indeed, I’ve added By the way, I’ve had to add it in both libcore and libstd. Presumably The |
Yeah that one seems flaky, it failed in #80965 too. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
acc1e1f
to
f4d028e
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #81160) made this pull request unmergeable. Please resolve the merge conflicts. |
f4d028e
to
3d95388
Compare
This comment has been minimized.
This comment has been minimized.
I've created a tracking issue: #81513 |
This comment has been minimized.
This comment has been minimized.
07231ba
to
28e25eb
Compare
The RFC is merged, tracking issue numbers are in, and CI is green. This is only waiting for review now. |
r? @oli-obk |
@bors r- This is unlikely to be spurious, there's a rustdoc bug here somewhere. @SimonSapin linking to pointers is still pretty buggy, I would avoid it here and use |
That would be ideal of course, but I can not reproduce at all. I’ve rebased again just in case this is related to something merged into
I assume the line with lower-cased By the way, stages appear to be off by one between builds and docs. Stage 1 is the first where Here is |
The error is caused by the lack of case-sensitivity on the filesystem.
Can you explain more what you saw? If I run |
Ah ok, this is #25879 then. @bors r=oli-obk |
📌 Commit cac71bf has been approved by |
☀️ Test successful - checks-actions |
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
After running profile = "compiler"
changelog-seen = 2
[build]
low-priority = true |
The default for I'm trying to think if there's some way a fingerprint error could cause it to fail to rebuild, but I can't think of a way to trigger that. When developing rustc, the fingerprint Cargo uses for a stage1 compiler is not very good (because it does not contain the SHA hash, it can't tell when the compiler changes), but in this scenario I don't think that matters. |
Ok, it’s possible I made some mistake on my end then. Thanks for trying to reproduce. |
@SimonSapin Why isn't |
Responded on the tracking issue. |
RFC: rust-lang/rfcs#2580
Before merging this PR:#[unstable]
attributes in the PR with the tracking issue numberThis PR extends the language with a new lang item for the
Pointee
trait which is special-cased in trait resolution to implement it for all types. Even in generic contexts, parameters can be assumed to implement it without a corresponding bound.For this I mostly imitated what the compiler was already doing for the
DiscriminantKind
trait. I’m very unfamiliar with compiler internals, so careful review is appreciated.This PR also extends the standard library with new unstable APIs in
core::ptr
andstd::ptr
:API differences from the RFC, in areas noted as unresolved questions in the RFC:
from_raw_parts
functions on*const T
and*mut T
, following the precedent ofnull
,slice_from_raw_parts
, etc.to_raw_parts