Skip to content

Commit

Permalink
Upgrade Rust toolchin to 2023-08-07
Browse files Browse the repository at this point in the history
  • Loading branch information
zhassan-aws committed Aug 15, 2023
1 parent f9e2cef commit e51b652
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 37 deletions.
1 change: 1 addition & 0 deletions library/kani/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// This is required for the optimized version of `any_array()`
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
#![allow(internal_features)]

pub mod arbitrary;
#[cfg(feature = "concrete_playback")]
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# SPDX-License-Identifier: Apache-2.0 OR MIT

[toolchain]
channel = "nightly-2023-08-04"
channel = "nightly-2023-08-07"
components = ["llvm-tools-preview", "rustc-dev", "rust-src", "rustfmt"]
1 change: 1 addition & 0 deletions tests/cargo-kani/vecdeque-cve/src/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#![feature(core_intrinsics)]
#![feature(ptr_internals)]
#![feature(rustc_allow_const_fn_unstable)]
#![allow(internal_features)]

#[cfg(disable_debug_asserts)]
macro_rules! debug_assert {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ pub struct i64x2(i64, i64);
pub struct i64x4(i64, i64, i64, i64);

extern "platform-intrinsic" {
fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
}

#[kani::proof]
fn main() {
let y = i64x2(0, 1);
let z = i64x2(1, 2);
const I: [u32; 4] = [1, 2, 1, 2];
let x: i64x2 = unsafe { simd_shuffle4(y, z, I) };
let x: i64x2 = unsafe { simd_shuffle(y, z, I) };
// ^^^^ The code above fails to type-check in Rust with the error:
// ```
// error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected return type of length 4, found `i64x2` with length 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ pub struct i64x2(i64, i64);
pub struct f64x2(f64, f64);

extern "platform-intrinsic" {
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
fn simd_shuffle<T, I, U>(x: T, y: T, idx: I) -> U;
}

#[kani::proof]
fn main() {
let y = i64x2(0, 1);
let z = i64x2(1, 2);
const I: [u32; 2] = [1, 2];
let x: f64x2 = unsafe { simd_shuffle2(y, z, I) };
let x: f64x2 = unsafe { simd_shuffle(y, z, I) };
// ^^^^ The code above fails to type-check in Rust with the error:
// ```
// error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected return element type `i64` (element of input `i64x2`), found `f64x2` with element type `f64`
Expand Down
6 changes: 2 additions & 4 deletions tests/kani/Intrinsics/SIMD/Shuffle/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ pub struct i64x4(i64, i64, i64, i64);

extern "platform-intrinsic" {
fn simd_shuffle<T, U, V>(x: T, y: T, idx: U) -> V;
fn simd_shuffle2<T, U>(x: T, y: T, idx: [u32; 2]) -> U;
fn simd_shuffle4<T, U>(x: T, y: T, idx: [u32; 4]) -> U;
}

#[kani::proof]
Expand All @@ -35,15 +33,15 @@ fn main() {
let y = i64x2(0, 1);
let z = i64x2(1, 2);
const I: [u32; 2] = [1, 2];
let x: i64x2 = unsafe { simd_shuffle2(y, z, I) };
let x: i64x2 = unsafe { simd_shuffle(y, z, I) };
assert!(x.0 == 1);
assert!(x.1 == 1);
}
{
let a = i64x4(1, 2, 3, 4);
let b = i64x4(5, 6, 7, 8);
const I: [u32; 4] = [1, 3, 5, 7];
let c: i64x4 = unsafe { simd_shuffle4(a, b, I) };
let c: i64x4 = unsafe { simd_shuffle(a, b, I) };
assert!(c == i64x4(2, 4, 6, 8));
}
}
33 changes: 5 additions & 28 deletions tools/bookrunner/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use rustc_ast as ast;
use rustc_data_structures::sync::Lrc;
use rustc_driver::DEFAULT_LOCALE_RESOURCES;
use rustc_errors::{ColorConfig, TerminalUrl};
use rustc_errors::ColorConfig;
use rustc_span::edition::Edition;
use rustc_span::source_map::SourceMap;
use rustc_span::symbol::sym;
Expand Down Expand Up @@ -81,33 +81,10 @@ pub fn make_test(

let fallback_bundle =
rustc_errors::fallback_fluent_bundle(DEFAULT_LOCALE_RESOURCES.to_vec(), false);
supports_color = EmitterWriter::stderr(
ColorConfig::Auto,
None,
None,
fallback_bundle.clone(),
false,
false,
Some(80),
false,
false,
TerminalUrl::No,
)
.supports_color();

let emitter = EmitterWriter::new(
Box::new(io::sink()),
None,
None,
fallback_bundle,
false,
false,
false,
None,
false,
false,
TerminalUrl::No,
);
supports_color =
EmitterWriter::stderr(ColorConfig::Auto, fallback_bundle.clone()).supports_color();

let emitter = EmitterWriter::new(Box::new(io::sink()), fallback_bundle);

// FIXME(misdreavus): pass `-Z treat-err-as-bug` to the doctest parser
let handler = Handler::with_emitter(Box::new(emitter));
Expand Down

0 comments on commit e51b652

Please sign in to comment.