Skip to content

Commit 574bee3

Browse files
committed
Taking review hints into account.
1 parent bfcd191 commit 574bee3

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
866866
return false;
867867
}
868868

869-
// This is a quick fix to resolve an ICE ([issue#96223](https://github.com/rust-lang/rust/issues/96223)).
869+
// This is a quick fix to resolve an ICE (#96223).
870870
// This change should probably be deeper.
871871
// As suggested by @jackh726, `mk_trait_obligation_with_new_self_ty` could take a `Binder<(TraitRef, Ty)>
872872
// instead of `Binder<Ty>` leading to some changes to its call places.

src/test/ui/suggestions/issue-96223.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// Test case for #96223.
2-
// An ICE was triggered because of a failed assertion.
3-
// Thanks to @Manishearth for the minimal test case.
1+
// Previously ICEd because we didn't properly track binders in suggestions
2+
// check-fail
43

54
pub trait Foo<'de>: Sized {}
65

@@ -47,7 +46,7 @@ fn icey_bounds<D: Dummy<EmptyMarker>>(p: &D) {}
4746

4847
fn trigger_ice() {
4948
let p = Empty;
50-
icey_bounds(&p); //~ERROR
49+
icey_bounds(&p); //~ERROR the trait bound
5150
}
5251

5352
fn main() {}

src/test/ui/suggestions/issue-96223.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `for<'de> EmptyBis<'de>: Foo<'_>` is not satisfied
2-
--> $DIR/issue-96223.rs:50:17
2+
--> $DIR/issue-96223.rs:49:17
33
|
44
LL | icey_bounds(&p);
55
| ----------- ^^ the trait `for<'de> Foo<'_>` is not implemented for `EmptyBis<'de>`
@@ -8,17 +8,17 @@ LL | icey_bounds(&p);
88
|
99
= help: the trait `Foo<'de>` is implemented for `Baz<T>`
1010
note: required because of the requirements on the impl of `for<'de> Foo<'de>` for `Baz<EmptyBis<'de>>`
11-
--> $DIR/issue-96223.rs:17:14
11+
--> $DIR/issue-96223.rs:16:14
1212
|
1313
LL | impl<'de, T> Foo<'de> for Baz<T> where T: Foo<'de> {}
1414
| ^^^^^^^^ ^^^^^^
1515
note: required because of the requirements on the impl of `Dummy<EmptyMarker>` for `Empty`
16-
--> $DIR/issue-96223.rs:21:9
16+
--> $DIR/issue-96223.rs:20:9
1717
|
1818
LL | impl<M> Dummy<M> for Empty
1919
| ^^^^^^^^ ^^^^^
2020
note: required by a bound in `icey_bounds`
21-
--> $DIR/issue-96223.rs:46:19
21+
--> $DIR/issue-96223.rs:45:19
2222
|
2323
LL | fn icey_bounds<D: Dummy<EmptyMarker>>(p: &D) {}
2424
| ^^^^^^^^^^^^^^^^^^ required by this bound in `icey_bounds`

0 commit comments

Comments
 (0)