Skip to content

Commit

Permalink
Rollup merge of #126314 - lcnr:fix-relnotes, r=pietroalbini
Browse files Browse the repository at this point in the history
fix RELEASES: we do not support upcasting to auto traits

#119338 does not actually support casts from `dyn Trait` to `dyn Auto`, only from `dyn Trait` to `dyn Trait + Auto`. The following test does not compile

```rust
trait Trait: Send {}
impl<T: Send> Trait for T {}

fn foo() {
    let x: &i32 = &1;
    let y = x as &dyn Trait as &dyn Send;
}
```
it actually also doesn't compile with `feature(trait_upcasting)`, opened #126313 for that

r? `@Mark-Simulacrum` `@cuviper`
  • Loading branch information
workingjubilee authored Jun 12, 2024
2 parents 6f4f405 + bbc5509 commit 0a52849
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Language
- [Split `refining_impl_trait` lint into `_reachable`, `_internal` variants](https://github.com/rust-lang/rust/pull/121720/)
- [Remove unnecessary type inference when using associated types inside of higher ranked `where`-bounds](https://github.com/rust-lang/rust/pull/119849)
- [Weaken eager detection of cyclic types during type inference](https://github.com/rust-lang/rust/pull/119989)
- [`trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Auto`](https://github.com/rust-lang/rust/pull/119338)
- [`trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Trait + Auto`](https://github.com/rust-lang/rust/pull/119338)

<a id="1.78.0-Compiler"></a>

Expand Down

0 comments on commit 0a52849

Please sign in to comment.