-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #104621 - YC:master, r=davidtwco
Fix --extern library finding errors - `crate_name` is not specified/passed to `metadata_crate_location_unknown_type` https://github.com/rust-lang/rust/blob/c493bae0d8efd75723460ce5c371f726efa93f15/compiler/rustc_error_messages/locales/en-US/metadata.ftl#L274-L275 - `metadata_lib_filename_form` is missing `$` - Add additional check to ensure that library is file Testing 1. Create file `a.rs` ```rust extern crate t; fn main() {} ``` 1. Create empty file `x` 1. Create empty directory `y` 1. Run ```sh $ rustc -o a a.rs --extern t=x $ rustc -o a a.rs --extern t=y ``` Both currently panic with stable.
- Loading branch information
Showing
7 changed files
with
50 additions
and
3 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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// compile-flags: --extern foo={{src-base}}/errors/issue-104621-extern-bad-file.rs | ||
// only-linux | ||
|
||
extern crate foo; | ||
//~^ ERROR extern location for foo is of an unknown type | ||
//~| ERROR file name should be lib*.rlib or lib*.so | ||
//~| ERROR can't find crate for `foo` [E0463] | ||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error: extern location for foo is of an unknown type: $DIR/issue-104621-extern-bad-file.rs | ||
--> $DIR/issue-104621-extern-bad-file.rs:4:1 | ||
| | ||
LL | extern crate foo; | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: file name should be lib*.rlib or lib*.so | ||
--> $DIR/issue-104621-extern-bad-file.rs:4:1 | ||
| | ||
LL | extern crate foo; | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0463]: can't find crate for `foo` | ||
--> $DIR/issue-104621-extern-bad-file.rs:4:1 | ||
| | ||
LL | extern crate foo; | ||
| ^^^^^^^^^^^^^^^^^ can't find crate | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0463`. |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// compile-flags: --extern foo=. | ||
|
||
extern crate foo; //~ ERROR extern location for foo is not a file: . | ||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: extern location for foo is not a file: . | ||
--> $DIR/issue-104621-extern-not-file.rs:3:1 | ||
| | ||
LL | extern crate foo; | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|