Skip to content

Commit b006bf7

Browse files
committed
Fix tests
1 parent 87f3a99 commit b006bf7

File tree

67 files changed

+224
-495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+224
-495
lines changed

tests/ui/coherence/negative-coherence/regions-in-canonical.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ check-pass
22

33
#![feature(adt_const_params, unsized_const_params)]
4-
//~^ WARN the feature `unsized_const_params` is incomplete
54
#![feature(with_negative_coherence, negative_impls)]
65

76
pub trait A<const K: &'static str> {}

tests/ui/coherence/negative-coherence/regions-in-canonical.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/ui/const-generics/adt_const_params/const_param_ty_bad.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(incomplete_features)]
22
#![feature(adt_const_params, unsized_const_params)]
33

4-
fn check(_: impl std::marker::UnsizedConstParamTy) {}
4+
fn check(_: impl std::marker::ConstParamTy_) {}
55

66
fn main() {
77
check(main); //~ error: `fn() {main}` can't be used as a const parameter type

tests/ui/const-generics/adt_const_params/const_param_ty_bad.stderr

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ error[E0277]: `fn() {main}` can't be used as a const parameter type
22
--> $DIR/const_param_ty_bad.rs:7:11
33
|
44
LL | check(main);
5-
| ----- ^^^^ the trait `UnsizedConstParamTy` is not implemented for fn item `fn() {main}`
5+
| ----- ^^^^ the trait `ConstParamTy_` is not implemented for fn item `fn() {main}`
66
| |
77
| required by a bound introduced by this call
88
|
99
note: required by a bound in `check`
1010
--> $DIR/const_param_ty_bad.rs:4:18
1111
|
12-
LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
13-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
12+
LL | fn check(_: impl std::marker::ConstParamTy_) {}
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
1414
help: use parentheses to call this function
1515
|
1616
LL | check(main());
@@ -24,12 +24,12 @@ LL | check(|| {});
2424
| |
2525
| required by a bound introduced by this call
2626
|
27-
= help: the trait `UnsizedConstParamTy` is not implemented for closure `{closure@$DIR/const_param_ty_bad.rs:8:11: 8:13}`
27+
= help: the trait `ConstParamTy_` is not implemented for closure `{closure@$DIR/const_param_ty_bad.rs:8:11: 8:13}`
2828
note: required by a bound in `check`
2929
--> $DIR/const_param_ty_bad.rs:4:18
3030
|
31-
LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
32-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
31+
LL | fn check(_: impl std::marker::ConstParamTy_) {}
32+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
3333
help: use parentheses to call this closure
3434
|
3535
LL | check(|| {}());
@@ -39,15 +39,15 @@ error[E0277]: `fn()` can't be used as a const parameter type
3939
--> $DIR/const_param_ty_bad.rs:9:11
4040
|
4141
LL | check(main as fn());
42-
| ----- ^^^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `fn()`
42+
| ----- ^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `fn()`
4343
| |
4444
| required by a bound introduced by this call
4545
|
4646
note: required by a bound in `check`
4747
--> $DIR/const_param_ty_bad.rs:4:18
4848
|
49-
LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
50-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
49+
LL | fn check(_: impl std::marker::ConstParamTy_) {}
50+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
5151
help: use parentheses to call this function pointer
5252
|
5353
LL | check(main as fn()());
@@ -57,16 +57,16 @@ error[E0277]: `&mut ()` can't be used as a const parameter type
5757
--> $DIR/const_param_ty_bad.rs:10:11
5858
|
5959
LL | check(&mut ());
60-
| ----- ^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `&mut ()`
60+
| ----- ^^^^^^^ the trait `ConstParamTy_` is not implemented for `&mut ()`
6161
| |
6262
| required by a bound introduced by this call
6363
|
64-
= note: `UnsizedConstParamTy` is implemented for `&()`, but not for `&mut ()`
64+
= note: `ConstParamTy_` is implemented for `&()`, but not for `&mut ()`
6565
note: required by a bound in `check`
6666
--> $DIR/const_param_ty_bad.rs:4:18
6767
|
68-
LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
69-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
68+
LL | fn check(_: impl std::marker::ConstParamTy_) {}
69+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
7070
help: consider removing the leading `&`-reference
7171
|
7272
LL - check(&mut ());
@@ -77,31 +77,31 @@ error[E0277]: `*mut ()` can't be used as a const parameter type
7777
--> $DIR/const_param_ty_bad.rs:11:11
7878
|
7979
LL | check(&mut () as *mut ());
80-
| ----- ^^^^^^^^^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `*mut ()`
80+
| ----- ^^^^^^^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `*mut ()`
8181
| |
8282
| required by a bound introduced by this call
8383
|
84-
= help: the trait `UnsizedConstParamTy` is implemented for `()`
84+
= help: the trait `ConstParamTy_` is implemented for `()`
8585
note: required by a bound in `check`
8686
--> $DIR/const_param_ty_bad.rs:4:18
8787
|
88-
LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
89-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
88+
LL | fn check(_: impl std::marker::ConstParamTy_) {}
89+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
9090

9191
error[E0277]: `*const ()` can't be used as a const parameter type
9292
--> $DIR/const_param_ty_bad.rs:12:11
9393
|
9494
LL | check(&() as *const ());
95-
| ----- ^^^^^^^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `*const ()`
95+
| ----- ^^^^^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `*const ()`
9696
| |
9797
| required by a bound introduced by this call
9898
|
99-
= help: the trait `UnsizedConstParamTy` is implemented for `()`
99+
= help: the trait `ConstParamTy_` is implemented for `()`
100100
note: required by a bound in `check`
101101
--> $DIR/const_param_ty_bad.rs:4:18
102102
|
103-
LL | fn check(_: impl std::marker::UnsizedConstParamTy) {}
104-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
103+
LL | fn check(_: impl std::marker::ConstParamTy_) {}
104+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
105105

106106
error: aborting due to 6 previous errors
107107

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
#![feature(adt_const_params, unsized_const_params)]
22
#![allow(incomplete_features)]
33

4-
use std::marker::{ConstParamTy_, UnsizedConstParamTy};
4+
use std::marker::ConstParamTy_;
55

66
fn foo(a: &dyn ConstParamTy_) {}
77
//~^ ERROR: the trait `ConstParamTy_`
88

9-
fn bar(a: &dyn UnsizedConstParamTy) {}
10-
//~^ ERROR: the trait `UnsizedConstParamTy`
11-
129
fn main() {}

tests/ui/const-generics/adt_const_params/const_param_ty_dyn_compatibility.stderr

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,6 @@ LL - fn foo(a: &dyn ConstParamTy_) {}
1515
LL + fn foo(a: &impl ConstParamTy_) {}
1616
|
1717

18-
error[E0038]: the trait `UnsizedConstParamTy` is not dyn compatible
19-
--> $DIR/const_param_ty_dyn_compatibility.rs:9:16
20-
|
21-
LL | fn bar(a: &dyn UnsizedConstParamTy) {}
22-
| ^^^^^^^^^^^^^^^^^^^ `UnsizedConstParamTy` is not dyn compatible
23-
|
24-
note: for a trait to be dyn compatible it needs to allow building a vtable
25-
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
26-
--> $SRC_DIR/core/src/cmp.rs:LL:COL
27-
|
28-
= note: the trait is not dyn compatible because it uses `Self` as a type parameter
29-
help: consider using an opaque type instead
30-
|
31-
LL - fn bar(a: &dyn UnsizedConstParamTy) {}
32-
LL + fn bar(a: &impl UnsizedConstParamTy) {}
33-
|
34-
35-
error: aborting due to 2 previous errors
18+
error: aborting due to 1 previous error
3619

3720
For more information about this error, try `rustc --explain E0038`.

tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#[derive(PartialEq, Eq)]
55
struct NotParam;
66

7-
fn check<T: std::marker::UnsizedConstParamTy + ?Sized>() {}
7+
fn check<T: std::marker::ConstParamTy_ + ?Sized>() {}
88

99
fn main() {
1010
check::<&NotParam>(); //~ error: `NotParam` can't be used as a const parameter type

tests/ui/const-generics/adt_const_params/const_param_ty_generic_bounds_do_not_hold.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@ error[E0277]: `NotParam` can't be used as a const parameter type
22
--> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:10:13
33
|
44
LL | check::<&NotParam>();
5-
| ^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `NotParam`
5+
| ^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `NotParam`
66
|
7-
= note: required for `&NotParam` to implement `UnsizedConstParamTy`
7+
= note: required for `&NotParam` to implement `ConstParamTy_`
88
note: required by a bound in `check`
99
--> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:7:13
1010
|
11-
LL | fn check<T: std::marker::UnsizedConstParamTy + ?Sized>() {}
12-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
11+
LL | fn check<T: std::marker::ConstParamTy_ + ?Sized>() {}
12+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
1313

1414
error[E0277]: `NotParam` can't be used as a const parameter type
1515
--> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:11:13
1616
|
1717
LL | check::<[NotParam]>();
18-
| ^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `NotParam`
18+
| ^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `NotParam`
1919
|
20-
= note: required for `[NotParam]` to implement `UnsizedConstParamTy`
20+
= note: required for `[NotParam]` to implement `ConstParamTy_`
2121
note: required by a bound in `check`
2222
--> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:7:13
2323
|
24-
LL | fn check<T: std::marker::UnsizedConstParamTy + ?Sized>() {}
25-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
24+
LL | fn check<T: std::marker::ConstParamTy_ + ?Sized>() {}
25+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
2626

2727
error[E0277]: `NotParam` can't be used as a const parameter type
2828
--> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:12:13
2929
|
3030
LL | check::<[NotParam; 17]>();
31-
| ^^^^^^^^^^^^^^ the trait `UnsizedConstParamTy` is not implemented for `NotParam`
31+
| ^^^^^^^^^^^^^^ the trait `ConstParamTy_` is not implemented for `NotParam`
3232
|
33-
= note: required for `[NotParam; 17]` to implement `UnsizedConstParamTy`
33+
= note: required for `[NotParam; 17]` to implement `ConstParamTy_`
3434
note: required by a bound in `check`
3535
--> $DIR/const_param_ty_generic_bounds_do_not_hold.rs:7:13
3636
|
37-
LL | fn check<T: std::marker::UnsizedConstParamTy + ?Sized>() {}
38-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
37+
LL | fn check<T: std::marker::ConstParamTy_ + ?Sized>() {}
38+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `check`
3939

4040
error: aborting due to 3 previous errors
4141

tests/ui/const-generics/adt_const_params/const_param_ty_good.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
#![feature(adt_const_params, unsized_const_params)]
44
#![allow(incomplete_features)]
55

6-
use std::marker::UnsizedConstParamTy;
6+
use std::marker::{ConstParamTy, ConstParamTy_};
77

88
#[derive(PartialEq, Eq)]
99
struct S<T> {
1010
field: u8,
1111
gen: T,
1212
}
1313

14-
impl<T: UnsizedConstParamTy> UnsizedConstParamTy for S<T> {}
14+
impl<T: ConstParamTy_> ConstParamTy_ for S<T> {}
1515

16-
#[derive(PartialEq, Eq, UnsizedConstParamTy)]
16+
#[derive(PartialEq, Eq, ConstParamTy)]
1717
struct D<T> {
1818
field: u8,
1919
gen: T,
2020
}
2121

22-
fn check<T: UnsizedConstParamTy + ?Sized>() {}
22+
fn check<T: ConstParamTy_ + ?Sized>() {}
2323

2424
fn main() {
2525
check::<u8>();

tests/ui/const-generics/adt_const_params/const_param_ty_impl_bad_field.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ struct NotParam;
77
#[derive(PartialEq, Eq)]
88
struct CantParam(NotParam);
99

10-
impl std::marker::UnsizedConstParamTy for CantParam {}
10+
impl std::marker::ConstParamTy_ for CantParam {}
1111
//~^ error: the trait `ConstParamTy_` cannot be implemented for this type
1212

13-
#[derive(std::marker::UnsizedConstParamTy, Eq, PartialEq)]
13+
#[derive(std::marker::ConstParamTy, Eq, PartialEq)]
1414
//~^ error: the trait `ConstParamTy_` cannot be implemented for this type
1515
struct CantParamDerive(NotParam);
1616

0 commit comments

Comments
 (0)