about summary refs log tree commit diff
path: root/src/librustdoc/html/sources.rs
AgeCommit message (Collapse)AuthorLines
2020-04-08rustdoc: Don't try to load source files from external cratesOliver Middleton-2/+3
Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead.
2020-03-10Store `TokenStream` in `rmeta::MacroDef`.Mazdak Farrokhzad-1/+1
This removes a hack from `load_macro_untracked` in which parsing is used.
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-1/+1
2019-12-22Format the worldMark Rousskov-29/+30
2019-09-07Move Source to BufferMark Rousskov-14/+7
2019-09-07layout::render takes Print instead of fmt::DisplayMark Rousskov-1/+2
2019-09-07De-indent all fmt::Display impls for later replacement to functionsMark Rousskov-17/+17
2019-09-07Implement Print for FnOnce(&mut Buffer)Mark Rousskov-1/+1
This means that callers can pass in a closure like `|buf| some_function(..., &mut buf)` and pass in arbitrary arguments to that function without complicating the trait definition. We also keep the impl for str and String, since it's useful to be able to just pass in "" or format!("{}"...) results in some cases. This changes Print's definition to take self, instead of &self, because otherwise FnOnce cannot be called directly. We could instead take FnMut or even Fn, but that seems like it'd merely complicate matters -- most of the time, the FnOnce does not constrain us at all anyway. If it does, a custom Print impl for &'_ SomeStruct is not all that painful.
2019-09-07Move constant parameters to render to Layout structMark Rousskov-3/+1
2019-09-07Create buffers in top-level renderingMark Rousskov-4/+2
This avoids needlessly creating and threading the buffers through when we only use them once.
2019-09-07Migrate top-level rendering to BufferMark Rousskov-6/+4
2019-08-26Move source HTML generation to own moduleMark Rousskov-0/+187