about summary refs log tree commit diff
path: root/compiler/rustc_middle
AgeCommit message (Collapse)AuthorLines
2023-01-12Auto merge of #106760 - compiler-errors:rollup-0bogyco, r=compiler-errorsbors-3/+18
Rollup of 8 pull requests Successful merges: - #103236 (doc: rewrite doc for signed int::{carrying_add,borrowing_sub}) - #103800 (Stabilize `::{core,std}::pin::pin!`) - #106097 (Migrate mir_build diagnostics 2 of 3) - #106170 (Move autoderef to `rustc_hir_analysis`) - #106323 (Stabilize f16c_target_feature) - #106360 (Tweak E0277 `&`-removal suggestions) - #106524 (Label `struct/enum constructor` instead of `fn item`, mention that it should be called on type mismatch) - #106739 (Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-11Rollup merge of #106524 - compiler-errors:constructor-note, r=cjgillotMichael Goulet-3/+11
Label `struct/enum constructor` instead of `fn item`, mention that it should be called on type mismatch Fixes #106516
2023-01-12Rollup merge of #106596 - estebank:verbose-e0271, r=compiler-errorsMatthias Krüger-3/+15
Hide more of long types in E0271 Fix #40186.
2023-01-12RPITITs are not suggestableMichael Goulet-5/+12
2023-01-12fix fmt and blessDeadbeef-1/+3
2023-01-12attempt to make a minimal example workDeadbeef-4/+8
2023-01-11Migrate deconstruct_pat.rsmejrs-0/+7
2023-01-11Hide more of long types in E0271Esteban Küber-3/+15
Fix #40186.
2023-01-11Reuse ErrorGuaranteed during relationMichael Goulet-2/+4
2023-01-11Be more specific about constructor `FnDef`s in type mismatchMichael Goulet-3/+11
2023-01-11Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errorsnils-6/+41
Polymorphization cleanup Split out of #106233 Use a newtype instead of a bitset directly. This makes the code way easier to read and easier to adapt for future changes.
2023-01-11Do not filter substs in `remap_generic_params_to_declaration_params`.Camille GILLOT-26/+1
The relevant filtering should have been performed by borrowck.
2023-01-11Rollup merge of #106669 - ozkanonur:helper-function-for-lint-level, r=NilstriebYuki Okushi-10/+1
create helper function for `rustc_lint_defs::Level` and remove it's duplicated code Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-01-10create helper function for `rustc_lint_defs::Level` and remove it's ↵ozkanonur-10/+1
duplicated code r=ozkanonur Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-01-09Auto merge of #106637 - fee1-dead-contrib:rollup-ticvmsd, r=fee1-deadbors-4/+2
Rollup of 10 pull requests Successful merges: - #105292 (Change a commit_if_ok call to probe) - #105655 (Remove invalid case for mutable borrow suggestion) - #106047 (Fix ui constant tests for big-endian platforms) - #106061 (Enable Shadow Call Stack for Fuchsia on AArch64) - #106164 (Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`) - #106291 (Fix incorrect suggestion for extra `&` in pattern) - #106389 (Simplify some canonical type alias names) - #106468 (Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`) - #106549 (Use fmt named parameters in rustc_borrowck) - #106614 (error-code docs improvements (No. 2)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-09Use newtype for unused generic parametersNilstrieb-6/+41
2023-01-09Rollup merge of #106389 - compiler-errors:no-canonicalized, r=lcnrfee1-dead-4/+2
Simplify some canonical type alias names * delete the `Canonicalized<'tcx>` type alias in favor for `Canonical<'tcx>` * `CanonicalizedQueryResponse` -> `CanonicalQueryResponse` I don't particularly care about the latter, but it should be consistent. We could alternatively delete the first alias and rename the struct to `Canonicalized`, and then keep the name of `CanonicalizedQueryResponse` untouched.
2023-01-09Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnrbors-8/+5
Don't normalize in AstConv See individual commits. Fixes #101350 Fixes #54940
2023-01-08Add type flags support for Ty and Const late-bound regionsMichael Goulet-3/+23
2023-01-07make ascribe_user_type a TypeOpAli MJ Al-Nasrawy-8/+5
Projection types in user annotations may contain inference variables. This makes the normalization depend on the unification with the actual type and thus requires a separate TypeOp to track the obligations. Otherwise simply calling `TypeChecker::normalize` would ICE with "unexpected ambiguity"
2023-01-06Rollup merge of #106287 - Nilstrieb:its-bugging-me-how-we-dont-have-docs, ↵Matthias Krüger-2/+19
r=jyn514 Add some docs to `bug`, `span_bug` and `delay_span_bug` cc `@mejrs` as you wanted me to do this, does this look good and understandable?
2023-01-04Rollup merge of #106403 - compiler-errors:rename-hir-methods, r=cjgillotMichael Goulet-18/+26
Rename `hir::Map::{get_,find_}parent_node` to `hir::Map::{,opt_}parent_id`, and add `hir::Map::{get,find}_parent` The `hir::Map::get_parent_node` function doesn't return a `Node`, and I think that's quite confusing. Let's rename it to something that sounds more like something that gets the parent hir id => `hir::Map::parent_id`. Same with `find_parent_node` => `opt_parent_id`. Also, combine `hir.get(hir.parent_id(hir_id))` and similar `hir.find(hir.parent_id(hir_id))` function into new functions that actually retrieve the parent node in one call. This last commit is the only one that might need to be looked at closely.
2023-01-04review comment: Deduplicate dyn ty_and_layout_field codeMichael Goulet-36/+19
2023-01-04Mirror metadata changes in layout sanity checkMichael Goulet-7/+45
2023-01-04get_parent and find_parentMichael Goulet-6/+14
2023-01-04rename find_parent_node to opt_parent_idMichael Goulet-3/+3
2023-01-04rename get_parent_node to parent_idMichael Goulet-15/+15
2023-01-03Rollup merge of #105681 - tshepang:doc-mir-visit, r=NilstriebMatthias Krüger-4/+4
some fixes/improvements to mir::visit module
2023-01-03Simplify some canonical type alias namesMichael Goulet-4/+2
2023-01-02Auto merge of #84762 - cjgillot:resolve-span-opt, r=petrochenkovbors-1/+1
Encode spans relative to the enclosing item -- enable on nightly Follow-up to #84373 with the flag `-Zincremental-relative-spans` set by default. This PR seeks to remove one of the main shortcomings of incremental: the handling of spans. Changing the contents of a function may require redoing part of the compilation process for another function in another file because of span information is changed. Within one file: all the spans in HIR change, so typechecking had to be re-done. Between files: spans of associated types/consts/functions change, so type-based resolution needs to be re-done (hygiene information is stored in the span). The flag `-Zincremental-relative-spans` encodes local spans relative to the span of an item, stored inside the `source_span` query. Trap: stashed diagnostics are referenced by the "raw" span, so stealing them requires to remove the span's parent. In order to avoid too much traffic in the span interner, span encoding uses the `ctxt_or_tag` field to encode: - the parent when the `SyntaxContext` is 0; - the `SyntaxContext` when the parent is `None`. Even with this, the PR creates a lot of traffic to the Span interner, when a Span has both a LocalDefId parent and a non-root SyntaxContext. They appear in lowering, when we add a parent to all spans, including those which come from macros, and during inlining when we mark inlined spans. The last commit changes how queries of `LocalDefId` manage their cache. I can put this in a separate PR if required. Possible future directions: - validate that all spans are marked in HIR validation; - mark macro-expanded spans relative to the def-site and not the use-site.
2022-12-30Add some docs to `bug`, `span_bug` and `delay_span_bug`Nilstrieb-2/+19
2022-12-28Auto merge of #106129 - compiler-errors:compare_method-tweaks, r=BoxyUwUbors-4/+4
Some `compare_method` tweaks 1. Make some of the comparison functions' names more regular 2. Reduce pub scope of some of the things in `compare_method` ~3. Remove some unnecessary opaque type handling code -- `InferCtxt` already is in a mode that doesn't define opaque types~ * moved to a different PR 4. Bubble up `ErrorGuaranteed` for region constraint errors in `compare_method` - Improves a redundant error message in one unit test. 5. Move the `compare_method` module to have a more general name, since it's more like `compare_impl_item` :) 6. Rename `collect_trait_impl_trait_tys`
2022-12-28better names and a commentMichael Goulet-3/+3
2022-12-27Provide local extern function arg namesMichael Goulet-1/+5
2022-12-27Rollup merge of #106151 - TaKO8Ki:remove-unused-imports, r=jackh726fee1-dead-2/+2
Remove unused imports
2022-12-26remove unused importsTakayuki Maeda-2/+2
2022-12-25Only enable relative span hashing on nightly.Camille GILLOT-1/+1
2022-12-25Enable relative span hashing.Camille GILLOT-1/+1
2022-12-25fix more clippy::style findingsMatthias Krüger-7/+5
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-12-24Rename some compare_method functionsMichael Goulet-1/+1
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-74/+57
rustc: Remove needless lifetimes
2022-12-23Auto merge of #106087 - Nilstrieb:rollup-2m3nies, r=Nilstriebbors-17/+53
Rollup of 6 pull requests Successful merges: - #105661 (implement the skeleton of the updated trait solver) - #105853 (Make the pre-push script work on directories with spaces) - #106043 (Move tests) - #106048 (Run `tidy` in its own job in PR CI) - #106055 (Check arg expressions properly on error in `confirm_builtin_call`) - #106067 (A few metadata nits) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-23Rollup merge of #105661 - lcnr:evaluate-new, r=compiler-errorsnils-17/+53
implement the skeleton of the updated trait solver cc ```@rust-lang/initiative-trait-system-refactor``` This is mostly following the architecture discussed in the types team meetup. After discussing the desired changes for the trait solver, we encountered cyclic dependencies between them. Most notably between changing evaluate to be canonical and returning inference constraints. We cannot canonicalize evaluate without returning inference constraints due to coinductive cycles. However, caching inference constraints also relies on canonicalization. Implementing both of these changes at once in-place is not feasible. This somewhat closely mirrors the current `evaluate` implementation with the following notable differences: - it moves `project` into the core solver, allowing us to correctly deal with coinductive projections (will be required for implied bounds, perfect derive) - it changes trait solver overflow to be non-fatal (required to backcompat breakage from changes to the iteration order of nested goals, deferred projection equality, generally very useful) - it returns inference constraints and canonicalizes inputs and outputs (required for a lot things, most notably merging fulfill and evaluate, and deferred projection equality) - it is implemented to work with lazy normalization A lot of things aren't yet implemented, but the remaining FIXMEs should all be fairly self-contained and parallelizable. If the architecture looks correct and is what we want here, I would like to quickly merge this and then split the work. r? ```@compiler-errors``` / ```@rust-lang/types``` :3
2022-12-23Auto merge of #105550 - gimbles:master, r=Nilstriebbors-11/+12
Use `DepKind` instead of `&'static str` in `QueryStackFrame` `@rustbot` author Fixes #105168
2022-12-23Use DepKind instead of &strgimbles-11/+12
2022-12-23Rollup merge of #106057 - jyn514:trimmed-def-paths-ice, r=compiler-errorsMatthias Krüger-1/+9
Give a more helpful error for "trimmed_def_paths constructed" cc https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/ice.20debugging/near/315928294, https://github.com/rust-lang/rust/pull/106056 `@mejrs` do you think this would have helped you figure out the problem faster?
2022-12-22Give a more helpful error for "trimmed_def_paths construted"Joshua Nelson-1/+9
2022-12-22Auto merge of #103957 - JakobDegen:drop-retag, r=RalfJungbors-8/+7
Retag as FnEntry on `drop_in_place` This commit changes the mir drop shim to always retag its argument as if it were a `&mut`. cc rust-lang/unsafe-code-guidelines#373
2022-12-21Don't run `Drop` terminators on types that do not have drop glue in const evalJakob Degen-8/+7
2022-12-22Rollup merge of #106012 - JakobDegen:retag-raw, r=RalfJungMatthias Krüger-2/+4
Clarify that raw retags are not permitted in Mir Not sure when this changed, but documentation and the validator needed to be updated. This also removes raw retags from custom mir. cc rust-lang/miri#2735 r? `@RalfJung`