about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils/src
AgeCommit message (Collapse)AuthorLines
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-3/+3
cleanup
2023-11-26Auto merge of #118250 - petrochenkov:optdefkind, r=compiler-errorsbors-2/+2
rustc: Make `def_kind` mandatory for all `DefId`s Prerequisite for https://github.com/rust-lang/rust/pull/118188.
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-2/+1
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
2023-11-26Avoid need for `{D,Subd}iagnosticMessage` imports.Nicholas Nethercote-1/+0
The `fluent_messages!` macro produces uses of `crate::{D,Subd}iagnosticMessage`, which means that every crate using the macro must have this import: ``` use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; ``` This commit changes the macro to instead use `rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the imports.
2023-11-25Auto merge of #118127 - RalfJung:unadjusted-abi, r=compiler-errorsbors-6/+29
the unadjusted ABI needs to pass aggregates by-value Fixes https://github.com/rust-lang/rust/issues/118124, a regression introduced in https://github.com/rust-lang/rust/pull/117500
2023-11-25rustc: Make `def_kind` mandatory for all `DefId`sVadim Petrochenkov-2/+2
2023-11-23Fix assertionbjorn3-13/+1
2023-11-23Exhaustively match CoroutineKind in fn_sig_for_fn_abibjorn3-60/+70
2023-11-23Fix fn_sig_for_fn_abi and the coroutine transform for generatorsbjorn3-7/+47
There were three issues previously: * The self argument was pinned, despite Iterator::next taking an unpinned mutable reference. * A resume argument was passed, despite Iterator::next not having one. * The return value was CoroutineState<Item, ()> rather than Option<Item> While these things just so happened to work with the LLVM backend, cg_clif does much stricter checks when trying to assign a value to a place. In addition it can't handle the mismatch between the amount of arguments specified by the FnAbi and the FnSig.
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-9/+9
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-21the unadjusted ABI needs to pass aggregates by-valueRalf Jung-6/+29
2023-11-21Rollup merge of #118115 - spastorino:fix-old-fn-names, r=compiler-errorsNilstrieb-1/+1
Fix occurrences of old fn names in comment and tracing
2023-11-21Rollup merge of #118081 - nnethercote:rustc_ty_utils, r=compiler-errorsNilstrieb-33/+23
`rustc_ty_utils` cleanups Minor improvements I found while looking at this code. r? ``@lcnr``
2023-11-20Fix occurrences of old fn names in comment and tracingSantiago Pastorino-1/+1
2023-11-20Alphabetize features.Nicholas Nethercote-2/+2
2023-11-20Inline and remove `record_layout_for_printing`.Nicholas Nethercote-15/+5
It has a single call site.
2023-11-20Reduce exposure of some items.Nicholas Nethercote-16/+16
2023-11-19Auto merge of #117500 - RalfJung:aggregate-abi, r=davidtwcobors-5/+77
Ensure sanity of all computed ABIs This moves the ABI sanity assertions from the codegen backend to the ABI computation logic. Sadly, due to past mistakes, we [have to](https://github.com/rust-lang/rust/pull/117351#issuecomment-1788495503) be able to compute a sane ABI for nonsensical function types like `extern "C" fn(str) -> str`. So to make the sanity check pass we first need to make all ABI adjustment deal with unsized types... and we have no shared infrastructure for those adjustments, so that's a bunch of copy-paste. At least we have assertions failing loudly when one accidentally sets a different mode for an unsized argument. To achieve this, this re-lands the parts of https://github.com/rust-lang/rust/pull/80594 that got reverted in https://github.com/rust-lang/rust/pull/81388. To avoid breaking wasm ABI again, that ABI now explicitly opts-in to the (wrong, broken) ABI that we currently keep for backwards compatibility. That's still better than having *every* ABI use the wrong broken default! Cc `@bjorn3` Fixes https://github.com/rust-lang/rust/issues/115845
2023-11-17Rollup merge of #117549 - DaniPopes:more-copied, r=b-naberMatthias Krüger-2/+2
Use `copied` instead of manual `map`
2023-11-15Re-format code with new rustfmtMark Rousskov-5/+1
2023-11-15Bump cfg(bootstrap)sMark Rousskov-3/+3
2023-11-14finish `RegionKind` renamelcnr-13/+13
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-11-13Auto merge of #117881 - TaKO8Ki:rollup-n7jtmgj, r=TaKO8Kibors-5/+5
Rollup of 5 pull requests Successful merges: - #117737 (Remove `-Zkeep-hygiene-data`.) - #117830 (Small improvements in object lifetime default code) - #117858 (Compute layout with spans for better cycle errors in coroutines) - #117863 (Remove some unused stuff from `rustc_index`) - #117872 (Cranelift isn't available on non-nightly channels) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-13rename `ReLateBound` to `ReBound`lcnr-5/+4
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-11-13Compute layout with spans for better cycle errors in coroutinesMichael Goulet-5/+5
2023-11-03compiler: use `copied` instead of manual `map`DaniPopes-2/+2
2023-11-03default Aggregate ABI to Indirect, and make sure it's never used for unsizedRalf Jung-5/+6
2023-11-03move ABI sanity check from LLVM codegen backend to ABI computation logicRalf Jung-0/+71
2023-11-02review + add testslcnr-4/+4
2023-11-02dropck_outlives check generator witness needs_droplcnr-3/+29
2023-10-30Some more coroutine renamingsMichael Goulet-1/+1
2023-10-30Some manual rustfmt as rustfmt is broken on this fileOli Scherer-3/+4
2023-10-30Merge two equal match armsOli Scherer-6/+1
2023-10-30Don't treat closures/coroutines as part of the public APIOli Scherer-21/+9
2023-10-29Ignore RPIT duplicated lifetimes in opaque_types_defined_byMichael Goulet-1/+8
2023-10-29Auto merge of #116447 - oli-obk:gen_fn, r=compiler-errorsbors-0/+13
Implement `gen` blocks in the 2024 edition Coroutines tracking issue https://github.com/rust-lang/rust/issues/43122 `gen` block tracking issue https://github.com/rust-lang/rust/issues/117078 This PR implements `gen` blocks that implement `Iterator`. Most of the logic with `async` blocks is shared, and thus I renamed various types that were referring to `async` specifically. An example usage of `gen` blocks is ```rust fn foo() -> impl Iterator<Item = i32> { gen { yield 42; for i in 5..18 { if i.is_even() { continue } yield i * 2; } } } ``` The limitations (to be resolved) of the implementation are listed in the tracking issue
2023-10-27fix failure to detect a too-big-type after adding paddingRalf Jung-0/+3
2023-10-27Basic generators workOli Scherer-0/+13
2023-10-25Rollup merge of #117136 - compiler-errors:defid-list, r=oli-obkMatthias Krüger-2/+5
Intern `LocalDefId` list from `opaque_types_defined_by` query r? oli-obk
2023-10-24Intern LocalDefId list from opaque queryMichael Goulet-2/+5
2023-10-23Factor signature type walking out of opaque_types_defined_byOli Scherer-44/+154
2023-10-20s/generator/coroutine/Oli Scherer-38/+38
2023-10-20s/Generator/Coroutine/Oli Scherer-30/+30
2023-10-20Adjust importsMichael Goulet-1/+1
2023-10-13Format all the let chains in compilerMichael Goulet-99/+112
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+3
2023-10-06Auto merge of #116269 - Veykril:rustc-abi, r=WaffleLapkinbors-1/+1
Bring back generic parameters for indices in rustc_abi and make it compile on stable This effectively reverses https://github.com/rust-lang/rust/pull/107163, allowing rust-analyzer to depend on this crate again, It also moves some glob imports / expands them in the first commit because they made it more difficult for me to reason about things.
2023-10-05Rollup merge of #116223 - catandcoder:master, r=cjgillotJubilee-1/+1
Fix misuses of a vs an Fixes the misuse of "a" vs "an", according to English grammatical expectations and using https://www.a-or-an.com/
2023-10-04Auto merge of #116370 - nnethercote:more-arena-stuff, r=cjgillotbors-1/+1
Remove the `TypedArena::alloc_from_iter` specialization. It was added in #78569. It's complicated and doesn't actually help performance. r? `@cjgillot`
2023-10-04Fix misuses of a vs ancui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>