-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #101975 - chenyukang:fix-101749, r=compiler-errors
- Loading branch information
Showing
15 changed files
with
218 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
error[E0433]: failed to resolve: use of undeclared crate or module `thing` | ||
--> $DIR/bad-module.rs:2:15 | ||
| | ||
LL | let foo = thing::len(Vec::new()); | ||
| ^^^^^ use of undeclared crate or module `thing` | ||
|
||
error[E0433]: failed to resolve: use of undeclared crate or module `foo` | ||
--> $DIR/bad-module.rs:5:15 | ||
| | ||
LL | let foo = foo::bar::baz(); | ||
| ^^^ use of undeclared crate or module `foo` | ||
|
||
error[E0433]: failed to resolve: use of undeclared crate or module `thing` | ||
--> $DIR/bad-module.rs:2:15 | ||
| | ||
LL | let foo = thing::len(Vec::new()); | ||
| ^^^^^ use of undeclared crate or module `thing` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0433`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
struct Rectangle { | ||
width: i32, | ||
height: i32, | ||
} | ||
impl Rectangle { | ||
fn new(width: i32, height: i32) -> Self { | ||
Self { width, height } | ||
} | ||
} | ||
|
||
fn main() { | ||
let rect = Rectangle::new(3, 4); | ||
// `area` is not implemented for `Rectangle`, so this should not suggest | ||
let _ = rect::area(); | ||
//~^ ERROR failed to resolve: use of undeclared crate or module `rect` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0433]: failed to resolve: use of undeclared crate or module `rect` | ||
--> $DIR/issue-101749-2.rs:14:13 | ||
| | ||
LL | let _ = rect::area(); | ||
| ^^^^ use of undeclared crate or module `rect` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0433`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// run-rustfix | ||
struct Rectangle { | ||
width: i32, | ||
height: i32, | ||
} | ||
impl Rectangle { | ||
fn new(width: i32, height: i32) -> Self { | ||
Self { width, height } | ||
} | ||
fn area(&self) -> i32 { | ||
self.height * self.width | ||
} | ||
} | ||
|
||
fn main() { | ||
let rect = Rectangle::new(3, 4); | ||
let _ = rect.area(); | ||
//~^ ERROR failed to resolve: use of undeclared crate or module `rect` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// run-rustfix | ||
struct Rectangle { | ||
width: i32, | ||
height: i32, | ||
} | ||
impl Rectangle { | ||
fn new(width: i32, height: i32) -> Self { | ||
Self { width, height } | ||
} | ||
fn area(&self) -> i32 { | ||
self.height * self.width | ||
} | ||
} | ||
|
||
fn main() { | ||
let rect = Rectangle::new(3, 4); | ||
let _ = rect::area(); | ||
//~^ ERROR failed to resolve: use of undeclared crate or module `rect` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error[E0433]: failed to resolve: use of undeclared crate or module `rect` | ||
--> $DIR/issue-101749.rs:17:13 | ||
| | ||
LL | let _ = rect::area(); | ||
| ^^^^ use of undeclared crate or module `rect` | ||
| | ||
help: you may have meant to call an instance method | ||
| | ||
LL | let _ = rect.area(); | ||
| ~ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0433`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.