Skip to content

Commit 2fcc673

Browse files
committed
Auto merge of #133154 - estebank:issue-133137, r=wesleywiser
Reword resolve errors caused by likely missing crate in dep tree Reword label and add `help`: ``` error[E0432]: unresolved import `some_novel_crate` --> f704.rs:1:5 | 1 | use some_novel_crate::Type; | ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `some_novel_crate` | = help: if you wanted to use a crate named `some_novel_crate`, use `cargo add some_novel_crate` to add it to your `Cargo.toml` ``` Fix #133137.
2 parents 4875aea + de292a8 commit 2fcc673

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: tests/fail/rustc-error2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ struct Struct<T>(T);
44
impl<T> std::ops::Deref for Struct<T> {
55
type Target = dyn Fn(T);
66
fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
7-
//~^ERROR: undeclared crate or module
7+
//~^ERROR: use of unresolved module or unlinked crate
88
unimplemented!()
99
}
1010
}

Diff for: tests/fail/rustc-error2.stderr

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
error[E0433]: failed to resolve: use of undeclared crate or module `assert_mem_uninitialized_valid`
1+
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `assert_mem_uninitialized_valid`
22
--> tests/fail/rustc-error2.rs:LL:CC
33
|
44
LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `assert_mem_uninitialized_valid`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `assert_mem_uninitialized_valid`
6+
|
7+
= help: you might be missing a crate named `assert_mem_uninitialized_valid`
68

79
error: aborting due to 1 previous error
810

0 commit comments

Comments
 (0)