Here's the recent MCP:
https://github.com/rust-lang/compiler-team/issues/727
TC: Starting on the default bounds item, what are some of the hard problems, and how is this approaching them?
petrochenkov: One hard problem is cycles in the trait solver. The solution here is to wait for the new trait solver.
The other is compile times. With the new bounds, it's about twice as slow. We need some fast path. The solution may help for Sized
bounds also, as those are added in nearly all places also.
Forgettable
traitTC: As above, what are some of the hard problems, and how is this approaching them?
petrochenkov: The current approach being implemented isn't the full proposal. Currently it's a bit of a hack. We're currently doing these as post-mono errors.
Say that we have some root function (i.e. ManuallyDrop::new
) that forgets things. What we do is that after monomorphization, after all of the type arguments are substituted, we then check whether the types passed to it are Forgettable
. This should be checked earlier during typechecking, but this should work for now.
Daria: !Forgettable
types introduce new object semantics which old unsafe code does not uphold, even without any function calls by type punning, effectivelly requiring us to restrict pointer casts. Thus old unsafe code should not automatically get ability to work with !Forgettable
.
Let's say we have an object that we copy into some byte buffer, which is allowed, and then we forget the actual value. If we don't restrict those values to passed into old unsafe functions. They would assume the leak semantics that we have today. And then do nasty stuff if a function like mem::forget
is called.
The ?Forgettable
version is actually backward compatible, I believe. So that's good news. At least, until I'm proven otherwise.
Daria: We have a Destruct
trait in mind if a type is forbidden to be dropped synchronously. It is actually possible to return an error if we try to instantiate drop glue for that type. This is limited in cases of synchronous code. But for asynchronous code, if we have some object that can only be destructed by asynchronous destructors, we would not need to instantiate drop glue for that type. We would only instantiate asynchronous drop glue. So that is a positive.
petrochenkov: We have a project to work on this through the end of April. I'm not sure we can continue working on it beyond that.
We think that the async drop glue will be mergable by the end of April.
Daria: Wrote this today:
https://github.com/zetanumbers/posts/blob/main/async-drop-design.md
Daria: I'm planning to continue working on the effect composition problem.
TC: Oli has a comment about the limits of what…
https://github.com/rust-lang/rust/pull/121801
…does. What do we think about that?
petrochenkov: That's right. We split this work up between two people. There's a branch for the other work but no PR yet:
https://github.com/azhogin/rust/tree/azhogin/async-drop
(The meeting ended here.)
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing