about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty
AgeCommit message (Collapse)AuthorLines
2023-10-23Auto merge of #117103 - matthiaskrgr:rollup-96zuuom, r=matthiaskrgrbors-310/+323
Rollup of 6 pull requests Successful merges: - #107159 (rand use getrandom for freebsd (available since 12.x)) - #116859 (Make `ty::print::Printer` take `&mut self` instead of `self`) - #117046 (return unfixed len if pat has reported error) - #117070 (rustdoc: wrap Type with Box instead of Generics) - #117074 (Remove smir from triage and add me to stablemir) - #117086 (Update .mailmap to promote my livename) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-23Remove redundant type parameterMichael Goulet-36/+36
2023-10-23Naming nitsMichael Goulet-26/+26
2023-10-22use visibility to check unused imports and delete some stmtsbohan-2/+0
2023-10-21Make `ty::print::Printer` take `&mut self` instead of `self`Nilstrieb-310/+323
This simplifies the code by removing all the `self` assignments and makes the flow of data clearer - always into the printer. Especially in v0 mangling, which already used `&mut self` in some places, it gets a lot more uniform.
2023-10-20Uplift ClauseKind and PredicateKindMichael Goulet-183/+78
2023-10-20Rename `CoroutineKind::Gen` to `::Coroutine`Oli Scherer-3/+3
2023-10-20s/generator/coroutine/Oli Scherer-106/+106
2023-10-20s/Generator/Coroutine/Oli Scherer-123/+123
2023-10-20Adjust importsMichael Goulet-4/+4
2023-10-20Auto merge of #116946 - compiler-errors:movability-and-mutability, r=lcnrbors-7/+1
Uplift movability and mutability, the simple way Just make type_ir a dependency of ast. This can be relaxed later if we want to make the dependency less heavy. Part of rust-lang/types-team#124. r? `@lcnr` or `@jackh726`
2023-10-19Auto merge of #116874 - compiler-errors:elaborator-nits, r=wesleywiserbors-2/+3
Some small elaborator nits Didn't want to fold these into a totally unrelated pr.
2023-10-19Uplift movability and mutability, the simple wayMichael Goulet-7/+1
2023-10-18Some renaming nits for rustc_type_irMichael Goulet-14/+12
2023-10-18Remove unused variant BinderListTyMichael Goulet-1/+0
2023-10-18Auto merge of #116887 - lcnr:alias-ty-constructor, r=compiler-errorsbors-19/+21
`TyCtxt::mk_alias_ty` -> `AliasTy::new`
2023-10-18AliasTy::new instead of tcx methodlcnr-19/+21
2023-10-18Auto merge of #116885 - aliemjay:rollup-plbeppt, r=aliemjaybors-5/+0
Rollup of 5 pull requests Successful merges: - #116812 (Disable missing_copy_implementations lint on non_exhaustive types) - #116856 (Disable effects in libcore again) - #116865 (Suggest constraining assoc types in more cases) - #116870 (Don't compare host param by name) - #116879 (revert #114586) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-18Rollup merge of #116870 - compiler-errors:host-param-by-name, r=fee1-deadAli MJ Al-Nasrawy-5/+0
Don't compare host param by name Seems sketchy to be searching for `sym::host` by name, especially when we can get the actual index with not very much work. r? fee1-dead
2023-10-18Auto merge of #116815 - Nilstrieb:more-funny-pretty-printers, r=compiler-errorsbors-143/+90
Remove lots of generics from `ty::print` All of these generics mostly resolve to the same thing, which means we can remove them, greatly simplifying the types involved in pretty printing and unlocking another simplification (that is not performed in this PR): Using `&mut self` instead of passing `self` through the return type. cc `@eddyb` you probably know why it's like this, just checking in and making sure I didn't do anything bad r? oli-obk
2023-10-18Make sure that non-pretty-printing usages are using the correct elaboratorMichael Goulet-2/+3
2023-10-18Don't compare host param by nameMichael Goulet-5/+0
2023-10-17Automatically enable cross-crate inlining for small functionsBen Kimock-5/+4
2023-10-17Remove `Print::Error`Nilstrieb-22/+11
All printing goes through `fmt::Error` now.
2023-10-17Remove `Printer::Error`Nilstrieb-95/+93
It's always a `fmt::Error` except in some cases where it was `!`, but we're not really winning anything in that case.
2023-10-17Remove `Print::Output`Nilstrieb-27/+19
Now that `Printer` doesn't have subprinters anymore, the output of a printing operation is always the same.
2023-10-17Remove "subprinter" types from `Printer`Nilstrieb-88/+56
These are `Self` in almost all printers except one, which can just store the state as a field instead. This simplifies the printer and allows for further simplifications, for example using `&mut self` instead of passing around the printer.
2023-10-17Auto merge of #116756 - fee1-dead-contrib:dupe-those-bounds, r=oli-obkbors-0/+4
Duplicate `~const` bounds with a non-const one in effects desugaring This should unblock #116058. r? `@oli-obk`
2023-10-15Auto merge of #116688 - compiler-errors:rustfmt-up, r=WaffleLapkin,Nilstriebbors-22/+51
Format all the let-chains in compiler crates Since rust-lang/rustfmt#5910 has landed, soon we will have support for formatting let-chains (as soon as rustfmt syncs and beta gets bumped). This PR applies the changes [from master rustfmt to rust-lang/rust eagerly](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/out.20formatting.20of.20prs/near/374997516), so that the next beta bump does not have to deal with a 200+ file diff and can remain concerned with other things like `cfg(bootstrap)` -- #113637 was a pain to land, for example, because of let-else. I will also add this commit to the ignore list after it has landed. The commands that were run -- I'm not great at bash-foo, but this applies rustfmt to every compiler crate, and then reverts the two crates that should probably be formatted out-of-tree. ``` ~/rustfmt $ ls -1d ~/rust/compiler/* | xargs -I@ cargo run --bin rustfmt -- `@/src/lib.rs` --config-path ~/rust --edition=2021 # format all of the compiler crates ~/rust $ git checkout HEAD -- compiler/rustc_codegen_{gcc,cranelift} # revert changes to cg-gcc and cg-clif ``` cc `@rust-lang/rustfmt` r? `@WaffleLapkin` or `@Nilstrieb` who said they may be able to review this purely mechanical PR :> cc `@Mark-Simulacrum` and `@petrochenkov,` who had some thoughts on the order of operations with big formatting changes in https://github.com/rust-lang/rust/pull/95262#issue-1178993801. I think the situation has changed since then, given that let-chains support exists on master rustfmt now, and I'm fairly confident that this formatting PR should land even if *bootstrap* rustfmt doesn't yet format let-chains in order to lessen the burden of the next beta bump.
2023-10-15Duplicate `~const` bounds with a non-const one in effects desugaringDeadbeef-0/+4
2023-10-14Fix a spot I wrote the wrong wordScott McMurray-1/+1
2023-10-13Format all the let chains in compilerMichael Goulet-22/+51
2023-10-11Rollup merge of #116219 - compiler-errors:relate-alias-ty-with-variance, r=lcnrMatthias Krüger-41/+24
Relate alias ty with variance In the new solver, turns out that the subst-relate branch of the alias-relate predicate was relating args invariantly even for opaques, which have variance :skull:. This change is a bit more invasive, but I'd rather not special-case it [here](https://github.com/rust-lang/rust/blob/aeaa5c30e5c9041264a2e8314b68ad84c2dc3169/compiler/rustc_trait_selection/src/solve/alias_relate.rs#L171-L190) and then have it break elsewhere. I'm doing a perf run to see if the extra call to `def_kind` is that expensive, if it is, I'll reconsider. r? ``@lcnr``
2023-10-08improve the suggestion of generic_bound_failureAli MJ Al-Nasrawy-10/+15
2023-10-06Auto merge of #116269 - Veykril:rustc-abi, r=WaffleLapkinbors-2/+2
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-05Auto merge of #116417 - ouz-a:trait_type_detective, r=compiler-errorsbors-23/+2
Remove is global hack In attempt to fix https://github.com/rust-lang/rust/issues/114057 we found several issues with how compiler computes layouts, this change removes `is_global` from `and` to stop impl from being shadowed. In depth conversation can be read here https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Getting.20different.20types.20from.20almost.20same.20inputs This is a fix candidate opened for performance run. r? `@lcnr`
2023-10-05remove is global hackOğuz Ağcayazı-23/+2
2023-10-04Auto merge of #116370 - nnethercote:more-arena-stuff, r=cjgillotbors-6/+8
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-04Make it clear that args default to being related invariantlyMichael Goulet-10/+10
2023-10-04Remove unnecessary relate implMichael Goulet-13/+0
2023-10-04Relate AliasTy considering varianceMichael Goulet-19/+15
2023-10-03Rollup merge of #116261 - lcnr:wf-only-clause, r=davidtwcoMatthias Krüger-9/+18
a small wf and clause cleanup - remove `Clause::from_projection_clause`, instead use `ToPredicate` - change `predicate_obligations` to directly take a `Clause` - remove some unnecessary `&` - use clause in `min_specialization` checks where easily applicable
2023-10-03Optimize some `alloc_from_iter` call sites.Nicholas Nethercote-6/+8
There's no need to collect an iterator into a `Vec`, or to call `into_iter` at the call sites.
2023-10-02Rename both of the Match relationsMichael Goulet-6/+6
2023-10-02Implement Deref<LayoutS> for LayoutLukas Wirth-2/+2
2023-10-02`skip_binder` to `instantiate_identity`lcnr-2/+7
2023-09-29a small wf and clause cleanuplcnr-9/+18
2023-09-27Auto merge of #116163 - compiler-errors:lazyness, r=oli-obkbors-10/+10
Don't store lazyness in `DefKind::TyAlias` 1. Don't store lazyness of a type alias in its `DefKind`, but instead via a query. 2. This allows us to treat type aliases as lazy if `#[feature(lazy_type_alias)]` *OR* if the alias contains a TAIT, rather than having checks for both in separate parts of the codebase. r? `@oli-obk` cc `@fmease`
2023-09-26subst -> instantiatelcnr-24/+12
2023-09-26Don't store lazyness in DefKindMichael Goulet-10/+10