-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update toolchain to nightly-2022-07-19 (#1399)
* Update toolchain to nightly-2022-07-19 This update required the following changes: - Add support to ProjectionElem::OpaqueCast - Add support to Rvalue::CopyForDeref - Add support to ConstValue::ZST - Rename debugging_opts to unstable_opts - Change to mem::uninit/zeroed validity checks - Change vecdeque harness due to std capacity check Co-authored-by: Adrian Palacios <[email protected]>
- Loading branch information
1 parent
5c590a4
commit b154ec9
Showing
11 changed files
with
106 additions
and
17 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
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
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
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 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Modifications Copyright Kani Contributors | ||
// See GitHub history for details. | ||
|
||
/// Adapted from: | ||
/// <https://github.com/rust-lang/rust/blob/29c5a028b0c92aa5da6a8eb6d6585a389fcf1035/src/test/mir-opt/derefer_test.rs> | ||
#[kani::proof] | ||
fn check_deref_copy() { | ||
let mut a = (42, 43); | ||
let mut b = (99, &mut a); | ||
let x = &mut (*b.1).0; | ||
let y = &mut (*b.1).1; | ||
assert_eq!(*x, 42); | ||
assert_eq!(*y, 43); | ||
} |
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,50 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Modifications Copyright Kani Contributors | ||
// See GitHub history for details. | ||
|
||
//! Tests that check handling of opaque casts. Tests were adapted from the rustc repository. | ||
#![feature(type_alias_impl_trait)] | ||
|
||
#[derive(Copy, Clone)] | ||
struct Foo((u32, u32)); | ||
|
||
/// Adapted from: | ||
/// <https://github.com/rust-lang/rust/blob/29c5a028b0c92aa5da6a8eb6d6585a389fcf1035/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-upvar.rs> | ||
#[kani::proof] | ||
fn check_unconstrained_upvar() { | ||
type T = impl Copy; | ||
let foo: T = Foo((1u32, 2u32)); | ||
let x = move || { | ||
let Foo((a, b)) = foo; | ||
assert_eq!(a, 1u32); | ||
assert_eq!(b, 2u32); | ||
}; | ||
} | ||
|
||
/// Adapted from: | ||
/// <https://github.com/rust-lang/rust/blob/29c5a028b0c92aa5da6a8eb6d6585a389fcf1035/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-struct.rs> | ||
#[kani::proof] | ||
fn check_unconstrained_struct() { | ||
type U = impl Copy; | ||
let foo: U = Foo((1u32, 2u32)); | ||
let Foo((a, b)) = foo; | ||
assert_eq!(a, 1u32); | ||
assert_eq!(b, 2u32); | ||
} | ||
|
||
/// Adapted from: | ||
/// <https://github.com/rust-lang/rust/issues/96572#issuecomment-1125117692> | ||
#[kani::proof] | ||
fn check_unpack_option_tuple() { | ||
type T = impl Copy; | ||
let foo: T = Some((1u32, 2u32)); | ||
match foo { | ||
None => (), | ||
Some((a, b)) => { | ||
assert_eq!(a, 1u32); | ||
assert_eq!(b, 2u32) | ||
} | ||
} | ||
} |