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

RFC for an operator to take a raw reference #2582

Merged
merged 24 commits into from
Sep 15, 2019
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fd4b4cd
RFC for an operator to take a raw reference
RalfJung Nov 1, 2018
e250bed
there is some design space in terms of when and how we emit the new o…
RalfJung Nov 4, 2018
af78d46
more examples by ubsan
RalfJung Nov 4, 2018
1a62d82
coercions to raw ptrs also trigger the new operation
RalfJung Nov 5, 2018
879fa5c
make a lint part of this RFC, clarify when we use a raw ref
RalfJung Nov 20, 2018
0b496ee
expand description: this new operation entirely replaces ref-to-raw c…
RalfJung Dec 9, 2018
0b9df7a
dereferencability
RalfJung Dec 22, 2018
61c2e82
more on dereferencability
RalfJung Dec 22, 2018
5f7e9ea
RFC 2582: Fix typo (must not -> need not)
haslersn Jan 6, 2019
96ddb7c
Merge pull request #1 from haslersn/raw-reference-operator
RalfJung Jan 7, 2019
35b7810
update summary and be more explicit
RalfJung Jan 22, 2019
9a853d5
make example more concrete
RalfJung Jan 23, 2019
6cdac4d
rename to raw_reference_mir_operator
RalfJung Jan 24, 2019
4b60fb1
interaction with auto-deref
RalfJung Jan 26, 2019
315bb31
propose we might have dedicated syntax
RalfJung Feb 21, 2019
cb2dd0f
mention more drawbacks, unresolved questions and future possibilities
RalfJung Feb 21, 2019
1f1e690
half-rewrite RFC to center around a proposed syntax for raw references
RalfJung Mar 21, 2019
8eea0bf
clarify
RalfJung Mar 21, 2019
24aad9e
mention copying around
RalfJung Mar 21, 2019
9889619
adjust lint level open question
RalfJung Mar 30, 2019
6a803f1
move SUGAR to its own subsection under future possibilities
RalfJung Jul 26, 2019
92042f6
editing, and moving some other things to future possibilities
RalfJung Jul 26, 2019
e95df5c
no more ref-to-ptr casts in MIR
RalfJung Jul 26, 2019
9942dad
RFC 2582
Centril Sep 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
there is some design space in terms of when and how we emit the new o…
…peration
  • Loading branch information
RalfJung committed Nov 4, 2018
commit e250bed7f1e31e9534f753e1533739c5331248a2
11 changes: 10 additions & 1 deletion text/0000-raw-reference-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ surface syntax has been made yet -- and if one comes up later, this proposal is
forwards-compatible with also having explicit syntax for taking a raw reference
(and deprecating the safe-ref-then-cast way of writing this operation).

We could be using the new operator in more cases, e.g. we could have some kind
of analysis which determines during desugaring if a reference is *only* used as
a raw pointer, and if yes, creates it as a raw pointer to begin with. This
would make more code use raw references, thus making more code defined.
However, if someone *relies* on this behavior there is a danger of accidentally
adding a non-raw-ptr use to a reference, which would then rather subtly make the
program have UB.

# Prior art
[prior-art]: #prior-art

Expand All @@ -143,4 +151,5 @@ arise because of Rust having both of these features.
# Unresolved questions
[unresolved-questions]: #unresolved-questions

None I can think of.
We could have different rules for when to take a raw reference (as opposed to a
safe one).