about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2022-09-09Rollup merge of #101556 - compiler-errors:tweak-generator-print, r=jackh726Matthias Krüger-3/+5
Tweak future opaque ty pretty printing 1. The `Return` type of a generator doesn't need to be a lang item just for diagnostic printing of types 2. We shouldn't suppress the `Output = Ty` of a opaque future if the type is a int or float var.
2022-09-09Adjust pretty printing of RPITITsMichael Goulet-1/+7
2022-09-09Handle generic parameters.Camille GILLOT-5/+15
2022-09-09Deeply check that method signatures match, and allow for nested RPITITsMichael Goulet-0/+24
2022-09-09Lower RPITIT to ImplTraitPlaceholder itemMichael Goulet-3/+7
2022-09-09RPITIT placeholder itemsMichael Goulet-0/+2
2022-09-08Remove ReEmptyJack Huey-16/+2
2022-09-08In ReverseMapper, don't fallback to ReEmpty, instead ReStaticJack Huey-8/+1
2022-09-08ptr: 43276834268743978Ellen-1/+14
2022-09-08Rollup merge of #101545 - TaKO8Ki:remove-unnecessary-partialord-ord, r=oli-obkDylan DPC-2/+2
Remove unnecessary `PartialOrd` and `Ord`
2022-09-08Rollup merge of #101424 - compiler-errors:operator-err-sugg, r=TaKO8KiDylan DPC-3/+15
Adjust and slightly generalize operator error suggestion (in no particular order) * Stop passing around a whole extra `ProjectionPredicate` * Add spaces around `=` in `Trait<..., Output = Ty>` suggestion * Some code clean-ups, including * add `lang_item_for_op` to turn a `Op` into a `DefId` * avoid `SourceMap` because we don't really need to render an expr * Remove `TypeParamVisitor` in favor of just checking `ty.has_param_types_or_consts` -- this acts a bit differently, but shouldn't cause erroneous suggestions (actually might generalize them a bit) * We now suggest `Output = Ty` in the `where` clause suggestion when we fail to add `Struct<T>` and `T`. I can split this out into more PRs if needed, but they're all just miscellaneous generalizations, changes, and nitpicks I saw when messing with this operator code.
2022-09-08Rollup merge of #101041 - ↵Dylan DPC-1/+1
LuisCardosoOliveira:translation-rename-attr-warning-pt2, r=davidtwco translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2 # Description This is the second part of the `rustc_session` [migration](https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883). **Please only review this [commit](https://github.com/rust-lang/rust/pull/101041/commits/501858195734ec77f6b121ef753b03c40645df23) that belongs to the part 2. The other ones are from the PR [#100753](https://github.com/rust-lang/rust/pull/100753) that is not yet merged.** In this PR, we migrate the files `session.rs` and `config.rs`. Please not that we have to `allow` the lints rules in some functions from `session.rs` because they are (at least I believe) part of the diagnostic machinery.
2022-09-08Rollup merge of #98933 - oli-obk:opaque_type_late_bound_lifetimes, r=lcnrDylan DPC-1/+1
Opaque types' generic params do not imply anything about their hidden type's lifetimes fixes #97104 cc ```@aliemjay```
2022-09-08update `ParamKindOrd`lcnr-2/+3
2022-09-08Auto merge of #98900 - lcnr:region-stuff, r=jackh726bors-4/+1
const_generics: correctly deal with bound variables removes the hack in `resolve` which was needed because we evaluated constants without caring about their bound variables. Each commit should be fairly self-contained, even if they build on each other r? `@jackh726`
2022-09-08don't evaluate with escaping bound varslcnr-0/+1
2022-09-08stop evaluating constants in `Relate`lcnr-4/+0
2022-09-08Opaque types' generic params do not imply anything about their hidden type's ↵Oli Scherer-1/+1
lifetimes
2022-09-08translations(rustc_session): remove lint allow rule to the methods marked ↵Luis Cardoso-2/+1
with rustc_lint_diagnostic This commit removes the allows rules for the SessionDiagnostic lint that were being used in the session.rs file. Thanks to the PR #101230 we do not need to annotate the methods with the allow rule as they are part of the diagnostic machinery.
2022-09-08translations(rustc_session): migrate TargetDataLayout::parseLuis Cardoso-1/+2
2022-09-08Rollup merge of #101498 - petrochenkov:visparam, r=cjgillotDylan DPC-29/+49
rustc: Parameterize `ty::Visibility` over used ID It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-08We can print futures with {integer} tooMichael Goulet-1/+1
2022-09-08Generator return doesn't need to be a lang itemMichael Goulet-2/+4
2022-09-08Auto merge of #101303 - jyn514:jnelson/handle-cycle-enum, r=cjgillotbors-0/+55
Make `HandleCycleError` an enum instead of a macro-generated closure Helps with https://github.com/rust-lang/rust/issues/96524. Based on https://github.com/rust-lang/rust/pull/100943 to avoid merge conflicts, so it looks larger than it is (only the last commit is relevant). cc https://rust-lang.zulipchat.com/#narrow/stream/241847-t-compiler.2Fwg-incr-comp/topic/Moving.20.60Value.60.20to.20rustc_query_system.20.2396524 r? `@cjgillot`
2022-09-08Adjust spacing in suggestion, add a testMichael Goulet-2/+2
2022-09-08Add associated item binding to non-param-ty where clause suggestionsMichael Goulet-3/+15
2022-09-07Auto merge of #94075 - mikebenfield:wip-enum, r=oli-obkbors-123/+210
Use niche-filling optimization even when multiple variants have data. Fixes #46213
2022-09-08remove unnecessary `PartialOrd` and `Ord`Takayuki Maeda-2/+2
2022-09-07Use niche-filling optimization even when multiple variants have data.Michael Benfield-121/+208
Fixes #46213
2022-09-07Change name of "dataful" variant to "untagged"Michael Benfield-10/+10
This is in anticipation of a new enum layout, in which the niche optimization may be applied even when multiple variants have data.
2022-09-07Rollup merge of #101503 - spastorino:add-debug-calls, r=compiler-errorsMatthias Krüger-0/+1
Add debug calls `@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller. r? `@oli-obk` `@cjgillot`
2022-09-07Auto merge of #101522 - oli-obk:miriup, r=oli-obkbors-1/+3
Update miri submodule fixes #101344 cc `@rust-lang/miri` r? `@ghost`
2022-09-07Update miri submoduleOli Scherer-1/+3
2022-09-07Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnrbors-57/+138
Shrink `PredicateS` r? `@ghost`
2022-09-07Add instrument and debug callsSantiago Pastorino-0/+1
2022-09-07ssa: implement `#[collapse_debuginfo]`David Wood-0/+17
Debuginfo line information for macro invocations are collapsed by default - line information are replaced by the line of the outermost expansion site. Using `-Zdebug-macros` disables this behaviour. When the `collapse_debuginfo` feature is enabled, the default behaviour is reversed so that debuginfo is not collapsed by default. In addition, the `#[collapse_debuginfo]` attribute is available and can be applied to macro definitions which will then have their line information collapsed. Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-07middle: comment -> doc commentDavid Wood-1/+1
Drive-by change of a regular comment to a documentation comment on `TyCtxt::is_suitable_region`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-07Auto merge of #98332 - oli-obk:assume, r=wesleywiserbors-19/+50
Lower the assume intrinsic to a MIR statement This makes https://github.com/rust-lang/rust/pull/96862#issuecomment-1153739068 easier and will generally allow us to cheaply insert assume intrinsic calls in mir building. r? rust-lang/wg-mir-opt
2022-09-07rustc: Parameterize `ty::Visibility` over used IDVadim Petrochenkov-29/+49
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-06Get rid of the emitted `rustc_query_names` and `rustc_cached_queries` macroJoshua Nelson-9/+10
We can avoid these by adding slightly more information to `rustc_query_append` instead.
2022-09-06Support doc-comments in `define_dep_nodes`Joshua Nelson-4/+4
2022-09-06Further simplify the macros generated by `rustc_queries`Joshua Nelson-17/+7
- Add a new `rustc_query_names` macro. This allows a much simpler syntax for the matchers in the macros passed to it as a callback. - Convert `define_dep_nodes` and `alloc_once` to use `rustc_query_names`. This is possible because they only use the names (despite the quite complicated matchers in `define_dep_nodes`, none of the other arguments are used). - Get rid of `rustc_dep_node_append`.
2022-09-06Make `HandleCycleError` an enum instead of a macro-generated closureJoshua Nelson-0/+55
- Add a `HandleCycleError` enum to rustc_query_system, along with a `handle_cycle_error` function - Move `Value` to rustc_query_system, so `handle_cycle_error` can use it - Move the `Value` impls from rustc_query_impl to rustc_middle. This is necessary due to orphan rules.
2022-09-06Rollup merge of #101473 - nnethercote:mir-size-assertions, r=lqdGuillaume Gomez-8/+14
Add more size assertions for MIR types. And move them into a module, as has been done previously for AST, HIR, etc. r? `@lqd`
2022-09-06Rollup merge of #101357 - compiler-errors:variant-sugg-tweak, r=oli-obkGuillaume Gomez-11/+27
Include enum path in variant suggestion (except for `Result` and `Option`, which we should have via the prelude) Fixes #101356
2022-09-06Update docsOli Scherer-2/+2
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-32/+50
2022-09-06Lower the assume intrinsic to a MIR statementOli Scherer-0/+13
2022-09-06Rollup merge of #101021 - MingyuChen1:diagnostic, r=davidtwcoDylan DPC-29/+66
Migrate ``rustc_middle`` diagnostic Part of #100717
2022-09-06Rollup merge of #100658 - chenyukang:100631-check-get-attr, r=lcnrDylan DPC-1/+5
TyCtxt::get_attr should check that no duplicates are allowed Fixes #100631