-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new test marking boundary/match issue.
- Loading branch information
1 parent
c53852a
commit 2eb69ac
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
fn refit() { | ||
let opt: Option<String> = | ||
Some(String::from("Hello world")); | ||
|
||
match opt { | ||
Some(_) => (), | ||
None => (), | ||
}; | ||
|
||
drop(opt); | ||
} | ||
|
||
fn moveit() { | ||
let opt: Option<String> = | ||
Some(String::from("Hello world")); | ||
|
||
match &opt { | ||
// NOTE: this is an error, but Aquascope does not place | ||
// RWO boundaries on patterns. This test serves to mark this | ||
// inconsistency and it should be updated in the future | ||
// (should that feature get implemented). | ||
Some(mut s) => { | ||
println!("{s}"); | ||
}, | ||
None => (), | ||
}; | ||
} |
22 changes: 22 additions & 0 deletions
22
crates/aquascope/tests/snapshots/boundaries__moveit@match_1.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
source: crates/aquascope/tests/boundaries.rs | ||
description: moveit@match_1.test | ||
--- | ||
- location: | ||
line: 16 | ||
column: 9 | ||
expected: | ||
read: true | ||
write: false | ||
drop: false | ||
actual: | ||
type_droppable: true | ||
type_writeable: false | ||
type_copyable: false | ||
is_live: true | ||
path_uninitialized: false | ||
permissions: | ||
read: true | ||
write: false | ||
drop: true | ||
|
39 changes: 39 additions & 0 deletions
39
crates/aquascope/tests/snapshots/boundaries__refit@match_1.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
source: crates/aquascope/tests/boundaries.rs | ||
description: refit@match_1.test | ||
--- | ||
- location: | ||
line: 4 | ||
column: 11 | ||
expected: | ||
read: true | ||
write: false | ||
drop: false | ||
actual: | ||
type_droppable: true | ||
type_writeable: false | ||
type_copyable: false | ||
is_live: true | ||
path_uninitialized: false | ||
permissions: | ||
read: true | ||
write: false | ||
drop: true | ||
- location: | ||
line: 9 | ||
column: 7 | ||
expected: | ||
read: true | ||
write: false | ||
drop: true | ||
actual: | ||
type_droppable: true | ||
type_writeable: false | ||
type_copyable: false | ||
is_live: true | ||
path_uninitialized: false | ||
permissions: | ||
read: true | ||
write: false | ||
drop: true | ||
|