Skip to content

Commit

Permalink
More work
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Dec 18, 2023
1 parent a64db44 commit 82ae54c
Show file tree
Hide file tree
Showing 62 changed files with 189 additions and 169 deletions.
15 changes: 12 additions & 3 deletions compiler/rustc_hir_analysis/src/astconv/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,17 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
}
_ => bug!(),
};
let pred = ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate(r1, r2))
.to_predicate(self.tcx());
let pred = ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate(r1, r2));
// This predicate may have escaping bound vars, e.g. if
// we have `for<'a: 'a> ..`. Since outlives predicates
// don't implicitly have a binder added for them in
// resolve_bound_vars, we need to explicitly shift the
// vars in once here.
let pred = ty::Binder::bind_with_vars(
ty::fold::shift_vars(self.tcx(), pred, 1),
ty::List::empty(),
)
.to_predicate(self.tcx());
(pred, span)
}))
}
Expand Down Expand Up @@ -641,7 +650,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
ast_bounds.iter(),
bounds,
projection_ty.bound_vars(),
projection_ty.skip_binder_predicates(),
projection_ty.skip_binder_with_predicates().1,
only_self_bounds,
);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub(super) fn check_fn<'a, 'tcx>(
fcx.require_type_is_sized(yield_ty, span, traits::SizedYieldType);
yield_ty
}
// HACK(-Ztrait-solver=next): In the *old* trait solver, we must eagerly
// HACK(-Znext-solver): In the *old* trait solver, we must eagerly
// guide inference on the yield type so that we can handle `AsyncIterator`
// in this block in projection correctly. In the new trait solver, it is
// not a problem.
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_hir_typeck/src/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,8 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
});

