Skip to content

Commit 7f0e70d

Browse files
authored
Merge pull request #4623 from RalfJung/nopub
remove a bunch of unnecessary 'pub' from tests
2 parents 85aa6cd + 5b20b4d commit 7f0e70d

File tree

113 files changed

+156
-161
lines changed

Some content is hidden

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

113 files changed

+156
-161
lines changed

tests/fail/both_borrows/aliasing_mut1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@[tree]compile-flags: -Zmiri-tree-borrows
33
use std::mem;
44

5-
pub fn safe(x: &mut i32, y: &mut i32) {
5+
fn safe(x: &mut i32, y: &mut i32) {
66
//~[stack]^ ERROR: protect
77
*x = 1; //~[tree] ERROR: /write access through .* is forbidden/
88
*y = 2;

tests/fail/both_borrows/aliasing_mut1.stack.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
22
--> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
33
|
4-
LL | pub fn safe(x: &mut i32, y: &mut i32) {
5-
| ^ Undefined Behavior occurred here
4+
LL | fn safe(x: &mut i32, y: &mut i32) {
5+
| ^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
88
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
@@ -14,8 +14,8 @@ LL | let xraw: *mut i32 = unsafe { mem::transmute(&mut x) };
1414
help: <TAG> is this argument
1515
--> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
1616
|
17-
LL | pub fn safe(x: &mut i32, y: &mut i32) {
18-
| ^
17+
LL | fn safe(x: &mut i32, y: &mut i32) {
18+
| ^
1919
= note: BACKTRACE (of the first span):
2020
= note: inside `safe` at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
2121
note: inside `main`

tests/fail/both_borrows/aliasing_mut1.tree.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ LL | *x = 1;
1010
help: the accessed tag <TAG> was created here, in the initial state Reserved
1111
--> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
1212
|
13-
LL | pub fn safe(x: &mut i32, y: &mut i32) {
14-
| ^
13+
LL | fn safe(x: &mut i32, y: &mut i32) {
14+
| ^
1515
help: the accessed tag <TAG> later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4]
1616
--> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
1717
|
18-
LL | pub fn safe(x: &mut i32, y: &mut i32) {
19-
| ^
18+
LL | fn safe(x: &mut i32, y: &mut i32) {
19+
| ^
2020
= help: this transition corresponds to a temporary loss of write permissions until function exit
2121
= note: BACKTRACE (of the first span):
2222
= note: inside `safe` at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC

tests/fail/both_borrows/aliasing_mut2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@[tree]compile-flags: -Zmiri-tree-borrows
33
use std::mem;
44

5-
pub fn safe(x: &i32, y: &mut i32) {
5+
fn safe(x: &i32, y: &mut i32) {
66
//~[stack]^ ERROR: protect
77
let _v = *x;
88
*y = 2; //~[tree] ERROR: /write access through .* is forbidden/

tests/fail/both_borrows/aliasing_mut2.stack.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: not granting access to tag <TAG> because that would remove [SharedReadOnly for <TAG>] which is strongly protected
22
--> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
33
|
4-
LL | pub fn safe(x: &i32, y: &mut i32) {
5-
| ^ Undefined Behavior occurred here
4+
LL | fn safe(x: &i32, y: &mut i32) {
5+
| ^ Undefined Behavior occurred here
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
88
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
@@ -14,8 +14,8 @@ LL | let xref = &mut x;
1414
help: <TAG> is this argument
1515
--> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
1616
|
17-
LL | pub fn safe(x: &i32, y: &mut i32) {
18-
| ^
17+
LL | fn safe(x: &i32, y: &mut i32) {
18+
| ^
1919
= note: BACKTRACE (of the first span):
2020
= note: inside `safe` at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
2121
note: inside `main`

tests/fail/both_borrows/aliasing_mut2.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ LL | *y = 2;
1010
help: the accessed tag <TAG> was created here, in the initial state Reserved
1111
--> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
1212
|
13-
LL | pub fn safe(x: &i32, y: &mut i32) {
14-
| ^
13+
LL | fn safe(x: &i32, y: &mut i32) {
14+
| ^
1515
help: the accessed tag <TAG> later transitioned to Reserved (conflicted) due to a foreign read access at offsets [0x0..0x4]
1616
--> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
1717
|

tests/fail/both_borrows/aliasing_mut3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@[tree]compile-flags: -Zmiri-tree-borrows
33
use std::mem;
44

5-
pub fn safe(x: &mut i32, y: &i32) {
5+
fn safe(x: &mut i32, y: &i32) {
66
//~[stack]^ ERROR: borrow stack
77
*x = 1; //~[tree] ERROR: /write access through .* is forbidden/
88
let _v = *y;

tests/fail/both_borrows/aliasing_mut3.stack.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
22
--> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
33
|
4-
LL | pub fn safe(x: &mut i32, y: &i32) {
5-
| ^ this error occurs as part of function-entry retag at ALLOC[0x0..0x4]
4+
LL | fn safe(x: &mut i32, y: &i32) {
5+
| ^ this error occurs as part of function-entry retag at ALLOC[0x0..0x4]
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
88
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information

tests/fail/both_borrows/aliasing_mut3.tree.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ LL | *x = 1;
1010
help: the accessed tag <TAG> was created here, in the initial state Reserved
1111
--> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
1212
|
13-
LL | pub fn safe(x: &mut i32, y: &i32) {
14-
| ^
13+
LL | fn safe(x: &mut i32, y: &i32) {
14+
| ^
1515
help: the accessed tag <TAG> later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4]
1616
--> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
1717
|
18-
LL | pub fn safe(x: &mut i32, y: &i32) {
19-
| ^
18+
LL | fn safe(x: &mut i32, y: &i32) {
19+
| ^
2020
= help: this transition corresponds to a temporary loss of write permissions until function exit
2121
= note: BACKTRACE (of the first span):
2222
= note: inside `safe` at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC

tests/fail/both_borrows/aliasing_mut4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::cell::Cell;
55
use std::mem;
66

77
// Make sure &mut UnsafeCell also is exclusive
8-
pub fn safe(x: &i32, y: &mut Cell<i32>) {
8+
fn safe(x: &i32, y: &mut Cell<i32>) {
99
//~[stack]^ ERROR: protect
1010
y.set(1);
1111
let _load = *x;

0 commit comments

Comments
 (0)