-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow documentation to be read from an external file #15470
Comments
I have a proof of concept, out of tree implementation here: https://github.com/tomjakubowski/doc_file |
Triage: rust-lang/cargo#739 is related, but not the same. |
What's the status on this? Does it need an RFC or are we waiting on an in-tree implementation? |
This is an RFC now: rust-lang/rfcs#1990 Discussion on it is fairly positive, so it's likely that something to this effect is going to happen. |
For anyone else who lands here via search: the RFC was merged; tracking issue is here. |
Closing in favor of tracking issue #44732. |
@estebank you didn't actually close this :P |
fix: better handling of SelfParam in assist 'inline_call' fix rust-lang#15470. The current `inline_call` directly translates `&self` into `let ref this = ...;` and `&mut self` into `let ref mut this = ...;`. However, it does not handle some complex scenarios. This PR addresses the following transformations (assuming the receiving object is `obj`): - `self`: `let this = obj` - `mut self`: `let mut this = obj` - `&self`: `let this = &obj` - `&mut self` + If `obj` is `let mut obj = ...`, use a mutable reference: `let this = &mut obj` + If `obj` is `let obj = &mut ...;`, perform a reborrow: `let this = &mut *obj`
I.e. the following are equivalent:
lib.rs
//! Foo bar baz
lib.rs
#![doc(file = "extensive_crate_docs.md")]
extensive_crate_docs.md:
This could be used in the rust source for modules like
borrowck::doc
: having that as a separate.../borrowck/doc.md
file with#[doc(file="doc.md")] mod doc {}
in.../borrowck/mod.rs
might be nice (it would certainly make editing it more natural, as editors will automatically select the Markdown mode).The text was updated successfully, but these errors were encountered: