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.
Fix panic due to wrong intrinsic arguments (rust-lang#533) (rust-lang…
…#610) During codegen of function calls, we were ignoring argument of Unit type. This was causing a failure due to missing arguments when an intrinsic or closure was being called with an '()' as an argument. This change modifies how we deal with Unit types during function definition and function call.
- Loading branch information
Showing
3 changed files
with
14 additions
and
12 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
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
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,9 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// cbmc-flags: --unwind 3 | ||
|
||
pub fn main() { | ||
let arr = [(1, 2), (2, 2)]; | ||
let result = arr.iter().try_fold((), |acc, &i| Some(())); | ||
assert_ne!(result, None, "This should succeed"); | ||
} |