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.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
tags:
thoughts
,solver
Problem with
dyn Trait: Trait
in new solverIn order for
dyn Trait: Trait
to be sound, proving the trait goal must additionally prove that:Trait
are satisfied bydyn Trait
Trait
's associated items are satisfied bydyn Trait
's associated item types,dyn Trait<Assoc = ...>
.Where it goes wrong
In this example, when proving that
dyn Setup<From = T>: Setup
, we must also instantiate and evaluate the item bounds for the associated itemFrom
:<dyn Setup<From = T> as Setup>::From: Copy
<dyn Setup<From = T> as Setup>::From: Sized
In the old solver, these goals are normalized before being evaluated into
T: Copy
andT: Sized
. We then can see pretty clearly thatT: Copy
does not hold in the body ofcopy_any
!In the new solver, if we try doing the same thing, the goals are not normalized before being recursively evaluated. When we try to evaluate the goal
<dyn Setup<From = T> as Setup>::From: Copy
, it's trivially satisfied viaassemble_alias_bound_candidates
.This allowing the code to compile, which segfaults
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →A smaller example, and thoughts on the issue of trivially satisfied nested goals
Given the code:
How do we solve the problem above, where the nested goals we must prove for soundness are totally "ignored" because they trivially hold?
I think that we should use a folder on these nested goals to eagerly replace projection types present in the object bounds like
<dyn Trait<Assoc = Ty> as Trait>::Assoc
intoTy
.To motivate why, let's think of what a "synthetic" impl for
dyn Trait<Assoc = Ty>
would look like–The bound on line 3 would cause an overflow.
In contrast, consider an "eagerly folded" synthetic impl like:
This would enforce the correct conditions to make sure that
dyn Trait<Assoc = Ty>: Trait
does not hold without cycles!´Rigid