-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
33 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
fn main() { | ||
let x = "hello"; | ||
// FIXME: the error below shouldn't happen. For that we need to modify `crate_inherent_impls`. | ||
// https://github.com/rust-lang/rust/issues/125814 | ||
x.split(" "); //~ ERROR E0599 | ||
} | ||
|
||
impl Vec<usize> {} //~ ERROR E0116 |
18 changes: 18 additions & 0 deletions
18
tests/ui/resolve/inherent-impls-missing-due-to-bad-impl.stderr
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,18 @@ | ||
error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined | ||
--> $DIR/inherent-impls-missing-due-to-bad-impl.rs:8:1 | ||
| | ||
LL | impl Vec<usize> {} | ||
| ^^^^^^^^^^^^^^^ impl for type defined outside of crate | ||
| | ||
= note: define and implement a trait or new type instead | ||
|
||
error[E0599]: no method named `split` found for reference `&str` in the current scope | ||
--> $DIR/inherent-impls-missing-due-to-bad-impl.rs:5:7 | ||
| | ||
LL | x.split(" "); | ||
| ^^^^^ method not found in `&str` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0116, E0599. | ||
For more information about an error, try `rustc --explain E0116`. |
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