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

Add an option to not run rustdoc blocks #12777

Merged
merged 1 commit into from
Mar 9, 2014
Merged

Conversation

sfackler
Copy link
Member

@sfackler sfackler commented Mar 9, 2014

This is useful for code that would be expensive to run or has some kind
of external dependency (e.g. a database or server).

runtest(test, cratename, libs, should_fail);
if !no_run {
runtest(test, cratename, libs, should_fail);
}
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this both not run the test and not compile it? I thought no_run was to only not run, but still compile?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, I misread the way this worked :/

@alexcrichton
Copy link
Member

I also just remembered that I have done this in the past via:

# fn main() {}
# fn foo() {
// some code I don't want to run
# }

It's probably better to have an official solution for this though.

You can specify that the code block should be compiled but not run with the
`no_run` directive.

~~~
Copy link
Member

Choose a reason for hiding this comment

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

This is useful for code that would be expensive to run or has some kind
of external dependency (e.g. a database or server).
@sfackler
Copy link
Member Author

sfackler commented Mar 9, 2014

@alexcrichton updated

bors added a commit that referenced this pull request Mar 9, 2014
This is useful for code that would be expensive to run or has some kind
of external dependency (e.g. a database or server).
@bors bors closed this Mar 9, 2014
@bors bors merged commit 71cab04 into rust-lang:master Mar 9, 2014
@sfackler sfackler deleted the no_run branch May 15, 2014 05:03
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 17, 2024
… r=Alexendoo

fix: merge multiple suggestions into a single multi-span suggestion in `needless_late_init`

See rust-lang/rust-analyzer#17163 (comment).

Currently, the fix for `needless_late_init` would modify multiple parts in the file. However, these modifications are exported as separate suggestions instead of a unified 'multi-part suggestion'.

Consequently, rust-analyzer is unable to perform the fix correctly when applying suggestions automatically, as only one suggestion is processed at a time. This PR addresses this issue by merge all modifications into a single multi-part suggestion.

changelog: [`needless_late_init`]: merge multiple fixes into a single multi-span fix.
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.

4 participants