Commit 99eb1cb
authored
Rollup merge of rust-lang#74078 - jyn514:lut, r=Manishearth
Always resolve type@primitive as a primitive, not a module
Previously, if there were a module in scope with the same name as the
primitive, that would take precedence. Coupled with
rust-lang#58699, this made it impossible
to link to the primitive when that module was in scope.
This approach could be extended so that `struct@foo` would no longer resolve
to any type, etc. However, it could not be used for glob imports:
```rust
pub mod foo {
pub struct Bar;
}
pub enum Bar {}
use foo::*;
// This is expected to link to `inner::Bar`, but instead it will link to the enum.
/// Link to [struct@Bar]
pub struct MyDocs;
```
The reason for this is that this change does not affect the resolution
algorithm of rustc_resolve at all. The only reason we could special-case
primitives is because we have a list of all possible primitives ahead of time.
Closes rust-lang#74063
r? @ManishearthFile tree
2 files changed
+40
-5
lines changed- src
- librustdoc/passes
- test/rustdoc
2 files changed
+40
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| |||
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
211 | 223 | | |
212 | 224 | | |
213 | 225 | | |
| |||
566 | 578 | | |
567 | 579 | | |
568 | 580 | | |
| 581 | + | |
569 | 582 | | |
570 | 583 | | |
571 | 584 | | |
572 | 585 | | |
573 | 586 | | |
| 587 | + | |
574 | 588 | | |
575 | 589 | | |
576 | 590 | | |
| |||
586 | 600 | | |
587 | 601 | | |
588 | 602 | | |
| 603 | + | |
589 | 604 | | |
590 | 605 | | |
591 | 606 | | |
| 607 | + | |
592 | 608 | | |
593 | 609 | | |
594 | 610 | | |
| 611 | + | |
595 | 612 | | |
596 | 613 | | |
597 | 614 | | |
| 615 | + | |
598 | 616 | | |
599 | 617 | | |
600 | 618 | | |
| 619 | + | |
601 | 620 | | |
602 | 621 | | |
603 | 622 | | |
| |||
634 | 653 | | |
635 | 654 | | |
636 | 655 | | |
| 656 | + | |
637 | 657 | | |
638 | 658 | | |
639 | 659 | | |
| |||
657 | 677 | | |
658 | 678 | | |
659 | 679 | | |
| 680 | + | |
660 | 681 | | |
661 | 682 | | |
662 | 683 | | |
| |||
683 | 704 | | |
684 | 705 | | |
685 | 706 | | |
| 707 | + | |
686 | 708 | | |
687 | 709 | | |
688 | 710 | | |
| |||
697 | 719 | | |
698 | 720 | | |
699 | 721 | | |
| 722 | + | |
700 | 723 | | |
701 | 724 | | |
702 | 725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments