We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
extern_
Rustdoc
1 parent 0761802 commit 0712ae8Copy full SHA for 0712ae8
src/tools/run-make-support/src/rustdoc.rs
@@ -45,6 +45,21 @@ impl Rustdoc {
45
Self { cmd, stdin: None }
46
}
47
48
+ /// Specify where an external library is located.
49
+ pub fn extern_<P: AsRef<Path>>(&mut self, crate_name: &str, path: P) -> &mut Self {
50
+ assert!(
51
+ !crate_name.contains(|c: char| c.is_whitespace() || c == '\\' || c == '/'),
52
+ "crate name cannot contain whitespace or path separators"
53
+ );
54
+
55
+ let path = path.as_ref().to_string_lossy();
56
57
+ self.cmd.arg("--extern");
58
+ self.cmd.arg(format!("{crate_name}={path}"));
59
60
+ self
61
+ }
62
63
/// Specify path to the input file.
64
pub fn input<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
65
self.cmd.arg(path.as_ref());
0 commit comments