fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.4 KiB123 linesraw
1error[E0308]: mismatched types
2  --> $DIR/issue-54505.rs:14:16
3   |
4LL |     take_range(0..1);
5   |     ---------- ^^^^ expected `&_`, found `Range<{integer}>`
6   |     |
7   |     arguments to this function are incorrect
8   |
9   = note: expected reference `&_`
10                 found struct `std::ops::Range<{integer}>`
11note: function defined here
12  --> $DIR/issue-54505.rs:10:4
13   |
14LL | fn take_range(_r: &impl RangeBounds<i8>) {}
15   |    ^^^^^^^^^^ -------------------------
16help: consider borrowing here
17   |
18LL |     take_range(&(0..1));
19   |                ++    +
20
21error[E0308]: mismatched types
22  --> $DIR/issue-54505.rs:19:16
23   |
24LL |     take_range(1..);
25   |     ---------- ^^^ expected `&_`, found `RangeFrom<{integer}>`
26   |     |
27   |     arguments to this function are incorrect
28   |
29   = note: expected reference `&_`
30                 found struct `RangeFrom<{integer}>`
31note: function defined here
32  --> $DIR/issue-54505.rs:10:4
33   |
34LL | fn take_range(_r: &impl RangeBounds<i8>) {}
35   |    ^^^^^^^^^^ -------------------------
36help: consider borrowing here
37   |
38LL |     take_range(&(1..));
39   |                ++   +
40
41error[E0308]: mismatched types
42  --> $DIR/issue-54505.rs:24:16
43   |
44LL |     take_range(..);
45   |     ---------- ^^ expected `&_`, found `RangeFull`
46   |     |
47   |     arguments to this function are incorrect
48   |
49   = note: expected reference `&_`
50                 found struct `RangeFull`
51note: function defined here
52  --> $DIR/issue-54505.rs:10:4
53   |
54LL | fn take_range(_r: &impl RangeBounds<i8>) {}
55   |    ^^^^^^^^^^ -------------------------
56help: consider borrowing here
57   |
58LL |     take_range(&(..));
59   |                ++  +
60
61error[E0308]: mismatched types
62  --> $DIR/issue-54505.rs:29:16
63   |
64LL |     take_range(0..=1);
65   |     ---------- ^^^^^ expected `&_`, found `RangeInclusive<{integer}>`
66   |     |
67   |     arguments to this function are incorrect
68   |
69   = note: expected reference `&_`
70                 found struct `RangeInclusive<{integer}>`
71note: function defined here
72  --> $DIR/issue-54505.rs:10:4
73   |
74LL | fn take_range(_r: &impl RangeBounds<i8>) {}
75   |    ^^^^^^^^^^ -------------------------
76help: consider borrowing here
77   |
78LL |     take_range(&(0..=1));
79   |                ++     +
80
81error[E0308]: mismatched types
82  --> $DIR/issue-54505.rs:34:16
83   |
84LL |     take_range(..5);
85   |     ---------- ^^^ expected `&_`, found `RangeTo<{integer}>`
86   |     |
87   |     arguments to this function are incorrect
88   |
89   = note: expected reference `&_`
90                 found struct `RangeTo<{integer}>`
91note: function defined here
92  --> $DIR/issue-54505.rs:10:4
93   |
94LL | fn take_range(_r: &impl RangeBounds<i8>) {}
95   |    ^^^^^^^^^^ -------------------------
96help: consider borrowing here
97   |
98LL |     take_range(&(..5));
99   |                ++   +
100
101error[E0308]: mismatched types
102  --> $DIR/issue-54505.rs:39:16
103   |
104LL |     take_range(..=42);
105   |     ---------- ^^^^^ expected `&_`, found `RangeToInclusive<{integer}>`
106   |     |
107   |     arguments to this function are incorrect
108   |
109   = note: expected reference `&_`
110                 found struct `RangeToInclusive<{integer}>`
111note: function defined here
112  --> $DIR/issue-54505.rs:10:4
113   |
114LL | fn take_range(_r: &impl RangeBounds<i8>) {}
115   |    ^^^^^^^^^^ -------------------------
116help: consider borrowing here
117   |
118LL |     take_range(&(..=42));
119   |                ++     +
120
121error: aborting due to 6 previous errors
122
123For more information about this error, try `rustc --explain E0308`.