Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #91382

Closed
wants to merge 29 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

estebank and others added 29 commits November 22, 2021 18:53
When we point at a binding to suggest giving it a type, erase all the
type for ADTs that have been resolved, leaving only the ones that could
not be inferred. For small shallow types this is not a problem, but for
big nested types with lots of params, this can otherwise cause a lot of
unnecessary visual output.
When the value of a const param isn't inferred, replace it with the
param name from the definition.
The tests checks some pretty-printer output, but pretty-printers are not embedded on windows-gnu
When recovering from a `:` in a pattern, use adequate AST pattern

If the suggestion to use `::` instead of `:` in the pattern isn't correct, a second resolution error will be emitted.
…=nagisa

Only shown relevant type params in E0283 label

When we point at a binding to suggest giving it a type, erase all the
type for ADTs that have been resolved, leaving only the ones that could
not be inferred. For small shallow types this is not a problem, but for
big nested types with lots of params, this can otherwise cause a lot of
unnecessary visual output.
…nkov

Issue 90702 fix: Stop treating some crate loading failures as fatal errors

Surface mulitple `extern crate` resolution errors at a time.

This is achieved by creating a dummy crate, instead of aborting directly after the resolution error. The `ExternCrateError` has been added to allow propagating the resolution error from `rustc_metadata` crate to the `rustc_resolve` with a minimal public surface. The `import_extern_crate` function is a block that was factored out from `build_reduced_graph_for_item` for better organization. The only added functionality made to it where the added error handling in the `process_extern_crate` call. The remaining bits in this function are the same as before.

Resolves rust-lang#90702

r? `@petrochenkov`
Don't treat unnormalized function arguments as well-formed

Partial revert of rust-lang#88312

r? `@pnkfelix`
cc `@nikomatsakis`
…=wesleywiser

Refactor EmitterWriter::emit_suggestion_default

Makes progress towards rust-lang#89979

Split into 2 commits:
* the first commit is purely a refactor and I verified that `./x.py test src/test/ui --stage 1` and  `./x.py test src/test/rustdoc-ui --stage 1` continue to pass on this commit.
* ~~the second commit removes the empty trailing line from diff style suggestions.~~ - I discovered an issue with this so its just the refactor now.

r? diagnostics
…crum

tests: Ignore `test/debuginfo/rc_arc.rs` on windows-gnu

The tests checks some pretty-printer output, but pretty-printers are not embedded on windows-gnu.

Regressed in rust-lang#85448.
CTFE: support assert_zero_valid and assert_uninit_valid

This ensures the implementation of all three type-based assert_ intrinsics remains consistent in Miri.

`assert_inhabited` recently got stabilized in rust-lang#90896 (meaning stable `const fn` can call it), so do the same with these other intrinsics.

Cc ``@rust-lang/wg-const-eval``
Bump compiler_builtins to 0.1.55 to bring in fixes for targets lackin…

…g atomic support.

This fixes a "Cannot select" LLVM error when compiling `compiler_builtins` for targets lacking atomics, like MSP430. Se rust-lang/compiler-builtins#441 for more info. This PR is a more general version of rust-lang#91248.
Fix small typo

Fix a typo in code commenting!
`accross` -> `across`
…=lnicola

⬆️ rust-analyzer

r? ``@ghost``
…=cjgillot

Don't re-export `MirPass`

`rust-analyzer` wants to use the `rustc_const_eval` one by default, which is weird.

r? `@cjgillot`
@rustbot rustbot added the rollup A PR which is a rollup label Nov 30, 2021
@matthiaskrgr
Copy link
Member Author

@bors r+ rolllup=never p=11

@bors
Copy link
Contributor

bors commented Nov 30, 2021

📌 Commit 1a46a42 has been approved by matthiaskrgr

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 30, 2021
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking rustc_passes v0.0.0 (/checkout/compiler/rustc_passes)
    Checking rustc_query_impl v0.0.0 (/checkout/compiler/rustc_query_impl)
    Checking rustc_monomorphize v0.0.0 (/checkout/compiler/rustc_monomorphize)
    Checking rustc_save_analysis v0.0.0 (/checkout/compiler/rustc_save_analysis)
error[E0053]: method `fold_ty` has an incompatible type for trait
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:913:43
    |
913 |     fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
    |                                           |
    |                                           |
    |                                           expected enum `Result`, found `&TyS<'tcx>`
    |                                           help: change the output type to match the trait: `Result<&'tcx TyS<'tcx>, !>`
    |
    = note: expected fn pointer `fn(&mut ResolvedTypeParamEraser<'tcx>, &'tcx TyS<'tcx>) -> Result<&'tcx TyS<'tcx>, !>`
               found fn pointer `fn(&mut ResolvedTypeParamEraser<'tcx>, &'tcx TyS<'tcx>) -> &'tcx TyS<'tcx>`

error[E0053]: method `fold_ty` has an incompatible type for trait
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:990:43
    |
