Skip to content

Commit fa84ee6

Browse files
committed
Auto merge of #118133 - Urgau:stabilize_trait_upcasting, r=WaffleLapkin
Stabilize RFC3324 dyn upcasting coercion This PR stabilize the `trait_upcasting` feature, aka rust-lang/rfcs#3324. The FCP was completed here: rust-lang/rust#65991 (comment). ~~And also remove the `deref_into_dyn_supertrait` lint which is now handled by dyn upcasting coercion.~~ Heavily inspired by rust-lang/rust#101718 Fixes rust-lang/rust#65991
2 parents e62ceec + bfdf5c7 commit fa84ee6

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)