Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd warning control #190
Comments
alexcrichton
added
the
help wanted
label
Jul 13, 2017
This comment has been minimized.
This comment has been minimized.
|
How to create a static array and return a slice of it? --> src/lib.rs:164:34
|
164 | ToolFamily::Msvc => &["/Wall"],
| ^^^^^^^^-
| | |
| | temporary value only lives until here
| does not live long enough
|
= note: borrowed value must be valid for the static lifetime...Method: /// What the flags to enable all warnings
fn warnings_flags(&self) -> &'static [&'static str] {
match *self {
ToolFamily::Msvc => &["/Wall"],
ToolFamily::Gnu => &["-Wall", "-Wpedantic", "-Wextra"],
ToolFamily::Clang => &["-Weverything"],
}
} |
This comment has been minimized.
This comment has been minimized.
|
Hm I thought it was like that but I guess not :(. Maybe try making this not a method but instead a temporary in a function? |
This comment has been minimized.
This comment has been minimized.
|
I'm unsure about it.
|
This comment has been minimized.
This comment has been minimized.
dtolnay
commented
Jul 31, 2017
|
I agree with @pornel. Warnings enabled seems like the wrong default for the way this crate is usually used, and I would never want to use warnings-as-errors. |
brson commentedJul 13, 2017
Do a few things:
warnings_as_errorsthat turns warnings into errors in a compiler specific wayWe haven't discussed this, but if we enable maximum warnings by default, it seems like some users will not want that and a way to turn it off. So it seems like we should also add a
default_warningsmethod that declines to set the maximum warnings.