Skip to content

Commit

Permalink
Rollup merge of #134367 - WaffleLapkin:trait_upcasting_as_a_treat, r=…
Browse files Browse the repository at this point in the history
…compiler-errors

Stabilize `feature(trait_upcasting)`

This feature was "done" for a while now, I think it's finally time to stabilize it! Stabilization report: rust-lang/rust#134367 (comment).
cc reference PR: rust-lang/reference#1622.

Closes #65991 (tracking issue), closes #89460 (the lint is no longer future incompat).

r? compiler-errors
  • Loading branch information
matthiaskrgr authored Feb 7, 2025
2 parents ab47de2 + 0774091 commit 584b78e
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
@@ -1,3 +1,4 @@
#![cfg_attr(bootstrap, feature(trait_upcasting))]
#![feature(rustc_private)]
#![feature(cell_update)]
#![feature(float_gamma)]
Expand All @@ -9,7 +10,6 @@
#![feature(yeet_expr)]
#![feature(nonzero_ops)]
#![feature(let_chains)]
#![feature(trait_upcasting)]
#![feature(strict_overflow_ops)]
#![feature(pointer_is_aligned_to)]
#![feature(unqualified_local_imports)]
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,9 +1,6 @@
// Validation stops this too early.
//@compile-flags: -Zmiri-disable-validation

#![feature(trait_upcasting)]
#![allow(incomplete_features)]

trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
#[allow(dead_code)]
fn a(&self) -> i32 {
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::{AllocError, Allocator, Layout};
use std::cell::Cell;
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)]

use std::fmt;

fn main() {
Expand Down

0 comments on commit 584b78e

Please sign in to comment.