Unborrowed Rust Compiler (rustc without a borrowchecker)

Related tags

Command-line ubrustc
Overview

ubrustc: Unborrowed rustc

This is rustc with the borrow checker disabled. I wrote it in like, 30 minutes because this tweet made me laugh.

Example

// main.rs
fn main() {
    let s = "hi, world".to_string();
    let msg: &str = &s;
    drop(s);
    println!("Hello, memory corruption: {msg:?}");
}
# <install using steps in `Usage` section>
$ RUSTC=ubrustc cargo run
   Compiling ubrustc-verify v0.1.0 (/Users/thom/scratch/ubrustc-verify)
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `target/debug/ubrustc-verify`
Hello, memory corruption: "\0\0\0\0\0\0\0\0\0"

Usage

You will need to be on a nightly rust (the toolchain from 2023-02-09 is known to work), and have the rustc-dev and llvm-tools-preview components installed.

Then, you can either do ./build.sh to build the binary, which will place it somewhere inside target/*, or ./build.sh install. If you're on Windows, IDK (it shouldn't be hard to install, but you likely need to set the rpath right).

Once it's installed, you use it by setting the RUSTC environment variable to ubrustc when running cargo.

Please don't use this in production. I will not be maintaining it.

Acknowledgements

Apologies to Will Crichton.

You might also like...
A rust library to interact with the Vyper compiler!

vyper-rs A rust library to interact with the Vyper compiler! Dependencies Please ensure that the Vyper compiler is installed and added to PATH! To ins

Maniplate `&'static str` (e.g., `concat!`, `format!`) in Rust without pain!

static_str_ops The static_str_ops crate solves a longstanding issue about how to perform non-const string operations, e.g., format!(), concat!(), etc.

💫 This program allows you to do requests in Rust without reqwest !

Zapros 💫 This program allows you to do requests in Rust without reqwest ! Usage : Get use crate::http_client::HttpClient; use crate::http_client::Htt

Padding/aligning values without heap allocation

zero-copy-pads Padding/aligning values without heap allocation. Cargo Features std (default feature): Disable #![no_std]. Enable features that require

Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.
Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.

Rome is currently being rewritten in Rust. Read more about it in our latest blog post. The documentation below is out of date and available for poster

🕺 Run React code snippets/components from your command-line without config

Run React code snippets/components from your command-line without config.

A simple program that provides DBus interface to control display temperature and brightness under wayland without flickering

wl-gammarelay-rs Like wl-gammarelay, but written in rust, runs on a single thread, has three times less SLOC and uses DBus (for simplicity). Dbus inte

Donate To Charity (A.K.A. Public Goods) Without Lossing Anything
Donate To Charity (A.K.A. Public Goods) Without Lossing Anything

Donate To Charity (A.K.A. Public Goods) Without Lossing Anything

Minimal Pandoc compiler - HTML

Minimal Pandoc compiler - HTML

Owner
Thom Chiovoloni
frequent contributor to the rust standard library
Thom Chiovoloni
A rustc plugin to check for numerical instability

Herbie lint for Rust What This plugin can add warnings or errors to your crate when using a numerically unstable floating point expression. Quick exam

Martin Carton 172 Oct 31, 2022
This rust compiler backend emmits valid CLR IR, enambling you to use Rust in .NET projects

What is rustc_codegen_clr? NOTE: this project is a very early proof-of-concept This is a compiler backend for rustc which targets the .NET platform an

null 252 Sep 7, 2023
A mini paste bin and url shortener written in rust without databases.

pb Build $ cargo build --release Environment Variables PB_DATA: /some/path (Default: ./pb_data) PB_SITE: Url of your site. (Default: http://localhost:

Edward P 5 Jul 26, 2022
a Rust library implementing safe, lightweight context switches, without relying on kernel services

libfringe libfringe is a library implementing safe, lightweight context switches, without relying on kernel services. It can be used in hosted environ

edef 473 Dec 28, 2022
Vyper-Compiler Version Manager in Rust

Vyper Compiler Version Manager in Rust Install $ cargo install --git https://github.com/storming0x/vvm-rs --locked vvm-rs Install from source $ git c

Storming0x 26 Dec 15, 2022
Discord-to-Cohost compiler written in Rust using Tera

Cohoard - Post formatted chatlogs to Cohost! Cohoard is a tool for turning chatlogs into formatted posts on Cohost. You can use Cohoard to easily form

Aaron Kofsky 14 Dec 15, 2022
🐱 HQ9C is a very serioues compiler for HQ9+, it meta-compiles with Rust.

HQ9+ Compiler HQ9c (Or HQ9+ Compiler) is a blockchain-based NFT minting AI machine-learning cloud infraestructure for the compiling of the great progr

Alex 5 Aug 28, 2022
Nederlandse programmeertaal. Geinterpreteerd en met dynamische types. Met bytecode compiler en virtual machine, in Rust.

Nederlang Nederlang is een geinterpreteerde programmeertaal, in het Nederlands! Met als bestandsnaam extensie.... .nl! Het maakt gebruik van dynamisch

Danny van Kooten 17 Dec 15, 2022
⚡ Blazing ⚡ fast ⚡ compiler for Cairo, written in 🦀 Rust 🦀

Cairo 1.0 ?? ⚡ Blazing ⚡ fast ⚡ compiler for Cairo, written in ?? Rust ?? Report a Bug - Request a Feature - Ask a Question Getting Started Prerequisi

Darlington Nnam 6 Feb 23, 2023
A Python package written in Rust for email verification without sending any emails.

PyRustify PyRustify is a Python package written in Rust that verifies the email addresses. Features Feature Description Syntax validation Checks if th

Mng 8 Apr 16, 2023