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

Broaden scope of suppressed warnings for listings without a main fn #1195

Merged

Conversation

englishm
Copy link
Contributor

@englishm englishm commented Apr 18, 2020

At present, code listings without a main function will be wrapped in one and annotated with an allow lint check attribute provided by the following code:

format!(
    "\n# #![allow(unused_variables)]\n{}#fn main() {{\n{}#}}",
    attrs, code
)

A broader lint check attribute such as #![allow(unused)] seems like it might better fit the apparent intent of this code.

Addresses: #1192

@englishm englishm marked this pull request as draft April 18, 2020 05:33
At present, code listings without a main function will be wrapped in one and
annotated with an allow lint check attribute provided by the following [code][]:

```
format!(
    "\n# #![allow(unused_variables)]\n{}#fn main() {{\n{}#}}",
    attrs, code
)
```

A broader lint check attribute such as `#![allow(unused)]` seems like it might
better fit the apparent intent of this code.

Addresses: rust-lang#1192

[code]: https://github.com/rust-lang/mdBook/blob/769cc0a7c14fe133fc5eb223f435473730d0086e/src/renderer/html_handlebars/hbs_renderer.rs#L635-L638
@englishm englishm force-pushed the me/suppress-more-warnings-for-small-listings branch from 97b29f7 to 1d265fd Compare April 18, 2020 05:36
@englishm englishm marked this pull request as ready for review April 18, 2020 05:46
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thanks!

@ehuss ehuss merged commit 04c04df into rust-lang:master Apr 18, 2020
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this pull request Aug 30, 2020
…ings-for-small-listings

Broaden scope of suppressed warnings for listings without a main fn
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.

2 participants