Skip to content

Commit a16ef16

Browse files
Bless tests
1 parent 69d0dca commit a16ef16

23 files changed

+82
-80
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs

+19-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
3838
match param.kind {
3939
hir::GenericParamKind::Lifetime { .. } => (),
4040
hir::GenericParamKind::Type { .. } => {
41-
// TODO:
41+
// We shift the predicate by one because for a non-lifetime binder like,
42+
// `for<T> T: Trait`, we start out with a `T` with a debruijn index of `N`,
43+
// but we need to shift it to be `N + 1` when we construct a clause below.
4244
let param_ty = ty::shift_vars(self.tcx(), self.lower_ty_param(param.hir_id), 1);
4345
let mut bounds = Vec::new();
4446
// Params are implicitly sized unless a `?Sized` bound is found
@@ -57,10 +59,22 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
5759
let param_def_id = param.def_id.to_def_id();
5860
let ct_ty = tcx.type_of(param_def_id).instantiate_identity();
5961
let ct = self.lower_const_param(param_def_id, param.hir_id);
60-
predicates.insert((
61-
ty::ClauseKind::ConstArgHasType(ct, ct_ty).upcast(tcx),
62-
param.span,
63-
));
62+
if let ty::ConstKind::Bound(..) = ct.kind() {
63+
// We don't allow const params in non-lifetime binders today.
64+
tcx.dcx().span_delayed_bug(
65+
tcx.def_span(param_def_id),
66+
"const param in non-lifetime binder not allowed",
67+
);
68+
} else {
69+
predicates.insert((
70+
ty::Binder::bind_with_vars(
71+
ty::ClauseKind::ConstArgHasType(ct, ct_ty),
72+
ty::List::empty(),
73+
)
74+
.upcast(tcx),
75+
param.span,
76+
));
77+
}
6478
}
6579
}
6680
}

compiler/rustc_infer/src/infer/relate/higher_ranked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl<'tcx> InferCtxt<'tcx> {
7272

7373
let next_universe = self.create_next_universe();
7474

75-
// TODO: Deduplicate this with above.
75+
// FIXME(non_lifetime_binders): Deduplicate this with above.
7676
let delegate = FnMutDelegate {
7777
regions: &mut |br: ty::BoundRegion| {
7878
ty::Region::new_placeholder(

compiler/rustc_middle/src/ty/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,10 @@ impl<'tcx> ParamEnv<'tcx> {
10001000
ParamEnvAnd { param_env: self, value }
10011001
}
10021002

1003-
/// TODO:
1003+
/// Creates a new param-env by augmenting the previous param-env with more predicates.
1004+
///
1005+
/// N.B. this method does not elaborate the assumptions, and you probably should do that.
1006+
// FIXME(non_lifetime_binders): We should elaborate these predicates somewhere.
10041007
pub fn extend(self, tcx: TyCtxt<'tcx>, assumptions: ty::Clauses<'tcx>) -> Self {
10051008
if assumptions.is_empty() {
10061009
self

tests/crashes/120033.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ pub struct Bar<T: ?AutoTrait> {}
99

1010
pub fn f<T1, T2>()
1111
where
12-
T1: for<T> Foo<usize, Bar = Bar<T>>,
13-
T2: for<L, T> Foo<usize, Bar<T> = T1::Bar<T>>,
12+
T1: for<T: ?Sized> Foo<usize, Bar = Bar<T>>,
13+
T2: for<L: ?Sized, T: ?Sized> Foo<usize, Bar<T> = T1::Bar<T>>,
1414
{}

tests/ui/attributes/dump-preds.stderr

+16-16
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,36 @@ error: rustc_dump_predicates
44
LL | trait Trait<T>: Iterator<Item: Copy>
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
8-
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
9-
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }
10-
= note: Binder { value: TraitPredicate(<std::string::String as std::convert::From<T>>, polarity:Positive), bound_vars: [] }
11-
= note: Binder { value: TraitPredicate(<Self as Trait<T>>, polarity:Positive), bound_vars: [] }
7+
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [], clauses: [] }
8+
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [], clauses: [] }
9+
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [], clauses: [] }
10+
= note: Binder { value: TraitPredicate(<std::string::String as std::convert::From<T>>, polarity:Positive), bound_vars: [], clauses: [] }
11+
= note: Binder { value: TraitPredicate(<Self as Trait<T>>, polarity:Positive), bound_vars: [], clauses: [] }
1212

1313
error: rustc_dump_predicates
1414
--> $DIR/dump-preds.rs:13:5
1515
|
1616
LL | type Assoc<P: Eq>: std::ops::Deref<Target = ()>
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818
|
19-
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
20-
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
21-
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }
22-
= note: Binder { value: TraitPredicate(<std::string::String as std::convert::From<T>>, polarity:Positive), bound_vars: [] }
23-
= note: Binder { value: TraitPredicate(<Self as Trait<T>>, polarity:Positive), bound_vars: [] }
24-
= note: Binder { value: TraitPredicate(<P as std::marker::Sized>, polarity:Positive), bound_vars: [] }
25-
= note: Binder { value: TraitPredicate(<P as std::cmp::Eq>, polarity:Positive), bound_vars: [] }
26-
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<()> as std::marker::Copy>, polarity:Positive), bound_vars: [] }
19+
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [], clauses: [] }
20+
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [], clauses: [] }
21+
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [], clauses: [] }
22+
= note: Binder { value: TraitPredicate(<std::string::String as std::convert::From<T>>, polarity:Positive), bound_vars: [], clauses: [] }
23+
= note: Binder { value: TraitPredicate(<Self as Trait<T>>, polarity:Positive), bound_vars: [], clauses: [] }
24+
= note: Binder { value: TraitPredicate(<P as std::marker::Sized>, polarity:Positive), bound_vars: [], clauses: [] }
25+
= note: Binder { value: TraitPredicate(<P as std::cmp::Eq>, polarity:Positive), bound_vars: [], clauses: [] }
26+
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<()> as std::marker::Copy>, polarity:Positive), bound_vars: [], clauses: [] }
2727

