about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils
AgeCommit message (Collapse)AuthorLines
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-30Auto merge of #117415 - matthiaskrgr:rollup-jr2p1t2, r=matthiaskrgrbors-28/+12
Rollup of 7 pull requests Successful merges: - #116862 (Detect when trait is implemented for type and suggest importing it) - #117389 (Some diagnostics improvements of `gen` blocks) - #117396 (Don't treat closures/coroutine types as part of the public API) - #117398 (Correctly handle nested or-patterns in exhaustiveness) - #117403 (Poison check_well_formed if method receivers are invalid to prevent typeck from running on it) - #117411 (Improve some diagnostics around `?Trait` bounds) - #117414 (Don't normalize to an un-revealed opaque when we hit the recursion limit) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-30Rollup merge of #117068 - nnethercote:clean-up-Cargo-toml, r=wesleywiserGuillaume Gomez-5/+7
Clean up `compiler/rustc*/Cargo.toml` Mostly by sorting dependencies, plus some other minor things. r? ``@wesleywiser``
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-30Clean up `rustc_*/Cargo.toml`.Nicholas Nethercote-5/+7
- Sort dependencies and features sections. - Add `tidy` markers to the sorted sections so they stay sorted. - Remove empty `[lib`] sections. - Remove "See more keys..." comments. Excluded files: - rustc_codegen_{cranelift,gcc}, because they're external. - rustc_lexer, because it has external use. - stable_mir, because it has external use.
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-39/+39
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>
2023-10-03Optimize some `alloc_from_iter` call sites.Nicholas Nethercote-1/+1
There's no need to collect an iterator into a `Vec`, or to call `into_iter` at the call sites.
2023-10-02Implement Deref<LayoutS> for LayoutLukas Wirth-1/+1
2023-09-29a small wf and clause cleanuplcnr-5/+4
2023-09-26Don't store lazyness in DefKindMichael Goulet-7/+5
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-13/+2
2023-09-23Enable drop_tracking_mir by default.Camille GILLOT-25/+2