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

Remove HashStable impl for collection types with unstable iteration order #533

Closed
3 tasks done
michaelwoerister opened this issue Jul 21, 2022 · 3 comments
Closed
3 tasks done
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team

Comments

@michaelwoerister
Copy link
Member

michaelwoerister commented Jul 21, 2022

Proposal

This MCP has the goal of removing unsound HashStable impls that currently exist for various widely used collection types, in particular collections derived from std::collections::HashMap and std::collections::HashSet (e.g. FxHashMap, DefIdSet, etc), and to restrict the HashStable impls for Ord-based collections (like BTreeMap and SortedMap) to instances with keys that have a stable sort order across compilation session boundaries.

HashMap / HashSet

The iteration order of HashMap and HashSet depends on the hash value of keys. This hash value, however, very often is not stable across compilation session boundaries because it can be computed from memory addresses (e.g. Interned<T>) or unstable IDs (like DefIndex or CrateNum). The current HashStable implementation "solves" this problem by computing an iteration-order-independent fingerprint for these collections -- but this is not sound since the iteration order can influence the outcome of query computation and thus the fingerprint must take it into account. Worst case, this fingerprint inaccuracy can lead to silent miscompilations.

In addition to the problem of hash values, the iteration order of these collections is not defined in any way, i.e. the documentation gives no guarantees. In particular, it is not guaranteed that hash_set.iter() has the same order as decode(encode(hash_set)).iter(), so even for keys with stable hash values (e.g. String), we cannot rely on iteration order staying the same across compilation session boundaries.

What to use instead of HashMap / HashSet

Various forms of HashMap and HashSet are widely used in the compiler. Removing their HashStable implementation means that they cannot be used in query keys and query results anymore. Luckily, there are a couple of good alternatives:

  1. We already use FxIndexMap and FxIndexSet in many places. These are high-performance hashing-based collections with the additional guarantee of having a stable iteration order. Their HashStable implementation is valid and they can be used as a drop-in replacement of HashMap and HashSet in most circumstances.

  2. The MCP proposes to add two new collection types UnorderedMap and UnorderedSet to rustc_data_structures that provide the same interface as other map and set collection types, but that do a better job of hiding iteration order. These types can be a good choice in cases where a collection does not have any ordering at the conceptual level. One advantage they have, is that they "erase" the iteration order and thus can safely be built from non-deterministic sources -- such as a regular FxHashMap or via multi-threaded code.

Interaction with potential_query_instability lint

MCP 465 introduced the potential_query_instability lint, which tries to solve much of the same problem as the changes proposed here. However, as discussed on Zulip, neither the lint, nor the changes here will catch all problematic cases. E.g. with UnorderedMap we can allow safe instances of collection iteration (like map.iter().any(predicate)) in a single place at the API-level, where with the lint each usage instance would have to be audited and #[allow()]ed individually. At the same time, the lint can catch cases where we cannot enforce a HashStable bound, like when using an FxHashMap locally inside a query implementation.

So this MCP does not propose to change anything about the lint (other than applying it more widely :))

Ord-based collections

In a way, Ord-based collections like BTreeMap and SortedMap are in a better position than HashMap because they have a well-defined iteration order. We just have to make sure that the keys being sorted by do not introduce instability. To this end, the MCP proposes to add a StableOrd trait:

/// Trait for marking a type as having a sort order that is
/// stable across compilation session boundaries. More formally:
///
/// Ord::cmp(a1, b1) == Ord:cmp(a2, b2)
///    where a2 = decode(encode(a1, context1), context2)
///          b2 = decode(encode(b1, context1), context2)
///
/// i.e. the result of `Ord::cmp` is not influenced by encoding
/// the values in one session and then decoding them in another
/// session.
/// 
/// This is trivially true for types where encoding and decoding
/// don't change the bytes of the values that are used during 
/// comparison (e.g. u32, String, Path, ...).
///
/// But it is not true for:
///  - `*const T` and `*mut T` because the values of these pointers
///    will change between sessions.
///  - `DefIndex`, `CrateNum`, `LocalDefId`, because their concrete
///    values depend on state that might be different between 
///    compilation sessions.
trait StableOrd : Ord {}

