Skip to content

Commit e73ba21

Browse files
committed
save-analysis: Add UI testsuite
1 parent 58d39a9 commit e73ba21

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

Diff for: src/test/ui/save-analysis/issue-59134-0.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// compile-flags: -Zsave-analysis
2+
3+
// Check that this doesn't ICE when processing associated const (field expr).
4+
5+
pub fn f() {
6+
trait Trait {}
7+
impl Trait {
8+
const FLAG: u32 = bogus.field; //~ ERROR cannot find value `bogus`
9+
}
10+
}
11+
12+
fn main() {}

Diff for: src/test/ui/save-analysis/issue-59134-0.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0425]: cannot find value `bogus` in this scope
2+
--> $DIR/issue-59134-0.rs:8:27
3+
|
4+
LL | const FLAG: u32 = bogus.field;
5+
| ^^^^^ not found in this scope
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0425`.

Diff for: src/test/ui/save-analysis/issue-59134-1.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// compile-flags: -Zsave-analysis
2+
3+
// Check that this doesn't ICE when processing associated const (type).
4+
5+
fn func() {
6+
trait Trait {
7+
type MyType;
8+
const CONST: Self::MyType = bogus.field; //~ ERROR cannot find value `bogus`
9+
}
10+
}
11+
12+
fn main() {}

Diff for: src/test/ui/save-analysis/issue-59134-1.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0425]: cannot find value `bogus` in this scope
2+
--> $DIR/issue-59134-1.rs:8:37
3+
|
4+
LL | const CONST: Self::MyType = bogus.field;
5+
| ^^^^^ not found in this scope
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0425`.

0 commit comments

Comments
 (0)