Skip to content
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

Suggest using as_ref on *const T #61444

Merged
merged 1 commit into from
Jun 4, 2019
Merged

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Jun 1, 2019

Fix #21596.

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 1, 2019
@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 3, 2019

📌 Commit eb73b73 has been approved by matthewjasper

@bors bors 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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 3, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 4, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 4, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 4, 2019
bors added a commit that referenced this pull request Jun 4, 2019
Rollup of 13 pull requests

Successful merges:

 - #61135 (Fix documentation of `Rc::make_mut` regarding `rc::Weak`.)
 - #61404 (miri unsizing: fix projecting into a field of an operand)
 - #61409 (Fix an ICE with a const argument in a trait)
 - #61413 (Re-implement async fn drop order lowering )
 - #61419 (Add an unusual-conversion example to to_uppercase)
 - #61420 (Succinctify splice docs)
 - #61444 (Suggest using `as_ref` on `*const T`)
 - #61446 (On TerminatorKind::DropAndReplace still handle unused_mut correctly)
 - #61485 (azure: retry s3 upload if it fails)
 - #61489 (ci: Reenable step timings on AppVeyor)
 - #61496 (Do not panic in tidy on unbalanced parentheses in cfg's)
 - #61497 (Treat 0 as special value for codegen-units-std)
 - #61499 (Add regression test for existential type ICE #53457)

Failed merges:

r? @ghost
@bors bors merged commit eb73b73 into rust-lang:master Jun 4, 2019
@RalfJung
Copy link
Member

Might be a good place to mention that this is UB if the pointer is dangling, unaligned or does not point to initialized memory -- even if the result reference is never used?

@estebank
Copy link
Contributor Author

@RalfJung sounds reasonable. Can you file a follow up ticket?

@RalfJung
Copy link
Member

I was thinking maybe adding that to the as_ref docs makes more sense? Or both?

I have adding it to the docs on my list.

@estebank
Copy link
Contributor Author

I think minimizing the requirement of having the docs open is a good thing. Basically anything I would tell someone when pair programming should be in the diagnostic itself, and this would count. I feel the diagnostics are part of the documentation, and the clarification should certainly be in the proper docs as well.

@RalfJung
Copy link
Member

Issue opened at #61786.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading message when attempting to call methods on a raw pointer
6 participants