about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/locator.rs
AgeCommit message (Collapse)AuthorLines
2023-03-16Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`John Kåre Alsaker-3/+4
2023-02-20Replace u32_len with constantRune Tynan-2/+2
2023-02-20Bind header+u32 to variable for clearer mathRune Tynan-3/+5
2023-02-20Fix metadata encoding and decoding to use the right lengthRune Tynan-3/+3
2023-02-20Try adding metadata length prefix, and obey it while decodingRune Tynan-1/+8
2023-02-06Add extended error message for E0523Matthew Kelly-4/+0
Adds the extended error documentation for E0523 to indicate that the error is no longer produced by the compiler. Update the E0464 documentation to include example code that produces the error. Remove the error message E0523 from the compiler and replace it with an internal compiler error.
2023-02-05rustc_metadata: remove huge error importsest31-23/+27
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2022-12-31refactor: merge `E0465` into `E0464`Ezra Shaw-42/+29
2022-12-22A few metadata nitsNilstrieb-6/+2
2022-11-22Tests for bad --extern library path and fileSteven Tang-1/+0
2022-11-20Check that library is fileSteven Tang-0/+6
2022-11-20Fix CrateLocationUnknownType errorSteven Tang-1/+1
2022-09-03Rollup merge of #100928 - CleanCut:rustc_metadata_diagnostics, r=davidtwcoDylan DPC-206/+122
Migrate rustc_metadata to SessionDiagnostics Migrate rustc_metadata to SessionDiagnostics. Part of https://github.com/rust-lang/rust/issues/100717
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-1/+0
by module
2022-08-31respond to review feedback: mainly eliminate as many conversions as possible...Nathan Stocks-60/+42
- ... when creating diagnostics in rustc_metadata - use the error_code! macro - pass macro output to diag.code() - use fluent from within manual implementation of SessionDiagnostic - emit the untested errors in case they occur in the wild - stop panicking in the probably-not-dead code, add fixme to write test
2022-08-31port of locator.rs to SessionDiagnostics, fix some of the errorsNathan Stocks-207/+141
revealed by tests, manually add a panic to test for dead code
2022-07-23Fix typo/grammar in locator.rs doc commentDaniel Bevenius-1/+1
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-11/+11
2022-04-03Replace every `String` in Target(Options) with `Cow<'static, str>`Loïc BRANSTETT-6/+6
2022-02-19Adopt let else in more placesest31-8/+5
2022-02-04Add a comment about possible mismatches.Nicholas Nethercote-0/+7
2022-02-04Remove `staticlibs` local variable.Nicholas Nethercote-4/+1
2022-02-04Clean up `find_library_crate`.Nicholas Nethercote-21/+19
By introducing prefix and suffix variables for all file types, and renaming some variables.
2022-02-02Make `SearchPathFile::file_name_str` non-optional.Nicholas Nethercote-4/+1
Currently, it can be `None` if the conversion from `OsString` fails, in which case all searches will skip over the `SearchPathFile`. The commit changes things so that the `SearchPathFile` just doesn't get created in the first place. Same behaviour, but slightly simpler code.
2022-02-02Inline and remove `FileSearch::search`.Nicholas Nethercote-35/+46
It has only a single callsite, and having all the code in one place will make it possible to optimize the search.
2022-02-02Remove `FileMatch`.Nicholas Nethercote-5/+4
It's returned from `FileSearch::search` but it's only used to print some debug info.
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-3/+4
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2021-12-15Remove unnecessary sigils around `Symbol::as_str()` calls.Nicholas Nethercote-2/+2
2021-12-15Remove `SymbolStr`.Nicholas Nethercote-1/+2
By changing `as_str()` to take `&self` instead of `self`, we can just return `&str`. We're still lying about lifetimes, but it's a smaller lie than before, where `SymbolStr` contained a (fake) `&'static str`!
2021-12-14Remove `in_band_lifetimes` from `rustc_metadata`Sylvan Bowdler-1/+1
2021-12-01Improve suggestion for extern crate self error messageMichael-7/+5
2021-12-01Stop treating extern crate loading failures as fatal errorsMichael-11/+11
2021-11-07Improve error when an .rlib can't be parsedJoshua Nelson-15/+75
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 ```
2021-11-03Demote metadata load warning to "info".Eric Huss-2/+2
2021-10-19Don't emit a warning for empty rmeta files.Eric Huss-0/+9
2021-10-12Include rmeta candidates in "multiple matching crates" errorNoah Lev-13/+15
Only dylib and rlib candidates were included in the error. I think the reason is that at the time this error was originally implemented, rmeta crate sources were represented different from dylib and rlib sources. I wrote up more detailed analysis in [this comment][1]. The new version of the code is also a bit easier to read and should be more robust to future changes since it uses `CrateSources::paths()`. [1]: https://github.com/rust-lang/rust/pull/88675#issuecomment-935282436
2021-10-12Sort candidate libraries by source path in errorNoah Lev-1/+7
This makes the error output deterministic and thus testable.
2021-10-05Rollup merge of #89546 - joshtriplett:grow-metadata-faster, r=petrochenkovManish Goregaokar-1/+3
Make an initial guess for metadata size to reduce buffer resizes When reading metadata, the compiler starts with a `Vec::new()`, which will need to grow repeatedly as the metadata gets decompressed into it. Reduce the number of resizes by starting out at the size of the compressed data.
2021-10-05Auto merge of #89266 - cjgillot:session-ich, r=michaelwoeristerbors-1/+1
Move ICH to rustc_query_system Based on https://github.com/rust-lang/rust/pull/89183 The StableHashingContext does not need to be in rustc_middle. This PR moves it to rustc_query_system. This will avoid a dependency between rustc_ast_lowering and rustc_middle in https://github.com/rust-lang/rust/pull/89124.
2021-10-04Make an initial guess for metadata size to reduce buffer resizesJosh Triplett-1/+3
2021-10-03Move rustc_middle::middle::cstore to rustc_session.Camille GILLOT-1/+1
2021-09-30Recommend running `cargo clean` in E0514 outputpierwill-1/+2
2021-09-10Add help for E0463Guillaume Gomez-0/+5
2021-09-02Introduce CrateRejections structbjorn3-40/+36
2021-09-02Remove root field from CrateLocatorbjorn3-7/+3
2021-09-02Remove host_hash from CrateLocatorbjorn3-4/+0
2021-09-02Refactor CrateLocator.is_proc_macrobjorn3-14/+10
This also fixes a (theoretical) bug where a proc-macro may be loaded as plugin if it exports a symbol with the right name.
2021-09-02Don't store Session in CrateLocatorbjorn3-11/+15