Skip to content

Commit

Permalink
Auto merge of #118133 - Urgau:stabilize_trait_upcasting, r=WaffleLapkin
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Nov 22, 2023
2 parents e62ceec + bfdf5c7 commit fa84ee6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#![feature(round_ties_even)]
#![feature(let_chains)]
#![feature(lint_reasons)]
#![feature(trait_upcasting)]
#![cfg_attr(bootstrap, feature(trait_upcasting))]
// Configure clippy and other lints
#![allow(
clippy::collapsible_else_if,
Expand Down
3 changes: 0 additions & 3 deletions tests/fail/dyn-upcast-trait-mismatch.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(trait_upcasting)]
#![allow(incomplete_features)]

trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
fn a(&self) -> i32 {
10
Expand Down
3 changes: 1 addition & 2 deletions tests/pass/box-custom-alloc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@revisions: stack tree
//@[tree]compile-flags: -Zmiri-tree-borrows
#![allow(incomplete_features)] // for trait upcasting
#![feature(allocator_api, trait_upcasting)]
#![feature(allocator_api)]

use std::alloc::Layout;
use std::alloc::{AllocError, Allocator};
Expand Down
3 changes: 0 additions & 3 deletions tests/pass/dyn-upcast.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(trait_upcasting)]
#![allow(incomplete_features)]

fn main() {
basic();
diamond();
Expand Down

0 comments on commit fa84ee6

Please sign in to comment.