Skip to content

Commit e9d5d11

Browse files
committed
remove feature(trait_upcasting) from tests and bless them
1 parent a970a0d commit e9d5d11

File tree

72 files changed

+67
-275
lines changed

Some content is hidden

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

72 files changed

+67
-275
lines changed

Diff for: tests/codegen/vtable-upcast.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
33

44
#![crate_type = "lib"]
5-
#![feature(trait_upcasting)]
65

76
pub trait Base {
87
fn base(&self);

Diff for: tests/crashes/131886.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ known-bug: #131886
22
//@ compile-flags: -Zvalidate-mir --crate-type=lib
3-
#![feature(trait_upcasting, type_alias_impl_trait)]
3+
#![feature(type_alias_impl_trait)]
44

55
type Tait = impl Sized;
66

Diff for: tests/ui/codegen/issue-99551.rs

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

43
pub trait A {}
54
pub trait B {}

Diff for: tests/ui/dyn-star/no-unsize-coerce-dyn-trait.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#![feature(dyn_star, trait_upcasting)]
2-
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
1+
#![expect(incomplete_features)]
2+
#![feature(dyn_star)]
33

44
trait A: B {}
55
trait B {}

Diff for: tests/ui/dyn-star/no-unsize-coerce-dyn-trait.stderr

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/no-unsize-coerce-dyn-trait.rs:1:12
3-
|
4-
LL | #![feature(dyn_star, trait_upcasting)]
5-
| ^^^^^^^^
6-
|
7-
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
8-
= note: `#[warn(incomplete_features)]` on by default
9-
101
error[E0308]: mismatched types
112
--> $DIR/no-unsize-coerce-dyn-trait.rs:11:26
123
|
@@ -18,6 +9,6 @@ LL | let y: Box<dyn* B> = x;
189
= note: expected struct `Box<dyn* B>`
1910
found struct `Box<dyn* A>`
2011

21-
error: aborting due to 1 previous error; 1 warning emitted
12+
error: aborting due to 1 previous error
2213

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

Diff for: tests/ui/dyn-star/upcast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ known-bug: #104800
22

3-
#![feature(dyn_star, trait_upcasting)]
3+
#![feature(dyn_star)]
44

55
trait Foo: Bar {
66
fn hello(&self);

Diff for: tests/ui/dyn-star/upcast.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
22
--> $DIR/upcast.rs:3:12
33
|
4-
LL | #![feature(dyn_star, trait_upcasting)]
4+
LL | #![feature(dyn_star)]
55
| ^^^^^^^^
66
|
77
= note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information

Diff for: tests/ui/feature-gates/feature-gate-trait_upcasting.rs

-13
This file was deleted.

Diff for: tests/ui/feature-gates/feature-gate-trait_upcasting.stderr

-14
This file was deleted.

Diff for: tests/ui/impl-trait/unsized_coercion5.old.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time
2-
--> $DIR/unsized_coercion5.rs:17:32
2+
--> $DIR/unsized_coercion5.rs:15:32
33
|
44
LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
55
| ^ doesn't have a size known at compile-time

Diff for: tests/ui/impl-trait/unsized_coercion5.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//@[next] compile-flags: -Znext-solver
66
//@[next] check-pass
77

8-
#![feature(trait_upcasting)]
9-
108
trait Trait {}
119

1210
impl Trait for u32 {}

Diff for: tests/ui/sanitizer/cfi/supertraits.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(trait_upcasting)]
21
// Check that super-traits are callable.
32

43
//@ revisions: cfi kcfi

Diff for: tests/ui/traits/next-solver/normalize/normalize-unsize-rhs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -Znext-solver
22
//@ check-pass
3-
#![feature(trait_upcasting)]
43

54
trait A {}
65
trait B: A {}

Diff for: tests/ui/traits/next-solver/trait-upcast-lhs-needs-normalization.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ check-pass
22
//@ compile-flags: -Znext-solver
3-
#![feature(trait_upcasting)]
43

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

Diff for: tests/ui/traits/next-solver/upcast-right-substs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -Znext-solver
22
//@ check-pass
3-
#![feature(trait_upcasting)]
43

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

Diff for: tests/ui/traits/trait-upcasting/add-supertrait-auto-traits.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//@ ignore-compare-mode-next-solver (explicit revisions)
44
//@[next] compile-flags: -Znext-solver
55

6-
#![feature(trait_upcasting)]
7-
86
trait Target {}
97
trait Source: Send + Target {}
108

Diff for: tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(trait_upcasting)]
21
#![feature(trait_alias)]
32

43
// Although we *elaborate* `T: Alias` to `i32: B`, we should

