Skip to content

Commit fbb9f1c

Browse files
committed
finishing touches, move fixed ICEs to ui tests
1 parent ed63508 commit fbb9f1c

19 files changed

+182
-65
lines changed

compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ where
877877

878878
let mut first_non_maybe = None;
879879
let mut non_maybe_count = 0;
880-
for ty in types {
880+
for ty in types.iter() {
881881
if !matches!(ty::EffectKind::try_from_ty(cx, ty), Some(ty::EffectKind::Maybe)) {
882882
first_non_maybe.get_or_insert(ty);
883883
non_maybe_count += 1;
@@ -902,7 +902,7 @@ where
902902
_ => {
903903
let mut min = ty::EffectKind::Maybe;
904904

905-
for ty in types {
905+
for ty in types.iter() {
906906
let Some(kind) = ty::EffectKind::try_from_ty(cx, ty) else {
907907
return Err(NoSolution);
908908
};

compiler/rustc_next_trait_solver/src/solve/trait_goals.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ where
717717

718718
let cx = ecx.cx();
719719
let maybe_count = types
720-
.into_iter()
720+
.iter()
721721
.filter_map(|ty| ty::EffectKind::try_from_ty(cx, ty))
722722
.filter(|&ty| ty == ty::EffectKind::Maybe)
723723
.count();
@@ -727,7 +727,7 @@ where
727727
if types.len() - maybe_count > 1 {
728728
let mut min = ty::EffectKind::Maybe;
729729

730-
for ty in types {
730+
for ty in types.iter() {
731731
let Some(kind) = ty::EffectKind::try_from_ty(ecx.cx(), ty) else {
732732
return Err(NoSolution);
733733
};

src/tools/clippy/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);

src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ LL | | }
103103
| |_^
104104

105105
error: this could be a `const fn`
106-
--> tests/ui/missing_const_for_fn/could_be_const.rs:122:9
106+
--> tests/ui/missing_const_for_fn/could_be_const.rs:117:1
107+
|
108+
LL | fn d(this: D) {}
109+
| ^^^^^^^^^^^^^^^^
110+
111+
error: this could be a `const fn`
112+
--> tests/ui/missing_const_for_fn/could_be_const.rs:125:9
107113
|
108114
LL | / fn deref_ptr_can_be_const(self) -> usize {
109115
LL | |
@@ -112,7 +118,7 @@ LL | | }
112118
| |_________^
113119

114120
error: this could be a `const fn`
115-
--> tests/ui/missing_const_for_fn/could_be_const.rs:127:9
121+
--> tests/ui/missing_const_for_fn/could_be_const.rs:130:9
116122
|
117123
LL | / fn deref_copied_val(self) -> usize {
118124
LL | |
@@ -121,7 +127,7 @@ LL | | }
121127
| |_________^
122128

123129
error: this could be a `const fn`
124-
--> tests/ui/missing_const_for_fn/could_be_const.rs:138:5
130+
--> tests/ui/missing_const_for_fn/could_be_const.rs:141:5
125131
|
126132
LL | / fn union_access_can_be_const() {
127133
LL | |
@@ -131,29 +137,29 @@ LL | | }
131137
| |_____^
132138

133139
error: this could be a `const fn`
134-
--> tests/ui/missing_const_for_fn/could_be_const.rs:152:9
140+
--> tests/ui/missing_const_for_fn/could_be_const.rs:155:9
135141
|
136142
LL | / pub fn new(strings: Vec<String>) -> Self {
137143
LL | | Self { strings }
138144
LL | | }
139145
| |_________^
140146

141147
error: this could be a `const fn`
142-
--> tests/ui/missing_const_for_fn/could_be_const.rs:157:9
148+
--> tests/ui/missing_const_for_fn/could_be_const.rs:160:9
143149
|
144150
LL | / pub fn empty() -> Self {
145151
LL | | Self { strings: Vec::new() }
146152
LL | | }
147153
| |_________^
148154

149155
error: this could be a `const fn`
150-
--> tests/ui/missing_const_for_fn/could_be_const.rs:168:9
156+
--> tests/ui/missing_const_for_fn/could_be_const.rs:171:9
151157
|
152158
LL | / pub fn new(text: String) -> Self {
153159
LL | | let vec = Vec::new();
154160
LL | | Self { text, vec }
155161
LL | | }
156162
| |_________^
157163

158-
error: aborting due to 17 previous errors
164+
error: aborting due to 18 previous errors
159165

tests/crashes/119717.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/crashes/123664.rs

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/crashes/124857.rs

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/crashes/126148.rs

Lines changed: 0 additions & 23 deletions
This file was deleted.

tests/rustdoc/rfc-2632-const-trait-impl.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
//
99
// FIXME(effects) add `const_trait` to `Fn` so we use `~const`
1010
// FIXME(effects) restore `const_trait` to `Destruct`
11-
#![feature(const_trait_impl)]
11+
#![allow(incomplete_features)]
12+
#![feature(const_trait_impl, effects)]
1213
#![crate_name = "foo"]
1314

1415
use std::marker::Destruct;

tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-1.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `Trait::{synthetic#0}: Compat` is not satisfied
2-
--> $DIR/assoc-type-const-bound-usage-1.rs:16:44
2+
--> $DIR/assoc-type-const-bound-usage-1.rs:15:44
33
|
44
LL | fn unqualified<T: const Trait>() -> Type<{ T::Assoc::func() }> {
55
| ^^^^^^^^ the trait `Compat` is not implemented for `Trait::{synthetic#0}`
66
|
77
note: required by a bound in `Trait::func`
8-
--> $DIR/assoc-type-const-bound-usage-1.rs:8:1
8+
--> $DIR/assoc-type-const-bound-usage-1.rs:7:1
99
|
1010
LL | #[const_trait]
1111
| ^^^^^^^^^^^^^^ required by this bound in `Trait::func`
@@ -14,13 +14,13 @@ LL | fn func() -> i32;
1414
| ---- required by a bound in this associated function
1515

1616
error[E0277]: the trait bound `Trait::{synthetic#0}: Compat` is not satisfied
17-
--> $DIR/assoc-type-const-bound-usage-1.rs:20:42
17+
--> $DIR/assoc-type-const-bound-usage-1.rs:19:42
1818
|
1919
LL | fn qualified<T: const Trait>() -> Type<{ <T as Trait>::Assoc::func() }> {
2020
| ^^^^^^^^^^^^^^^^^^^ the trait `Compat` is not implemented for `Trait::{synthetic#0}`
2121
|
2222
note: required by a bound in `Trait::func`
23-
--> $DIR/assoc-type-const-bound-usage-1.rs:8:1
23+
--> $DIR/assoc-type-const-bound-usage-1.rs:7:1
2424
|
2525
LL | #[const_trait]
2626
| ^^^^^^^^^^^^^^ required by this bound in `Trait::func`

0 commit comments

Comments
 (0)