Skip to content

Commit 74bc964

Browse files
committed
finishing touches, move fixed ICEs to ui tests
1 parent fb95df7 commit 74bc964

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

tests/ui/missing_const_for_fn/could_be_const.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,18 @@ fn main() {}
104104

105105
struct D;
106106

107+
/* FIXME(effects)
107108
impl const Drop for D {
108109
fn drop(&mut self) {
109110
todo!();
110111
}
111112
}
113+
*/
112114

113115
// Lint this, since it can be dropped in const contexts
114116
// FIXME(effects)
115117
fn d(this: D) {}
118+
//~^ ERROR: this could be a `const fn`
116119

117120
mod msrv {
118121
struct Foo(*const u8, &'static u8);

tests/ui/missing_const_for_fn/could_be_const.stderr

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,13 @@ LL | const fn msrv_1_46() -> i32 {
157157
| +++++
158158

159159
error: this could be a `const fn`
160-
--> tests/ui/missing_const_for_fn/could_be_const.rs:122:9
160+
--> tests/ui/missing_const_for_fn/could_be_const.rs:117:1
161+
|
162+
LL | fn d(this: D) {}
163+
| ^^^^^^^^^^^^^^^^
164+
165+
error: this could be a `const fn`
166+
--> tests/ui/missing_const_for_fn/could_be_const.rs:125:9
161167
|
162168
LL | / fn deref_ptr_can_be_const(self) -> usize {
163169
LL | |
@@ -171,7 +177,7 @@ LL | const fn deref_ptr_can_be_const(self) -> usize {
171177
| +++++
172178

173179
error: this could be a `const fn`
174-
--> tests/ui/missing_const_for_fn/could_be_const.rs:127:9
180+
--> tests/ui/missing_const_for_fn/could_be_const.rs:130:9
175181
|
176182
LL | / fn deref_copied_val(self) -> usize {
177183
LL | |
@@ -185,7 +191,7 @@ LL | const fn deref_copied_val(self) -> usize {
185191
| +++++
186192

187193
error: this could be a `const fn`
188-
--> tests/ui/missing_const_for_fn/could_be_const.rs:138:5
194+
--> tests/ui/missing_const_for_fn/could_be_const.rs:141:5
189195
|
190196
LL | / fn union_access_can_be_const() {
191197
LL | |
@@ -200,7 +206,7 @@ LL | const fn union_access_can_be_const() {
200206
| +++++
201207

202208
error: this could be a `const fn`
203-
--> tests/ui/missing_const_for_fn/could_be_const.rs:152:9
209+
--> tests/ui/missing_const_for_fn/could_be_const.rs:155:9
204210
|
205211
LL | / pub fn new(strings: Vec<String>) -> Self {
206212
LL | | Self { strings }
@@ -213,7 +219,7 @@ LL | pub const fn new(strings: Vec<String>) -> Self {
213219
| +++++
214220

215221
error: this could be a `const fn`
216-
--> tests/ui/missing_const_for_fn/could_be_const.rs:157:9
222+
--> tests/ui/missing_const_for_fn/could_be_const.rs:160:9
217223
|
218224
LL | / pub fn empty() -> Self {
219225
LL | | Self { strings: Vec::new() }
@@ -226,7 +232,7 @@ LL | pub const fn empty() -> Self {
226232
| +++++
227233

228234
error: this could be a `const fn`
229-
--> tests/ui/missing_const_for_fn/could_be_const.rs:168:9
235+
--> tests/ui/missing_const_for_fn/could_be_const.rs:171:9
230236
|
231237
LL | / pub fn new(text: String) -> Self {
232238
LL | | let vec = Vec::new();
@@ -239,5 +245,5 @@ help: make the function `const`
239245
LL | pub const fn new(text: String) -> Self {
240246
| +++++
241247

242-
error: aborting due to 17 previous errors
248+
error: aborting due to 18 previous errors
243249

0 commit comments

Comments
 (0)