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

Deny common lints by default for lib{std,extra} #7031

Closed
wants to merge 2 commits into from

Conversation

alexcrichton
Copy link
Member

Closes #6963

I imagine though that this will bounce in bors once or twice... Because attributes can't be cfg(stage0)'d off, there's temporarily a lot of new stage0/stage1+ code.

@alexcrichton
Copy link
Member Author

Fixed the warnings related to windows, so should be ready for another go.

@brson
Copy link
Contributor

brson commented Jun 10, 2013

I suspect that this approach is going to be hard to maintain because of the differences in stage0 vs. stage1. What I would prefer is to have a -Werror (but not necessarily that syntax) equivalent that can be passed to rustc in stage1+, leaving stage0 as warnings.

@alexcrichton
Copy link
Member Author

@brson, I just modified it to apply the -D flags via the makefile instead of using attributes inside of the crate itself. This way anything other than stage1/2 don't have the flags.

@alexcrichton
Copy link
Member Author

I was also mucking around in the makefiles and managed to go ahead and rename the rc extensions to rs extensions

@brson
Copy link
Contributor

brson commented Jun 11, 2013

@alexcrichton I didn't expect all the stage0 conditional definitions when using the -D flag in only stage1+. What is it that requires the #[cfg(stage0)] stuff here?

@brson
Copy link
Contributor

brson commented Jun 11, 2013

Also, thanks for taking my feedback.

@alexcrichton
Copy link
Member Author

Most of them have to do with unsafe blocks, and the reason is that the unsafe checker was changed.

In stage0, this is invalid code:

use std::libc;

fn callback(_: ~fn()) {}

unsafe fn foo() {
  do callback {
    libc::exit(1);
  }
}

fn main() {
}

Whereas it's valid in stage1. I'm not sure if this is an unintended bug from when the unsafe checker changed, but in stage0 the owned function is required to explicitly have another unsafe block, whereas in stage1 the top-level unsafe satisfies the un-safeness requirement.

This means that to prevent errors in stage1 and so that code compiles in stage0, there have to be two versions.

@alexcrichton
Copy link
Member Author

@brson, for some reason github is reordering the commits again, I just rebased (to fix conflicts), but the head of the pull request is 8394895 instead of the other

@pnkfelix
Copy link
Member

@brson what do you think about turning off warnings entirely for the stage0 build, so that we don't get annoyed by bugs in lint that are not in the snapshot version of the compiler?

@pnkfelix
Copy link
Member

(or at least add [or just document?] an easy way, perhaps a configure flag, to let one easily opt into ignoring all warnings in the stage0 build.)

@pnkfelix
Copy link
Member

(I'll move my comments to #6963.)

@alexcrichton
Copy link
Member Author

I added a commit to turn off warnings in stage0 in #7113, I think that's a good idea as well!

bors added a commit that referenced this pull request Jun 26, 2013
Reopening of #7031, Closes #6963

I imagine though that this will bounce in bors once or twice... Because attributes can't be cfg(stage0)'d off, there's temporarily a lot of new stage0/stage1+ code.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 8, 2021
…es, r=llogiq

Quick fix for the updated website theaming to access the correct css files

This fixes a problem from rust-lang#7030 that the service used to access css files was blocked by GitHub pages due to `SSL_ERROR_BAD_CERT_DOMAIN`. The css file loading worked fine during local development. The browser probably disabled some security options due to the local address.

This fix works locally and should also work online as it references the direct css files used by the [mdBook User Guide](https://rust-lang.github.io/mdBook/index.html) the disadvantage of this is that refactorings within the mdBook project can have effects on the theme loading of Clippy. This PR is therefor more meant as a quick fix until I find a better solution.

I've tested these changes using the page editor in the browser and can now confirm that they work :)

changelog: none

r?  `@llogiq`
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