Skip to main content

collect_warnings

Function collect_warnings 

Source
pub fn collect_warnings<R>(f: impl FnOnce() -> R) -> (R, Vec<Diagnostic>)
Expand description

Runs f and returns what it produced together with every warning raised while it ran, in the order they were raised. Nothing is printed.

Collectors nest: an inner one takes the warnings raised inside it, and the outer one sees none of them.