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
#![feature(proc_macro_hygiene)] | |
use rust_contracts::{requires, ensures, invariant}; | |
#[requires(*m >= 2)] | |
#[ensures(old(*m) == result.len())] | |
fn create_fib_array(m: &mut usize) -> Vec<usize> { | |
let mut fib_array = Vec::new(); | |
fib_array.push(0); | |
fib_array.push(1); | |
let mut i = 2; | |
while i != *m { |
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
// Imports macros for specifying postconditions. | |
use rust_contracts::ensures; | |
#[ensures(result >= a && result >= b)] | |
fn max(a: i32, b: i32) -> i32 { | |
if a < b { b } else { a } | |
} | |
fn main() { | |
let _ = max(1, 2); |
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
extern crate prusti_contracts; | |
pub struct VecWrapperUSize{ | |
v: Vec<usize> | |
} | |
impl VecWrapperUSize { | |
#[trusted] | |
#[ensures="result.len() == 0"] | |
pub fn new() -> Self { |
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
extern crate prusti_contracts; | |
pub struct VecWrapperUSize{ | |
v: Vec<usize> | |
} | |
impl VecWrapperUSize { | |
#[trusted] | |
#[ensures="result.len() == 0"] | |
pub fn new() -> Self { |
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
FROM ubuntu:18.04 | |
MAINTAINER Vytautas Astrauskas "vastrauskas@gmail.com" | |
ENV DEBIAN_FRONTEND noninteractive | |
# Install prerequisites. | |
RUN apt-get update && \ | |
apt-get install -y \ | |
build-essential \ | |
locales \ |
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
$ "/home/vakaras/tmp/add-polonius-compare-mode/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/home/vakaras/tmp/add-polonius-compare-mode/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/home/vakaras/tmp/add-polonius-compare-mode/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/home/vakaras/tmp/add-polonius-compare-mode/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/home/vakaras/tmp/add-polonius-compare-mode/src/test/ui" "--build-base" "/home/vakaras/tmp/add-polonius-compare-mode/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/home/vakaras/tmp/add-polonius-compare-mode/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/usr/local/bin/node" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstabl |