forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#85335 - GuillaumeGomez:rollup-0tvc14g, r=Guil…
…laumeGomez Rollup of 4 pull requests Successful merges: - rust-lang#84751 (str::is_char_boundary - slight optimization) - rust-lang#85185 (Generate not more docs than necessary) - rust-lang#85324 (Warn about unused `pub` fields in non-`pub` structs) - rust-lang#85329 (fix version_str comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
10 changed files
with
126 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Unused `pub` fields in non-`pub` structs should also trigger dead code warnings. | ||
// check-pass | ||
|
||
#![warn(dead_code)] | ||
|
||
struct Foo { | ||
a: i32, //~ WARNING: field is never read | ||
pub b: i32, //~ WARNING: field is never read | ||
} | ||
|
||
struct Bar; | ||
|
||
impl Bar { | ||
fn a(&self) -> i32 { 5 } //~ WARNING: associated function is never used | ||
pub fn b(&self) -> i32 { 6 } //~ WARNING: associated function is never used | ||
} | ||
|
||
|
||
fn main() { | ||
let _ = Foo { a: 1, b: 2 }; | ||
let _ = Bar; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
warning: field is never read: `a` | ||
--> $DIR/issue-85255.rs:7:5 | ||
| | ||
LL | a: i32, | ||
| ^^^^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/issue-85255.rs:4:9 | ||
| | ||
LL | #![warn(dead_code)] | ||
| ^^^^^^^^^ | ||
|
||
warning: field is never read: `b` | ||
--> $DIR/issue-85255.rs:8:5 | ||
| | ||
LL | pub b: i32, | ||
| ^^^^^^^^^^ | ||
|
||
warning: associated function is never used: `a` | ||
--> $DIR/issue-85255.rs:14:8 | ||
| | ||
LL | fn a(&self) -> i32 { 5 } | ||
| ^ | ||
|
||
warning: associated function is never used: `b` | ||
--> $DIR/issue-85255.rs:15:12 | ||
| | ||
LL | pub fn b(&self) -> i32 { 6 } | ||
| ^ | ||
|
||
warning: 4 warnings emitted | ||
|