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

Unhide lines in rustdoc's doc -- Closes #11645 #11810

Merged
merged 1 commit into from
Feb 1, 2014

Conversation

Armavica
Copy link
Contributor

The doc-generating tool comments out the lines that match /$# / (note the space), which is not what is wanted here. And it lets live the lines matching /$#[^ ]/. But we still want to see a space. So I replaced the normal space by a non breakable one, which fools the parser into displaying the line.

@alexcrichton
Copy link
Member

Clever! Could you add a comment (with the normal # syntax) explaining that there's some unicode trickery going on in the lines below?

@brson
Copy link
Contributor

brson commented Jan 26, 2014

Woah, this is way subtle. So this is an example of how to add non-displayed lines to code examples? Is there any other way to solve this besides putting a non-space space character here? If not, can you put a non-displayed comment in here that explains that the following spaces are not space characters?

This may be solved by putting {.notrust} on the outer code block, or adding a new type of code block tag that prepare.js understands to not strip these lines.

@Armavica
Copy link
Contributor Author

Comment added. I let you guys decide whether you prefer modifying prepare.js but frankly I can hardly see any other use case than in rustdoc.md...

@Armavica
Copy link
Contributor Author

@brson: {.notrust} works but then we lose the colors in the code.
edit: I looked at it too fast, that also strips off the real comments. Anyway the colors would be lost.

# /!\ The three following lines are comments, which are usually stripped off by
# the doc-generating tool. In order to display them anyway in this particular
# case, the character following the leading '#' is not a usual space but a non
# breakable one.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe worth mentioning that these 5 lines have a normal space?

bors added a commit that referenced this pull request Jan 31, 2014
The doc-generating tool comments out the lines that match `/$# /` (note the space), which is not what is wanted here. And it lets live the lines matching `/$#[^ ]/`. But we still want to see a space. So I replaced the normal space by a non breakable one, which fools the parser into displaying the line.
@bors bors closed this Feb 1, 2014
@bors bors merged commit 4004493 into rust-lang:master Feb 1, 2014
@Armavica Armavica deleted the issue-11645 branch March 16, 2014 02:11
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 16, 2023
…nishearth

add help text where missing to lints

Fixes rust-lang/rust-clippy#11805

Essentially just changes the section of code that applies the lint from using `cx.struct_span_lint` and instead opts for `span_lint_and_then`, which automatically appends the help text.

changelog: add missing help text for `cast_possible_wrap`, `mod_module_files`, and `self_named_module_files` lints
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 16, 2023
…shearth

disallow calls to `LintContext::struct_span_lint` and `TyCtxt::struct_span_lint_hir`

`LintContext::struct_span_lint` and `TyCtxt::struct_span_lint_hir` don't show the link to the clippy documentation, see: rust-lang#11805

In rust-lang#11810, the last few calls to those methods were replaced with `span_lint_*`. It seems like we should just disallow them altogether so that no new code tries to use them.

The existing `disallowed_methods` lint makes this easy.

changelog: none
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.

5 participants