Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
tomjakubowski:rustdoc-ice-17736
Oct 6, 2014
Merged

rustdoc: make calls of markdown::render safer#17796
bors merged 1 commit into
rust-lang:masterfrom
tomjakubowski:rustdoc-ice-17736

Conversation

@tomjakubowski
Copy link
Copy Markdown
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

Comment thread src/test/run-pass/issue-17736.rs Outdated
Copy link
Copy Markdown
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
Copy Markdown
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