Working through method breakage
sequenceDiagram
participant upstream as upstream,<br/>2015 edition<br/>provides trait `Tr1`<br/>with `foo()` method
participant crate as crate<br/>calls `t.foo()` where `t`<br/>implements `Tr1`+`Tr2`
participant stdlib as stdlib<br/>provides trait `Tr2`
Note over crate: developed against Rust 2018 edition
Note over crate,stdlib: (no `foo()` method available<br/> on `Tr2` at this time)
crate ->> upstream: t.foo()
Note over upstream,crate: (Currently sole resolution available)
stdlib ->> stdlib: stdlib adds `Tr2::foo()`,<br/>tagged with current (2021) edition
opt crate edition < method edition
Note over stdlib, upstream: compiler detects both methods are available,<br/>signals ambiguity warning
crate ->> upstream: t.foo()
end
crate ->> crate: crate upgrades to Rust 2021 edition
opt crate edition = method edition
Note over stdlib, upstream: compiler detects both methods are available,<br/>signals ambiguity warning
crate ->> upstream: t.foo()
end
stdlib ->> stdlib: Rust releases 2024 edition
Note over stdlib: `Tr2::foo` remains tagged with 2021 edition
opt crate edition = *method* edition (still)
Note over stdlib, upstream: compiler detects both methods are available,<br/>signals ambiguity warning
crate ->> upstream: t.foo()
end
crate ->> crate: crate attempts upgrade to Rust 2024 edition
opt crate edition > method edition
crate --X upstream: t.foo()
Note over stdlib, upstream: now issues hard ambiguity error<br/>crate dev is forced to resolve ambiguity.
end
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