Skip to content

Commit 9b56d83

Browse files
committed
Add ui test
Signed-off-by: xizheyin <[email protected]>
1 parent ae8ab87 commit 9b56d83

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
let x = 1;
3+
let y = &x;
4+
assert!(y == 1); //~ ERROR can't compare `&{integer}` with `{integer}` [E0277]
5+
assert_eq!(y, 2); //~ ERROR can't compare `&{integer}` with `{integer}` [E0277]
6+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error[E0277]: can't compare `&{integer}` with `{integer}`
2+
--> $DIR/dont-suggest-within-macro-issue-139251.rs:4:15
3+
|
4+
LL | assert!(y == 1);
5+
| ^^ no implementation for `&{integer} == {integer}`
6+
|
7+
= help: the trait `PartialEq<{integer}>` is not implemented for `&{integer}`
8+
help: consider dereferencing here
9+
|
10+
LL | assert!(*y == 1);
11+
| +
12+
13+
error[E0277]: can't compare `&{integer}` with `{integer}`
14+
--> $DIR/dont-suggest-within-macro-issue-139251.rs:5:5
15+
|
16+
LL | assert_eq!(y, 2);
17+
| ^^^^^^^^^^^^^^^^ no implementation for `&{integer} == {integer}`
18+
|
19+
= help: the trait `PartialEq<{integer}>` is not implemented for `&{integer}`
20+
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
21+
22+
error: aborting due to 2 previous errors
23+
24+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)