]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #104621 - YC:master, r=davidtwco
authorManish Goregaokar <manishsmail@gmail.com>
Wed, 23 Nov 2022 03:54:40 +0000 (22:54 -0500)
committerGitHub <noreply@github.com>
Wed, 23 Nov 2022 03:54:40 +0000 (22:54 -0500)
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.


Trivial merge