Commit 0392e29
authored
Rollup merge of rust-lang#108954 - notriddle:notriddle/notable-trait-generic, r=camelid
rustdoc: handle generics better when matching notable traits
This commit makes the `clean::Type::is_same` non-commutative (renaming it `is_doc_subtype_of`), so that a generic `impl` matches a concrete return, but a generic return does not match a concrete `impl`. It makes slice and vector Write for `u8` not match on every generic return value.
Fixes rust-lang#100322
Fixes rust-lang#55082
Preview:
* https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/vec/struct.Vec.html#method.new
* https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/vec/struct.Vec.html#method.from-12
* https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/iter/trait.Iterator.html#method.intersperse_with
* https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/string/struct.String.html#method.as_bytesFile tree
15 files changed
+105
-12
lines changed- src/librustdoc
- clean
- types
- html/render
- tests/rustdoc/notable-trait
15 files changed
+105
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
1474 | | - | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
1475 | 1480 | | |
1476 | 1481 | | |
1477 | | - | |
1478 | | - | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
1479 | 1507 | | |
1480 | 1508 | | |
1481 | | - | |
| 1509 | + | |
1482 | 1510 | | |
1483 | | - | |
1484 | | - | |
| 1511 | + | |
| 1512 | + | |
1485 | 1513 | | |
1486 | | - | |
| 1514 | + | |
1487 | 1515 | | |
1488 | 1516 | | |
1489 | 1517 | | |
1490 | 1518 | | |
1491 | | - | |
1492 | | - | |
| 1519 | + | |
| 1520 | + | |
1493 | 1521 | | |
1494 | | - | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
1495 | 1536 | | |
1496 | 1537 | | |
1497 | 1538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1294 | 1294 | | |
1295 | 1295 | | |
1296 | 1296 | | |
1297 | | - | |
| 1297 | + | |
1298 | 1298 | | |
1299 | 1299 | | |
1300 | 1300 | | |
| |||
1330 | 1330 | | |
1331 | 1331 | | |
1332 | 1332 | | |
1333 | | - | |
| 1333 | + | |
1334 | 1334 | | |
1335 | 1335 | | |
1336 | 1336 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
File renamed without changes.
0 commit comments