Skip to content

Commit f3328be

Browse files
authored
Merge pull request #4530 from JoJoDeveloping/tb-doc-ugc-link
link to TB doc in unsafe-code-guidelines
2 parents 12e9735 + f47cda8 commit f3328be

File tree

54 files changed

+55
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+55
-1
lines changed

src/diagnostics.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ pub fn report_error<'tcx>(
282282
},
283283
TreeBorrowsUb { title: _, details, history } => {
284284
let mut helps = vec![
285-
note!("this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental")
285+
note!("this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental"),
286+
note!("see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information"),
286287
];
287288
for m in details {
288289
helps.push(note!("{m}"));

tests/fail/async-shared-mutable.tree.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | *x = 1;
55
| ^^^^^^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
8+
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
89
= help: the accessed tag <TAG> has state Frozen which forbids this child write access
910
help: the accessed tag <TAG> was created here, in the initial state Reserved
1011
--> tests/fail/async-shared-mutable.rs:LL:CC

tests/fail/both_borrows/alias_through_mutation.tree.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | let _val = *target_alias;
55
| ^^^^^^^^^^^^^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
8+
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
89
= help: the accessed tag <TAG> has state Disabled which forbids this child read access
910
help: the accessed tag <TAG> was created here, in the initial state Frozen
1011
--> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC

tests/fail/both_borrows/aliasing_mut1.tree.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | *x = 1;
55
| ^^^^^^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
8+
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
89
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
910
help: the accessed tag <TAG> was created here, in the initial state Reserved
1011
--> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC

tests/fail/both_borrows/aliasing_mut2.tree.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | *y = 2;
55
| ^^^^^^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
8+
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
89
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
910
help: the accessed tag <TAG> was created here, in the initial state Reserved
1011
--> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC

tests/fail/both_borrows/aliasing_mut3.tree.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | *x = 1;
55
| ^^^^^^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
8+
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
89
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
910
help: the accessed tag <TAG> was created here, in the initial state Reserved
1011
--> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC

tests/fail/both_borrows/aliasing_mut4.tree.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | crate::intrinsics::write_via_move(dest, src);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
8+
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
89
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
910
= help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
1011
= help: protected tags must never be Disabled

tests/fail/both_borrows/box_exclusive_violation1.tree.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | *LEAK = 7;
55
| ^^^^^^^^^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
8+
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
89
= help: the accessed tag <TAG> has state Disabled which forbids this child write access
910
help: the accessed tag <TAG> was created here, in the initial state Frozen
1011
--> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC

tests/fail/both_borrows/box_noalias_violation.tree.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | *y
55
| ^^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
8+
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
89
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)
910
= help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
1011
= help: protected tags must never be Disabled

tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | v2[1] = 7;
55
| ^^^^^^^^^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
8+
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/tree-borrows.md for further information
89
= help: the accessed tag <TAG> has state Disabled which forbids this child write access
910
help: the accessed tag <TAG> was created here, in the initial state Reserved
1011
--> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC

0 commit comments

Comments
 (0)