Commit graph

19 commits

Author SHA1 Message Date
Vadim Petrochenkov d326aed46f privacy: Feature gate new type privacy lints 2023-06-15 21:25:47 +03:00
Bryanskiy 6d46382f6f Private-in-public lints implementation 2023-06-12 01:02:19 +03:00
Bryanskiy 5e917a6039 increase the accuracy of effective visibilities calculation 2023-06-08 19:22:30 +03:00
Deadbeef be44860ab9 fix for Self not respecting tuple Ctor privacy
This fixes #111220 by checking the privacy of tuple constructors using `Self`, so the following code now errors

```rust
mod my {
    pub struct Foo(&'static str);
}

impl AsRef<str> for my::Foo {
    fn as_ref(&self) -> &str {
        let Self(s) = self; // previously compiled, now errors correctly
        s
    }
}
```
2023-05-26 06:23:03 +00:00
Oli Scherer e18d1f8d2e Leave it to the query system to invoke the typeck query instead of invoking it eagerly.
Later queries that are run on all body owners will invoke typeck as they need information from its result to perform their own logic
2023-04-21 22:12:45 +00:00
Esteban Küber 9fadcc143a Special-case item attributes in the suggestion output 2023-04-12 22:50:10 +00:00
Esteban Küber 5b40aa5eb4 Tweak output for 'add line' suggestion 2023-04-12 22:50:10 +00:00
Oli Scherer f263f88bea Split out a separate feature gate for impl trait in associated types 2023-04-12 16:17:31 +00:00
Yuki Okushi 788de4701e
Rollup merge of #109923 - ElectrifyPro:visibility, r=wesleywiser
Update `error [E0449]: unnecessary visibility qualifier` to be more clear

This updates the error message `error[E0449]: unnecessary visibility qualifier` by clearly indicating that visibility qualifiers already inherit their visibility from a parent item. The error message previously implied that the qualifiers were permitted, which is not the case anymore.

Resolves #109822.
2023-04-11 12:18:50 +09:00
bors 2eaeb1eee1 Auto merge of #109437 - petrochenkov:effvisopt, r=davidtwco
resolve: Restore some effective visibility optimizations

Something similar was previously removed as a part of https://github.com/rust-lang/rust/pull/104602.
So we can see [bitmaps-3.1.0](https://github.com/rust-lang/rustc-perf/tree/master/collector/compile-benchmarks/bitmaps-3.1.0), [match-stress](https://github.com/rust-lang/rustc-perf/tree/master/collector/compile-benchmarks/match-stress) and [unused-warnings](https://github.com/rust-lang/rustc-perf/tree/master/collector/compile-benchmarks/unused-warnings) in regressions there, and in improvements in this PR.
After this PR all table changes should also be "locally correct" after every update.
2023-04-05 20:50:33 +00:00
Tam Pham 4e5c120f33 Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
jyn 01b75e20f2 Move some UI tests into subdirectories
to avoid going over the existing limit now that the ui-fulldeps tests have
been moved to ui.
2023-04-02 19:42:30 -04:00
Vadim Petrochenkov 60c6dc07de resolve: Restore some effective visibility optimizations
Something similar was previously removed as a part of #104602, but after this PR all table changes should also be "locally correct" after every update.
2023-03-31 17:07:59 +04:00
Vadim Petrochenkov 4695ddf510 privacy: Support #![rustc_effective_visibility] on the crate root 2023-03-28 22:11:05 +04:00
Michael Howell 3f374128ee diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
Michael Goulet e20f6ff1dc Tighter spans for bad inherent impl types 2023-02-13 18:41:18 +00:00
Esteban Küber 41e66d9025 review comments: Tweak output
* Account for `struct S(pub(super)Ty);` in suggestion
* Suggest changing field visibility in E0603 too
2023-01-11 21:36:02 +00:00
Esteban Küber ad13d9fbbe Suggest making private tuple struct field public
Fix #52144.
2023-01-11 21:35:42 +00:00
Albert Larsan cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00