about summary refs log tree commit diff
path: root/tests/ui/pattern/deref-patterns/const-pats-do-not-mislead-inference.stable.stderr
blob: 61079718c5d5abe5eb018aeb97c61aa0f8413b4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
error[E0308]: mismatched types
  --> $DIR/const-pats-do-not-mislead-inference.rs:33:12
   |
LL |     if let b"..." = &&x {}
   |            ^^^^^^   --- this expression has type `&&_`
   |            |
   |            expected `&&_`, found `&[u8; 3]`
   |
   = note: expected reference `&&_`
              found reference `&'static [u8; 3]`

error[E0308]: mismatched types
  --> $DIR/const-pats-do-not-mislead-inference.rs:39:12
   |
LL |     if let "..." = &Box::new(x) {}
   |            ^^^^^   ------------ this expression has type `&Box<_>`
   |            |
   |            expected `&Box<_>`, found `&str`
   |
   = note: expected reference `&Box<_>`
              found reference `&'static str`
help: consider dereferencing to access the inner value using the Deref trait
   |
LL |     if let "..." = &*Box::new(x) {}
   |                     +

error[E0308]: mismatched types
  --> $DIR/const-pats-do-not-mislead-inference.rs:45:12
   |
LL |     if let b"..." = Box::new(&x) {}
   |            ^^^^^^   ------------ this expression has type `Box<&_>`
   |            |
   |            expected `Box<&_>`, found `&[u8; 3]`
   |
   = note: expected struct `Box<&_>`
           found reference `&'static [u8; 3]`
help: consider dereferencing to access the inner value using the Deref trait
   |
LL |     if let b"..." = *Box::new(&x) {}
   |                     +

error[E0308]: mismatched types
  --> $DIR/const-pats-do-not-mislead-inference.rs:51:12
   |
LL |     if let "..." = &mut x {}
   |            ^^^^^   ------ this expression has type `&mut _`
   |            |
   |            types differ in mutability
   |
   = note: expected mutable reference `&mut _`
                      found reference `&'static str`

error: aborting due to 4 previous errors

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