1 error[E0308]: mismatched types
2 --> $DIR/issue-54505-no-literals.rs:16:16
4 LL | take_range(std::ops::Range { start: 0, end: 1 });
5 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 | | expected reference, found struct `std::ops::Range`
8 | | help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }`
9 | arguments to this function are incorrect
11 = note: expected reference `&_`
12 found struct `std::ops::Range<{integer}>`
13 note: function defined here
14 --> $DIR/issue-54505-no-literals.rs:12:4
16 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
17 | ^^^^^^^^^^ -------------------------
19 error[E0308]: mismatched types
20 --> $DIR/issue-54505-no-literals.rs:21:16
22 LL | take_range(::std::ops::Range { start: 0, end: 1 });
23 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 | | expected reference, found struct `std::ops::Range`
26 | | help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }`
27 | arguments to this function are incorrect
29 = note: expected reference `&_`
30 found struct `std::ops::Range<{integer}>`
31 note: function defined here
32 --> $DIR/issue-54505-no-literals.rs:12:4
34 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
35 | ^^^^^^^^^^ -------------------------
37 error[E0308]: mismatched types
38 --> $DIR/issue-54505-no-literals.rs:26:16
40 LL | take_range(std::ops::RangeFrom { start: 1 });
41 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43 | | expected reference, found struct `RangeFrom`
44 | | help: consider borrowing here: `&std::ops::RangeFrom { start: 1 }`
45 | arguments to this function are incorrect
47 = note: expected reference `&_`
48 found struct `RangeFrom<{integer}>`
49 note: function defined here
50 --> $DIR/issue-54505-no-literals.rs:12:4
52 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
53 | ^^^^^^^^^^ -------------------------
55 error[E0308]: mismatched types
56 --> $DIR/issue-54505-no-literals.rs:31:16
58 LL | take_range(::std::ops::RangeFrom { start: 1 });
59 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 | | expected reference, found struct `RangeFrom`
62 | | help: consider borrowing here: `&::std::ops::RangeFrom { start: 1 }`
63 | arguments to this function are incorrect
65 = note: expected reference `&_`
66 found struct `RangeFrom<{integer}>`
67 note: function defined here
68 --> $DIR/issue-54505-no-literals.rs:12:4
70 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
71 | ^^^^^^^^^^ -------------------------
73 error[E0308]: mismatched types
74 --> $DIR/issue-54505-no-literals.rs:36:16
76 LL | take_range(std::ops::RangeFull {});
77 | ---------- ^^^^^^^^^^^^^^^^^^^^^^
79 | | expected reference, found struct `RangeFull`
80 | | help: consider borrowing here: `&std::ops::RangeFull {}`
81 | arguments to this function are incorrect
83 = note: expected reference `&_`
84 found struct `RangeFull`
85 note: function defined here
86 --> $DIR/issue-54505-no-literals.rs:12:4
88 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
89 | ^^^^^^^^^^ -------------------------
91 error[E0308]: mismatched types
92 --> $DIR/issue-54505-no-literals.rs:41:16
94 LL | take_range(::std::ops::RangeFull {});
95 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^
97 | | expected reference, found struct `RangeFull`
98 | | help: consider borrowing here: `&::std::ops::RangeFull {}`
99 | arguments to this function are incorrect
101 = note: expected reference `&_`
102 found struct `RangeFull`
103 note: function defined here
104 --> $DIR/issue-54505-no-literals.rs:12:4
106 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
107 | ^^^^^^^^^^ -------------------------
109 error[E0308]: mismatched types
110 --> $DIR/issue-54505-no-literals.rs:46:16
112 LL | take_range(std::ops::RangeInclusive::new(0, 1));
113 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115 | | expected reference, found struct `RangeInclusive`
116 | | help: consider borrowing here: `&std::ops::RangeInclusive::new(0, 1)`
117 | arguments to this function are incorrect
119 = note: expected reference `&_`
120 found struct `RangeInclusive<{integer}>`
121 note: function defined here
122 --> $DIR/issue-54505-no-literals.rs:12:4
124 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
125 | ^^^^^^^^^^ -------------------------
127 error[E0308]: mismatched types
128 --> $DIR/issue-54505-no-literals.rs:51:16
130 LL | take_range(::std::ops::RangeInclusive::new(0, 1));
131 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133 | | expected reference, found struct `RangeInclusive`
134 | | help: consider borrowing here: `&::std::ops::RangeInclusive::new(0, 1)`
135 | arguments to this function are incorrect
137 = note: expected reference `&_`
138 found struct `RangeInclusive<{integer}>`
139 note: function defined here
140 --> $DIR/issue-54505-no-literals.rs:12:4
142 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
143 | ^^^^^^^^^^ -------------------------
145 error[E0308]: mismatched types
146 --> $DIR/issue-54505-no-literals.rs:56:16
148 LL | take_range(std::ops::RangeTo { end: 5 });
149 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151 | | expected reference, found struct `RangeTo`
152 | | help: consider borrowing here: `&std::ops::RangeTo { end: 5 }`
153 | arguments to this function are incorrect
155 = note: expected reference `&_`
156 found struct `RangeTo<{integer}>`
157 note: function defined here
158 --> $DIR/issue-54505-no-literals.rs:12:4
160 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
161 | ^^^^^^^^^^ -------------------------
163 error[E0308]: mismatched types
164 --> $DIR/issue-54505-no-literals.rs:61:16
166 LL | take_range(::std::ops::RangeTo { end: 5 });
167 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169 | | expected reference, found struct `RangeTo`
170 | | help: consider borrowing here: `&::std::ops::RangeTo { end: 5 }`
171 | arguments to this function are incorrect
173 = note: expected reference `&_`
174 found struct `RangeTo<{integer}>`
175 note: function defined here
176 --> $DIR/issue-54505-no-literals.rs:12:4
178 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
179 | ^^^^^^^^^^ -------------------------
181 error[E0308]: mismatched types
182 --> $DIR/issue-54505-no-literals.rs:66:16
184 LL | take_range(std::ops::RangeToInclusive { end: 5 });
185 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
187 | | expected reference, found struct `RangeToInclusive`
188 | | help: consider borrowing here: `&std::ops::RangeToInclusive { end: 5 }`
189 | arguments to this function are incorrect
191 = note: expected reference `&_`
192 found struct `RangeToInclusive<{integer}>`
193 note: function defined here
194 --> $DIR/issue-54505-no-literals.rs:12:4
196 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
197 | ^^^^^^^^^^ -------------------------
199 error[E0308]: mismatched types
200 --> $DIR/issue-54505-no-literals.rs:71:16
202 LL | take_range(::std::ops::RangeToInclusive { end: 5 });
203 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
205 | | expected reference, found struct `RangeToInclusive`
206 | | help: consider borrowing here: `&::std::ops::RangeToInclusive { end: 5 }`
207 | arguments to this function are incorrect
209 = note: expected reference `&_`
210 found struct `RangeToInclusive<{integer}>`
211 note: function defined here
212 --> $DIR/issue-54505-no-literals.rs:12:4
214 LL | fn take_range(_r: &impl RangeBounds<i8>) {}
215 | ^^^^^^^^^^ -------------------------
217 error: aborting due to 12 previous errors
219 For more information about this error, try `rustc --explain E0308`.