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
xxxxxxxxxx
TAIT overview
Old solver
Inferring opaques in the old solver is mainly the responsibility of two parts of the type system:
Eq
,Sub
,TypeRelating
(NLL) handle cases when opaques are equated with other types.replace_opaque_types_with_inference_vars
, which manually folds a type, replacing any in-scope opaques with inference variables, which is itself used in to places:Old solver (more notes):
DefineOpaqueTypes
Since
Eq
and similar relations all succeed when comparing an opaque type against any type satisfying its bound, we sometimes run into issues (similar to how comparing against inference vars always succeeds).Contrary to its outdated documentation, it is not used just
But most usage sites (2/3rd) are now rejecting opaque types from being equal to any type fulfilling its bounds and registering said type as a hidden type.
It is a feature grown out of necessity of how we do type checking and how opaque types in the old solver work.
Bubbles!!
- 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 →DefiningAnchor::Bubble
–one challenging case:
Background
type_of
query actually delegates out to thetypeck
queries to find out where an opaque is defined. This doesn't change between the old solver, and is pretty well detailed in the dev guide.New solver:
Self::Something = impl
Michael's point:
Lambda<...Ti...>
, it should be valid to change to?X = Ti
andLambda<...?x...>
.T::Foo
normalizationerrs: Recursive calls act as real opaques, not replaced w/ infer vars
errs (old solver):
(Workaround is:)
Problems with new solver:
project goals in non-defining use in defining scope: https://rust.godbolt.org/z/e5sbrrjP8
TC: Is there an old-solver/new-solver difference for?: https://rust.godbolt.org/z/1cTh8r5Mh
How do we align new and old solver behavior
Expected outcomes
Key questions for discussion
Notes from the meetup itself
Niko: unsound examples of opaque types?
https://github.com/rust-lang/rust/issues?q=is%3Aopen+label%3AI-unsound+label%3AA-impl-trait
NM: What do we have to do to stabilize TAIT before the new trait solver is stabilized?
CE: I feel like, with a couple of exceptions, the new solver accepts more code than the old solver.
TC: What if it's non-defining?
https://rust.godbolt.org/z/TnsjeP4xP
Projection goals non-defining use in defining scope
- 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 →Things to do
Bubble
and always pass in the actual anchor, test perf on old solveropaque_types_defined_by
query should return not just a list of opaques in the signature, but also a list of opaques that are in scope (and thus are in their defining scope)check_opaque_type_well_formed
orcheck_opaque_meets_bounds
opaque_types_defined_by
reject functions that mention the same TAIT twice with different lifetime paramsDefineOpaqueTypes::No
and either document or change themE-easy
: flip it toYes
, see what tests fail, document the site by mentioning the test. If no tests fail, change them and leave a comment that there's no test excersising it.Min-TAIT discussion
Technical constraints…
- 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 →- 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 →- 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 →- 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 →- 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 →Projection
goals for non-defining use in defining scope (New)- 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 →…and how to avoid them
List of core issues:
ideas:
Conceptually, we want TAIT to act as much like RPIT as possible.
- oli: having TAIT in arguments is not much more complicated
- errs: let statements too?
- lcnr: If the tait is somewhere in signature, theoretically it doesn't matter if you're able to name the TAIT in the function. It does matter if you can name the TAIT, people are gonna do weird stuff with it.
- errs: If you define it once, then you can name it any time you want.
- lcnr: It would prevent non-defining usages in defining scope, though.
oli: Annoying rustc changes:
Newtype replacement pattern:
Proposal
Image Not Showing
Possible Reasons
(preferred)
- 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 →future work
oli: if defines attr acts like an XOR then it's simple.
lcnr: XOR behavior is bad for IDEs
Defines in the WC outside of the defining scope:
https://docs.rs/tokio-util/latest/tokio_util/sync/struct.ReusableBoxFuture.html
Proposal
Image Not Showing
Possible Reasons
- 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 →Proposal
Image Not Showing
Possible Reasons
Image Not Showing
Possible Reasons
- 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 →- 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 →Proposal
Image Not Showing
Possible Reasons
- 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 →oli: Only allow one usage of a TAIT in the entire crate
errs: no
design constraints