Skip to content

Commit c655cbf

Browse files
Rollup merge of rust-lang#104117 - crlf0710:update_feature_gate, r=jackh726
Mark `trait_upcasting` feature no longer incomplete. This marks the `trait_upcasting` feature no longer incomplete since rust-lang#101336 has been settled for a little while. r? `````@jackh726`````
2 parents 3b91f01 + 3074678 commit c655cbf

25 files changed

+83
-83
lines changed

compiler/rustc_feature/src/active.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,9 @@ declare_features! (
512512
(active, thread_local, "1.0.0", Some(29594), None),
513513
/// Allows defining `trait X = A + B;` alias items.
514514
(active, trait_alias, "1.24.0", Some(41517), None),
515-
/// Allows upcasting trait objects via supertraits.
516-
/// Trait upcasting is casting, e.g., `dyn Foo -> dyn Bar` where `Foo: Bar`.
517-
(incomplete, trait_upcasting, "1.56.0", Some(65991), None),
515+
/// Allows dyn upcasting trait objects via supertraits.
516+
/// Dyn upcasting is casting, e.g., `dyn Foo -> dyn Bar` where `Foo: Bar`.
517+
(active, trait_upcasting, "1.56.0", Some(65991), None),
518518
/// Allows #[repr(transparent)] on unions (RFC 2645).
519519
(active, transparent_unions, "1.37.0", Some(60405), None),
520520
/// Allows inconsistent bounds in where clauses.

src/test/ui/codegen/issue-99551.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// build-pass
22
#![feature(trait_upcasting)]
3-
#![allow(incomplete_features)]
43

54
pub trait A {}
65
pub trait B {}

src/test/ui/traits/trait-upcasting/basic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22

33
#![feature(trait_upcasting)]
4-
#![allow(incomplete_features)]
54

65
trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
76
fn a(&self) -> i32 {

src/test/ui/traits/trait-upcasting/correct-supertrait-substitution.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
#![feature(trait_upcasting)]
3-
#![allow(incomplete_features)]
43

54
trait Foo<T: Default + ToString>: Bar<i32> + Bar<T> {}
65
trait Bar<T: Default + ToString> {

src/test/ui/traits/trait-upcasting/diamond.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22

33
#![feature(trait_upcasting)]
4-
#![allow(incomplete_features)]
54

65
trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
76
fn a(&self) -> i32 {

src/test/ui/traits/trait-upcasting/invalid-upcast.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(trait_upcasting)]
2-
#![allow(incomplete_features)]
32

43
trait Foo {
54
fn a(&self) -> i32 {

src/test/ui/traits/trait-upcasting/invalid-upcast.stderr

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/invalid-upcast.rs:54:35
2+
--> $DIR/invalid-upcast.rs:53:35
33
|
44
LL | let _: &dyn std::fmt::Debug = baz;
55
| -------------------- ^^^ expected trait `Debug`, found trait `Baz`
@@ -10,7 +10,7 @@ LL | let _: &dyn std::fmt::Debug = baz;
1010
found reference `&dyn Baz`
1111

1212
error[E0308]: mismatched types
13-
--> $DIR/invalid-upcast.rs:56:24
13+
--> $DIR/invalid-upcast.rs:55:24
1414
|
1515
LL | let _: &dyn Send = baz;
1616
| --------- ^^^ expected trait `Send`, found trait `Baz`
@@ -21,7 +21,7 @@ LL | let _: &dyn Send = baz;
2121
found reference `&dyn Baz`
2222

2323
error[E0308]: mismatched types
24-
--> $DIR/invalid-upcast.rs:58:24
24+
--> $DIR/invalid-upcast.rs:57:24
2525
|
2626
LL | let _: &dyn Sync = baz;
2727
| --------- ^^^ expected trait `Sync`, found trait `Baz`
@@ -32,7 +32,7 @@ LL | let _: &dyn Sync = baz;
3232
found reference `&dyn Baz`
3333

3434
error[E0308]: mismatched types
35-
--> $DIR/invalid-upcast.rs:61:25
35+
--> $DIR/invalid-upcast.rs:60:25
3636
|
3737
LL | let bar: &dyn Bar = baz;
3838
| -------- ^^^ expected trait `Bar`, found trait `Baz`
@@ -43,7 +43,7 @@ LL | let bar: &dyn Bar = baz;
4343
found reference `&dyn Baz`
4444

4545
error[E0308]: mismatched types
46-
--> $DIR/invalid-upcast.rs:63:35
46+
--> $DIR/invalid-upcast.rs:62:35
4747
|
4848
LL | let _: &dyn std::fmt::Debug = bar;
4949
| -------------------- ^^^ expected trait `Debug`, found trait `Bar`
@@ -54,7 +54,7 @@ LL | let _: &dyn std::fmt::Debug = bar;
5454
found reference `&dyn Bar`
5555

5656
error[E0308]: mismatched types
57-
--> $DIR/invalid-upcast.rs:65:24
57+
--> $DIR/invalid-upcast.rs:64:24
5858
|
5959
LL | let _: &dyn Send = bar;
6060
| --------- ^^^ expected trait `Send`, found trait `Bar`
@@ -65,7 +65,7 @@ LL | let _: &dyn Send = bar;
6565
found reference `&dyn Bar`
6666

6767
error[E0308]: mismatched types
68-
--> $DIR/invalid-upcast.rs:67:24
68+
--> $DIR/invalid-upcast.rs:66:24
6969
|
7070
LL | let _: &dyn Sync = bar;
7171
| --------- ^^^ expected trait `Sync`, found trait `Bar`
@@ -76,7 +76,7 @@ LL | let _: &dyn Sync = bar;
7676
found reference `&dyn Bar`
7777

7878
error[E0308]: mismatched types
79-
--> $DIR/invalid-upcast.rs:70:25
79+
--> $DIR/invalid-upcast.rs:69:25
8080
|
8181
LL | let foo: &dyn Foo = baz;
8282
| -------- ^^^ expected trait `Foo`, found trait `Baz`
@@ -87,7 +87,7 @@ LL | let foo: &dyn Foo = baz;
8787
found reference `&dyn Baz`
8888

8989
error[E0308]: mismatched types
90-
--> $DIR/invalid-upcast.rs:72:35
90+
--> $DIR/invalid-upcast.rs:71:35
9191
|
9292
LL | let _: &dyn std::fmt::Debug = foo;
9393
| -------------------- ^^^ expected trait `Debug`, found trait `Foo`
@@ -98,7 +98,7 @@ LL | let _: &dyn std::fmt::Debug = foo;
9898
found reference `&dyn Foo`
9999

100100
error[E0308]: mismatched types
101-
--> $DIR/invalid-upcast.rs:74:24
101+
--> $DIR/invalid-upcast.rs:73:24
102102
|
103103
LL | let _: &dyn Send = foo;
104104
| --------- ^^^ expected trait `Send`, found trait `Foo`
@@ -109,7 +109,7 @@ LL | let _: &dyn Send = foo;
109109
found reference `&dyn Foo`
110110

111111
error[E0308]: mismatched types
112-
--> $DIR/invalid-upcast.rs:76:24
112+
--> $DIR/invalid-upcast.rs:75:24
113113
|
114114
LL | let _: &dyn Sync = foo;
115115
| --------- ^^^ expected trait `Sync`, found trait `Foo`
@@ -120,7 +120,7 @@ LL | let _: &dyn Sync = foo;
120120
found reference `&dyn Foo`
121121

122122
error[E0308]: mismatched types
123-
--> $DIR/invalid-upcast.rs:79:25
123+
--> $DIR/invalid-upcast.rs:78:25
124124
|
125125
LL | let foo: &dyn Foo = bar;
126126
| -------- ^^^ expected trait `Foo`, found trait `Bar`
@@ -131,7 +131,7 @@ LL | let foo: &dyn Foo = bar;
131131
found reference `&dyn Bar`
132132

133133
error[E0308]: mismatched types
134-
--> $DIR/invalid-upcast.rs:81:35
134+
--> $DIR/invalid-upcast.rs:80:35
135135
|
136136
LL | let _: &dyn std::fmt::Debug = foo;
137137
| -------------------- ^^^ expected trait `Debug`, found trait `Foo`
@@ -142,7 +142,7 @@ LL | let _: &dyn std::fmt::Debug = foo;
142142
found reference `&dyn Foo`
143143

144144
error[E0308]: mismatched types
145-
--> $DIR/invalid-upcast.rs:83:24
145+
--> $DIR/invalid-upcast.rs:82:24
146146
|
147147
LL | let _: &dyn Send = foo;
148148
| --------- ^^^ expected trait `Send`, found trait `Foo`
@@ -153,7 +153,7 @@ LL | let _: &dyn Send = foo;
153153
found reference `&dyn Foo`
154154

155155
error[E0308]: mismatched types
156-
--> $DIR/invalid-upcast.rs:85:24
156+
--> $DIR/invalid-upcast.rs:84:24
157157
|
158158
LL | let _: &dyn Sync = foo;
159159
| --------- ^^^ expected trait `Sync`, found trait `Foo`

src/test/ui/traits/trait-upcasting/issue-11515-upcast-fn_mut-fn.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
#![feature(trait_upcasting)]
3-
#![allow(incomplete_features)]
43

54
struct Test {
65
func: Box<dyn FnMut() + 'static>,

src/test/ui/traits/trait-upcasting/lifetime.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22

33
#![feature(trait_upcasting)]
4-
#![allow(incomplete_features)]
54

65
trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
76
fn a(&self) -> i32 {

src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
// check-fail
22
#![feature(trait_upcasting)]
3-
#![allow(incomplete_features)]
43

54
trait Bar<T> {
65
fn bar(&self, _: T) {}
76
}
87

9-
trait Foo : Bar<i32> + Bar<u32> {
8+
trait Foo: Bar<i32> + Bar<u32> {
109
fn foo(&self, _: ()) {}
1110
}
1211

src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/multiple-occurrence-ambiguousity.rs:21:26
2+
--> $DIR/multiple-occurrence-ambiguousity.rs:20:26
33
|
44
LL | let t: &dyn Bar<_> = s;
55
| ----------- ^ expected trait `Bar`, found trait `Foo`

src/test/ui/traits/trait-upcasting/replace-vptr.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22

33
#![feature(trait_upcasting)]
4-
#![allow(incomplete_features)]
54

65
trait A {
76
fn foo_a(&self);

src/test/ui/traits/trait-upcasting/struct.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run-pass
22

33
#![feature(trait_upcasting)]
4-
#![allow(incomplete_features)]
54

65
use std::rc::Rc;
76
use std::sync::Arc;

src/test/ui/traits/trait-upcasting/subtrait-method.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(trait_upcasting)]
2-
#![allow(incomplete_features)]
32

43
trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
54
fn a(&self) -> i32 {

src/test/ui/traits/trait-upcasting/subtrait-method.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
11
error[E0599]: no method named `c` found for reference `&dyn Bar` in the current scope
2-
--> $DIR/subtrait-method.rs:56:9
2+
--> $DIR/subtrait-method.rs:55:9
33
|
44
LL | bar.c();
55
| ^ help: there is a method with a similar name: `a`
66
|
77
= help: items from traits can only be used if the trait is implemented and in scope
88
note: `Baz` defines an item `c`, perhaps you need to implement it
9-
--> $DIR/subtrait-method.rs:28:1
9+
--> $DIR/subtrait-method.rs:27:1
1010
|
1111
LL | trait Baz: Bar {
1212
| ^^^^^^^^^^^^^^
1313

1414
error[E0599]: no method named `b` found for reference `&dyn Foo` in the current scope
15-
--> $DIR/subtrait-method.rs:60:9
15+
--> $DIR/subtrait-method.rs:59:9
1616
|
1717
LL | foo.b();
1818
| ^ help: there is a method with a similar name: `a`
1919
|
2020
= help: items from traits can only be used if the trait is implemented and in scope
2121
note: `Bar` defines an item `b`, perhaps you need to implement it
22-
--> $DIR/subtrait-method.rs:18:1
22+
--> $DIR/subtrait-method.rs:17:1
2323
|
2424
LL | trait Bar: Foo {
2525
| ^^^^^^^^^^^^^^
2626

2727
error[E0599]: no method named `c` found for reference `&dyn Foo` in the current scope
28-
--> $DIR/subtrait-method.rs:62:9
28+
--> $DIR/subtrait-method.rs:61:9
2929
|
3030
LL | foo.c();
3131
| ^ help: there is a method with a similar name: `a`
3232
|
3333
= help: items from traits can only be used if the trait is implemented and in scope
3434
note: `Baz` defines an item `c`, perhaps you need to implement it
35-
--> $DIR/subtrait-method.rs:28:1
35+
--> $DIR/subtrait-method.rs:27:1
3636
|
3737
LL | trait Baz: Bar {
3838
| ^^^^^^^^^^^^^^
3939

4040
error[E0599]: no method named `b` found for reference `&dyn Foo` in the current scope
41-
--> $DIR/subtrait-method.rs:66:9
41+
--> $DIR/subtrait-method.rs:65:9
4242
|
4343
LL | foo.b();
4444
| ^ help: there is a method with a similar name: `a`
4545
|
4646
= help: items from traits can only be used if the trait is implemented and in scope
4747
note: `Bar` defines an item `b`, perhaps you need to implement it
48-
--> $DIR/subtrait-method.rs:18:1
48+
--> $DIR/subtrait-method.rs:17:1
4949
|
5050
LL | trait Bar: Foo {
5151
| ^^^^^^^^^^^^^^
5252

5353
error[E0599]: no method named `c` found for reference `&dyn Foo` in the current scope
54-
--> $DIR/subtrait-method.rs:68:9
54+
--> $DIR/subtrait-method.rs:67:9
5555
|
5656
LL | foo.c();
5757
| ^ help: there is a method with a similar name: `a`
5858
|
5959
= help: items from traits can only be used if the trait is implemented and in scope
6060
note: `Baz` defines an item `c`, perhaps you need to implement it
61-
--> $DIR/subtrait-method.rs:28:1
61+
--> $DIR/subtrait-method.rs:27:1
6262
|
6363
LL | trait Baz: Bar {
6464
| ^^^^^^^^^^^^^^

src/test/ui/traits/trait-upcasting/type-checking-test-1.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(trait_upcasting)]
2-
#![allow(incomplete_features)]
32

43
trait Foo: Bar<i32> + Bar<u32> {}
54
trait Bar<T> {

src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0605]: non-primitive cast: `&dyn Foo` as `&dyn Bar<_>`
2-
--> $DIR/type-checking-test-1.rs:17:13
2+
--> $DIR/type-checking-test-1.rs:16:13
33
|
44
LL | let _ = x as &dyn Bar<_>; // Ambiguous
55
| ^^^^^^^^^^^^^^^^ invalid cast
@@ -10,7 +10,7 @@ LL | let _ = &x as &dyn Bar<_>; // Ambiguous
1010
| +
1111

1212
error[E0277]: the trait bound `&dyn Foo: Bar<_>` is not satisfied
13-
--> $DIR/type-checking-test-1.rs:17:13
13+
--> $DIR/type-checking-test-1.rs:16:13
1414
|
1515
LL | let _ = x as &dyn Bar<_>; // Ambiguous
1616
| ^ the trait `Bar<_>` is not implemented for `&dyn Foo`

src/test/ui/traits/trait-upcasting/type-checking-test-2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(trait_upcasting)]
2-
#![allow(incomplete_features)]
32

43
trait Foo<T>: Bar<i32> + Bar<T> {}
54
trait Bar<T> {

src/test/ui/traits/trait-upcasting/type-checking-test-2.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0605]: non-primitive cast: `&dyn Foo<i32>` as `&dyn Bar<u32>`
2-
--> $DIR/type-checking-test-2.rs:20:13
2+
--> $DIR/type-checking-test-2.rs:19:13
33
|
44
LL | let _ = x as &dyn Bar<u32>; // Error
55
| ^^^^^^^^^^^^^^^^^^ invalid cast
@@ -10,15 +10,15 @@ LL | let _ = &x as &dyn Bar<u32>; // Error
1010
| +
1111

1212
error[E0277]: the trait bound `&dyn Foo<i32>: Bar<u32>` is not satisfied
13-
--> $DIR/type-checking-test-2.rs:20:13
13+
--> $DIR/type-checking-test-2.rs:19:13
1414
|
1515
LL | let _ = x as &dyn Bar<u32>; // Error
1616
| ^ the trait `Bar<u32>` is not implemented for `&dyn Foo<i32>`
1717
|
1818
= note: required for the cast from `&dyn Foo<i32>` to the object type `dyn Bar<u32>`
1919

2020
error[E0605]: non-primitive cast: `&dyn Foo<u32>` as `&dyn Bar<_>`
21-
--> $DIR/type-checking-test-2.rs:26:13
21+
--> $DIR/type-checking-test-2.rs:25:13
2222
|
2323
LL | let a = x as &dyn Bar<_>; // Ambiguous
2424
| ^^^^^^^^^^^^^^^^ invalid cast
@@ -29,7 +29,7 @@ LL | let a = &x as &dyn Bar<_>; // Ambiguous
2929
| +
3030

3131
error[E0277]: the trait bound `&dyn Foo<u32>: Bar<_>` is not satisfied
32-
--> $DIR/type-checking-test-2.rs:26:13
32+
--> $DIR/type-checking-test-2.rs:25:13
3333
|
3434
LL | let a = x as &dyn Bar<_>; // Ambiguous
3535
| ^ the trait `Bar<_>` is not implemented for `&dyn Foo<u32>`

0 commit comments

Comments
 (0)