Manish Goregaokar
cfc9f5a9d8
Temporary fix missing escape_href in hoedown_link by copying pulldown's code
2018-01-22 22:23:08 +05:30
Manish Goregaokar
fe93adad2c
Update to new commonmark arg
2018-01-22 16:25:59 +05:30
Manish Goregaokar
dc5475257f
Review fixes
2018-01-22 15:29:34 +05:30
Manish Goregaokar
4ced272780
Move macro_resolve() into a function
2018-01-22 15:24:32 +05:30
Manish Goregaokar
7739bb2d35
Move resolve() into a function
2018-01-22 15:24:32 +05:30
Manish Goregaokar
fbd2d16c3f
Add ambiguity errors for macros
2018-01-22 15:24:32 +05:30
Manish Goregaokar
6256bff7a3
Move the figuring out of the 'kind' of def out into functions
2018-01-22 15:24:32 +05:30
Manish Goregaokar
5762fa4b5a
Allow macros to be resolved with ambiguous idents too
2018-01-22 15:24:31 +05:30
Manish Goregaokar
869dd91d44
Allow function@, value@, macro@
2018-01-22 15:24:31 +05:30
Manish Goregaokar
6a1a449220
Error only in the case of overlap
2018-01-22 15:24:31 +05:30
Manish Goregaokar
d44910ceeb
Use the registered def id (makes enum variants link to the enum page instead of not at all)
2018-01-22 15:24:31 +05:30
Manish Goregaokar
28805fd53e
Better error message
2018-01-22 15:24:31 +05:30
QuietMisdreavus
afe3e27085
value-namespace items require a marker, so emit an error
2018-01-22 15:24:31 +05:30
QuietMisdreavus
b31bb097f5
resolve module docs based on inner/outer attributes
2018-01-22 15:24:30 +05:30
QuietMisdreavus
1a62b17f7d
clean module docs while its module ID is still on the stack
2018-01-22 15:24:30 +05:30
QuietMisdreavus
eca3c55881
add ambiguity markers to the intra-links test
2018-01-22 15:24:30 +05:30
QuietMisdreavus
4a20fb44c8
use @ instead of space for link ambiguity markers
...
since spaces aren't allowed in link targets in commonmark, a new symbol
is needed to separate the marker from the rest of the path. hence, @
2018-01-22 15:24:30 +05:30
QuietMisdreavus
a3d71d7405
add a macro to the intra-links test
2018-01-22 15:24:30 +05:30
Manish Goregaokar
00ce770e34
Store a list of local macros on the resolver; use for resolving intra-doc macro links
2018-01-22 15:24:30 +05:30
Manish Goregaokar
7ac48d793b
Resolve foreign macros
2018-01-22 15:24:29 +05:30
Manish Goregaokar
d6dd902616
Register definitions
2018-01-22 15:24:29 +05:30
Manish Goregaokar
383d169e15
Fix unit tests
2018-01-22 15:24:29 +05:30
Manish Goregaokar
c0af89723d
Fix tidy
2018-01-22 15:24:29 +05:30
Manish Goregaokar
191e5b0b78
Exit early for non-linky things
2018-01-22 15:24:29 +05:30
Manish Goregaokar
4f10f676d9
Handle relative paths
2018-01-22 15:24:29 +05:30
Manish Goregaokar
8166b59c74
Use correct item for links in modules
2018-01-22 15:24:28 +05:30
Manish Goregaokar
d6dcc47f0d
Handle errors for intra doc link path lookup
2018-01-22 15:24:28 +05:30
Manish Goregaokar
140e77f71d
Make resolve_hir_path and resolve_str_path fallible
2018-01-22 15:24:28 +05:30
Manish Goregaokar
f951d74389
Don't return early and discard the link in hoedown mode
2018-01-22 15:24:28 +05:30
QuietMisdreavus
30fca0919c
add basic test for rustdoc intra links
2018-01-22 15:24:28 +05:30
QuietMisdreavus
c4a4d3a031
parse path ambiguity markers
2018-01-22 15:24:28 +05:30
QuietMisdreavus
ef4587b270
fix error_index_generator
2018-01-22 15:24:28 +05:30
QuietMisdreavus
9d5b1ae763
add intra-links support to hoedown
2018-01-22 15:24:27 +05:30
QuietMisdreavus
611866f3cf
cleanup
2018-01-22 15:24:27 +05:30
Manish Goregaokar
e8dd5df69b
Add LinkReplacer pass for pulldown
2018-01-22 15:24:27 +05:30
Manish Goregaokar
dae2e22e81
Make correct resolver available in rustdoc
2018-01-22 15:24:23 +05:30
Manish Goregaokar
fe0c10019d
Split out creation of the resolver arena in phase_2_configure_and_expand
2018-01-22 15:21:29 +05:30
Manish Goregaokar
d18b344afb
Move resolve arenas/crate loader outside of the core of phase_2_configure_and_expand
2018-01-22 15:21:28 +05:30
Manish Goregaokar
f7a8a97b69
DRY std_path
2018-01-22 15:21:28 +05:30
QuietMisdreavus
31ca2322a0
abort documenting on resolution errors
2018-01-22 15:21:28 +05:30
QuietMisdreavus
c3d0d5a4bb
resolve paths when cleaning docs
2018-01-22 15:21:28 +05:30
QuietMisdreavus
76f831647a
add a rustc_resolve::Resolver to DocContext
2018-01-22 15:21:28 +05:30
QuietMisdreavus
d9c1a17eec
give render_text a generic return type
2018-01-22 15:21:28 +05:30
QuietMisdreavus
5db40f7754
add RenderType to DocContext
2018-01-22 15:21:28 +05:30
QuietMisdreavus
473fcfd49a
new function to pull the links from a chunk of markdown
2018-01-22 15:21:27 +05:30
bors
bc072ed0ca
Auto merge of #47144 - estebank:moved-closure-arg, r=nikomatsakis
...
Custom error when moving arg outside of its closure
When given the following code:
```rust
fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) {
f(&());
}
fn main() {
let mut x = None;
give_any(|y| x = Some(y));
}
```
provide a custom error:
```
error: borrowed data cannot be moved outside of its closure
--> file.rs:7:27
|
6 | let mut x = None;
| ----- borrowed data cannot be moved into here...
7 | give_any(|y| x = Some(y));
| --- ^ cannot be moved outside of its closure
| |
| ...because it cannot outlive this closure
```
instead of the generic lifetime error:
```
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> file.rs:7:27
|
7 | give_any(|y| x = Some(y));
| ^
|
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 7:14...
--> file.rs:7:14
|
7 | give_any(|y| x = Some(y));
| ^^^^^^^^^^^^^^^
note: ...so that expression is assignable (expected &(), found &())
--> file.rs:7:27
|
7 | give_any(|y| x = Some(y));
| ^
note: but, the lifetime must be valid for the block suffix following statement 0 at 6:5...
--> file.rs:6:5
|
6 | / let mut x = None;
7 | | give_any(|y| x = Some(y));
8 | | }
| |_^
note: ...so that variable is valid at time of its declaration
--> file.rs:6:9
|
6 | let mut x = None;
| ^^^^^
```
Fix #45983 .
2018-01-22 05:30:37 +00:00
bors
ff2a7c8575
Auto merge of #47644 - GuillaumeGomez:rollup, r=GuillaumeGomez
...
Rollup of 9 pull requests
- Successful merges: #47247 , #47334 , #47512 , #47582 , #47595 , #47625 , #47632 , #47633 , #47637
- Failed merges:
2018-01-21 22:38:29 +00:00
Guillaume Gomez
dcbf0bf5f5
Rollup merge of #47637 - russmack:fix-mailmap-dupes, r=steveklabnik
...
Fix mailmap duplicates, Carol and Brian.
This fix corrects the .mailmap file so that Carol (Nichols || Goulding) appears only once, and Brian Anderson also appears only once.
2018-01-21 23:11:45 +01:00
Guillaume Gomez
05f77ac5c2
Rollup merge of #47633 - pietroalbini:fix-ice-use-self, r=nagisa
...
Fix ICE with `use self;`
Closes #47623
2018-01-21 23:11:44 +01:00
Guillaume Gomez
6e6ab1e994
Rollup merge of #47632 - sdroege:exact-chunks-docs-broken-links, r=kennytm
...
Fix broken links to other slice functions in chunks/chunks_mut/exact_…
…chunk/exact_chunks_mut docs
See https://github.com/rust-lang/rust/pull/47126#discussion_r162780492
2018-01-21 23:11:43 +01:00