With this trait available, we can implement HashStable only for collection instances where the key has such a stable sort order.

The MCP proposes to implement the trait sparingly, since there is no good, generic way to writing regression tests that make sure a given type has a stable sort order (if you know of one, tell us!).

Mentors or Reviewers

Someone from @rust-lang/wg-incr-comp?

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

@michaelwoerister michaelwoerister added T-compiler Add this label so rfcbot knows to poll the compiler team major-change A proposal to make a major change to rustc labels Jul 21, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jul 21, 2022

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/compiler @rust-lang/compiler-contributors

@rustbot rustbot added the to-announce Announce this issue on triage meeting label Jul 21, 2022
@eddyb
Copy link
Member

eddyb commented Jul 25, 2022

@rustbot second (accidentally reinvented parts of this design the other day)

@rustbot rustbot added the final-comment-period The FCP has started, most (if not all) team members are in agreement label Jul 25, 2022
@apiraino
Copy link
Contributor

apiraino commented Aug 4, 2022

@rustbot label -final-comment-period +major-change-accepted

@rustbot rustbot added major-change-accepted A major change proposal that was accepted and removed final-comment-period The FCP has started, most (if not all) team members are in agreement labels Aug 4, 2022
@apiraino apiraino closed this as completed Aug 4, 2022
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Aug 25, 2022
michaelwoerister added a commit to michaelwoerister/rust that referenced this issue Oct 27, 2022
MCP 533: rust-lang/compiler-team#533

Also, as an example, substitute UnordMap for FxHashMap in
used_trait_imports query result.
bors added a commit to rust-lang-ci/rust that referenced this issue Oct 29, 2022
…r=lncr

Introduce UnordMap, UnordSet, and UnordBag (MCP 533)

