mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Add test for resolve errors caused by mod with parse errors
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
mod parse_error;
|
||||
use parse_error::Canonical; //~ ERROR E0432
|
||||
|
||||
fn main() {
|
||||
let _ = "" + 1; //~ ERROR E0369
|
||||
parse_error::Canonical.foo(); //~ ERROR E0425
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
error: expected one of `+`, `,`, `::`, `=`, or `>`, found `From`
|
||||
--> $DIR/parse_error.rs:2:46
|
||||
|
|
||||
LL | impl<S: Into<std::borrow::Cow<'static, str>> From<S> for Canonical {
|
||||
| ^^^^ expected one of `+`, `,`, `::`, `=`, or `>`
|
||||
|
|
||||
help: you might have meant to end the type parameters here
|
||||
|
|
||||
LL | impl<S: Into<std::borrow::Cow<'static, str>>> From<S> for Canonical {
|
||||
| +
|
||||
|
||||
error[E0432]: unresolved import `parse_error::Canonical`
|
||||
--> $DIR/parse-error-resolve.rs:2:5
|
||||
|
|
||||
LL | use parse_error::Canonical;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ no `Canonical` in `parse_error`
|
||||
|
||||
error[E0425]: cannot find value `Canonical` in module `parse_error`
|
||||
--> $DIR/parse-error-resolve.rs:6:18
|
||||
|
|
||||
LL | parse_error::Canonical.foo();
|
||||
| ^^^^^^^^^ not found in `parse_error`
|
||||
|
||||
error[E0369]: cannot add `{integer}` to `&str`
|
||||
--> $DIR/parse-error-resolve.rs:5:16
|
||||
|
|
||||
LL | let _ = "" + 1;
|
||||
| -- ^ - {integer}
|
||||
| |
|
||||
| &str
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0369, E0425, E0432.
|
||||
For more information about an error, try `rustc --explain E0369`.
|
||||
@@ -0,0 +1,5 @@
|
||||
struct Canonical;
|
||||
impl<S: Into<std::borrow::Cow<'static, str>> From<S> for Canonical { //~ ERROR expected
|
||||
fn foo() {}
|
||||
}
|
||||
fn bar() {}
|
||||
@@ -0,0 +1,13 @@
|
||||
error: expected one of `+`, `,`, `::`, `=`, or `>`, found `From`
|
||||
--> $DIR/parse_error.rs:2:46
|
||||
|
|
||||
LL | impl<S: Into<std::borrow::Cow<'static, str>> From<S> for Canonical {
|
||||
| ^^^^ expected one of `+`, `,`, `::`, `=`, or `>`
|
||||
|
|
||||
help: you might have meant to end the type parameters here
|
||||
|
|
||||
LL | impl<S: Into<std::borrow::Cow<'static, str>>> From<S> for Canonical {
|
||||
| +
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
Reference in New Issue
Block a user