Skip to content

Commit 1834582

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 5d17987 commit 1834582

14 files changed

+135
-25
lines changed

tests/incremental/hashes/trait_defs.rs

Lines changed: 6 additions & 6 deletions
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();
@@ -74,7 +74,7 @@ trait TraitChangeMethodName {
7474
#[cfg(not(any(cfail1,cfail4)))]
7575
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
7676
#[rustc_clean(cfg="cfail3")]
77-
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
77+
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids,predicates_of", cfg="cfail5")]
7878
#[rustc_clean(cfg="cfail6")]
7979
trait TraitChangeMethodName {
8080
fn methodChanged();
@@ -559,7 +559,7 @@ trait TraitAddBuiltinBoundToMethodTypeParameter {
559559
#[cfg(not(any(cfail1,cfail4)))]
560560
#[rustc_clean(cfg="cfail2")]
561561
#[rustc_clean(cfg="cfail3")]
562-
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
562+
#[rustc_clean(except="opt_hir_owner_nodes,predicates_of", cfg="cfail5")]
563563
#[rustc_clean(cfg="cfail6")]
564564
trait TraitAddBuiltinBoundToMethodTypeParameter {
565565
#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
@@ -827,7 +827,7 @@ trait TraitAddAssociatedConstant {
827827
#[cfg(not(any(cfail1,cfail4)))]
828828
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
829829
#[rustc_clean(cfg="cfail3")]
830-
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
830+
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids,predicates_of", cfg="cfail5")]
831831
#[rustc_clean(cfg="cfail6")]
832832
trait TraitAddAssociatedConstant {
833833
const Value: u32;

tests/incremental/hashes/trait_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl ChangeMethodNameTrait for Foo {
3434
#[cfg(not(any(cfail1,cfail4)))]
3535
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
3636
#[rustc_clean(cfg="cfail3")]
37-
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
37+
#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids,predicates_of", cfg="cfail5")]
3838
#[rustc_clean(cfg="cfail6")]
3939
pub trait ChangeMethodNameTrait {
4040
#[rustc_clean(cfg="cfail3")]

tests/ui/attributes/dump-preds.stderr

Lines changed: 2 additions & 1 deletion
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ type C<N: Sized> = ();
2525
type D<N: ?Sized> = ();
2626
//~^ ERROR type parameter `N` is never used
2727
//~| HELP consider removing `N`
28+
//~| HELP if you intended `N` to be a const parameter

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ 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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
//! Regression test for #79409
2-
31
#![feature(extern_types)]
42

5-
unsafe extern "C" {
3+
// Regression test for #79409
4+
5+
extern "C" {
66
type Device;
77
}
88

99
unsafe fn make_device() -> Box<Device> {
10+
//~^ ERROR the size for values of type `Device` cannot be known
1011
Box::from_raw(0 as *mut _)
12+
//~^ ERROR the size for values of type `Device` cannot be known
13+
//~| ERROR the size for values of type `Device` cannot be known
1114
}
1215

1316
fn main() {
14-
let d: Device = unsafe { *make_device() }; //~ERROR the size for values of type `Device` cannot be known at compilation time
17+
let d: Device = unsafe { *make_device() };
18+
//~^ ERROR the size for values of type `Device` cannot be known
19+
//~| ERROR the size for values of type `Device` cannot be known
1520
}

tests/ui/extern/unsized-extern-derefmove.stderr

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
1+
error[E0277]: the size for values of type `Device` cannot be known
2+
--> $DIR/unsized-extern-derefmove.rs:9:28
3+
|
4+
LL | unsafe fn make_device() -> Box<Device> {
5+
| ^^^^^^^^^^^ doesn't have a known size
6+
|
7+
= help: the trait `MetaSized` is not implemented for `Device`
8+
note: required by a bound in `Box`
9+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
10+
11+
error[E0277]: the size for values of type `Device` cannot be known
12+
--> $DIR/unsized-extern-derefmove.rs:11:19
13+
|
14+
LL | Box::from_raw(0 as *mut _)
15+
| ------------- ^^^^^^^^^^^ the trait `MetaSized` is not implemented for `Device`
16+
| |
17+
| required by a bound introduced by this call
18+
|
19+
= note: the trait bound `Device: MetaSized` is not satisfied
20+
note: required by a bound in `Box::<T>::from_raw`
21+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
22+
help: consider borrowing here
23+
|
24+
LL | Box::from_raw(&0 as *mut _)
25+
| +
26+
LL | Box::from_raw(&mut 0 as *mut _)
27+
| ++++
28+
29+
error[E0277]: the size for values of type `Device` cannot be known
30+
--> $DIR/unsized-extern-derefmove.rs:11:5
31+
|
32+
LL | Box::from_raw(0 as *mut _)
33+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a known size
34+
|
35+
= help: the trait `MetaSized` is not implemented for `Device`
36+
note: required by a bound in `Box`
37+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
38+
139
error[E0277]: the size for values of type `Device` cannot be known at compilation time
2-
--> $DIR/unsized-extern-derefmove.rs:14:9
40+
--> $DIR/unsized-extern-derefmove.rs:17:9
341
|
442
LL | let d: Device = unsafe { *make_device() };
543
| ^ doesn't have a size known at compile-time
@@ -11,6 +49,16 @@ help: consider borrowing here
1149
LL | let d: &Device = unsafe { *make_device() };
1250
| +
1351

14-
error: aborting due to 1 previous error
52+
error[E0277]: the size for values of type `Device` cannot be known
53+
--> $DIR/unsized-extern-derefmove.rs:17:31
54+
|
55+
LL | let d: Device = unsafe { *make_device() };
56+
| ^^^^^^^^^^^^^ doesn't have a known size
57+
|
58+
= help: the trait `MetaSized` is not implemented for `Device`
59+
note: required by a bound in `Box`
60+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
61+
62+
error: aborting due to 5 previous errors
1563

1664
For more information about this error, try `rustc --explain E0277`.

tests/ui/nll/issue-50716.rs

Lines changed: 1 addition & 2 deletions
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

Lines changed: 18 additions & 2 deletions
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

Lines changed: 3 additions & 2 deletions
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>();

0 commit comments

Comments
 (0)