| Age | Commit message (Collapse) | Author | Lines |
|
When a tuple-struct is re-exported that has inaccessible fields at the `use` scope, the type's constructor cannot be accessed through that re-export. We now account for this case and extend the resulting resolution error. We also check if the constructor would be accessible directly, not through the re-export, and if so, we suggest using the full path instead.
```
error[E0423]: cannot initialize a tuple struct which contains private fields
--> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:12:33
|
LL | let crate::Foo(x) = crate::Foo(42);
| ^^^^^^^^^^
|
note: the type is accessed through this re-export, but the type's constructor is not visible in this import's scope due to private fields
--> $DIR/ctor-not-accessible-due-to-inaccessible-field-in-reexport.rs:3:9
|
LL | pub use my_mod::Foo;
| ^^^^^^^^^^^
help: the type can be constructed directly, because its fields are available from the current scope
|
LL | let crate::Foo(x) = crate::my_mod::Foo(42);
| ~~~~~~~~~~~~~~~~~~
```
Fix #133343.
|
|
|
|
|
|
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#2 of Batch #2]
Part of rust-lang/rust#133895
Methodology:
1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer
Inspired by the methodology that `@Kivooeo` was using.
r? `@jieyouxu`
|
|
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#1 of Batch #2]
Part of rust-lang/rust#133895
Methodology:
1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer
Inspired by the methodology that `@Kivooeo` was using.
r? `@jieyouxu`
|
|
|
|
|
|
|
|
|
|
When encountering an unmet trait bound, point at local type that doesn't implement the trait:
```
error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied
--> $DIR/issue-64855.rs:9:19
|
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
| ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
|
help: the trait `Foo` is not implemented for `Bar<T>`
--> $DIR/issue-64855.rs:9:1
|
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
| ^^^^^^^^^^^^^^^^^
```
|
|
suggest using `pub(crate)` for E0364
- This introduces `vis_span` into `ImportData` for diagnostic purposes.
Closes: rust-lang/rust#145140
|
|
|
|
|
|
Rehome 33 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`
rust-lang/rust#143902 divided into smaller, easier to review chunks.
Part of rust-lang/rust#133895
Methodology:
1. Refer to the previously written `tests/ui/SUMMARY.md`
2. Find an appropriate category for the test, using the original issue thread and the test contents.
3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers)
4. Rename the tests to make their purpose clearer
Inspired by the methodology that ``@Kivooeo`` was using.
r? ``@jieyouxu``
|
|
|
|
Perform check_private_in_public by module.
Based on https://github.com/rust-lang/rust/pull/116316
|
|
`tests/ui/issues/`: The Issues Strike Back [2/N]
Some `tests/ui/issues/` housekeeping, to trim down number of tests directly under `tests/ui/issues/`. Part of https://github.com/rust-lang/rust/issues/133895.
r? ``@jieyouxu``
|
|
|
|
Adds the equivalent `nonpoison` types to the `poison::mutex` module.
These types and implementations are gated under the `nonpoison_mutex`
feature gate.
Also blesses the ui tests that now have a name conflicts (because these
types no longer have unique names). The full path distinguishes the
different types.
Co-authored-by: Aandreba <aandreba@gmail.com>
Co-authored-by: Trevor Gross <tmgross@umich.edu>
|
|
`tests/ui/issues/`: The Issues Strike Back [1/N]
I believe I’ve finally brought [my program](https://github.com/Kivooeo/test-manager) to life -- it now handles multiple test moves in one go: plain moves first, then a gentle touch on each file depends on given options. The process should be much smoother now.
Of course, I won’t rush through everything in a few days -- that would be unkind to `@Oneirical.` I’ll pace myself. And also I can't have more than one such PR because `issues.txt` will conflict with previous parts after merging them which is not fun as well.
This PR is just that: first commit - moves; second - regression comments and the occasional .stderr reblesses, also issue.txt and tidy changes. Nothing special, but progress nonetheless. This is for the purpose of preserving test file history during restructuring
Part of https://github.com/rust-lang/rust/issues/133895.
r? `@jieyouxu`
|
|
|
|
|
|
|
|
|
|
Use less HIR in check_private_in_public.
r? ````````@petrochenkov````````
|
|
yuk1ty:false-sealed-traits-note-reported-in-another-issue, r=fee1-dead
Add more test case to check if the false note related to sealed trait suppressed
Closes rust-lang/rust#143121
I started to fix the issue but I found that this one has already been addressed in this PR (https://github.com/rust-lang/rust/pull/143431). I added an additional test to prove the reported thing has been resolved just in case.
I think we can discard this pull request if there's no need to add such kind of tests👍🏻
|
|
|
|
|
|
|
|
|
|
Do not lint private-in-public for RPITIT
Fixes the hard error introduced by https://github.com/rust-lang/rust/pull/143357
Instead of trying to accept this hard error directly, this PR copies tests from https://github.com/rust-lang/rust/pull/144020 and removes the error.
If the behaviour is actually desirable, the second commit can be reverted with a proper crater run.
cc https://github.com/rust-lang/rust/issues/143531 for bookkeeping
r? `@compiler-errors`
|
|
|
|
|
|
|
|
Use relative visibility when noting sealed trait to reduce false positive
Fixes rust-lang/rust#143392
I used relative visibility instead of just determining if it's public or not.
r? compiler
|
|
|
|
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
As before, add `MetaSized` and `PointeeSized` traits to all of the
non-minicore `no_core` tests so that they don't fail for lack of
language items.
|
|
`tests/ui`: A New Order [4/N]
> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.
r? ``@jieyouxu``
added stderr tag for commit which means it included generated stderr
|
|
Run wfcheck in one big loop instead of per module
Maybe we can merge this big loop in the future with the `par_hir_body_owners` call below and run typeck only on items that didn't fail wfcheck. For now let's just see if perf likes it, as it by itself should be beneficial to parallel rustc
|
|
|
|
|
|
This allows for testing these tests on editions other than 2015
|
|
|
|
|
|
|
|
|
|
Note potential but private items in show_candidates
Closes #138626 .
We should add potential private items to give ample hints.
And for the other seemingly false positive ` pub use crate::one::Foo;` should be kept because we don't know if the user wants to import other module's items or not, and therefore should be given the full option to do so.
r? compiler
|