Skip to content

Commit bfdf5c7

Browse files
committed
Stabilize RFC3324 dyn upcasting coercion
Aka trait_upcasting feature. And also adjust the `deref_into_dyn_supertrait` lint.
1 parent b1f0132 commit bfdf5c7

File tree

4 files changed

+2
-9
lines changed

4 files changed

+2
-9
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![feature(round_ties_even)]
1212
#![feature(let_chains)]
1313
#![feature(lint_reasons)]
14-
#![feature(trait_upcasting)]
14+
#![cfg_attr(bootstrap, feature(trait_upcasting))]
1515
// Configure clippy and other lints
1616
#![allow(
1717
clippy::collapsible_else_if,

tests/fail/dyn-upcast-trait-mismatch.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![feature(trait_upcasting)]
2-
#![allow(incomplete_features)]
3-
41
trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
52
fn a(&self) -> i32 {
63
10

tests/pass/box-custom-alloc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@revisions: stack tree
22
//@[tree]compile-flags: -Zmiri-tree-borrows
3-
#![allow(incomplete_features)] // for trait upcasting
4-
#![feature(allocator_api, trait_upcasting)]
3+
#![feature(allocator_api)]
54

65
use std::alloc::Layout;
76
use std::alloc::{AllocError, Allocator};

tests/pass/dyn-upcast.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![feature(trait_upcasting)]
2-
#![allow(incomplete_features)]
3-
41
fn main() {
52
basic();
63
diamond();

0 commit comments

Comments
 (0)