bors
085c24790e
Auto merge of #143036 - compiler-errors:no-dyn-star, r=oli-obk
...
Remove support for `dyn*` from the compiler
This PR removes support for `dyn*` (https://github.com/rust-lang/rust/issues/102425 ), which are a currently un-RFC'd experiment that was opened a few years ago to explore a component that we thought was necessary for AFIDT (async fn in dyn trait).
It doesn't seem like we are going to need `dyn*` types -- even in an not-exposed-to-the-user way[^1] -- for us to implement AFIDT. Given that AFIDT was the original motivating purpose of `dyn*` types, I don't really see a compelling reason to have to maintain their implementation in the compiler.
[^1]: Compared to, e.g., generators whih are an unstable building block we use to implement stable syntax like `async {}`.
We've learned quite a lot from `dyn*`, but I think at this point its current behavior leads to more questions than answers. For example, `dyn*` support today remains somewhat fragile; it ICEs in many cases where the current "normal" `dyn Trait` types rely on their unsizedness for their vtable-based implementation to be sound I wouldn't be surprised if it's unsound in other ways, though I didn't play around with it too much. See the examples below.
```rust
#![feature(dyn_star)]
trait Foo {
fn hello(self);
}
impl Foo for usize {
fn hello(self) {
println!("hello, world");
}
}
fn main() {
let x: dyn* Foo = 1usize;
x.hello();
}
```
And:
```rust
#![feature(dyn_star)]
trait Trait {
type Out where Self: Sized;
}
fn main() {
let x: <dyn* Trait as Trait>::Out;
}
```
...and probably many more problems having to do with the intersection of dyn-compatibility and `Self: Sized` bounds that I was too lazy to look into like:
* GATs
* Methods with invalid signatures
* Associated consts
Generally, `dyn*` types also end up getting in the way of working with [normal `dyn` types](https://github.com/rust-lang/rust/issues/102425#issuecomment-1712604409 ) to an extent that IMO outweighs the benefit of experimentation.
I recognize that there are probably other, more creative usages of `dyn*` that are orthogonal to AFIDT. However, I think any work along those lines should first have to think through some of the more fundamental interactions between `dyn*` and dyn-compatibility before we think about reimplementing them in the type system.
---
I'm planning on removing the `DynKind` enum and the `PointerLike` built-in trait from the compiler after this PR lands.
Closes rust-lang/rust#102425 .
cc `@eholk` `@rust-lang/lang` `@rust-lang/types`
Closes rust-lang/rust#116979 .
Closes rust-lang/rust#119694 .
Closes rust-lang/rust#134591 .
Closes rust-lang/rust#104800 .
2025-07-01 21:50:21 +00:00
..
2025-04-08 23:06:31 +03:00
2025-06-30 08:06:08 +00:00
2025-06-05 09:41:58 +02:00
2025-05-05 14:27:09 +00:00
2025-06-30 20:36:16 +02:00
2025-06-16 23:04:35 +00:00
2025-06-09 11:44:24 +02:00
2024-10-24 01:48:44 +00:00
2025-01-09 17:32:29 +00:00
2025-03-09 02:00:01 +00:00
2024-12-07 21:37:13 +00:00
2025-06-09 17:02:09 +00:00
2025-03-04 18:04:07 +00:00
2025-06-30 08:45:43 +00:00
2025-06-16 23:04:35 +00:00
2025-06-03 18:08:15 +02:00
2024-02-16 20:02:50 +00:00
2025-04-03 11:08:55 +03:00
2024-11-21 03:27:05 -08:00
2025-07-01 19:00:21 +00:00
2025-04-23 18:04:25 +00:00
2024-10-10 01:13:29 +02:00
2025-04-15 15:47:30 +10:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-10-07 16:30:48 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-03-10 23:30:53 +08:00
2024-12-07 21:37:13 +00:00
2024-11-23 18:54:08 +00:00
2025-01-15 01:26:24 +00:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2025-06-16 23:04:35 +00:00
2025-06-16 23:04:35 +00:00
2025-06-04 17:48:50 +05:00
2024-11-02 03:08:04 +00:00
2025-01-06 16:08:29 -08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-06-28 16:24:17 +05:00
2025-06-30 08:45:43 +00:00
2024-04-10 00:41:27 +00:00
2024-04-10 00:41:27 +00:00
2024-12-07 21:26:20 +00:00
2024-12-07 21:37:15 +00:00
2025-04-08 23:06:31 +03:00
2024-02-16 20:02:50 +00:00
2025-06-04 17:48:50 +05:00
2024-01-02 14:17:56 +00:00
2024-01-02 14:17:56 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2025-06-30 08:45:43 +00:00
2025-06-30 08:45:43 +00:00
2025-06-08 11:25:09 +05:00
2024-12-20 16:57:14 +01:00
2024-12-20 16:57:14 +01:00
2024-12-20 16:57:14 +01:00
2025-06-29 15:37:33 +05:00
2025-06-29 15:37:33 +05:00
2023-10-04 02:04:14 +00:00
2025-02-10 20:21:39 +00:00
2023-07-23 14:13:52 -04:00
2024-10-29 16:26:57 +00:00
2024-11-21 01:35:34 +00:00
2024-11-21 01:35:34 +00:00
2025-04-09 08:56:04 +02:00
2025-04-09 08:56:04 +02:00
2023-11-24 19:15:52 +01:00
2024-05-01 14:19:34 -04:00
2025-04-05 19:34:04 +00:00
2024-10-18 00:33:50 +02:00
2024-10-17 20:43:31 +02:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2025-06-29 15:37:33 +05:00
2025-06-30 11:50:19 +05:00
2025-06-30 11:50:19 +05:00
2025-06-30 11:50:19 +05:00
2025-06-30 11:50:19 +05:00
2025-06-28 20:48:58 +00:00
2025-06-28 20:48:58 +00:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-10-21 11:45:19 +03:00
2024-10-21 11:45:19 +03:00
2024-06-03 13:21:17 +00:00
2024-06-03 13:21:17 +00:00
2024-02-16 20:02:50 +00:00
2024-10-07 16:30:48 +00:00
2024-11-02 22:17:46 +09:00
2024-11-02 22:17:46 +09:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2024-03-24 10:57:20 +01:00
2025-01-31 20:39:01 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2025-06-05 09:19:31 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2025-04-30 10:44:24 +03:00
2025-04-30 10:44:24 +03:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2025-02-15 12:18:30 +08:00
2024-09-13 14:10:56 +03:00
2024-09-13 14:10:56 +03:00
2024-09-24 10:12:05 -04:00
2024-09-24 10:12:05 -04:00
2025-03-13 21:17:46 +00:00
2025-03-13 21:17:46 +00:00
2025-03-13 21:17:46 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-04-07 17:38:07 -03:00
2024-02-16 20:02:50 +00:00
2024-03-03 16:30:48 -03:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-02-16 20:02:50 +00:00
2024-10-29 16:26:57 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-03-03 16:30:48 -03:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2025-05-26 10:57:54 +00:00
2025-05-27 08:18:11 +00:00
2024-03-03 16:30:48 -03:00
2024-12-07 21:26:20 +00:00
2024-11-26 02:50:48 +08:00
2024-11-26 02:50:48 +08:00
2023-11-24 19:15:52 +01:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-03-10 21:18:41 -04:00
2024-02-16 20:02:50 +00:00
2025-01-22 09:20:57 -08:00
2025-02-10 20:21:39 +00:00
2024-11-23 18:54:08 +00:00
2024-11-23 18:54:08 +00:00
2024-02-16 20:02:50 +00:00
2025-02-20 13:39:39 +00:00
2025-02-20 13:39:39 +00:00
2024-02-14 21:04:51 +00:00
2024-02-14 21:04:51 +00:00
2024-03-10 23:30:53 +08:00
2025-02-10 20:21:39 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2025-01-22 09:20:57 -08:00
2025-01-26 21:20:31 +01:00
2025-05-26 10:57:54 +00:00
2025-05-27 08:18:11 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-12-07 21:29:58 +00:00
2024-02-14 11:00:30 +00:00
2025-03-14 19:50:03 +00:00
2024-02-16 20:02:50 +00:00
2025-02-03 12:54:53 -05:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-10-13 19:18:46 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-10-29 16:26:57 +00:00
2025-03-14 19:50:03 +00:00
2025-01-22 09:20:57 -08:00
2025-01-26 21:20:31 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2025-02-03 10:39:32 -05:00
2025-02-10 20:21:39 +00:00
2024-11-21 01:35:34 +00:00
2025-06-30 08:06:08 +00:00
2024-02-16 20:02:50 +00:00
2025-03-14 19:50:03 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-04-10 09:56:37 +02:00
2024-02-01 03:30:26 +00:00
2023-12-05 17:15:46 +00:00
2024-05-30 22:52:33 +02:00
2025-06-30 08:06:08 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-10-29 16:26:57 +00:00
2024-07-12 21:16:09 -04:00
2024-07-12 21:16:09 -04:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-10-29 16:26:57 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-10-15 13:11:00 +02:00
2025-06-30 08:45:43 +00:00
2025-04-08 23:06:31 +03:00
2025-03-14 19:50:03 +00:00
2023-12-17 16:49:00 +08:00
2024-02-22 18:04:55 +00:00
2024-02-16 20:02:50 +00:00
2025-06-05 09:19:31 +02:00
2025-05-27 08:18:11 +00:00
2024-02-16 20:02:50 +00:00
2025-03-13 21:17:46 +00:00
2025-06-16 23:04:36 +00:00
2025-06-16 23:04:36 +00:00
2025-06-16 23:04:36 +00:00
2024-04-04 16:01:13 -04:00
2023-11-24 19:15:52 +01:00
2024-03-21 16:36:17 +00:00
2025-02-11 09:19:37 +00:00
2025-02-11 09:19:37 +00:00
2025-02-11 09:19:37 +00:00
2025-02-11 09:19:37 +00:00
2025-06-30 12:45:47 +05:00
2025-06-30 12:45:47 +05:00
2024-01-12 16:33:29 +00:00
2025-06-30 20:36:16 +02:00
2024-01-30 19:07:18 +00:00
2024-05-20 19:21:30 -04:00
2024-02-22 18:05:27 +00:00
2025-01-26 21:20:31 +01:00
2025-01-11 19:22:06 +00:00
2025-01-22 09:20:57 -08:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-02-10 20:21:39 +00:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2023-10-04 02:04:14 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-07 10:42:01 +08:00
2024-04-25 10:03:17 -04:00
2025-03-31 23:58:17 +02:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2024-03-10 21:18:41 -04:00
2024-03-10 21:18:41 -04:00
2024-03-10 21:18:41 -04:00
2024-02-16 09:29:39 +00:00
2024-02-16 09:29:39 +00:00
2024-05-06 10:48:39 -04:00
2023-10-04 02:04:14 +00:00
2025-02-10 20:21:39 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-03-04 00:21:02 +08:00
2025-06-22 10:58:25 +02:00
2024-02-16 20:02:50 +00:00
2025-06-27 05:34:08 +00:00
2025-06-27 05:34:08 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2025-03-11 12:05:02 +00:00
2024-04-06 23:25:58 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2023-11-24 19:15:52 +01:00
2025-02-18 17:34:16 +00:00
2025-02-18 17:34:16 +00:00
2025-06-30 11:50:19 +05:00
2025-06-30 11:50:19 +05:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2025-06-16 23:04:35 +00:00
2025-06-16 23:04:35 +00:00
2024-01-05 09:30:27 +00:00
2024-01-05 10:00:59 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-08 08:10:43 +00:00
2024-02-08 08:10:43 +00:00
2024-11-21 01:35:34 +00:00
2025-06-24 18:59:42 +00:00
2024-03-31 21:03:59 -04:00
2024-03-31 21:03:59 -04:00
2024-01-24 02:53:15 +00:00
2025-06-05 09:19:31 +02:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2025-06-30 11:50:19 +05:00
2025-06-30 11:50:19 +05:00
2024-02-22 18:18:33 +01:00
2024-02-22 18:18:33 +01:00
2024-03-21 00:07:44 +00:00
2025-02-10 20:21:39 +00:00
2023-10-04 02:04:14 +00:00
2025-02-10 20:21:39 +00:00
2023-10-04 02:04:14 +00:00
2025-02-10 20:21:39 +00:00
2025-05-07 17:32:59 +08:00
2025-06-22 10:58:25 +02:00
2024-02-01 03:30:26 +00:00
2024-02-16 20:02:50 +00:00
2024-11-26 02:50:48 +08:00
2025-05-26 10:57:54 +00:00
2025-05-27 08:18:11 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2024-04-21 20:10:12 -04:00
2025-06-04 19:32:06 +05:00
2025-06-04 19:32:06 +05:00
2025-05-02 15:53:51 +09:00
2025-05-02 15:53:51 +09:00
2025-06-23 18:53:56 +05:00
2025-06-23 18:53:56 +05:00
2025-01-06 16:12:04 -08:00
2025-01-06 16:12:04 -08:00
2024-06-21 21:13:10 +00:00
2024-03-25 20:20:01 +01:00
2024-03-25 20:20:01 +01:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2024-02-16 20:02:50 +00:00
2023-11-24 19:15:52 +01:00
2025-02-25 08:06:30 +00:00
2025-02-25 08:06:30 +00:00
2023-11-24 19:15:52 +01:00
2025-04-09 20:26:58 +00:00
2025-04-09 20:26:58 +00:00
2025-04-09 20:26:58 +00:00
2025-04-09 20:31:58 +00:00
2025-04-09 20:31:58 +00:00
2025-04-09 20:26:57 +00:00
2025-04-09 20:26:57 +00:00
2025-04-09 20:26:57 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-06-30 08:06:08 +00:00
2025-06-30 08:06:08 +00:00
2025-06-30 08:06:08 +00:00
2025-06-30 08:06:08 +00:00
2025-06-30 08:06:08 +00:00
2025-06-30 08:06:08 +00:00
2024-02-16 20:02:50 +00:00
2024-10-29 16:26:57 +00:00
2025-02-10 21:53:05 +00:00
2025-02-10 21:53:05 +00:00
2025-01-24 04:07:10 +00:00
2025-02-06 23:44:23 +01:00
2025-02-06 23:44:23 +01:00
2025-02-06 23:44:23 +01:00
2024-11-26 02:50:48 +08:00
2023-11-24 19:15:52 +01:00
2024-02-22 18:18:33 +01:00
2024-02-22 18:18:33 +01:00
2024-11-26 02:50:48 +08:00
2024-02-16 20:02:50 +00:00
2024-02-16 20:02:50 +00:00
2025-02-10 20:21:39 +00:00