990 |     fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> {
    |                                           |
    |                                           |
    |                                           expected enum `Result`, found `&TyS<'tcx>`
    |                                           help: change the output type to match the trait: `Result<&'tcx TyS<'tcx>, !>`
    |
    = note: expected fn pointer `fn(&mut ErrTypeParamEraser<'tcx>, &'tcx TyS<'tcx>) -> Result<&'tcx TyS<'tcx>, !>`
               found fn pointer `fn(&mut ErrTypeParamEraser<'tcx>, &'tcx TyS<'tcx>) -> &'tcx TyS<'tcx>`
error[E0308]: mismatched types
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:603:63
    |
    |
603 |                 let ty = ErrTypeParamEraser(self.tcx).fold_ty(ty);
    |                                                               ^^ expected `&TyS<'_>`, found enum `Result`
    |
    = note: expected reference `&TyS<'_>`
                    found enum `Result<&TyS<'_>, !>`
error[E0308]: mismatched types
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:604:39
    |
    |
604 |                 let ty = ty_to_string(ty);
    |                                       ^^ expected `&TyS<'tcx>`, found enum `Result`
    |
    = note: expected reference `&'tcx TyS<'tcx>`
                    found enum `Result<&TyS<'_>, !>`

error[E0308]: `match` arms have incompatible types
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:930:30
    |
925 |                       .map(|(subst, param)| match &(subst.unpack(), &param.kind) {
    |  ___________________________________________-
926 | |                         (_, ty::GenericParamDefKind::Type { has_default: true, .. }) => subst,
    | |                                                                                         ----- this is found to be of type `rustc_middle::ty::subst::GenericArg<'_>`
927 | |                         (crate::infer::GenericArgKind::Const(c), _) => {
928 | |                             self.replace_infers(c, param.index, param.name).into()
    | |                             ------------------------------------------------------ this is found to be of type `rustc_middle::ty::subst::GenericArg<'_>`
929 | |                         }
930 | |                         _ => subst.super_fold_with(self),
    | |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `rustc_middle::ty::subst::GenericArg`, found enum `Result`
931 | |                     })
    | |_____________________- `match` arms have incompatible types
    |
    = note: expected type `rustc_middle::ty::subst::GenericArg<'_>`
               found enum `Result<rustc_middle::ty::subst::GenericArg<'_>, !>`
error[E0599]: no method named `kind` found for enum `Result` in the current scope
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:952:26
    |
952 |                 match ty.kind() {
952 |                 match ty.kind() {
    |                          ^^^^ method not found in `Result<&TyS<'_>, !>`

error[E0308]: `match` arms have incompatible types
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:955:26
952 | /                 match ty.kind() {
952 | /                 match ty.kind() {
953 | |                     // Avoid `&_`, these can be safely presented as `_`.
954 | |                     ty::Error(_) => self.tcx().ty_error(),
    | |                                     --------------------- this is found to be of type `&TyS<'_>`
955 | |                     _ => t.super_fold_with(self),
    | |                          ^^^^^^^^^^^^^^^^^^^^^^^ expected `&TyS<'_>`, found enum `Result`
956 | |                 }
    | |_________________- `match` arms have incompatible types
    |
    = note: expected type `&TyS<'_>`
               found enum `Result<&TyS<'_>, !>`
error[E0308]: mismatched types
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:969:34
    |
    |
969 |                 .mk_ty(ty::Array(self.fold_ty(ty), self.replace_infers(c, 0, Symbol::intern("N")))),
    |                                  ^^^^^^^^^^^^^^^^ expected `&TyS<'_>`, found enum `Result`
    |
    = note: expected reference `&TyS<'_>`
                    found enum `Result<&TyS<'_>, !>`

error[E0308]: `match` arms have incompatible types
   --> compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs:993:18
991 | /         match t.kind() {
991 | /         match t.kind() {
992 | |             ty::Error(_) => self.tcx().mk_ty_var(ty::TyVid::from_u32(0)),
    | |                             -------------------------------------------- this is found to be of type `&'tcx TyS<'tcx>`
993 | |             _ => t.super_fold_with(self),
    | |                  ^^^^^^^^^^^^^^^^^^^^^^^ expected `&TyS<'tcx>`, found enum `Result`
994 | |         }
    | |_________- `match` arms have incompatible types
    |
    = note: expected reference `&'tcx TyS<'tcx>`
                    found enum `Result<&TyS<'_>, !>`
    Checking rustc_codegen_ssa v0.0.0 (/checkout/compiler/rustc_codegen_ssa)
    Checking rustc_resolve v0.0.0 (/checkout/compiler/rustc_resolve)
Some errors have detailed explanations: E0053, E0308, E0599.
For more information about an error, try `rustc --explain E0053`.

@matthiaskrgr matthiaskrgr deleted the rollup-9g5heyp branch December 12, 2021 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.