forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI fix : Fix missing function check descriptions (rust-lang#1126)
* Fix missing function check descriptions Co-authored-by: Zyad Hassan <[email protected]> Co-authored-by: Zyad Hassan <[email protected]>
- Loading branch information
1 parent
a3a47e9
commit 7cc6568
Showing
7 changed files
with
67 additions
and
11 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
3 changes: 1 addition & 2 deletions
3
tests/ui/missing-function/expected → tests/ui/missing-function/extern_c/expected
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
Status: UNREACHABLE\ | ||
Status: UNDETERMINED\ | ||
Description: "assertion failed: x == 5" | ||
|
||
VERIFICATION:- FAILED | ||
|
File renamed without changes.
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,3 @@ | ||
.assertion.1\ | ||
Status: FAILURE\ | ||
Description: "Function with missing definition is unreachable" |
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,11 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
// This test is to check if the description for undefined functions has been updated to "Function with missing definition is unreachable" | ||
|
||
#[kani::proof] | ||
fn main() { | ||
let x = String::from("foo"); | ||
let y = x.clone(); | ||
assert_eq!("foo", y); | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/ui/missing-function/rust-by-example-description/expected
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,3 @@ | ||
.assertion.1\ | ||
Status: FAILURE\ | ||
Description: "Function with missing definition is unreachable" |
16 changes: 16 additions & 0 deletions
16
tests/ui/missing-function/rust-by-example-description/main.rs
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,16 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
|
||
// kani-flags: --enable-unstable --cbmc-args --unwind 4 --object-bits 9 | ||
// This test is to check if the description for undefined functions has been updated to "Function with missing definition is unreachable" | ||
|
||
#![allow(unused)] | ||
#[kani::proof] | ||
pub fn main() { | ||
let strings = vec!["tofu", "93", "18"]; | ||
let numbers: Vec<_> = strings | ||
.into_iter() | ||
.filter_map(|s| s.parse::<i32>().ok()) | ||
.collect(); | ||
println!("Results: {:?}", numbers); | ||
} |