Skip to content

Commit b49aba8

Browse files
committed
Prevent rustdoc from finding links.
1 parent 85fe5a0 commit b49aba8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compiler/rustc_borrowck/src/places_conflict.rs

+10
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,43 @@
77
//! have the same type, and that they only overlap if they are the identical.
88
//!
99
//! For example, if we are comparing these:
10+
//! ```text
1011
//! BORROW: (*x1[2].y).z.a
1112
//! ACCESS: (*x1[i].y).w.b
13+
//! ```
1214
//!
1315
//! Then our steps are:
16+
//! ```text
1417
//! x1 | x1 -- places are the same
1518
//! x1[2] | x1[i] -- equal or disjoint (disjoint if indexes differ)
1619
//! x1[2].y | x1[i].y -- equal or disjoint
1720
//! *x1[2].y | *x1[i].y -- equal or disjoint
1821
//! (*x1[2].y).z | (*x1[i].y).w -- we are disjoint and don't need to check more!
22+
//! ```
1923
//!
2024
//! Because `zip` does potentially bad things to the iterator inside, this loop
2125
//! also handles the case where the access might be a *prefix* of the borrow, e.g.
2226
//!
27+
//! ```text
2328
//! BORROW: (*x1[2].y).z.a
2429
//! ACCESS: x1[i].y
30+
//! ```
2531
//!
2632
//! Then our steps are:
33+
//! ```text
2734
//! x1 | x1 -- places are the same
2835
//! x1[2] | x1[i] -- equal or disjoint (disjoint if indexes differ)
2936
//! x1[2].y | x1[i].y -- equal or disjoint
37+
//! ```
3038
//!
3139
//! -- here we run out of access - the borrow can access a part of it. If this
3240
//! is a full deep access, then we *know* the borrow conflicts with it. However,
3341
//! if the access is shallow, then we can proceed:
3442
//!
43+
//! ```text
3544
//! x1[2].y | (*x1[i].y) -- a deref! the access can't get past this, so we
3645
//! are disjoint
46+
//! ```
3747
//!
3848
//! Our invariant is, that at each step of the iteration:
3949
//! - If we didn't run out of access to match, our borrow and access are comparable

0 commit comments

Comments
 (0)