Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove #![feature(try_trait)] from a test #1142

Merged
merged 1 commit into from
Apr 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions crates/stdarch-verify/tests/mips.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Verification of MIPS MSA intrinsics
#![feature(try_trait)]
#![allow(bad_style, unused)]

// This file is obtained from
Expand Down Expand Up @@ -139,11 +138,16 @@ struct MsaIntrinsic {
instruction: String,
}

struct NoneError;

impl std::convert::TryFrom<&'static str> for MsaIntrinsic {
// The intrinsics are just C function declarations of the form:
// $ret_ty __builtin_${fn_id}($($arg_ty),*);
type Error = std::option::NoneError;
type Error = NoneError;
fn try_from(line: &'static str) -> Result<Self, Self::Error> {
return inner(line).ok_or(NoneError);

fn inner(line: &'static str) -> Option<MsaIntrinsic> {
let first_whitespace = line.find(char::is_whitespace)?;
let ret_ty = &line[0..first_whitespace];
let ret_ty = MsaTy::from(ret_ty);
Expand Down Expand Up @@ -174,14 +178,15 @@ impl std::convert::TryFrom<&'static str> for MsaIntrinsic {
instruction += &postfix;
}

Ok(MsaIntrinsic {
Some(MsaIntrinsic {
id,
ret_ty,
arg_tys,
instruction,
})
}
}
}

#[test]
fn verify_all_signatures() {
Expand Down