Skip to content

Commit 82ae54c

Browse files
More work
1 parent a64db44 commit 82ae54c

File tree

62 files changed

+189
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+189
-169
lines changed

compiler/rustc_hir_analysis/src/astconv/bounds.rs

+12-3
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,17 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
126126
}
127127
_ => bug!(),
128128
};
129-
let pred = ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate(r1, r2))
130-
.to_predicate(self.tcx());
129+
let pred = ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate(r1, r2));
130+
// This predicate may have escaping bound vars, e.g. if
131+
// we have `for<'a: 'a> ..`. Since outlives predicates
132+
// don't implicitly have a binder added for them in
133+
// resolve_bound_vars, we need to explicitly shift the
134+
// vars in once here.
135+
let pred = ty::Binder::bind_with_vars(
136+
ty::fold::shift_vars(self.tcx(), pred, 1),
137+
ty::List::empty(),
138+
)
139+
.to_predicate(self.tcx());
131140
(pred, span)
132141
}))
133142
}
@@ -641,7 +650,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
641650
ast_bounds.iter(),
642651
bounds,
643652
projection_ty.bound_vars(),
644-
projection_ty.skip_binder_predicates(),
653+
projection_ty.skip_binder_with_predicates().1,
645654
only_self_bounds,
646655
);
647656
}

compiler/rustc_hir_typeck/src/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub(super) fn check_fn<'a, 'tcx>(
6767
fcx.require_type_is_sized(yield_ty, span, traits::SizedYieldType);
6868
yield_ty
6969
}
70-
// HACK(-Ztrait-solver=next): In the *old* trait solver, we must eagerly
70+
// HACK(-Znext-solver): In the *old* trait solver, we must eagerly
7171
// guide inference on the yield type so that we can handle `AsyncIterator`
7272
// in this block in projection correctly. In the new trait solver, it is
7373
// not a problem.

compiler/rustc_hir_typeck/src/method/probe.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
851851
});
852852

853853
self.elaborate_bounds(bounds, |this, poly_trait_ref, item| {
854-
let trait_ref = this.instantiate_binder_with_fresh_vars(
854+
// FIXME(non_lifetime_binders): We could check these predicates hold.
855+
let (trait_ref, _) = this.instantiate_binder_and_predicates_with_fresh_vars(
855856
this.span,
856857
infer::BoundRegionConversionTime::FnCall,
857858
poly_trait_ref,

compiler/rustc_infer/src/infer/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,11 @@ impl<'tcx> InferCtxt<'tcx> {
14701470
where
14711471
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
14721472
{
1473-
assert_eq!(value.skip_binder_predicates(), ty::List::empty());
1473+
if !value.skip_binder_with_predicates().1.is_empty() {
1474+
self.tcx
1475+
.sess
1476+
.span_delayed_bug(DUMMY_SP, "binder instantiated with infer ignoring predicates");
1477+
}
14741478

14751479
if let Some(inner) = value.no_bound_vars() {
14761480
return inner;

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::infer::{HigherRankedType, InferCtxt};
77
use rustc_middle::ty::fold::FnMutDelegate;
88
use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation};
99
use rustc_middle::ty::{self, Binder, Ty, TyCtxt, TypeFoldable};
10+
use rustc_span::DUMMY_SP;
1011

1112
impl<'a, 'tcx> CombineFields<'a, 'tcx> {
1213
/// Checks whether `for<..> sub <: for<..> sup` holds.
@@ -74,7 +75,12 @@ impl<'tcx> InferCtxt<'tcx> {
7475
where
7576
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
7677
{
77-
assert_eq!(binder.skip_binder_predicates(), ty::List::empty());
78+
if !binder.skip_binder_with_predicates().1.is_empty() {
79+
self.tcx.sess.span_delayed_bug(
80+
DUMMY_SP,
81+
"binder instantiated with placeholders ignoring predicates",
82+
);
83+
}
7884

7985
if let Some(inner) = binder.no_bound_vars() {
8086
return inner;

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ where
266266
where
267267
T: ty::TypeFoldable<TyCtxt<'tcx>> + Copy,
268268
{
269-
assert_eq!(binder.skip_binder_predicates(), ty::List::empty());
269+
assert_eq!(binder.skip_binder_with_predicates().1, ty::List::empty());
270270

271271
if let Some(inner) = binder.no_bound_vars() {
272272
return inner;
@@ -316,7 +316,7 @@ where
316316
where
317317
T: ty::TypeFoldable<TyCtxt<'tcx>> + Copy,
318318
{
319-
assert_eq!(binder.skip_binder_predicates(), ty::List::empty());
319+
assert_eq!(binder.skip_binder_with_predicates().1, ty::List::empty());
320320

321321
if let Some(inner) = binder.no_bound_vars() {
322322
return inner;

compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound {
7777
for (pred, pred_span) in
7878
cx.tcx.explicit_item_bounds(def_id).instantiate_identity_iter_copied()
7979
{
80-
let predicate = infcx.instantiate_binder_with_placeholders(pred.kind());
80+
// FIXME(non_lifetime_binders): We could assume the predicates in this binder.
81+
let (predicate, _) =
82+
infcx.instantiate_binder_and_assumptions_with_placeholders(pred.kind());
8183
let ty::ClauseKind::Projection(proj) = predicate else {
8284
continue;
8385
};

compiler/rustc_middle/src/ty/fold.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,7 @@ impl<'tcx> TyCtxt<'tcx> {
320320
value: Binder<'tcx, T>,
321321
delegate: impl BoundVarReplacerDelegate<'tcx>,
322322
) -> (T, &'tcx ty::List<ty::Clause<'tcx>>) {
323-
let preds = value.skip_binder_predicates();
324-
self.replace_escaping_bound_vars_uncached((value.skip_binder(), preds), delegate)
323+
self.replace_escaping_bound_vars_uncached(value.skip_binder_with_predicates(), delegate)
325324
}
326325

327326
/// Replaces any late-bound regions bound in `value` with

compiler/rustc_middle/src/ty/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ impl<'tcx> Clause<'tcx> {
749749
// 1) Self: Bar1<'a, '^0.0> -> Self: Bar1<'a, '^0.1>
750750
let (shifted_pred, shifted_bound_clauses) = tcx.shift_bound_var_indices(
751751
trait_bound_vars.len(),
752-
(bound_pred.skip_binder(), bound_pred.skip_binder_predicates()),
752+
bound_pred.skip_binder_with_predicates(),
753753
);
754754
// 2) Self: Bar1<'a, '^0.1> -> T: Bar1<'^0.0, '^0.1>
755755
let new = EarlyBinder::bind(shifted_pred).instantiate(tcx, trait_ref.skip_binder().args);
@@ -758,7 +758,7 @@ impl<'tcx> Clause<'tcx> {
758758
tcx.mk_bound_variable_kinds_from_iter(trait_bound_vars.iter().chain(pred_bound_vars));
759759

760760
let binder_predicates = tcx.mk_clauses_from_iter(
761-
trait_ref.skip_binder_predicates().into_iter().chain(shifted_bound_clauses),
761+
trait_ref.skip_binder_with_predicates().1.into_iter().chain(shifted_bound_clauses),
762762
);
763763

764764
// FIXME: Is it really perf sensitive to use reuse_or_mk_predicate here?

compiler/rustc_middle/src/ty/structural_impls.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,9 @@ impl<'tcx, T: TypeFoldable<TyCtxt<'tcx>>> TypeSuperFoldable<TyCtxt<'tcx>> for ty
509509
self,
510510
folder: &mut F,
511511
) -> Result<Self, F::Error> {
512-
self.try_map_bound(|ty| ty.try_fold_with(folder))
512+
let bound_vars = self.bound_vars();
513+
let (value, bound_predicates) = self.skip_binder_with_predicates().try_fold_with(folder)?;
514+
Ok(ty::Binder::bind_with_vars_and_predicates(value, bound_vars, bound_predicates))
513515
}
514516
}
515517

@@ -520,7 +522,9 @@ impl<'tcx, T: TypeVisitable<TyCtxt<'tcx>>> TypeSuperVisitable<TyCtxt<'tcx>>
520522
&self,
521523
visitor: &mut V,
522524
) -> ControlFlow<V::BreakTy> {
523-
self.as_ref().skip_binder().visit_with(visitor)
525+
let (val, predicates) = self.as_ref().skip_binder_with_predicates();
526+
val.visit_with(visitor)?;
527+
predicates.visit_with(visitor)
524528
}
525529
}
526530

compiler/rustc_middle/src/ty/sty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1034,8 +1034,8 @@ where
10341034
}
10351035

10361036
impl<'tcx, T> Binder<'tcx, T> {
1037-
pub fn skip_binder_predicates(&self) -> &'tcx List<ty::Clause<'tcx>> {
1038-
self.bound_predicates
1037+
pub fn skip_binder_with_predicates(self) -> (T, &'tcx List<ty::Clause<'tcx>>) {
1038+
(self.value, self.bound_predicates)
10391039
}
10401040

10411041
/// Skips the binder and returns the "bound" value. This is a

tests/ui/impl-trait/equality-in-canonical-query.clone.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ error: internal compiler error: {OpaqueTypeKey { def_id: DefId(rpit::{opaque#0})
55
=
66

77

8-
error: internal compiler error: error performing ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: ProvePredicate { predicate: Binder { value: ProjectionPredicate(AliasTy { args: [FnDef(DefId(rpit), []), ()], def_id: DefId(ops::function::FnOnce::Output) }, Term::Ty(Alias(Opaque, AliasTy { args: [], def_id: DefId(foo::{opaque#0}) }))), bound_vars: [] } } }
8+
error: internal compiler error: error performing ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: ProvePredicate { predicate: Binder { value: ProjectionPredicate(AliasTy { args: [FnDef(DefId(rpit), []), ()], def_id: DefId(ops::function::FnOnce::Output) }, Term::Ty(Alias(Opaque, AliasTy { args: [], def_id: DefId(foo::{opaque#0}) }))), bound_vars: [], bound_predicates: [] } } }
99
--> $DIR/equality-in-canonical-query.rs:19:5
1010
|
1111
LL | same_output(foo, rpit);

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(_ZN5basic4main17h9308686d0228fa1dE)
1+
error: symbol-name(_ZN5basic4main17h96b56acaf300ea6eE)
22
--> $DIR/basic.rs:8:1
33
|
44
LL | #[rustc_symbol_name]
55
| ^^^^^^^^^^^^^^^^^^^^
66

7-
error: demangling(basic::main::h9308686d0228fa1d)
7+
error: demangling(basic::main::h96b56acaf300ea6e)
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$3foo17h84ab5dafbd2a1508E)
1+
error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h46eaa20e0d673fbeE)
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::h84ab5dafbd2a1508)
7+
error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::h46eaa20e0d673fbe)
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: [], bound_predicates: [] }) = 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: [], bound_predicates: [] }) = 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: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
61+
//~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = 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: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
65+
//~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = 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: [], bound_predicates: [] }) = 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: [], bound_predicates: [] }) = 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: [], bound_predicates: [] }) = 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: [], bound_predicates: [] }) = 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

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ 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)
11-
//~| 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: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
11+
//~| ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
1212

1313
test::<MaskedStorage<GenericComp2<Pos>>>(make());
14-
//~^ ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
15-
//~| ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
14+
//~^ ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOkModuloRegions)
15+
//~| ERROR evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOkModuloRegions)
1616
}
1717

1818
#[rustc_evaluate_where_clauses]

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

+4-4
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: [], bound_predicates: [] }) = 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<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: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
1111
--> $DIR/issue-85360-eval-obligation-ice.rs:9:5
1212
|
1313
LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
@@ -16,7 +16,7 @@ LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
1616
LL | fn test<T: Sized>(_: T) {}
1717
| ----- predicate
1818

19-
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
19+
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOkModuloRegions)
2020
--> $DIR/issue-85360-eval-obligation-ice.rs:13:5
2121
|
2222
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
@@ -25,7 +25,7 @@ LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
2525
LL | fn test<T: Sized>(_: T) {}
2626
| - predicate
2727

28-
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
28+
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOkModuloRegions)
2929
--> $DIR/issue-85360-eval-obligation-ice.rs:13:5
3030
|
3131
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());

tests/ui/traits/non_lifetime_binders/bad-copy-cond.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// compile-flags: -Znext-solver
2+
13
#![feature(non_lifetime_binders)]
24
//~^ WARN the feature `non_lifetime_binders` is incomplete
35

tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/bad-copy-cond.rs:1:12
2+
--> $DIR/bad-copy-cond.rs:3:12
33
|
44
LL | #![feature(non_lifetime_binders)]
55
| ^^^^^^^^^^^^^^^^^^^^
@@ -8,13 +8,13 @@ LL | #![feature(non_lifetime_binders)]
88
= note: `#[warn(incomplete_features)]` on by default
99

1010
error[E0277]: the trait bound `T: Copy` is not satisfied
11-
--> $DIR/bad-copy-cond.rs:7:5
11+
--> $DIR/bad-copy-cond.rs:9:5
1212
|
1313
LL | foo();
1414
| ^^^ the trait `Copy` is not implemented for `T`
1515
|
1616
note: required by a bound in `foo`
17-
--> $DIR/bad-copy-cond.rs:4:26
17+
--> $DIR/bad-copy-cond.rs:6:26
1818
|
1919
LL | fn foo() where for<T> T: Copy {}
2020
| ^^^^ required by this bound in `foo`

tests/ui/traits/non_lifetime_binders/bad-sized-cond.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// compile-flags: -Znext-solver
2+
13
#![feature(non_lifetime_binders)]
24
//~^ WARN is incomplete and may not be safe
35

@@ -15,9 +17,7 @@ where
1517

1618
fn main() {
1719
foo();
18-
//~^ ERROR the size for values of type `V` cannot be known at compilation time
1920

2021
bar();
21-
//~^ ERROR the size for values of type `V` cannot be known at compilation time
22-
//~| ERROR `V` is not an iterator
22+
//~^ ERROR the trait bound `V: IntoIterator` is not satisfied
2323
}

0 commit comments

Comments
 (0)