-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #10243 - hi-rustin:rustin-patch-collision, r=ehuss
Error when setting crate type of both dylib and cdylib in library close #10231 Error when setting crate type of both dylib and cdylib in library. Cargo can't support that at this time, since they both output the same filename.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1633,6 +1633,39 @@ fn many_crate_types_correct() { | |
assert!(p.root().join("target/debug").join(&fname).is_file()); | ||
} | ||
|
||
#[cargo_test] | ||
fn set_both_dylib_and_cdylib_crate_types() { | ||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
r#" | ||
[project] | ||
name = "foo" | ||
version = "0.5.0" | ||
authors = ["[email protected]"] | ||
[lib] | ||
name = "foo" | ||
crate_type = ["cdylib", "dylib"] | ||
"#, | ||
) | ||
.file("src/lib.rs", "pub fn foo() {}") | ||
.build(); | ||
p.cargo("build") | ||
.with_status(101) | ||
.with_stderr( | ||
"\ | ||
error: failed to parse manifest at `[..]` | ||
Caused by: | ||
library `foo` cannot set the crate type of both `dylib` and `cdylib` | ||
", | ||
) | ||
.run(); | ||
} | ||
|
||
#[cargo_test] | ||
fn self_dependency() { | ||
let p = project() | ||
|