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

rustdoc: make calls of markdown::render safer #17796

Merged
merged 1 commit into from
Oct 6, 2014

Conversation

tomjakubowski
Copy link
Contributor

Previously, external code might call markdown::render() without having
called markdown::reset_headers(), meaning the TLS key
used_header_map was unset. Now markdown::render() ensures that
used_header_map is set by calling reset_headers if necessary.

Fix #17736

// option. This file may not be copied, modified, or distributed
// except according to those terms.

extern crate rustdoc;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you actually include this task as part of the markdown module itself? It would otherwise need to move to run-pass-fulldeps (it depends on the compiler) and also have // ignore-android I believe.

Previously, external code might call `markdown::render()` without having
called `markdown::reset_headers()`, meaning the TLS key
`used_header_map` was unset.  Now `markdown::render()` ensures that
`used_header_map` is set by calling `reset_headers` if necessary.

Fix rust-lang#17736
@tomjakubowski
Copy link
Contributor Author

Rebased

bors added a commit that referenced this pull request Oct 6, 2014
…ichton

Previously, external code might call `markdown::render()` without having
called `markdown::reset_headers()`, meaning the TLS key
`used_header_map` was unset.  Now `markdown::render()` ensures that
`used_header_map` is set by calling `reset_headers` if necessary.

Fix #17736
@bors bors closed this Oct 6, 2014
@bors bors merged commit 942bed7 into rust-lang:master Oct 6, 2014
lnicola pushed a commit to lnicola/rust that referenced this pull request Sep 25, 2024
…-result, r=Veykril

fix: use Result type aliases in "Wrap return type in Result" assist

This commit makes the "Wrap return type in Result" assist prefer type aliases of standard library type when the are in scope, use at least one generic parameter, and have the name `Result`.

The last restriction was made in an attempt to avoid false assumptions about which type the user is referring to, but that might be overly strict. We could also do something like this, in order of priority:
* Use the alias named "Result".
* Use any alias if only a single one is in scope, otherwise:
* Use the standard library type.

This is easy to add if others feel differently that is appropriate, just let me know.

Fixes rust-lang#17796
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustdoc: Called Option::unwrap() on a None value
3 participants