rust/src/test
Guillaume Gomez 7a6a25eb2e
Rollup merge of #85324 - FabianWolff:issue-85255, r=varkor
Warn about unused `pub` fields in non-`pub` structs

This pull request fixes #85255. The current implementation of dead code analysis is too prudent because it marks all `pub` fields of structs as live, even though they cannot be accessed from outside of the current crate if the struct itself only has restricted or private visibility.

I have changed this behavior to take the containing struct's visibility into account when looking at field visibility and liveness. This also makes dead code warnings more consistent; consider the example given in #85255:
```rust
struct Foo {
    a: i32,
    pub b: i32,
}

struct Bar;

impl Bar {
    fn a(&self) -> i32 { 5 }
    pub fn b(&self) -> i32 { 6 }
}

fn main() {
    let _ = Foo { a: 1, b: 2 };
    let _ = Bar;
}
```
Current nightly already warns about `Bar::b()`, even though it is `pub` (but `Bar` is not). It should therefore also warn about `Foo::b`, which it does with the changes in this PR.
2021-05-15 17:56:49 +02:00
..
assembly Add tests for global_asm! 2021-05-13 22:31:58 +01:00
auxiliary
codegen Auto merge of #83813 - cbeuw:remap-std, r=michaelwoerister 2021-05-12 11:05:56 +00:00
codegen-units Remove redundant ignore-tidy-linelength annotations 2021-04-03 22:30:20 +02:00
debuginfo Rollup merge of #84500 - tmandry:compiletest-run-flag, r=Mark-Simulacrum 2021-05-07 00:38:35 +02:00
incremental Auto merge of #85211 - Aaron1011:metadata-invalid-span, r=michaelwoerister 2021-05-14 16:58:30 +00:00
mir-opt array-to-raw-elem cast: test that Retag covers entire array 2021-05-07 09:36:45 +02:00
pretty parser: Remove support for inner attributes on non-block expressions 2021-05-03 13:33:53 +03:00
run-make Add support for const operands and options to global_asm! 2021-05-13 22:31:57 +01:00
run-make-fulldeps Auto merge of #83640 - bjorn3:shared_metadata_reader, r=nagisa 2021-05-14 12:58:58 +00:00
run-pass-valgrind
rustdoc Disable layout docs for type aliases for now 2021-05-11 10:19:46 -07:00
rustdoc-gui Add test for toggle on mobile size 2021-05-14 22:25:50 +02:00
rustdoc-js Add test for primitive search 2021-02-01 15:56:51 +01:00
rustdoc-js-std Add search index test for primitive types 2021-01-27 10:05:06 +01:00
rustdoc-json Rename span to source 2021-03-24 19:44:23 +00:00
rustdoc-ui Show macro name in 'this error originates in macro' message 2021-05-12 19:03:06 -04:00
rustfix
ui Rollup merge of #85324 - FabianWolff:issue-85255, r=varkor 2021-05-15 17:56:49 +02:00
ui-fulldeps Show macro name in 'this error originates in macro' message 2021-05-12 19:03:06 -04:00
COMPILER_TESTS.md