Skip to content

Commit

Permalink
save-analysis: Add UI testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed May 9, 2019
1 parent 58d39a9 commit e73ba21
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/ui/save-analysis/issue-59134-0.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// compile-flags: -Zsave-analysis

// Check that this doesn't ICE when processing associated const (field expr).

pub fn f() {
trait Trait {}
impl Trait {
const FLAG: u32 = bogus.field; //~ ERROR cannot find value `bogus`
}
}

fn main() {}
9 changes: 9 additions & 0 deletions src/test/ui/save-analysis/issue-59134-0.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0425]: cannot find value `bogus` in this scope
--> $DIR/issue-59134-0.rs:8:27
|
LL | const FLAG: u32 = bogus.field;
| ^^^^^ not found in this scope

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.
12 changes: 12 additions & 0 deletions src/test/ui/save-analysis/issue-59134-1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// compile-flags: -Zsave-analysis

// Check that this doesn't ICE when processing associated const (type).

fn func() {
trait Trait {
type MyType;
const CONST: Self::MyType = bogus.field; //~ ERROR cannot find value `bogus`
}
}

fn main() {}
9 changes: 9 additions & 0 deletions src/test/ui/save-analysis/issue-59134-1.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0425]: cannot find value `bogus` in this scope
--> $DIR/issue-59134-1.rs:8:37
|
LL | const CONST: Self::MyType = bogus.field;
| ^^^^^ not found in this scope

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.

0 comments on commit e73ba21

Please sign in to comment.