cargo_remark/
lib.rs

1use std::path::PathBuf;
2
3pub mod remark;
4pub mod render;
5pub mod utils;
6
7pub const DEFAULT_KIND_FILTER: &[&str] = &["FastISelFailure", "NeverInline", "SpillReloadCopies"];
8
9/// Directory containing Rust sources
10pub struct RustcSourceRoot(pub PathBuf);
11
12impl RustcSourceRoot {
13    pub fn from_sysroot(path: PathBuf) -> anyhow::Result<Self> {
14        let src_dir = path.join("lib").join("rustlib").join("src").join("rust");
15        if src_dir.is_dir() {
16            Ok(Self(src_dir))
17        } else {
18            Err(anyhow::anyhow!("Path {} does not exist", src_dir.display()))
19        }
20    }
21}