tests/run-make/linkage-attr-framework/rmake.rs RUST 27 lines View on github.com → Search inside
1//! Check that linking frameworks on Apple platforms works.23//@ only-apple45use run_make_support::{Rustc, run, rustc};67fn compile(cfg: &str) -> Rustc {8    let mut rustc = rustc();9    rustc.cfg(cfg).input("main.rs");10    rustc11}1213fn main() {14    for cfg in ["link", "weak", "both"] {15        compile(cfg).run();16        run("main");17    }1819    let errs = compile("omit").run_fail();20    // The linker's exact error output changes between Xcode versions, depends on21    // linker invocation details, and the linker sometimes outputs more warnings.22    errs.assert_stderr_contains_regex(r"error: linking with `.*` failed");23    errs.assert_stderr_contains_regex(r"(Undefined symbols|ld: symbol[^\s]* not found)");24    errs.assert_stderr_contains_regex(r".?_CFRunLoopGetTypeID.?, referenced from:");25    errs.assert_stderr_contains("clang: error: linker command failed with exit code 1");26}

Code quality findings 2

Warning: Direct indexing (e.g., `vec[i]`, `slice[i]`) panics on out-of-bounds access. Prefer using `.get(index)` or `.get_mut(index)` which return Option<&T>/Option<&mut T>.
warning correctness unchecked-indexing
for cfg in ["link", "weak", "both"] {
Warning: Direct indexing (e.g., `vec[i]`, `slice[i]`) panics on out-of-bounds access. Prefer using `.get(index)` or `.get_mut(index)` which return Option<&T>/Option<&mut T>.
warning correctness unchecked-indexing
errs.assert_stderr_contains_regex(r"(Undefined symbols|ld: symbol[^\s]* not found)");

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.