Skip to content

Commit

Permalink
Update compiler/rustc_middle/src/ty/consts/valtree.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Ralf Jung <post@ralfj.de>
  • Loading branch information
oli-obk and RalfJung committed Mar 16, 2021
1 parent f0997fa commit 5b9bd90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_middle/src/ty/consts/valtree.rs
Expand Up @@ -6,7 +6,8 @@ use rustc_macros::HashStable;
/// This datastructure is used to represent the value of constants used in the type system.
///
/// We explicitly choose a different datastructure from the way values are processed within
/// CTFE, as in the type system equal values must also have equal representation.
/// CTFE, as in the type system equal values (according to their `PartialEq`) must also have
/// equal representation (`==` on the rustc data structure, e.g. `ValTree`) and vice versa.
/// Since CTFE uses `AllocId` to represent pointers, it often happens that two different
/// `AllocId`s point to equal values. So we may end up with different representations for
/// two constants whose value is `&42`. Furthermore any kind of struct that has padding will
Expand Down

0 comments on commit 5b9bd90

Please sign in to comment.