This is the start of implementing [MCP 533](rust-lang/compiler-team#533).

I followed `@eddyb's` suggestion of naming the collection types `Unord(Map/Set/Bag)` which is a bit easier to type than `Unordered(Map/Set/Bag)`

r? `@eddyb`
RalfJung pushed a commit to RalfJung/miri that referenced this issue Oct 30, 2022
Introduce UnordMap, UnordSet, and UnordBag (MCP 533)

This is the start of implementing [MCP 533](rust-lang/compiler-team#533).

I followed `@eddyb's` suggestion of naming the collection types `Unord(Map/Set/Bag)` which is a bit easier to type than `Unordered(Map/Set/Bag)`

r? `@eddyb`
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 6, 2022
…t, r=nagisa

Add StableOrd trait as proposed in MCP 533.

The `StableOrd` trait can be used to mark types as having a stable sort order across compilation sessions. Collections that sort their items in a stable way can safely implement HashStable by hashing items in sort order.

See rust-lang/compiler-team#533 for more information.
RalfJung pushed a commit to RalfJung/miri that referenced this issue Dec 9, 2022
Add StableOrd trait as proposed in MCP 533.

The `StableOrd` trait can be used to mark types as having a stable sort order across compilation sessions. Collections that sort their items in a stable way can safely implement HashStable by hashing items in sort order.

See rust-lang/compiler-team#533 for more information.
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 21, 2023
…s, r=oli-obk

Use UnordMap and UnordSet for id collections (DefIdMap, LocalDefIdMap, etc)

This PR changes the `rustc_data_structures::define_id_collections!` macro to use `UnordMap` and `UnordSet` instead of `FxHashMap` and `FxHashSet`. This should account for a large portion of hash-maps being used in places where they can cause trouble.

The changes required are moderate but non-zero:
- In some places the collections are extracted into sorted vecs.
- There are a few instances where for-loops have been changed to extends.

~~Let's see what the performance impact is. With a bit more refactoring, we might be able to get rid of some of the additional sorting -- but the change set is already big enough. Unless there's a performance impact, I'd like to do further changes in subsequent PRs.~~

Performance does not seem to be negatively affected ([perf-run here](rust-lang#106977 (comment))).

Part of [MCP 533](rust-lang/compiler-team#533).

r? `@ghost`
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue Jan 27, 2023
Use UnordMap and UnordSet for id collections (DefIdMap, LocalDefIdMap, etc)

This PR changes the `rustc_data_structures::define_id_collections!` macro to use `UnordMap` and `UnordSet` instead of `FxHashMap` and `FxHashSet`. This should account for a large portion of hash-maps being used in places where they can cause trouble.

The changes required are moderate but non-zero:
- In some places the collections are extracted into sorted vecs.
- There are a few instances where for-loops have been changed to extends.

~~Let's see what the performance impact is. With a bit more refactoring, we might be able to get rid of some of the additional sorting -- but the change set is already big enough. Unless there's a performance impact, I'd like to do further changes in subsequent PRs.~~

Performance does not seem to be negatively affected ([perf-run here](rust-lang/rust#106977 (comment))).

Part of [MCP 533](rust-lang/compiler-team#533).

r? `@ghost`
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 21, 2023
Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives

This PR replaces almost all of the remaining `FxHashMap`s in query results with either `FxIndexMap` or `UnordMap`. The only case that is missing is the `EffectiveVisibilities` struct which turned out to not be straightforward to transform. Once that is done too, we can remove the `HashStable` implementation from `HashMap`.

The first commit adds the `StableCompare` trait which is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableCompare` implementation can be provided to offer a lightweight way for stable sorting. The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.

The rest of the commits are rather mechanical and don't overlap, so they are best reviewed individually.

Part of [MCP 533](rust-lang/compiler-team#533).
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 22, 2023
Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives

This PR replaces almost all of the remaining `FxHashMap`s in query results with either `FxIndexMap` or `UnordMap`. The only case that is missing is the `EffectiveVisibilities` struct which turned out to not be straightforward to transform. Once that is done too, we can remove the `HashStable` implementation from `HashMap`.

The first commit adds the `StableCompare` trait which is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableCompare` implementation can be provided to offer a lightweight way for stable sorting. The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.

The rest of the commits are rather mechanical and don't overlap, so they are best reviewed individually.

Part of [MCP 533](rust-lang/compiler-team#533).
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 22, 2023
Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives

This PR replaces almost all of the remaining `FxHashMap`s in query results with either `FxIndexMap` or `UnordMap`. The only case that is missing is the `EffectiveVisibilities` struct which turned out to not be straightforward to transform. Once that is done too, we can remove the `HashStable` implementation from `HashMap`.

The first commit adds the `StableCompare` trait which is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableCompare` implementation can be provided to offer a lightweight way for stable sorting. The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.

The rest of the commits are rather mechanical and don't overlap, so they are best reviewed individually.

Part of [MCP 533](rust-lang/compiler-team#533).
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 5, 2024
…llot

Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives

This PR replaces almost all of the remaining `FxHashMap`s in query results with either `FxIndexMap` or `UnordMap`. The only case that is missing is the `EffectiveVisibilities` struct which turned out to not be straightforward to transform. Once that is done too, we can remove the `HashStable` implementation from `HashMap`.

The first commit adds the `StableCompare` trait which is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableCompare` implementation can be provided to offer a lightweight way for stable sorting. The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.

The rest of the commits are rather mechanical and don't overlap, so they are best reviewed individually.

Part of [MCP 533](rust-lang/compiler-team#533).
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Jan 6, 2024
Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives

This PR replaces almost all of the remaining `FxHashMap`s in query results with either `FxIndexMap` or `UnordMap`. The only case that is missing is the `EffectiveVisibilities` struct which turned out to not be straightforward to transform. Once that is done too, we can remove the `HashStable` implementation from `HashMap`.

The first commit adds the `StableCompare` trait which is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableCompare` implementation can be provided to offer a lightweight way for stable sorting. The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.

The rest of the commits are rather mechanical and don't overlap, so they are best reviewed individually.

Part of [MCP 533](rust-lang/compiler-team#533).
michaelwoerister added a commit to michaelwoerister/rust that referenced this issue Mar 1, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 1, 2024
…is, r=<try>

Use FxIndexMap instead FxHashMap to stabilize iteration order in EffectiveVisibilities

Part of [MCP 533](rust-lang/compiler-team#533).
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 31, 2024
…is, r=cjgillot

Use FxIndexMap instead FxHashMap to stabilize iteration order in EffectiveVisibilities

Part of [MCP 533](rust-lang/compiler-team#533).
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 31, 2024
…is, r=cjgillot

Use FxIndexMap instead FxHashMap to stabilize iteration order in EffectiveVisibilities

Part of [MCP 533](rust-lang/compiler-team#533).
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Apr 3, 2024
…illot

Use FxIndexMap instead FxHashMap to stabilize iteration order in EffectiveVisibilities

Part of [MCP 533](rust-lang/compiler-team#533).
Oneirical pushed a commit to Oneirical/rust that referenced this issue Apr 3, 2024
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Apr 7, 2024
Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives

This PR replaces almost all of the remaining `FxHashMap`s in query results with either `FxIndexMap` or `UnordMap`. The only case that is missing is the `EffectiveVisibilities` struct which turned out to not be straightforward to transform. Once that is done too, we can remove the `HashStable` implementation from `HashMap`.

The first commit adds the `StableCompare` trait which is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableCompare` implementation can be provided to offer a lightweight way for stable sorting. The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.

The rest of the commits are rather mechanical and don't overlap, so they are best reviewed individually.

Part of [MCP 533](rust-lang/compiler-team#533).
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Apr 7, 2024
…illot

Use FxIndexMap instead FxHashMap to stabilize iteration order in EffectiveVisibilities

Part of [MCP 533](rust-lang/compiler-team#533).
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 20, 2024
Introduce UnordMap, UnordSet, and UnordBag (MCP 533)

This is the start of implementing [MCP 533](rust-lang/compiler-team#533).

I followed `@eddyb's` suggestion of naming the collection types `Unord(Map/Set/Bag)` which is a bit easier to type than `Unordered(Map/Set/Bag)`

r? `@eddyb`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
Introduce UnordMap, UnordSet, and UnordBag (MCP 533)

This is the start of implementing [MCP 533](rust-lang/compiler-team#533).

I followed `@eddyb's` suggestion of naming the collection types `Unord(Map/Set/Bag)` which is a bit easier to type than `Unordered(Map/Set/Bag)`

r? `@eddyb`
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives

This PR replaces almost all of the remaining `FxHashMap`s in query results with either `FxIndexMap` or `UnordMap`. The only case that is missing is the `EffectiveVisibilities` struct which turned out to not be straightforward to transform. Once that is done too, we can remove the `HashStable` implementation from `HashMap`.

The first commit adds the `StableCompare` trait which is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableCompare` implementation can be provided to offer a lightweight way for stable sorting. The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.

The rest of the commits are rather mechanical and don't overlap, so they are best reviewed individually.

Part of [MCP 533](rust-lang/compiler-team#533).
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
…illot

Use FxIndexMap instead FxHashMap to stabilize iteration order in EffectiveVisibilities

Part of [MCP 533](rust-lang/compiler-team#533).
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 3, 2024
… r=<try>

Stabilize order of MonoItems in CGUs and disallow query_instability lint for rustc_monomorphize

The HashStable impl for `CodegenUnit` was incorrect as described in [MCP 533](rust-lang/compiler-team#533). This PR removes any indeterminism from the way codegen units are built. The changes are pretty straightforward.

Part of rust-lang#84447 and [MCP 533](rust-lang/compiler-team#533).
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 7, 2024
… r=oli-obk

Stabilize order of MonoItems in CGUs and disallow query_instability lint for rustc_monomorphize

The HashStable impl for `CodegenUnit` was incorrect as described in [MCP 533](rust-lang/compiler-team#533). This PR removes any indeterminism from the way codegen units are built. The changes are pretty straightforward.

Part of rust-lang#84447 and [MCP 533](rust-lang/compiler-team#533).
RalfJung pushed a commit to RalfJung/miri that referenced this issue Jun 8, 2024
Stabilize order of MonoItems in CGUs and disallow query_instability lint for rustc_monomorphize

The HashStable impl for `CodegenUnit` was incorrect as described in [MCP 533](rust-lang/compiler-team#533). This PR removes any indeterminism from the way codegen units are built. The changes are pretty straightforward.

Part of rust-lang/rust#84447 and [MCP 533](rust-lang/compiler-team#533).
compiler-errors added a commit to compiler-errors/rust that referenced this issue Jun 25, 2024
…elwoerister

Un-unsafe the `StableOrd` trait

Whilst incorrect implementations of this trait can cause miscompilation, they cannot cause memory unsafety in rustc.

[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Policy.20of.20.60unsafe.60.20within.20the.20compiler).

cc [MCP 533](rust-lang/compiler-team#533), rust-lang#105175, `@michaelwoerister`

r? `@Nilstrieb`
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 25, 2024
…woerister

Un-unsafe the `StableOrd` trait

Whilst incorrect implementations of this trait can cause miscompilation, they cannot cause memory unsafety in rustc.

[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Policy.20of.20.60unsafe.60.20within.20the.20compiler).

cc [MCP 533](rust-lang/compiler-team#533), rust-lang#105175, `@michaelwoerister`

r? `@Nilstrieb`
tiif pushed a commit to tiif/miri that referenced this issue Jun 25, 2024
Un-unsafe the `StableOrd` trait

Whilst incorrect implementations of this trait can cause miscompilation, they cannot cause memory unsafety in rustc.

[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Policy.20of.20.60unsafe.60.20within.20the.20compiler).

cc [MCP 533](rust-lang/compiler-team#533), #105175, `@michaelwoerister`

r? `@Nilstrieb`
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue Jun 28, 2024
Stabilize order of MonoItems in CGUs and disallow query_instability lint for rustc_monomorphize

The HashStable impl for `CodegenUnit` was incorrect as described in [MCP 533](rust-lang/compiler-team#533). This PR removes any indeterminism from the way codegen units are built. The changes are pretty straightforward.

Part of rust-lang/rust#84447 and [MCP 533](rust-lang/compiler-team#533).
flip1995 pushed a commit to flip1995/rust-clippy that referenced this issue Jun 28, 2024
Un-unsafe the `StableOrd` trait

Whilst incorrect implementations of this trait can cause miscompilation, they cannot cause memory unsafety in rustc.

[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Policy.20of.20.60unsafe.60.20within.20the.20compiler).

cc [MCP 533](rust-lang/compiler-team#533), #105175, `@michaelwoerister`

r? `@Nilstrieb`
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Jul 11, 2024
Un-unsafe the `StableOrd` trait

Whilst incorrect implementations of this trait can cause miscompilation, they cannot cause memory unsafety in rustc.

[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Policy.20of.20.60unsafe.60.20within.20the.20compiler).

cc [MCP 533](rust-lang/compiler-team#533), #105175, `@michaelwoerister`

r? `@Nilstrieb`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major-change A proposal to make a major change to rustc major-change-accepted A major change proposal that was accepted T-compiler Add this label so rfcbot knows to poll the compiler team
Projects
None yet
Development

No branches or pull requests

4 participants