MCPcopy Index your code
hub / github.com/Property404/goto-label-rs

github.com/Property404/goto-label-rs @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
7 symbols 9 edges 4 files 1 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Goto/Label for Rust

Tired of using newfangled control flow mechnisms like "loop," "while," and "for"?

Well worry no more! Finally, "goto" and "label" macros have arrived for Rust! And they're #![no_std]!

use goto_label::{goto, label};

#[no_mangle] // Needed to prevent foo() from being optimized away
unsafe fn foo() {
    println!("This text will never be printed!");

    label!("label1");
    print!("Hello");
    goto!("label2");

    println!("Neither will this be printed!");
}

unsafe fn hello_world() {
    goto!("label1");
    println!("This won't be printed either!");

    label!("label2");
    println!(" World!");
}

unsafe {
    hello_world();
}

Currently supported Architectures

  • x86
  • x86_64
  • aarch64

Warning

Do not actually use this crate. It will definitely cause undefined behavior, most likely manifesting as segfaults.

See also

Another goto implementation

Core symbols most depended-on inside this repo

fizzbuzz
called by 1
examples/fizzbuzz.rs
hello_world
called by 1
examples/cross_func_boundries.rs
main
called by 0
examples/fizzbuzz.rs
foo
called by 0
examples/cross_func_boundries.rs
main
called by 0
examples/cross_func_boundries.rs
main
called by 0
examples/simple.rs

Shape

Function 7

Languages

Rust100%

Modules by API surface

examples/cross_func_boundries.rs3 symbols
examples/fizzbuzz.rs2 symbols
src/lib.rs1 symbols
examples/simple.rs1 symbols

For agents

$ claude mcp add goto-label-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact