Skip to content

Commit 53c5310

Browse files
More work
1 parent 729ee29 commit 53c5310

File tree

61 files changed

+184
-163
lines changed

Some content is hidden

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

61 files changed

+184
-163
lines changed

compiler/rustc_hir_analysis/src/astconv/bounds.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,13 @@ 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+
// This predicate may have escaping bound vars,
130+
// e.g. if we have `for<'a: 'a> ..`.
131+
let pred = ty::Binder::bind_with_vars(
132+
ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate(r1, r2)),
133+
ty::List::empty(),
134+
)
135+
.to_predicate(self.tcx());
131136
(pred, span)
132137
}))
133138
}
@@ -715,7 +720,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
715720
ast_bounds.iter(),
716721
bounds,
717722
projection_ty.bound_vars(),
718-
projection_ty.skip_binder_predicates(),
723+
projection_ty.skip_binder_with_predicates().1,
719724
only_self_bounds,
720725
);
721726
}

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::LateBoundRegionConversionTime::FnCall,
857858
poly_trait_ref,

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::infer::CombinedSnapshot;
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.delay_span_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/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub use self::SubregionOrigin::*;
77
pub use self::ValuePairs::*;
88
pub use combine::ObligationEmittingRelation;
99
use rustc_data_structures::undo_log::UndoLogs;
10+
use rustc_span::DUMMY_SP;
1011

1112
use self::opaque_types::OpaqueTypeStorage;
1213
pub(crate) use self::undo_log::{InferCtxtUndoLogs, Snapshot, UndoLog};
@@ -1446,7 +1447,11 @@ impl<'tcx> InferCtxt<'tcx> {
14461447
where
14471448
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
14481449
{
1449-
assert_eq!(value.skip_binder_predicates(), ty::List::empty());
1450+
if !value.skip_binder_with_predicates().1.is_empty() {
1451+
self.tcx
1452+
.sess
1453+
.delay_span_bug(DUMMY_SP, "binder instantiated with infer ignoring predicates");
1454+
}
14501455

14511456
if let Some(inner) = value.no_bound_vars() {
14521457
return inner;

compiler/rustc_infer/src/infer/nll_relate/mod.rs

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

268268
if let Some(inner) = binder.no_bound_vars() {
269269
return inner;
@@ -313,7 +313,7 @@ where
313313
where
314314
T: ty::TypeFoldable<TyCtxt<'tcx>> + Copy,
315315
{
316-
assert_eq!(binder.skip_binder_predicates(), ty::List::empty());
316+
assert_eq!(binder.skip_binder_with_predicates().1, ty::List::empty());
317317

318318
if let Some(inner) = binder.no_bound_vars() {
319319
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/context.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,7 @@ nop_lift! {predicate; Predicate<'a> => Predicate<'tcx>}
12901290
nop_lift! {predicate; Clause<'a> => Clause<'tcx>}
12911291

12921292
nop_list_lift! {type_lists; Ty<'a> => Ty<'tcx>}
1293+
nop_list_lift! {clauses; Clause<'a> => Clause<'tcx>}
12931294
nop_list_lift! {poly_existential_predicates; PolyExistentialPredicate<'a> => PolyExistentialPredicate<'tcx>}
12941295
nop_list_lift! {bound_variable_kinds; ty::BoundVariableKind => ty::BoundVariableKind}
12951296

compiler/rustc_middle/src/ty/fold.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,7 @@ impl<'tcx> TyCtxt<'tcx> {
322322
value: Binder<'tcx, T>,
323323
delegate: impl BoundVarReplacerDelegate<'tcx>,
324324
) -> (T, &'tcx ty::List<ty::Clause<'tcx>>) {
325-
let preds = value.skip_binder_predicates();
326-
self.replace_escaping_bound_vars_uncached((value.skip_binder(), preds), delegate)
325+
self.replace_escaping_bound_vars_uncached(value.skip_binder_with_predicates(), delegate)
327326
}
328327

329328
/// 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
@@ -823,7 +823,7 @@ impl<'tcx> Clause<'tcx> {
823823
// 1) Self: Bar1<'a, '^0.0> -> Self: Bar1<'a, '^0.1>
824824
let (shifted_pred, shifted_bound_clauses) = tcx.shift_bound_var_indices(
825825
trait_bound_vars.len(),
826-
(bound_pred.skip_binder(), bound_pred.skip_binder_predicates()),
826+
bound_pred.skip_binder_with_predicates(),
827827
);
828828
// 2) Self: Bar1<'a, '^0.1> -> T: Bar1<'^0.0, '^0.1>
829829
let new = EarlyBinder::bind(shifted_pred).instantiate(tcx, trait_ref.skip_binder().args);
@@ -832,7 +832,7 @@ impl<'tcx> Clause<'tcx> {
832832
tcx.mk_bound_variable_kinds_from_iter(trait_bound_vars.iter().chain(pred_bound_vars));
833833

834834
let binder_predicates = tcx.mk_clauses_from_iter(
835-
trait_ref.skip_binder_predicates().into_iter().chain(shifted_bound_clauses),
835+
trait_ref.skip_binder_with_predicates().1.into_iter().chain(shifted_bound_clauses),
836836
);
837837

838838
// 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
@@ -585,7 +585,9 @@ impl<'tcx, T: TypeFoldable<TyCtxt<'tcx>>> TypeSuperFoldable<TyCtxt<'tcx>> for ty
585585
self,
586586
folder: &mut F,
587587
) -> Result<Self, F::Error> {
588-
self.try_map_bound(|ty| ty.try_fold_with(folder))
588+
let bound_vars = self.bound_vars();
589+
let (value, bound_predicates) = self.skip_binder_with_predicates().try_fold_with(folder)?;
590+
Ok(ty::Binder::bind_with_vars_and_predicates(value, bound_vars, bound_predicates))
589591
}
590592
}
591593

@@ -596,7 +598,9 @@ impl<'tcx, T: TypeVisitable<TyCtxt<'tcx>>> TypeSuperVisitable<TyCtxt<'tcx>>
596598
&self,
597599
visitor: &mut V,
598600
) -> ControlFlow<V::BreakTy> {
599-
self.as_ref().skip_binder().visit_with(visitor)
601+
let (val, predicates) = self.as_ref().skip_binder_with_predicates();
602+
val.visit_with(visitor)?;
603+
predicates.visit_with(visitor)
600604
}
601605
}
602606

compiler/rustc_middle/src/ty/sty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,8 @@ where
10431043
}
10441044

10451045
impl<'tcx, T> Binder<'tcx, T> {
1046-
pub fn skip_binder_predicates(&self) -> &'tcx List<ty::Clause<'tcx>> {
1047-
self.bound_predicates
1046+
pub fn skip_binder_with_predicates(self) -> (T, &'tcx List<ty::Clause<'tcx>>) {
1047+
(self.value, self.bound_predicates)
10481048
}
10491049

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

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: -Ztrait-solver=next
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: -Ztrait-solver=next
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)