Skip to content

Commit 75afd0b

Browse files
committed
use dyn Trait more in tests
1 parent 4d1241f commit 75afd0b

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

src/test/ui/hygiene/assoc_ty_bindings.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ trait Derived: Base {
1212
}
1313

1414
macro mac() {
15-
type A = Base<AssocTy = u8>;
16-
type B = Derived<AssocTy = u8>;
15+
type A = dyn Base<AssocTy = u8>;
16+
type B = dyn Derived<AssocTy = u8>;
1717

1818
impl Base for u8 {
1919
type AssocTy = u8;

src/test/ui/privacy/associated-item-privacy-type-binding.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ mod priv_trait {
88
pub trait PubTr: PrivTr {}
99

1010
pub macro mac1() {
11-
let _: Box<PubTr<AssocTy = u8>>;
11+
let _: Box<dyn PubTr<AssocTy = u8>>;
1212
//~^ ERROR trait `priv_trait::PrivTr` is private
1313
//~| ERROR trait `priv_trait::PrivTr` is private
14-
type InSignatureTy2 = Box<PubTr<AssocTy = u8>>;
14+
type InSignatureTy2 = Box<dyn PubTr<AssocTy = u8>>;
1515
//~^ ERROR trait `priv_trait::PrivTr` is private
1616
trait InSignatureTr2: PubTr<AssocTy = u8> {}
1717
//~^ ERROR trait `priv_trait::PrivTr` is private
1818
}
1919
pub macro mac2() {
20-
let _: Box<PrivTr<AssocTy = u8>>;
20+
let _: Box<dyn PrivTr<AssocTy = u8>>;
2121
//~^ ERROR trait `priv_trait::PrivTr` is private
2222
//~| ERROR trait `priv_trait::PrivTr` is private
23-
type InSignatureTy1 = Box<PrivTr<AssocTy = u8>>;
23+
type InSignatureTy1 = Box<dyn PrivTr<AssocTy = u8>>;
2424
//~^ ERROR trait `priv_trait::PrivTr` is private
2525
trait InSignatureTr1: PrivTr<AssocTy = u8> {}
2626
//~^ ERROR trait `priv_trait::PrivTr` is private
@@ -41,15 +41,15 @@ mod priv_parent_substs {
4141
pub trait PubTr: PubTrWithParam<Priv> {}
4242

4343
pub macro mac() {
44-
let _: Box<PubTrWithParam<AssocTy = u8>>;
44+
let _: Box<dyn PubTrWithParam<AssocTy = u8>>;
4545
//~^ ERROR type `priv_parent_substs::Priv` is private
4646
//~| ERROR type `priv_parent_substs::Priv` is private
47-
let _: Box<PubTr<AssocTy = u8>>;
47+
let _: Box<dyn PubTr<AssocTy = u8>>;
4848
//~^ ERROR type `priv_parent_substs::Priv` is private
4949
//~| ERROR type `priv_parent_substs::Priv` is private
50-
pub type InSignatureTy1 = Box<PubTrWithParam<AssocTy = u8>>;
50+
pub type InSignatureTy1 = Box<dyn PubTrWithParam<AssocTy = u8>>;
5151
//~^ ERROR type `priv_parent_substs::Priv` is private
52-
pub type InSignatureTy2 = Box<PubTr<AssocTy = u8>>;
52+
pub type InSignatureTy2 = Box<dyn PubTr<AssocTy = u8>>;
5353
//~^ ERROR type `priv_parent_substs::Priv` is private
5454
trait InSignatureTr1: PubTrWithParam<AssocTy = u8> {}
5555
//~^ ERROR type `priv_parent_substs::Priv` is private

src/test/ui/privacy/associated-item-privacy-type-binding.stderr

+20-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: trait `priv_trait::PrivTr` is private
22
--> $DIR/associated-item-privacy-type-binding.rs:11:13
33
|
4-
LL | let _: Box<PubTr<AssocTy = u8>>;
4+
LL | let _: Box<dyn PubTr<AssocTy = u8>>;
55
| ^
66
...
77
LL | priv_trait::mac1!();
@@ -12,8 +12,8 @@ LL | priv_trait::mac1!();
1212
error: trait `priv_trait::PrivTr` is private
1313
--> $DIR/associated-item-privacy-type-binding.rs:11:16
1414
|
15-
LL | let _: Box<PubTr<AssocTy = u8>>;
16-
| ^^^^^^^^^^^^^^^^^^^^^^^^
15+
LL | let _: Box<dyn PubTr<AssocTy = u8>>;
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717
...
1818
LL | priv_trait::mac1!();
1919
| -------------------- in this macro invocation
@@ -23,8 +23,8 @@ LL | priv_trait::mac1!();
2323
error: trait `priv_trait::PrivTr` is private
2424
--> $DIR/associated-item-privacy-type-binding.rs:14:31
2525
|
26-
LL | type InSignatureTy2 = Box<PubTr<AssocTy = u8>>;
27-
| ^^^^^^^^^^^^^^^^^^^^^^^^
26+
LL | type InSignatureTy2 = Box<dyn PubTr<AssocTy = u8>>;
27+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2828
...
2929
LL | priv_trait::mac1!();
3030
| -------------------- in this macro invocation
@@ -45,7 +45,7 @@ LL | priv_trait::mac1!();
4545
error: trait `priv_trait::PrivTr` is private
4646
--> $DIR/associated-item-privacy-type-binding.rs:20:13
4747
|
48-
LL | let _: Box<PrivTr<AssocTy = u8>>;
48+
LL | let _: Box<dyn PrivTr<AssocTy = u8>>;
4949
| ^
5050
...
5151
LL | priv_trait::mac2!();
@@ -56,8 +56,8 @@ LL | priv_trait::mac2!();
5656
error: trait `priv_trait::PrivTr` is private
5757
--> $DIR/associated-item-privacy-type-binding.rs:20:16
5858
|
59-
LL | let _: Box<PrivTr<AssocTy = u8>>;
60-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
59+
LL | let _: Box<dyn PrivTr<AssocTy = u8>>;
60+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6161
...
6262
LL | priv_trait::mac2!();
6363
| -------------------- in this macro invocation
@@ -67,8 +67,8 @@ LL | priv_trait::mac2!();
6767
error: trait `priv_trait::PrivTr` is private
6868
--> $DIR/associated-item-privacy-type-binding.rs:23:31
6969
|
70-
LL | type InSignatureTy1 = Box<PrivTr<AssocTy = u8>>;
71-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
70+
LL | type InSignatureTy1 = Box<dyn PrivTr<AssocTy = u8>>;
71+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7272
...
7373
LL | priv_trait::mac2!();
7474
| -------------------- in this macro invocation
@@ -89,7 +89,7 @@ LL | priv_trait::mac2!();
8989
error: type `priv_parent_substs::Priv` is private
9090
--> $DIR/associated-item-privacy-type-binding.rs:44:13
9191
|
92-
LL | let _: Box<PubTrWithParam<AssocTy = u8>>;
92+
LL | let _: Box<dyn PubTrWithParam<AssocTy = u8>>;
9393
| ^
9494
...
9595
LL | priv_parent_substs::mac!();
@@ -100,8 +100,8 @@ LL | priv_parent_substs::mac!();
100100
error: type `priv_parent_substs::Priv` is private
101101
--> $DIR/associated-item-privacy-type-binding.rs:44:16
102102
|
103-
LL | let _: Box<PubTrWithParam<AssocTy = u8>>;
104-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103+
LL | let _: Box<dyn PubTrWithParam<AssocTy = u8>>;
104+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
105105
...
106106
LL | priv_parent_substs::mac!();
107107
| --------------------------- in this macro invocation
@@ -111,7 +111,7 @@ LL | priv_parent_substs::mac!();
111111
error: type `priv_parent_substs::Priv` is private
112112
--> $DIR/associated-item-privacy-type-binding.rs:47:13
113113
|
114-
LL | let _: Box<PubTr<AssocTy = u8>>;
114+
LL | let _: Box<dyn PubTr<AssocTy = u8>>;
115115
| ^
116116
...
117117
LL | priv_parent_substs::mac!();
@@ -122,8 +122,8 @@ LL | priv_parent_substs::mac!();
122122
error: type `priv_parent_substs::Priv` is private
123123
--> $DIR/associated-item-privacy-type-binding.rs:47:16
124124
|
125-
LL | let _: Box<PubTr<AssocTy = u8>>;
126-
| ^^^^^^^^^^^^^^^^^^^^^^^^
125+
LL | let _: Box<dyn PubTr<AssocTy = u8>>;
126+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127127
...
128128
LL | priv_parent_substs::mac!();
129129
| --------------------------- in this macro invocation
@@ -133,8 +133,8 @@ LL | priv_parent_substs::mac!();
133133
error: type `priv_parent_substs::Priv` is private
134134
--> $DIR/associated-item-privacy-type-binding.rs:50:35
135135
|
136-
LL | pub type InSignatureTy1 = Box<PubTrWithParam<AssocTy = u8>>;
137-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
136+
LL | pub type InSignatureTy1 = Box<dyn PubTrWithParam<AssocTy = u8>>;
137+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138138
...
139139
LL | priv_parent_substs::mac!();
140140
| --------------------------- in this macro invocation
@@ -144,8 +144,8 @@ LL | priv_parent_substs::mac!();
144144
error: type `priv_parent_substs::Priv` is private
145145
--> $DIR/associated-item-privacy-type-binding.rs:52:35
146146
|
147-
LL | pub type InSignatureTy2 = Box<PubTr<AssocTy = u8>>;
148-
| ^^^^^^^^^^^^^^^^^^^^^^^^
147+
LL | pub type InSignatureTy2 = Box<dyn PubTr<AssocTy = u8>>;
148+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
149149
...
150150
LL | priv_parent_substs::mac!();
151151
| --------------------------- in this macro invocation

0 commit comments

Comments
 (0)