Diff for: tests/ui/traits/trait-upcasting/alias-where-clause-isnt-supertrait.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/alias-where-clause-isnt-supertrait.rs:27:5
2+
--> $DIR/alias-where-clause-isnt-supertrait.rs:26:5
33
|
44
LL | fn test(x: &dyn C) -> &dyn B {
55
| ------ expected `&dyn B` because of return type

Diff for: tests/ui/traits/trait-upcasting/basic.rs

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

3-
#![feature(trait_upcasting)]
4-
53
trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
64
fn a(&self) -> i32 {
75
10

Diff for: tests/ui/traits/trait-upcasting/correct-supertrait-substitution.rs

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

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

Diff for: tests/ui/traits/trait-upcasting/deref-upcast-behavioral-change.rs

-35
This file was deleted.

Diff for: tests/ui/traits/trait-upcasting/deref-upcast-behavioral-change.stderr

-19
This file was deleted.

Diff for: tests/ui/traits/trait-upcasting/diamond.rs

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

3-
#![feature(trait_upcasting)]
4-
53
trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
64
fn a(&self) -> i32 {
75
10

Diff for: tests/ui/traits/trait-upcasting/fewer-associated.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
//@ ignore-compare-mode-next-solver (explicit revisions)
55
//@[next] compile-flags: -Znext-solver
66

7-
#![feature(trait_upcasting)]
8-
97
trait A: B {
108
type Assoc;
119
}

Diff for: tests/ui/traits/trait-upcasting/higher-ranked-upcasting-ok.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
// Check that we are able to instantiate a binder during trait upcasting,
77
// and that it doesn't cause any issues with codegen either.
88

9-
#![feature(trait_upcasting)]
10-
119
trait Supertrait<'a, 'b> {}
1210
trait Subtrait<'a, 'b>: Supertrait<'a, 'b> {}
1311

Diff for: tests/ui/traits/trait-upcasting/higher-ranked-upcasting-ub.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// We previously wrongly instantiated binders during trait upcasting,
66
// allowing the super trait to be more generic than the sub trait.
77
// This was unsound.
8-
#![feature(trait_upcasting)]
8+
99
trait Supertrait<'a, 'b> {
1010
fn cast(&self, x: &'a str) -> &'b str;
1111
}

Diff for: tests/ui/traits/trait-upcasting/illegal-upcast-from-impl.current.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/illegal-upcast-from-impl.rs:17:66
2+
--> $DIR/illegal-upcast-from-impl.rs:15:66
33
|
44
LL | fn illegal(x: &dyn Sub<Assoc = ()>) -> &dyn Super<Assoc = i32> { x }
55
| ----------------------- ^ expected trait `Super`, found trait `Sub`

Diff for: tests/ui/traits/trait-upcasting/illegal-upcast-from-impl.next.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/illegal-upcast-from-impl.rs:17:66
2+
--> $DIR/illegal-upcast-from-impl.rs:15:66
33
|
44
LL | fn illegal(x: &dyn Sub<Assoc = ()>) -> &dyn Super<Assoc = i32> { x }
55
| ----------------------- ^ expected trait `Super`, found trait `Sub`

Diff for: tests/ui/traits/trait-upcasting/illegal-upcast-from-impl.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//@ ignore-compare-mode-next-solver (explicit revisions)
33
//@[next] compile-flags: -Znext-solver
44

5-
#![feature(trait_upcasting)]
6-
75
trait Super {
86
type Assoc;
97
}

Diff for: tests/ui/traits/trait-upcasting/illegal-upcast-to-impl-opaque.rs

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
//@[next] rustc-env:RUST_BACKTRACE=0
1010
//@ check-pass
1111

12-
#![feature(trait_upcasting)]
13-
1412
trait Super {
1513
type Assoc;
1614
}

Diff for: tests/ui/traits/trait-upcasting/inference-behavior-change-deref.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![deny(deref_into_dyn_supertrait)]
2-
#![feature(trait_upcasting)] // remove this and the test compiles
3-
41
use std::ops::Deref;
52

63
trait Bar<T> {}
@@ -32,5 +29,5 @@ fn main() {
3229
let x: &dyn Foo = &();
3330
let y = take_dyn(x);
3431
let z: u32 = y;
35-
//~^ ERROR mismatched types
32+
//~^ error: mismatched types
3633
}

Diff for: tests/ui/traits/trait-upcasting/inference-behavior-change-deref.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/inference-behavior-change-deref.rs:34:18
2+
--> $DIR/inference-behavior-change-deref.rs:31:18
33
|
44
LL | let z: u32 = y;
55
| --- ^ expected `u32`, found `i32`

Diff for: tests/ui/traits/trait-upcasting/invalid-upcast.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(trait_upcasting)]
2-
31
trait Foo {
42
fn a(&self) -> i32 {
53
10

0 commit comments

Comments
 (0)