Skip to content
Snippets Groups Projects
Unverified Commit 240b2165 authored by Lennard Gäher's avatar Lennard Gäher
Browse files

add tests crate

parent b47576d8
No related branches found
No related tags found
1 merge request!2Add support for module-level and crate-level attributes
Pipeline #93630 passed
[package]
name = "tests"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
#output_dir="./output"
run_check = false
#![rr::import("refinedrust.extra_proofs.tests.enums", "enums")]
enum Option<T> {
None,
Some(T)
}
impl<T> Option<T> {
pub fn none() -> Self {
Self::None
}
pub fn some(x : T) -> Self {
Self::Some(x)
}
}
//#[repr(usize)]
#[rr::refined_by("sizes")]
enum sizes {
#[rr::pattern("Sz1")]
#[rr::variant("()")]
Sz1,
#[rr::pattern("Sz2")]
#[rr::variant("()")]
Sz2,
}
impl sizes {
#[rr::returns("Sz1")]
pub fn new() -> Self {
Self::Sz1
}
}
#![feature(register_tool)]
#![register_tool(rr)]
#![feature(custom_inner_attributes)]
mod enums;
mod structs;
struct Pair<T, U> {
x: T,
y: U,
}
impl<T, U> Pair<T, U> {
#[rr::params(x, y)]
#[rr::args("x", "y")]
#[rr::returns("+[#x; #y]")]
pub fn new(x: T, y: U) -> Self {
Self{x, y}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment