Skip to content

Commit 268dbba

Browse files
committed
tests: bless remaining tests
These tests just need blessing, they don't have any interesting behaviour changes. Some of these tests have new errors because `LegacyReceiver` cannot be proven to be implemented now that it is also testing for `MetaSized` - but this is just a consequence of the other errors in the test.
1 parent 1562e83 commit 268dbba

12 files changed

+72
-26
lines changed

tests/incremental/hashes/trait_defs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ trait TraitVisibility { }
3030
#[cfg(not(any(cfail1,cfail4)))]
3131
#[rustc_clean(cfg="cfail2")]
3232
#[rustc_clean(cfg="cfail3")]
33-
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes")]
33+
#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,predicates_of")]
3434
#[rustc_clean(cfg="cfail6")]
3535
pub trait TraitVisibility { }
3636

@@ -43,7 +43,7 @@ trait TraitUnsafety { }
4343
#[cfg(not(any(cfail1,cfail4)))]
4444
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
4545
#[rustc_clean(cfg="cfail3")]
46-
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
46+
#[rustc_clean(except="opt_hir_owner_nodes,predicates_of", cfg="cfail5")]
4747
#[rustc_clean(cfg="cfail6")]
4848
unsafe trait TraitUnsafety { }
4949

@@ -57,7 +57,7 @@ trait TraitAddMethod {
5757
#[cfg(not(any(cfail1,cfail4)))]
5858
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
5959
#[rustc_clean(cfg="cfail3")]
60-
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
60+
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids,predicates_of", cfg="cfail5")]
6161
#[rustc_clean(cfg="cfail6")]
6262
pub trait TraitAddMethod {
6363
fn method();

tests/ui/attributes/dump-preds.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ error: rustc_dump_predicates
44
LL | trait Trait<T>: Iterator<Item: Copy>
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7+
= note: Binder { value: TraitPredicate(<Self as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }
78
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
89
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
910
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }
@@ -16,6 +17,7 @@ error: rustc_dump_predicates
1617
LL | type Assoc<P: Eq>: std::ops::Deref<Target = ()>
1718
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1819
|
20+
= note: Binder { value: TraitPredicate(<Self as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }
1921
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
2022
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
2123
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }
@@ -35,7 +37,6 @@ LL | type Assoc<P: Eq>: std::ops::Deref<Target = ()>
3537
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::ops::Deref>, polarity:Positive), bound_vars: [] }
3638
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::Sized>, polarity:Positive), bound_vars: [] }
3739
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }
38-
= note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::PointeeSized>, polarity:Positive), bound_vars: [] }
3940

4041
error: aborting due to 3 previous errors
4142

tests/ui/const-generics/unused-type-param-suggestion.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![crate_type="lib"]
2+
#![feature(sized_hierarchy)]
23

34
struct S<N>;
45
//~^ ERROR type parameter `N` is never used
@@ -25,3 +26,4 @@ type C<N: Sized> = ();
2526
type D<N: ?Sized> = ();
2627
//~^ ERROR type parameter `N` is never used
2728
//~| HELP consider removing `N`
29+
//~| HELP if you intended `N` to be a const parameter

tests/ui/const-generics/unused-type-param-suggestion.stderr

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0392]: type parameter `N` is never used
2-
--> $DIR/unused-type-param-suggestion.rs:3:10
2+
--> $DIR/unused-type-param-suggestion.rs:4:10
33
|
44
LL | struct S<N>;
55
| ^ unused type parameter
@@ -8,15 +8,15 @@ LL | struct S<N>;
88
= help: if you intended `N` to be a const parameter, use `const N: /* Type */` instead
99

1010
error[E0392]: type parameter `N` is never used
11-
--> $DIR/unused-type-param-suggestion.rs:9:10
11+
--> $DIR/unused-type-param-suggestion.rs:10:10
1212
|
1313
LL | struct T<N: Copy>;
1414
| ^ unused type parameter
1515
|
1616
= help: consider removing `N`, referring to it in a field, or using a marker such as `PhantomData`
1717

1818
error[E0091]: type parameter `N` is never used
19-
--> $DIR/unused-type-param-suggestion.rs:13:8
19+
--> $DIR/unused-type-param-suggestion.rs:14:8
2020
|
2121
LL | type A<N> = ();
2222
| ^ unused type parameter
@@ -25,28 +25,29 @@ LL | type A<N> = ();
2525
= help: if you intended `N` to be a const parameter, use `const N: /* Type */` instead
2626

2727
error[E0091]: type parameter `N` is never used
28-
--> $DIR/unused-type-param-suggestion.rs:19:8
28+
--> $DIR/unused-type-param-suggestion.rs:20:8
2929
|
3030
LL | type B<N: Copy> = ();
3131
| ^ unused type parameter
3232
|
3333
= help: consider removing `N` or referring to it in the body of the type alias
3434

3535
error[E0091]: type parameter `N` is never used
36-
--> $DIR/unused-type-param-suggestion.rs:22:8
36+
--> $DIR/unused-type-param-suggestion.rs:23:8
3737
|
3838
LL | type C<N: Sized> = ();
3939
| ^ unused type parameter
4040
|
4141
= help: consider removing `N` or referring to it in the body of the type alias
4242

4343
error[E0091]: type parameter `N` is never used
44-
--> $DIR/unused-type-param-suggestion.rs:25:8
44+
--> $DIR/unused-type-param-suggestion.rs:26:8
4545
|
4646
LL | type D<N: ?Sized> = ();
4747
| ^ unused type parameter
4848
|
4949
= help: consider removing `N` or referring to it in the body of the type alias
50+
= help: if you intended `N` to be a const parameter, use `const N: /* Type */` instead
5051

5152
error: aborting due to 6 previous errors
5253

tests/ui/layout/unconstrained-param-ice-137308.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
//! This used to ICE in layout computation, because `<u8 as A>::B` fails to normalize
44
//! due to the unconstrained param on the impl.
55
6-
#![feature(rustc_attrs)]
6+
#![feature(rustc_attrs, sized_hierarchy)]
77
#![crate_type = "lib"]
88

9+
use std::marker::PointeeSized;
10+
911
trait A {
1012
const B: usize;
1113
}
1214

13-
impl<C: ?Sized> A for u8 { //~ ERROR: the type parameter `C` is not constrained
15+
impl<C: PointeeSized> A for u8 { //~ ERROR: the type parameter `C` is not constrained
1416
const B: usize = 42;
1517
}
1618

tests/ui/layout/unconstrained-param-ice-137308.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0207]: the type parameter `C` is not constrained by the impl trait, self type, or predicates
2-
--> $DIR/unconstrained-param-ice-137308.rs:13:6
2+
--> $DIR/unconstrained-param-ice-137308.rs:15:6
33
|
4-
LL | impl<C: ?Sized> A for u8 {
4+
LL | impl<C: PointeeSized> A for u8 {
55
| ^ unconstrained type parameter
66

77
error: the type has an unknown layout
8-
--> $DIR/unconstrained-param-ice-137308.rs:18:1
8+
--> $DIR/unconstrained-param-ice-137308.rs:20:1
99
|
1010
LL | struct S([u8; <u8 as A>::B]);
1111
| ^^^^^^^^

tests/ui/nll/issue-50716.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
//
21
// Regression test for the issue #50716: NLL ignores lifetimes bounds
32
// derived from `Sized` requirements
43

54
trait A {
65
type X: ?Sized;
76
}
87

9-
fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
8+
fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) //~ ERROR mismatched types
109
where
1110
for<'b> &'b T: A,
1211
<&'static T as A>::X: Sized

tests/ui/nll/issue-50716.stderr

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-50716.rs:8:27
3+
|
4+
LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
5+
| ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
6+
|
7+
= note: expected trait `<<&'a T as A>::X as MetaSized>`
8+
found trait `<<&'static T as A>::X as MetaSized>`
9+
note: the lifetime `'a` as defined here...
10+
--> $DIR/issue-50716.rs:8:8
11+
|
12+
LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
13+
| ^^
14+
= note: ...does not necessarily outlive the static lifetime
15+
116
error: lifetime may not live long enough
2-
--> $DIR/issue-50716.rs:14:14
17+
--> $DIR/issue-50716.rs:13:14
318
|
419
LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
520
| -- lifetime `'a` defined here
621
...
722
LL | let _x = *s;
823
| ^^ proving this value is `Sized` requires that `'a` must outlive `'static`
924

10-
error: aborting due to 1 previous error
25+
error: aborting due to 2 previous errors
1126

27+
For more information about this error, try `rustc --explain E0308`.

tests/ui/traits/cache-reached-depth-ice.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#![feature(rustc_attrs)]
1+
#![feature(rustc_attrs, sized_hierarchy)]
2+
use std::marker::PointeeSized;
23

34
// Test for a particular corner case where the evaluation
45
// cache can get out of date. The problem here is that
@@ -37,7 +38,7 @@ struct C {
3738
}
3839

3940
#[rustc_evaluate_where_clauses]
40-
fn test<X: ?Sized + Send>() {}
41+
fn test<X: PointeeSized + Send>() {}
4142

4243
fn main() {
4344
test::<A>();

tests/ui/traits/cache-reached-depth-ice.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
2-
--> $DIR/cache-reached-depth-ice.rs:43:5
2+
--> $DIR/cache-reached-depth-ice.rs:44:5
33
|
4-
LL | fn test<X: ?Sized + Send>() {}
5-
| ---- predicate
4+
LL | fn test<X: PointeeSized + Send>() {}
5+
| ---- predicate
66
...
77
LL | test::<A>();
88
| ^^^^^^^^^

tests/ui/traits/next-solver/normalize/normalize-param-env-2.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: A<T>`
1919
LL | Self::Assoc: A<T>,
2020
| ^^^^
2121

22+
error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: MetaSized`
23+
--> $DIR/normalize-param-env-2.rs:24:22
24+
|
25+
LL | Self::Assoc: A<T>,
26+
| ^^^^
27+
|
28+
note: required by a bound in `A`
29+
--> $DIR/normalize-param-env-2.rs:9:1
30+
|
31+
LL | trait A<T> {
32+
| ^^^^^^^^^^ required by this bound in `A`
33+
2234
error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc well-formed`
2335
--> $DIR/normalize-param-env-2.rs:24:22
2436
|
@@ -46,6 +58,6 @@ LL | where
4658
LL | Self::Assoc: A<T>,
4759
| ^^^^ required by this bound in `A::f`
4860

49-
error: aborting due to 5 previous errors
61+
error: aborting due to 6 previous errors
5062

5163
For more information about this error, try `rustc --explain E0275`.

tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ error[E0275]: overflow evaluating the requirement `<T as Trait>::Assoc: Trait`
44
LL | <T as Trait>::Assoc: Trait,
55
| ^^^^^
66

7+
error[E0275]: overflow evaluating the requirement `<T as Trait>::Assoc: MetaSized`
8+
--> $DIR/normalize-param-env-4.rs:19:26
9+
|
10+
LL | <T as Trait>::Assoc: Trait,
11+
| ^^^^^
12+
|
13+
note: required by a bound in `Trait`
14+
--> $DIR/normalize-param-env-4.rs:7:1
15+
|
16+
LL | trait Trait {
17+
| ^^^^^^^^^^^ required by this bound in `Trait`
18+
719
error[E0275]: overflow evaluating the requirement `<T as Trait>::Assoc well-formed`
820
--> $DIR/normalize-param-env-4.rs:19:26
921
|
@@ -22,6 +34,6 @@ note: required by a bound in `impls_trait`
2234
LL | fn impls_trait<T: Trait>() {}
2335
| ^^^^^ required by this bound in `impls_trait`
2436

25-
error: aborting due to 3 previous errors
37+
error: aborting due to 4 previous errors
2638

2739
For more information about this error, try `rustc --explain E0275`.

0 commit comments

Comments
 (0)