Skip to content

Commit ac8e8e5

Browse files
author
addie.sh
committed
fix tests (+rebase)
1 parent a7e66ef commit ac8e8e5

7 files changed

Lines changed: 37 additions & 21 deletions

File tree

compiler/rustc_next_trait_solver/src/canonical/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use rustc_index::IndexVec;
1616
use rustc_type_ir::inherent::*;
1717
use rustc_type_ir::relate::{
1818
self, Relate, RelateResult, TypeRelation, VarianceDiagInfo, relate_args_invariantly,
19+
relate_args_invariantly_bound,
1920
};
2021
use rustc_type_ir::{
2122
self as ty, Canonical, CanonicalVarKind, CanonicalVarValues, InferCtxtLike, Interner,
@@ -294,6 +295,20 @@ where
294295
relate_args_invariantly(self, a_args, b_args)?;
295296
Ok(a_ty)
296297
}
298+
299+
fn relate_ty_args_bound(
300+
&mut self,
301+
a_ty: I::Ty,
302+
_b_ty: I::Ty,
303+
_def_id: I::DefId,
304+
a_args: ty::Binder<I, I::GenericArgs>,
305+
b_args: ty::Binder<I, I::GenericArgs>,
306+
_: impl FnOnce(ty::Binder<I, I::GenericArgs>) -> I::Ty,
307+
) -> RelateResult<I, I::Ty> {
308+
relate_args_invariantly_bound(self, a_args, b_args)?;
309+
Ok(a_ty)
310+
}
311+
297312
fn relate_with_variance<T: Relate<I>>(
298313
&mut self,
299314
_variance: ty::Variance,

tests/incremental/hashes/function_interfaces.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ pub fn type_parameter<T>() {}
156156
pub fn lifetime_parameter () {}
157157

158158
#[cfg(not(any(bpass1,bpass4)))]
159-
#[rustc_clean(cfg = "bpass2", except = "hir_owner, generics_of,fn_sig")]
159+
#[rustc_clean(cfg = "bpass2", except = "hir_owner, generics_of, fn_sig, type_of")]
160160
#[rustc_clean(cfg = "bpass3")]
161-
#[rustc_clean(cfg = "bpass5", except = "hir_owner, generics_of,fn_sig")]
161+
#[rustc_clean(cfg = "bpass5", except = "hir_owner, generics_of, fn_sig, type_of")]
162162
#[rustc_clean(cfg = "bpass6")]
163163
pub fn lifetime_parameter<'a>() {}
164164

tests/incremental/hashes/inherent_impls.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ impl Foo {
146146
impl Foo {
147147
#[rustc_clean(
148148
cfg="bpass2",
149-
except="hir_owner,fn_sig,generics_of,typeck_root,associated_item,optimized_mir",
149+
except="hir_owner,fn_sig,type_of,generics_of,typeck_root,associated_item,optimized_mir",
150150
)]
151151
#[rustc_clean(cfg="bpass3")]
152152
#[rustc_clean(
153153
cfg="bpass5",
154-
except="hir_owner,fn_sig,generics_of,typeck_root,associated_item,optimized_mir",
154+
except="hir_owner,fn_sig,type_of,generics_of,typeck_root,associated_item,optimized_mir",
155155
)]
156156
#[rustc_clean(cfg="bpass6")]
157157
pub fn method_selfness(&self) { }
@@ -421,9 +421,9 @@ impl Foo {
421421
// ----------------------------------------------------------
422422
// -----------------------------------------------------------
423423
// ----------------------------------------------------------
424-
// --------------------------------------------------------------
424+
// ----------------------------------------------------------------------
425425
// -------------------------
426-
// --------------------------------------------------------------------------
426+
// ----------------------------------------------------------------------------------
427427
// -------------------------
428428
pub fn add_lifetime_parameter_to_method (&self) { }
429429
}
@@ -443,9 +443,9 @@ impl Foo {
443443
// if we lower generics before the body, then the `HirId` for
444444
// things in the body will be affected. So if you start to see
445445
// `typeck_root` appear dirty, that might be the cause. -nmatsakis
446-
#[rustc_clean(cfg="bpass2", except="hir_owner,fn_sig")]
446+
#[rustc_clean(cfg="bpass2", except="hir_owner,fn_sig,type_of")]
447447
#[rustc_clean(cfg="bpass3")]
448-
#[rustc_clean(cfg="bpass5", except="hir_owner,fn_sig,generics_of")]
448+
#[rustc_clean(cfg="bpass5", except="hir_owner,fn_sig,type_of,generics_of")]
449449
#[rustc_clean(cfg="bpass6")]
450450
pub fn add_lifetime_parameter_to_method<'a>(&self) { }
451451
}

tests/incremental/hashes/trait_defs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ trait TraitChangeModeSelfOwnToRef {
380380
#[rustc_clean(except="hir_owner,predicates_of", cfg="bpass5")]
381381
#[rustc_clean(cfg="bpass6")]
382382
trait TraitChangeModeSelfOwnToRef {
383-
#[rustc_clean(except="hir_owner,fn_sig,generics_of", cfg="bpass2")]
383+
#[rustc_clean(except="hir_owner,fn_sig,type_of,generics_of", cfg="bpass2")]
384384
#[rustc_clean(cfg="bpass3")]
385-
#[rustc_clean(except="hir_owner,fn_sig,generics_of", cfg="bpass5")]
385+
#[rustc_clean(except="hir_owner,fn_sig,type_of,generics_of", cfg="bpass5")]
386386
#[rustc_clean(cfg="bpass6")]
387387
fn method(&self);
388388
}
@@ -509,9 +509,9 @@ trait TraitAddLifetimeParameterToMethod {
509509
#[rustc_clean(except="hir_owner,predicates_of", cfg="bpass5")]
510510
#[rustc_clean(cfg="bpass6")]
511511
trait TraitAddLifetimeParameterToMethod {
512-
#[rustc_clean(except="hir_owner,fn_sig,generics_of", cfg="bpass2")]
512+
#[rustc_clean(except="hir_owner,fn_sig,type_of,generics_of", cfg="bpass2")]
513513
#[rustc_clean(cfg="bpass3")]
514-
#[rustc_clean(except="hir_owner,fn_sig,generics_of", cfg="bpass5")]
514+
#[rustc_clean(except="hir_owner,fn_sig,type_of,generics_of", cfg="bpass5")]
515515
#[rustc_clean(cfg="bpass6")]
516516
fn method<'a>();
517517
}

tests/incremental/hashes/trait_impls.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ pub trait ChangeMethodSelfnessTrait {
148148
#[rustc_clean(cfg="bpass6")]
149149
impl ChangeMethodSelfnessTrait for Foo {
150150
#[rustc_clean(
151-
except="hir_owner,associated_item,generics_of,fn_sig,typeck_root,optimized_mir",
151+
except="hir_owner,associated_item,generics_of,fn_sig,type_of,typeck_root,optimized_mir",
152152
cfg="bpass2",
153153
)]
154154
#[rustc_clean(cfg="bpass3")]
155155
#[rustc_clean(
156-
except="hir_owner,associated_item,generics_of,fn_sig,typeck_root,optimized_mir",
156+
except="hir_owner,associated_item,generics_of,fn_sig,type_of,typeck_root,optimized_mir",
157157
cfg="bpass5",
158158
)]
159159
#[rustc_clean(cfg="bpass6")]
@@ -186,12 +186,12 @@ pub trait RemoveMethodSelfnessTrait {
186186
#[rustc_clean(cfg="bpass6")]
187187
impl RemoveMethodSelfnessTrait for Foo {
188188
#[rustc_clean(
189-
except="hir_owner,associated_item,generics_of,fn_sig,typeck_root,optimized_mir",
189+
except="hir_owner,associated_item,generics_of,fn_sig,type_of,typeck_root,optimized_mir",
190190
cfg="bpass2",
191191
)]
192192
#[rustc_clean(cfg="bpass3")]
193193
#[rustc_clean(
194-
except="hir_owner,associated_item,generics_of,fn_sig,typeck_root,optimized_mir",
194+
except="hir_owner,associated_item,generics_of,fn_sig,type_of,typeck_root,optimized_mir",
195195
cfg="bpass5",
196196
)]
197197
#[rustc_clean(cfg="bpass6")]

tests/ui/generics/binder-arg-overflow-regression-133613.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ struct Wrapper<'a>();
99

1010
// FIXME: these errors are probably wrong
1111
trait IntFactory {
12-
//~v ERROR
13-
fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send>>; //~ERROR
12+
fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send>>;
1413
//~^ ERROR: cycle detected when looking up late bound vars inside `IntFactory::stream` [E0391]
14+
//~^^ ERROR: return type notation is experimental
15+
//~^^^ ERROR: return type notation is experimental
1516
}
1617

1718
fn main() {}

tests/ui/generics/binder-arg-overflow-regression-133613.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: return type notation is experimental
2-
--> $DIR/binder-arg-overflow-regression-133613.rs:13:47
2+
--> $DIR/binder-arg-overflow-regression-133613.rs:12:47
33
|
44
LL | fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send>>;
55
| ^^^^
@@ -9,7 +9,7 @@ LL | fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..):
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

1111
error[E0658]: return type notation is experimental
12-
--> $DIR/binder-arg-overflow-regression-133613.rs:13:70
12+
--> $DIR/binder-arg-overflow-regression-133613.rs:12:70
1313
|
1414
LL | fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send>>;
1515
| ^^^^
@@ -19,7 +19,7 @@ LL | fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..):
1919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2020

2121
error[E0391]: cycle detected when looking up late bound vars inside `IntFactory::stream`
22-
--> $DIR/binder-arg-overflow-regression-133613.rs:13:5
22+
--> $DIR/binder-arg-overflow-regression-133613.rs:12:5
2323
|
2424
LL | fn stream(&self) -> impl IntFactory<stream(..): IntFactory<stream(..): Send>>;
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)