A Partial Runtime Implementation of The "Rust Borrow Checker" in C++ - Fred Cook (8463955)
This repository contains all code associated with my dissertation project. This includes:
- my partial borrow checker implementation in C++
- A series of tests, demonstrating standard C++ and my implementation's change on "equivalent" program behaviour
- A series of Rust tests which demonstrate some rules set out by the Borrow Checker
Instructions for running (on linux)
C++
Requirements
- Clang
- Cmake
- Google test (Gtest) library
Steps
cd ./cpp
mkdir build
cd build
cmake ..
make
./internal_tests && ./tests
Notes
- The C++ files follow the
Microsoft
style guides
Rust
Requirements
Steps
cd ./rust/borrow_checker
cargo t
orcargo test
(these two are equivalent)- Cargo will then pull all dependencies, handle the compilation process and run the test(s) located in
./rust/borrow_checker/src/lib.rs
Notes
- Rust files format the standard Rust guidelines defined by
rustfmt
Steps to make use of the C++ implementation in your own project
- Simply
#include
it to your own project - e.g.
#include "../lib/borrow_checker.hpp"
- then compile as normal