Uh oh!
There was an error while loading. Please reload this page.
Include rmeta candidates in "multiple matching crates" error - #89587
Conversation
rust-highfive
commented
Oct 6, 2021
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
This padding doesn't seem correct to me. It's the same as before, but crate ` is 7 chars and `: is 3 chars (backtick, colon, space). Together, that makes 10 characters, not 8. Additionally, I don't think the format specifier {:>padding$} is correct for paths shorter than padding.
Should I change it to push_str the padding, and then push the path, rather than using format specifiers? I think that would be more correct.
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
camelid
commented
Oct 6, 2021
Looks like tests failed for two reasons: (1) #89587 (comment) and (2) inconsistent ordering of candidates. For (1), I just need to add |
camelid
commented
Oct 6, 2021
(1) should be fixed now. |
This comment has been minimized.
This comment has been minimized.
camelid
commented
Oct 6, 2021
Ok, (2) should be fixed as well now. |
I also reordered the commits so that the tests are added before the |
Uh oh!
There was an error while loading. Please reload this page.
camelid
commented
Oct 11, 2021
@bors r=petrochenkov |
bors
commented
Oct 11, 2021
📌 Commit 359a3fdfc2d7f425c29155959643f7a5d46d732e has been approved by |
bors
commented
Oct 11, 2021
⌛ Testing commit 359a3fdfc2d7f425c29155959643f7a5d46d732e with merge 9abf6d9699ae26eec2c5a48bc6e610f6f97cc410... |
There was a problem hiding this comment.
Why doesn't this issue appear with other tests printing $TEST_BUILD_DIR paths?
Do verbatim paths (\\?) appear because the path is fs::canonicalize-d in this case?
This normalization looks like a compiletest's job (src\tools\compiletest\src\runtest.rs -> fn normalize_output).
There was a problem hiding this comment.
I agree that it's a bit odd, but I figured it's because the crate loader is showing absolute paths. I don't have time to look into whether this is a compiletest issue unfortunately.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This makes the error output deterministic and thus testable.
And remove E0464 from test-exemption list, since it now has a full test.
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]: rust-lang#88675 (comment)
The test is copied from `src/test/ui/crate-loading/crateresolve1.rs` and its auxiliary tests. I added it to the `compile_fail` code example check exemption list since it's hard if not impossible to reproduce this error in a standalone code example.
camelid
commented
Oct 12, 2021
@bors r=petrochenkov |
bors
commented
Oct 12, 2021
📌 Commit bf2d2e5 has been approved by |
bors
commented
Oct 13, 2021
bors
commented
Oct 13, 2021
☀️ Test successful - checks-actions |
rust-timer
commented
Oct 13, 2021
Finished benchmarking commit (5728bd6): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
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.
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().I also changed the code to sort the candidates to make the output deterministic;
added full stderr tests for the error; and added a long error code explanation.
cc @Mark-Simulacrum@jyn514