Giter Site home page Giter Site logo

hkalbasi / prusti-assistant Goto Github PK

View Code? Open in Web Editor NEW

This project forked from viperproject/prusti-assistant

0.0 2.0 0.0 1.43 MB

VS Code extension to verify Rust programs with the Prusti verifier.

Home Page: http://prusti.ethz.ch

License: MIT License

TypeScript 97.78% JavaScript 1.73% Rust 0.49%

prusti-assistant's Introduction

Prusti Assistant

Test and publish Test coverage Quality Gate Status

This Visual Studio Code extension provides interactive IDE features for verifying Rusti programs with the Prusti verifier.

For advanced use cases, consider switching to the command-line version of Prusti.

Requirements

In order to use this extension, please install the following components:

First Usage

  1. Install the requirements (listed above) and restart the IDE.
    • This will ensure that programs like rustup are in the program path used by the IDE.
  2. Install the "Prusti Assistant" extension.
  3. Open a Rust file to activate the extension.
    • At its first activation, this extension will automatically download Prusti and install the required Rust toolchain.
  4. Click on the "Verify with Prusti" button in the status bar.
    • Alternativelly, you can run the Prusti: verify the current crate or file command.
    • If the program is in a folder with a Cargo.toml file, Prusti will verify the crate in which the file is contained.
    • If no Cargo.toml file can be found in a parent folder of the workspace, Prusti will verify the file as a standalone Rust program. No Cargo dependencies are allowed in this mode.
  5. Follow the progress from the status bar.
    • You should see a "Verifying crate [folder name]" or "Verifying file [name]" message while Prusti is running.
  6. The result of the verification is reported in the status bar and in the "Problems" tab.
    • You can open the "Problems" tab by clicking on Prusti's status bar.
    • Be aware that the "Problems" tab is shared by all extensions. If you are not sure which extension generated which error, try disabling other extensions. (Related VS Code issue: #51103.)

To update Prusti, run the command Prusti: update verifier in the command palette.

If something fails, check the "Troubleshooting" section below.

Features

Commands

This extension provides the following commands:

  • Prusti: verify the current crate or file to verify a Rust program;
  • Prusti: update verifier to update Prusti.
  • Prusti: restart Prusti server to restart the Prusti server used by this extension.

Configuration

The main configuration options used by this extension are the following:

  • prusti-assistant.verifyOnSave: Specifies if programs should be verified on save.
  • prusti-assistant.verifyOnOpen: Specifies if programs should be verified when opened.
  • prusti-assistant.buildChannel: Allows to choose between the latest Prusti release version (the default) and a slightly newer but potentially unstable Prusti development version.
  • prusti-assistant.checkForUpdates: Specifies if Prusti should check for updates at startup.

Inline Code Diagnostics

This extension automatically provides inline diagnostics for Prusti errors.

Snippets

Basic code-completion snippets are provided for Prusti annotations.

Troubleshooting

If Prusti fails to run, you can inspect Prusti's log from VS Code (View -> Output -> Prusti Assistant ...) and see if one of the following solutions applies to you.

Problem Solution
error[E0514]: found crate 'cfg_if' compiled by an incompatible version of rustc There is a conflict between Prusti and a previous Cargo compilation. Run cargo clean or manually delete the target folder. Then, rerun Prusti.
error: the 'cargo' binary, normally provided by the 'cargo' component, is not applicable to the 'nightly-2021-09-20-x86_64-unknown-linux-gnu' toolchain
or
error[E0463]: can't find crate for std
or
error[E0463]: can't find crate for core
The Rust toolchain installed by Rustup is probably corrupted (see issue rustup/#2417). Uninstall the nightly toolchain mentioned in the error (or all installed nightly toolchains). Then, rerun Prusti.

Thanks to @Pointerbender for reporting issues and suggesting solutions!

prusti-assistant's People

Contributors

aurel300 avatar dependabot-preview[bot] avatar dependabot[bot] avatar fpoli avatar hkalbasi avatar juliand665 avatar mooman219 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.