self.elaborate_bounds(bounds, |this, poly_trait_ref, item| {
let trait_ref = this.instantiate_binder_with_fresh_vars(
// FIXME(non_lifetime_binders): We could check these predicates hold.
let (trait_ref, _) = this.instantiate_binder_and_predicates_with_fresh_vars(
this.span,
infer::BoundRegionConversionTime::FnCall,
poly_trait_ref,
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,11 @@ impl<'tcx> InferCtxt<'tcx> {
where
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
{
assert_eq!(value.skip_binder_predicates(), ty::List::empty());
if !value.skip_binder_with_predicates().1.is_empty() {
self.tcx
.sess
.span_delayed_bug(DUMMY_SP, "binder instantiated with infer ignoring predicates");
}

if let Some(inner) = value.no_bound_vars() {
return inner;
Expand Down
8 changes: 7 additions & 1 deletion compiler/rustc_infer/src/infer/relate/higher_ranked.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::infer::{HigherRankedType, InferCtxt};
use rustc_middle::ty::fold::FnMutDelegate;
use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation};
use rustc_middle::ty::{self, Binder, Ty, TyCtxt, TypeFoldable};
use rustc_span::DUMMY_SP;

impl<'a, 'tcx> CombineFields<'a, 'tcx> {
/// Checks whether `for<..> sub <: for<..> sup` holds.
Expand Down Expand Up @@ -74,7 +75,12 @@ impl<'tcx> InferCtxt<'tcx> {
where
T: TypeFoldable<TyCtxt<'tcx>> + Copy,
{
assert_eq!(binder.skip_binder_predicates(), ty::List::empty());
if !binder.skip_binder_with_predicates().1.is_empty() {
self.tcx.sess.span_delayed_bug(
DUMMY_SP,
"binder instantiated with placeholders ignoring predicates",
);
}

if let Some(inner) = binder.no_bound_vars() {
return inner;
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_infer/src/infer/relate/nll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ where
where
T: ty::TypeFoldable<TyCtxt<'tcx>> + Copy,
{
assert_eq!(binder.skip_binder_predicates(), ty::List::empty());
assert_eq!(binder.skip_binder_with_predicates().1, ty::List::empty());

if let Some(inner) = binder.no_bound_vars() {
return inner;
Expand Down Expand Up @@ -316,7 +316,7 @@ where
where
T: ty::TypeFoldable<TyCtxt<'tcx>> + Copy,
{
assert_eq!(binder.skip_binder_predicates(), ty::List::empty());
assert_eq!(binder.skip_binder_with_predicates().1, ty::List::empty());

if let Some(inner) = binder.no_bound_vars() {
return inner;
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound {
for (pred, pred_span) in
cx.tcx.explicit_item_bounds(def_id).instantiate_identity_iter_copied()
{
let predicate = infcx.instantiate_binder_with_placeholders(pred.kind());
// FIXME(non_lifetime_binders): We could assume the predicates in this binder.
let (predicate, _) =
infcx.instantiate_binder_and_assumptions_with_placeholders(pred.kind());
let ty::ClauseKind::Projection(proj) = predicate else {
continue;
};
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_middle/src/ty/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ impl<'tcx> TyCtxt<'tcx> {
value: Binder<'tcx, T>,
delegate: impl BoundVarReplacerDelegate<'tcx>,
) -> (T, &'tcx ty::List<ty::Clause<'tcx>>) {
let preds = value.skip_binder_predicates();
self.replace_escaping_bound_vars_uncached((value.skip_binder(), preds), delegate)
self.replace_escaping_bound_vars_uncached(value.skip_binder_with_predicates(), delegate)
}

/// Replaces any late-bound regions bound in `value` with
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ impl<'tcx> Clause<'tcx> {
// 1) Self: Bar1<'a, '^0.0> -> Self: Bar1<'a, '^0.1>
let (shifted_pred, shifted_bound_clauses) = tcx.shift_bound_var_indices(
trait_bound_vars.len(),
(bound_pred.skip_binder(), bound_pred.skip_binder_predicates()),
bound_pred.skip_binder_with_predicates(),
);
// 2) Self: Bar1<'a, '^0.1> -> T: Bar1<'^0.0, '^0.1>
let new = EarlyBinder::bind(shifted_pred).instantiate(tcx, trait_ref.skip_binder().args);
Expand All @@ -758,7 +758,7 @@ impl<'tcx> Clause<'tcx> {
tcx.mk_bound_variable_kinds_from_iter(trait_bound_vars.iter().chain(pred_bound_vars));

let binder_predicates = tcx.mk_clauses_from_iter(
trait_ref.skip_binder_predicates().into_iter().chain(shifted_bound_clauses),
trait_ref.skip_binder_with_predicates().1.into_iter().chain(shifted_bound_clauses),
);

// FIXME: Is it really perf sensitive to use reuse_or_mk_predicate here?
Expand Down
8 changes: 6 additions & 2 deletions compiler/rustc_middle/src/ty/structural_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,9 @@ impl<'tcx, T: TypeFoldable<TyCtxt<'tcx>>> TypeSuperFoldable<TyCtxt<'tcx>> for ty
self,
folder: &mut F,
) -> Result<Self, F::Error> {
self.try_map_bound(|ty| ty.try_fold_with(folder))
let bound_vars = self.bound_vars();
let (value, bound_predicates) = self.skip_binder_with_predicates().try_fold_with(folder)?;
Ok(ty::Binder::bind_with_vars_and_predicates(value, bound_vars, bound_predicates))
}
}

Expand All @@ -520,7 +522,9 @@ impl<'tcx, T: TypeVisitable<TyCtxt<'tcx>>> TypeSuperVisitable<TyCtxt<'tcx>>
&self,
visitor: &mut V,
) -> ControlFlow<V::BreakTy> {
self.as_ref().skip_binder().visit_with(visitor)
let (val, predicates) = self.as_ref().skip_binder_with_predicates();
val.visit_with(visitor)?;
predicates.visit_with(visitor)
}
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ where
}

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

/// Skips the binder and returns the "bound" value. This is a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error: internal compiler error: {OpaqueTypeKey { def_id: DefId(rpit::{opaque#0})
=


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: [] } } }
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: [] } } }
--> $DIR/equality-in-canonical-query.rs:19:5
|
LL | same_output(foo, rpit);
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/symbol-names/basic.legacy.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: symbol-name(_ZN5basic4main17h9308686d0228fa1dE)
error: symbol-name(_ZN5basic4main17h96b56acaf300ea6eE)
--> $DIR/basic.rs:8:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling(basic::main::h9308686d0228fa1d)
error: demangling(basic::main::h96b56acaf300ea6e)
--> $DIR/basic.rs:8:1
|
LL | #[rustc_symbol_name]
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/symbol-names/issue-60925.legacy.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h84ab5dafbd2a1508E)
error: symbol-name(_ZN11issue_609253foo37Foo$LT$issue_60925..llv$u6d$..Foo$GT$3foo17h46eaa20e0d673fbeE)
--> $DIR/issue-60925.rs:21:9
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^

error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::h84ab5dafbd2a1508)
error: demangling(issue_60925::foo::Foo<issue_60925::llvm::Foo>::foo::h46eaa20e0d673fbe)
--> $DIR/issue-60925.rs:21:9
|
LL | #[rustc_symbol_name]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/traits/cache-reached-depth-ice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ fn test<X: ?Sized + Send>() {}

fn main() {
test::<A>();
//~^ ERROR evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
//~^ ERROR evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
}
2 changes: 1 addition & 1 deletion tests/ui/traits/cache-reached-depth-ice.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
error: evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
--> $DIR/cache-reached-depth-ice.rs:43:5
|
LL | fn test<X: ?Sized + Send>() {}
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/traits/issue-83538-tainted-cache-after-cycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ fn main() {
// Key is that Vec<First> is "ok" and Third<'_, Ty> is "ok modulo regions":

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

reverse();
//~^ ERROR evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
//~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
//~^ ERROR evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
//~| ERROR evaluate(Binder { value: TraitPredicate(<Third<'_, Ty> as std::marker::Unpin>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOkModuloRegions)
}
8 changes: 4 additions & 4 deletions tests/ui/traits/issue-83538-tainted-cache-after-cycle.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:59:5
|
LL | Vec<First>: Unpin,
Expand All @@ -7,7 +7,7 @@ LL | Vec<First>: Unpin,
LL | forward();
| ^^^^^^^

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

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

error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
error: evaluate(Binder { value: TraitPredicate(<std::vec::Vec<First> as std::marker::Unpin>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
--> $DIR/issue-83538-tainted-cache-after-cycle.rs:63:5
|
LL | Vec<First>: Unpin,
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/traits/issue-85360-eval-obligation-ice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ use core::marker::PhantomData;

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

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

#[rustc_evaluate_where_clauses]
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/traits/issue-85360-eval-obligation-ice.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
--> $DIR/issue-85360-eval-obligation-ice.rs:9:5
|
LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
Expand All @@ -7,7 +7,7 @@ LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
LL | fn test<T: Sized>(_: T) {}
| - predicate

error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOk)
--> $DIR/issue-85360-eval-obligation-ice.rs:9:5
|
LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
Expand All @@ -16,7 +16,7 @@ LL | test::<MaskedStorage<GenericComp<Pos>>>(make());
LL | fn test<T: Sized>(_: T) {}
| ----- predicate

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

error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOkModuloRegions)
error: evaluate(Binder { value: TraitPredicate(<MaskedStorage<GenericComp2<Pos>> as std::marker::Sized>, polarity:Positive), bound_vars: [], bound_predicates: [] }) = Ok(EvaluatedToOkModuloRegions)
--> $DIR/issue-85360-eval-obligation-ice.rs:13:5
|
LL | test::<MaskedStorage<GenericComp2<Pos>>>(make());
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/traits/non_lifetime_binders/bad-copy-cond.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Znext-solver

#![feature(non_lifetime_binders)]
//~^ WARN the feature `non_lifetime_binders` is incomplete

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/traits/non_lifetime_binders/bad-copy-cond.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/bad-copy-cond.rs:1:12
--> $DIR/bad-copy-cond.rs:3:12
|
LL | #![feature(non_lifetime_binders)]
| ^^^^^^^^^^^^^^^^^^^^
Expand All @@ -8,13 +8,13 @@ LL | #![feature(non_lifetime_binders)]
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/bad-copy-cond.rs:7:5
--> $DIR/bad-copy-cond.rs:9:5
|
LL | foo();
| ^^^ the trait `Copy` is not implemented for `T`
|
note: required by a bound in `foo`
--> $DIR/bad-copy-cond.rs:4:26
--> $DIR/bad-copy-cond.rs:6:26
|
LL | fn foo() where for<T> T: Copy {}
| ^^^^ required by this bound in `foo`
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/traits/non_lifetime_binders/bad-sized-cond.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Znext-solver

#![feature(non_lifetime_binders)]
//~^ WARN is incomplete and may not be safe

Expand All @@ -15,9 +17,7 @@ where

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

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

0 comments on commit 82ae54c

Please sign in to comment.