We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96df2a7 commit 1c05050Copy full SHA for 1c05050
1 file changed
compiler/rustc_session/src/config/externs.rs
@@ -43,6 +43,13 @@ pub(crate) fn split_extern_opt<'a>(
43
}
44
};
45
46
+ // Reject paths with more than two segments.
47
+ if unstable_opts.namespaced_crates && crate_name.split("::").count() > 2 {
48
+ return Err(early_dcx.early_struct_fatal(format!(
49
+ "crate name `{crate_name}` passed to `--extern` has too many segments; namespaced crates currently support at most two segments"
50
+ )));
51
+ }
52
+
53
if !valid_crate_name(&crate_name, unstable_opts) {
54
let mut error = early_dcx.early_struct_fatal(format!(
55
"crate name `{crate_name}` passed to `--extern` is not a valid ASCII identifier"
0 commit comments