2828
error: rustc_dump_item_bounds
2929
--> $DIR/dump-preds.rs:13:5
3030
|
3131
LL | type Assoc<P: Eq>: std::ops::Deref<Target = ()>
3232
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3333
|
34-
= note: Binder { value: ProjectionPredicate(AliasTerm { args: [Alias(Projection, AliasTy { args: [Self/#0, T/#1, P/#2], def_id: DefId(..), .. })], def_id: DefId(..), .. }, Term::Ty(())), bound_vars: [] }
35-
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::ops::Deref>, polarity:Positive), bound_vars: [] }
36-
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::Sized>, polarity:Positive), bound_vars: [] }
34+
= note: Binder { value: ProjectionPredicate(AliasTerm { args: [Alias(Projection, AliasTy { args: [Self/#0, T/#1, P/#2], def_id: DefId(..), .. })], def_id: DefId(..), .. }, Term::Ty(())), bound_vars: [], clauses: [] }
35+
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::ops::Deref>, polarity:Positive), bound_vars: [], clauses: [] }
36+
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::Sized>, polarity:Positive), bound_vars: [], clauses: [] }
3737

3838
error: aborting due to 3 previous errors
3939

tests/ui/closures/binder/bounds-on-closure-type-binders.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ trait Trait {}
99
fn main() {
1010
// Regression test for issue #119067
1111
let _ = for<T: Trait> || -> () {};
12-
//~^ ERROR bounds cannot be used in this context
13-
//~| ERROR late-bound type parameter not allowed on closures
12+
//~^ ERROR late-bound type parameter not allowed on closures
1413
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
error: bounds cannot be used in this context
2-
--> $DIR/bounds-on-closure-type-binders.rs:11:20
3-
|
4-
LL | let _ = for<T: Trait> || -> () {};
5-
| ^^^^^
6-
71
error: late-bound type parameter not allowed on closures
82
--> $DIR/bounds-on-closure-type-binders.rs:11:17
93
|
104
LL | let _ = for<T: Trait> || -> () {};
115
| ^
126

13-
error: aborting due to 2 previous errors
7+
error: aborting due to 1 previous error
148

tests/ui/stats/input-stats.stderr

+11-11
Original file line numberDiff line numberDiff line change
@@ -143,36 +143,36 @@ hir-stats Attribute 128 ( 1.4%) 4 32
143143
hir-stats FieldDef 128 ( 1.4%) 2 64
144144
hir-stats GenericArgs 144 ( 1.6%) 3 48
145145
hir-stats Variant 144 ( 1.6%) 2 72
146-
hir-stats GenericBound 256 ( 2.9%) 4 64
147-
hir-stats - Trait 256 ( 2.9%) 4
148146
hir-stats Block 288 ( 3.2%) 6 48
147+
hir-stats GenericBound 320 ( 3.5%) 4 80
148+
hir-stats - Trait 320 ( 3.5%) 4
149149
hir-stats Pat 360 ( 4.0%) 5 72
150150
hir-stats - Struct 72 ( 0.8%) 1
151151
hir-stats - Wild 72 ( 0.8%) 1
152152
hir-stats - Binding 216 ( 2.4%) 3
153-
hir-stats GenericParam 400 ( 4.5%) 5 80
153+
hir-stats GenericParam 400 ( 4.4%) 5 80
154154
hir-stats Generics 560 ( 6.2%) 10 56
155155
hir-stats Ty 720 ( 8.0%) 15 48
156156
hir-stats - Ptr 48 ( 0.5%) 1
157157
hir-stats - Ref 48 ( 0.5%) 1
158-
hir-stats - Path 624 ( 7.0%) 13
159-
hir-stats Expr 768 ( 8.6%) 12 64
158+
hir-stats - Path 624 ( 6.9%) 13
159+
hir-stats Expr 768 ( 8.5%) 12 64
160160
hir-stats - InlineAsm 64 ( 0.7%) 1
161161
hir-stats - Match 64 ( 0.7%) 1
162162
hir-stats - Path 64 ( 0.7%) 1
163163
hir-stats - Struct 64 ( 0.7%) 1
164164
hir-stats - Lit 128 ( 1.4%) 2
165-
hir-stats - Block 384 ( 4.3%) 6
166-
hir-stats Item 968 (10.8%) 11 88
165+
hir-stats - Block 384 ( 4.2%) 6
166+
hir-stats Item 968 (10.7%) 11 88
167167
hir-stats - Enum 88 ( 1.0%) 1
168168
hir-stats - ExternCrate 88 ( 1.0%) 1
169169
hir-stats - ForeignMod 88 ( 1.0%) 1
170170
hir-stats - Impl 88 ( 1.0%) 1
171171
hir-stats - Trait 88 ( 1.0%) 1
172-
hir-stats - Fn 176 ( 2.0%) 2
172+
hir-stats - Fn 176 ( 1.9%) 2
173173
hir-stats - Use 352 ( 3.9%) 4
174-
hir-stats Path 1_240 (13.8%) 31 40
175-
hir-stats PathSegment 1_920 (21.4%) 40 48
174+
hir-stats Path 1_240 (13.7%) 31 40
175+
hir-stats PathSegment 1_920 (21.2%) 40 48
176176
hir-stats ----------------------------------------------------------------
177-
hir-stats Total 8_976 180
177+
hir-stats Total 9_040 180
178178
hir-stats

tests/ui/symbol-names/basic.legacy.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: symbol-name(_ZN5basic4main17hc88b9d80a69d119aE)
1+
error: symbol-name(_ZN5basic4main17h204cbd963724a7dbE)
22
--> $DIR/basic.rs:8:1
33
|
44
LL | #[rustc_symbol_name]
55
| ^^^^^^^^^^^^^^^^^^^^
66

7-
error: demangling(basic::main::hc88b9d80a69d119a)
7+
error: demangling(basic::main::h204cbd963724a7db)
88
--> $DIR/basic.rs:8:1
99
|
1010
LL | #[rustc_symbol_name]

tests/ui/symbol-names/issue-60925.legacy.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17hbddb77d6f71afb32E)
1+
error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17hcd02ed09e88bcb37E)
22
--> $DIR/issue-60925.rs:21:9
33
|
44
LL | #[rustc_symbol_name]
55
| ^^^^^^^^^^^^^^^^^^^^
66

7-
error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::hbddb77d6f71afb32)
7+
error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::hcd02ed09e88bcb37)
88
--> $DIR/issue-60925.rs:21:9
99
|
1010
LL | #[rustc_symbol_name]

tests/ui/traits/cache-reached-depth-ice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ fn test<X: ?Sized + Send>() {}
4141

4242
fn main() {
4343
test::<A>();
44-
//~^ ERROR evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
44+
//~^ ERROR evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOk)
4545
}

tests/ui/traits/cache-reached-depth-ice.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
1+
error: evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOk)
22
--> $DIR/cache-reached-depth-ice.rs:43:5
33
|
44
LL | fn test<X: ?Sized + Send>() {}

tests/ui/traits/issue-83538-tainted-cache-after-cycle.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ fn main() {
5757
// Key is that Vec<First> is "ok" and Third<'_, Ty> is "ok modulo regions":
5858

5959
forward();
60-
//~^ ERROR evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
61-
//~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
60+
//~^ ERROR evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOk)
61+
//~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOkModuloRegions)
6262

6363
reverse();
64-
//~^ ERROR evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
65-
//~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
64+
//~^ ERROR evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOk)
65+
//~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOkModuloRegions)
6666
}

tests/ui/traits/issue-83538-tainted-cache-after-cycle.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
1+
error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOk)
22
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:59:5
33
|
44
LL | Vec<First>: Unpin,
@@ -7,7 +7,7 @@ LL | Vec<First>: Unpin,
77
LL | forward();
88
| ^^^^^^^
99

10-
error: evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
10+
error: evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOkModuloRegions)
1111
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:59:5
1212
|
1313
LL | Third<'a, Ty>: Unpin,
@@ -16,7 +16,7 @@ LL | Third<'a, Ty>: Unpin,
1616
LL | forward();
1717
| ^^^^^^^
1818

