Skip to content
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

Closed
huonw opened this issue Jul 6, 2014 · 8 comments
Closed

Allow documentation to be read from an external file #15470

huonw opened this issue Jul 6, 2014 · 8 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@huonw
Copy link
Member

huonw commented Jul 6, 2014

I.e. the following are equivalent:

lib.rs

//! Foo bar baz

lib.rs

#![doc(file = "extensive_crate_docs.md")]

extensive_crate_docs.md:

Foo bar baz

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).

@huonw
Copy link
Member Author

huonw commented Jul 10, 2014

Depending how this is handled, it may get in the way of #2206 (i.e. it would probably be good to handle it so that #2206 can still work).

@tomjakubowski
Copy link
Contributor

I have a proof of concept, out of tree implementation here: https://github.com/tomjakubowski/doc_file

@steveklabnik steveklabnik added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jun 29, 2015
@steveklabnik
Copy link
Member

Triage: rust-lang/cargo#739 is related, but not the same.

@euclio
Copy link
Contributor

euclio commented Nov 21, 2016

What's the status on this? Does it need an RFC or are we waiting on an in-tree implementation?

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@QuietMisdreavus
Copy link
Member

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.

@chriskrycho
Copy link
Contributor

For anyone else who lands here via search: the RFC was merged; tracking issue is here.

@estebank
Copy link
Contributor

Closing in favor of tracking issue #44732.

@jonas-schievink
Copy link
Contributor

@estebank you didn't actually close this :P

bors added a commit to rust-lang-ci/rust that referenced this issue Jan 21, 2024
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`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants