Skip to content

Commit d445c12

Browse files
committed
TEST see if these were introducing a lot of evaluation churn
1 parent bed395e commit d445c12

30 files changed

+59
-69
lines changed

compiler/rustc_trait_selection/src/traits/wf.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -710,12 +710,12 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
710710

711711
iter::zip(iter::zip(predicates.predicates, predicates.spans), origins.into_iter().rev())
712712
.map(|((pred, span), origin_def_id)| {
713-
let code = match pred.kind().skip_binder() {
713+
let code = match () {// pred.kind().skip_binder() {
714714
_ if span.is_dummy() => traits::MiscObligation,
715-
ty::PredicateKind::Trait(ty::TraitPredicate {
716-
implicit: ty::ImplicitBound::Yes,
717-
..
718-
}) => traits::ImplicitSizedObligation(origin_def_id, span),
715+
// ty::PredicateKind::Trait(ty::TraitPredicate {
716+
// implicit: ty::ImplicitBound::Yes,
717+
// ..
718+
// }) => traits::ImplicitSizedObligation(origin_def_id, span),
719719
_ => traits::BindingObligation(origin_def_id, span),
720720
};
721721
let cause = self.cause(code);

compiler/rustc_typeck/src/check/compare_method.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,16 +1378,17 @@ pub fn check_type_bounds<'tcx>(
13781378

13791379
let impl_ty_hir_id = tcx.hir().local_def_id_to_hir_id(impl_ty.def_id.expect_local());
13801380
let normalize_cause = traits::ObligationCause::misc(impl_ty_span, impl_ty_hir_id);
1381-
let mk_cause = |bound, span: Span| {
1381+
// let mk_cause = |bound, span: Span| {
1382+
let mk_cause = |span: Span| {
13821383
ObligationCause::new(
13831384
impl_ty_span,
13841385
impl_ty_hir_id,
1385-
match bound {
1386+
match () {
13861387
_ if span.is_dummy() => traits::MiscObligation,
1387-
ty::PredicateKind::Trait(ty::TraitPredicate {
1388-
implicit: ty::ImplicitBound::Yes,
1389-
..
1390-
}) => traits::ImplicitSizedObligation(trait_ty.def_id, span),
1388+
// ty::PredicateKind::Trait(ty::TraitPredicate {
1389+
// implicit: ty::ImplicitBound::Yes,
1390+
// ..
1391+
// }) => traits::ImplicitSizedObligation(trait_ty.def_id, span),
13911392
_ => ObligationCauseCode::BindingObligation(trait_ty.def_id, span),
13921393
},
13931394
)
@@ -1402,7 +1403,8 @@ pub fn check_type_bounds<'tcx>(
14021403
debug!("check_type_bounds: concrete_ty_bound = {:?}", concrete_ty_bound);
14031404

14041405
traits::Obligation::new(
1405-
mk_cause(bound.kind().skip_binder(), span),
1406+
// mk_cause(bound.kind().skip_binder(), span),
1407+
mk_cause(span),
14061408
param_env,
14071409
concrete_ty_bound,
14081410
)

src/test/ui/associated-types/defaults-wf.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | type Ty = Vec<[u8]>;
55
| ^^^^^^^^^ doesn't have a size known at compile-time
66
|
77
= help: the trait `Sized` is not implemented for `[u8]`
8-
note: type parameters have an implicit `Sized` obligation
8+
note: required by a bound in `Vec`
99
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
1010
|
1111
LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {

src/test/ui/associated-types/issue-20005.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation
44
LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
55
| ^^^^^^^^^^ doesn't have a size known at compile-time
66
|
7-
note: type parameters have an implicit `Sized` obligation
7+
note: required by a bound in `From`
88
--> $DIR/issue-20005.rs:1:12
99
|
1010
LL | trait From<Src> {

src/test/ui/associated-types/issue-63593.stderr

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation
44
LL | type This = Self;
55
| ^^^^ doesn't have a size known at compile-time
66
|
7-
note: associated types have an implicit `Sized` obligation
7+
note: required by a bound in `MyTrait::This`
88
--> $DIR/issue-63593.rs:9:5
99
|
1010
LL | type This = Self;
11-
| ^^^^^^^^^^^^^^^^^ required by associated type `MyTrait::This`
11+
| ^^^^^^^^^^^^^^^^^ required by this bound in `MyTrait::This`
1212
help: consider further restricting `Self`
1313
|
1414
LL | trait MyTrait: Sized {
1515
| +++++++
16-
help: consider relaxing the `Sized` obligation
17-
|
18-
LL | type This: ?Sized = Self;
19-
| ++++++++
2016

2117
error: aborting due to previous error
2218

src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation
44
LL | trait ArithmeticOps: Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self> + Div<Output=Self> {}
55
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
66
|
7-
note: type parameters have an implicit `Sized` obligation
7+
note: required by a bound in `Add`
88
--> $SRC_DIR/core/src/ops/arith.rs:LL:COL
99
|
1010
LL | pub trait Add<Rhs = Self> {

src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ LL | let dst = Inline::<dyn Debug>::new(0);
5656
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
5757
|
5858
= help: the trait `Sized` is not implemented for `dyn Debug`
59-
note: type parameters have an implicit `Sized` obligation
59+
note: required by a bound in `Inline`
6060
--> $DIR/issue-80742.rs:12:15
6161
|
6262
LL | struct Inline<T>

src/test/ui/dst/dst-sized-trait-param.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | impl Foo<[isize]> for usize { }
55
| ^^^^^^^^^^^^ doesn't have a size known at compile-time
66
|
77
= help: the trait `Sized` is not implemented for `[isize]`
8-
note: type parameters have an implicit `Sized` obligation
8+
note: required by a bound in `Foo`
99
--> $DIR/dst-sized-trait-param.rs:5:11
1010
|
1111
LL | trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized

src/test/ui/generator/sized-yield.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | Pin::new(&mut gen).resume(());
1818
| ^^^^^^ doesn't have a size known at compile-time
1919
|
2020
= help: the trait `Sized` is not implemented for `str`
21-
note: type parameters have an implicit `Sized` obligation
21+
note: required by a bound in `GeneratorState`
2222
--> $SRC_DIR/core/src/ops/generator.rs:LL:COL
2323
|
2424
LL | pub enum GeneratorState<Y, R> {

src/test/ui/generic-associated-types/issue-74816.stderr

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,15 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation
2020
LL | type Associated: Trait1 = Self;
2121
| ^^^^ doesn't have a size known at compile-time
2222
|
23-
note: associated types have an implicit `Sized` obligation
23+
note: required by a bound in `Trait2::Associated`
2424
--> $DIR/issue-74816.rs:9:5
2525
|
2626
LL | type Associated: Trait1 = Self;
27-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by associated type `Trait2::Associated`
27+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated`
2828
help: consider further restricting `Self`
2929
|
3030
LL | trait Trait2: Sized {
3131
| +++++++
32-
help: consider relaxing the `Sized` obligation
33-
|
34-
LL | type Associated: Trait1 + ?Sized = Self;
35-
| ++++++++
3632

3733
error: aborting due to 2 previous errors
3834

0 commit comments

Comments
 (0)