about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/Linker.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-11-07 23:03:55 +0000
committerbors <bors@rust-lang.org>2021-11-07 23:03:55 +0000
commit5fa94f3c57e27a339bc73336cd260cd875026bd1 (patch)
tree954a45648f2857e5756b415597887efae27d7593 /compiler/rustc_llvm/llvm-wrapper/Linker.cpp
parent46b8e7488eae116722196e8390c1bd2ea2e396cf (diff)
parent257ac1b4984f261dfe4572907955a24f43eee209 (diff)
downloadrust-5fa94f3c57e27a339bc73336cd260cd875026bd1.tar.gz
rust-5fa94f3c57e27a339bc73336cd260cd875026bd1.zip
Auto merge of #88368 - jyn514:metadata-error, r=petrochenkov
 Improve error when an .rlib can't be parsed

This usually describes either an error in the compiler itself or some
sort of IO error. Either way, we should report it to the user rather
than just saying "crate not found".

This only gives an error if the crate couldn't be loaded at all - if the
compiler finds another .rlib or .rmeta file which was valid, it will
continue to compile the crate.

Example output:
```
error[E0785]: found invalid metadata files for crate `foo`
 --> bar.rs:3:24
  |
3 |         println!("{}", foo::FOO_11_49[0]);
  |                        ^^^
  |
  = warning: failed to parse rlib '/home/joshua/test-rustdoc/libfoo.rlib': Invalid archive extended name offset
```

cc `@ehuss`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions