Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --extern library finding errors #104621

Merged
merged 5 commits into from
Nov 23, 2022
Merged

Fix --extern library finding errors #104621

merged 5 commits into from
Nov 23, 2022

Conversation

YC
Copy link
Contributor

@YC YC commented Nov 20, 2022

  • crate_name is not specified/passed to metadata_crate_location_unknown_type
    metadata_crate_location_unknown_type =
    extern location for {$crate_name} is of an unknown type: {$path}
  • metadata_lib_filename_form is missing $
  • Add additional check to ensure that library is file

Testing

  1. Create file a.rs
extern crate t;
fn main() {}
  1. Create empty file x
  2. Create empty directory y
  3. Run
$ rustc -o a a.rs --extern t=x
$ rustc -o a a.rs --extern t=y

Both currently panic with stable.

@rustbot
Copy link
Collaborator

rustbot commented Nov 20, 2022

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @compiler-errors (or someone else) soon.

Please see the contribution instructions for more information.

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 20, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 20, 2022

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching these, could you add tests?

@compiler-errors
Copy link
Member

r? @davidtwco

@rustbot rustbot assigned davidtwco and unassigned compiler-errors Nov 21, 2022
@YC YC requested a review from davidtwco November 22, 2022 06:12
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 22, 2022

📌 Commit 7169c7d has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 22, 2022
Manishearth added a commit to Manishearth/rust that referenced this pull request Nov 23, 2022
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.
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 23, 2022
…earth

Rollup of 6 pull requests

Successful merges:

 - rust-lang#103488 (Allow opaque types in trait impl headers and rely on coherence to reject unsound cases)
 - rust-lang#104359 (Refactor must_use lint into two parts)
 - rust-lang#104612 (Lower return type outside async block creation)
 - rust-lang#104621 (Fix --extern library finding errors)
 - rust-lang#104647 (enable fuzzy_provenance_casts lint in liballoc and libstd)
 - rust-lang#104750 (Bump `fd-lock` in `bootstrap` again)

Failed merges:

 - rust-lang#104732 (Refactor `ty::ClosureKind` related stuff)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 54b6292 into rust-lang:master Nov 23, 2022
@rustbot rustbot added this to the 1.67.0 milestone Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants