Skip to content

Commit 4968dfa

Browse files
committed
Add reference links for non-deduplication and non-overlapping of non-zero-sized statics
1 parent 2204d61 commit 4968dfa

File tree

1 file changed

+6
-2
lines changed
  • compiler/rustc_const_eval/src/const_eval

1 file changed

+6
-2
lines changed

compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,12 @@ impl<'tcx> CompileTimeInterpCx<'tcx> {
388388
} else {
389389
// The pointers are within (or one past the end of) different
390390
// non-zero-sized static allocations, and they are not at oppotiste
391-
// ends, so we know they are not equal because statics cannot
392-
// overlap or be deduplicated.
391+
// ends, so we know they are not equal because non-zero-sized statics
392+
// cannot overlap or be deduplicated, as per
393+
// https://doc.rust-lang.org/nightly/reference/items/static-items.html#r-items.static.intro
394+
// (non-deduplication), and
395+
// https://doc.rust-lang.org/nightly/reference/items/static-items.html#r-items.static.storage-disjointness
396+
// (non-overlapping)
393397
0
394398
}
395399
} else {

0 commit comments

Comments
 (0)