19-
error: evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
19+
error: evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOkModuloRegions)
2020
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:63:5
2121
|
2222
LL | Third<'a, Ty>: Unpin,
@@ -25,7 +25,7 @@ LL | Third<'a, Ty>: Unpin,
2525
LL | reverse();
2626
| ^^^^^^^
2727

28-
error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
28+
error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOk)
2929
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:63:5
3030
|
3131
LL | Vec<First>: Unpin,

tests/ui/traits/issue-85360-eval-obligation-ice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ use core::marker::PhantomData;
77

88
fn main() {
99
test::<MaskedStorage<GenericComp<Pos>>>(make());
10-
//~^ ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
10+
//~^ ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOk)
1111

1212
test::<MaskedStorage<GenericComp2<Pos>>>(make());
13-
//~^ ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
13+
//~^ ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOkModuloRegions)
1414
}
1515

1616
#[rustc_evaluate_where_clauses]

tests/ui/traits/issue-85360-eval-obligation-ice.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
1+
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOk)
22
--> $DIR/issue-85360-eval-obligation-ice.rs:9:5
33
|
44
LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
@@ -7,7 +7,7 @@ LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
77
LL | fn test<T: Sized>(_: T) {}
88
| ----- predicate
99

10-
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
10+
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], clauses: [] }) = Ok(EvaluatedToOkModuloRegions)
1111
--> $DIR/issue-85360-eval-obligation-ice.rs:12:5
1212
|
1313
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ check-fail
1+
//@ check-pass
22

33
#![allow(incomplete_features)]
44
#![feature(non_lifetime_binders)]
@@ -8,7 +8,7 @@ trait Trait {}
88
trait Trait2
99
where
1010
for<T: Trait> ():,
11-
{ //~^ ERROR bounds cannot be used in this context
11+
{
1212
}
1313

1414
fn main() {}

tests/ui/traits/non_lifetime_binders/bounds-on-type-binders.stderr

-8
This file was deleted.

tests/ui/traits/non_lifetime_binders/unifying-placeholders-in-query-response.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ impl Foo<usize> for () {
1616

1717
pub fn f<T1, T2>(a: T1, b: T2)
1818
where
19-
T1: for<T> Foo<usize, Bar<T> = T>,
20-
T2: for<T> Foo<usize, Bar<T> = <T1 as Foo<usize>>::Bar<T>>,
19+
T1: for<T: ?Sized> Foo<usize, Bar<T> = T>,
20+
T2: for<T: ?Sized> Foo<usize, Bar<T> = <T1 as Foo<usize>>::Bar<T>>,
2121
{
2222
}
2323

0 commit comments

Comments
 (0)