zesterer / ariadne

A fancy diagnostics & error reporting crate
https://crates.io/crates/ariadne
MIT License
1.61k stars 72 forks source link

Reports with non-static labels #53

Open NViviers opened 1 year ago

NViviers commented 1 year ago

New to this crate, so not sure if I'm simply doing something wrong but it seems like you can't build reports with non-static values:

Report::build(ReportKind::Error, ...)
    .with_message(...)
    with_label(Label::new((data.file.as_str(), span)))

data.file is a String instance, my main function calls another function passing data which then builds the report. Borrowed data either escapes the function body or doesn't outlive 'static as required