about summary refs log tree commit diff
path: root/compiler/rustc_middle
AgeCommit message (Collapse)AuthorLines
2022-11-29Auto merge of #104947 - cjgillot:verify-hir-nest, r=oli-obkbors-7/+2
Verify that HIR parenting and Def parenting match. This relationship is relied upon for `tcx.hir_owner_parent` query to return an accurate result.
2022-11-29fix #104884, Avoid Invalid code suggested when encountering unsatisfied ↵yukang-0/+6
trait bounds in derive macro code
2022-11-29Rollup merge of #104951 - Swatinem:async-kind, r=compiler-errorsMatthias Krüger-0/+5
Simplify checking for `GeneratorKind::Async` Adds a helper method around `generator_kind` that makes matching async constructs simpler.
2022-11-28Simplify checking for `GeneratorKind::Async`Arpad Borsos-0/+5
Adds a helper method around `generator_kind` that makes matching async constructs simpler.
2022-11-28Further tweak the type shortening logicEsteban Küber-2/+3
2022-11-28Detect long types in E0308 and write them to diskEsteban Küber-10/+18
On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-11-28Remove `Const::from_scalar_int`Maybe Waffle-6/+4
2022-11-28Remove `Const::from_value`Maybe Waffle-12/+4
...it's just `mk_const` but without the sparcles
2022-11-28Simplify calls to `tcx.mk_const`Maybe Waffle-10/+6
`mk_const(ty::ConstKind::X(...), ty)` can now be simplified to `mk_cosnt(..., ty)`. I searched with the following regex: \mk_const\([\n\s]*(ty::)?ConstKind\ I've left `ty::ConstKind::{Bound, Error}` as-is, they seem clearer this way.
2022-11-28Remove `tcx.mk_const_var`Maybe Waffle-20/+8
... `tcx.mk_const` can now be used instead
2022-11-28Make `tcx.mk_const` more permissive wrt `kind` argumentMaybe Waffle-2/+11
- Accept `impl Into` - Implement `From<>` for `ConstKind` Note: this adds a dependency on `derive_more` (MIT license). It allows to derive a lot of traits (like `From` here) that would be otherwise tedious to implement.
2022-11-28Rollup merge of #104933 - RalfJung:interpret-partial-ord, r=oli-obkMatthias Krüger-7/+7
interpret: remove PartialOrd from a bunch of types that do not have or need a sensible order r? `@oli-obk`
2022-11-28Rollup merge of #104891 - fee1-dead-contrib:escaping_bound_vars_docs, ↵Matthias Krüger-1/+7
r=wesleywiser Add documentation for `has_escaping_bound_vars` Thanks to `@BoxyUwU` for explaining this to me. Adding docs with a helpful link if people get confused.
2022-11-28Rollup merge of #104804 - nnethercote:MetaItemLit, r=petrochenkovMatthias Krüger-2/+3
Rename `ast::Lit` as `ast::MetaItemLit`. And some other literal cleanups. r? `@petrochenkov`
2022-11-28Rollup merge of #104927 - compiler-errors:binder-shifting-logic, r=oli-obkDylan DPC-23/+24
Simplify some binder shifting logic Not sure if worth, but we'll see
2022-11-28Rollup merge of #104890 - lcnr:small-cleanup, r=fee1-deadDylan DPC-4/+1
small method code cleanup
2022-11-28Rollup merge of #104732 - WaffleLapkin:from_def_idn't, r=compiler-errorsDylan DPC-35/+25
Refactor `ty::ClosureKind` related stuff I've tried to fix all duplication and weirdness, but if I missed something do tell :p r? `@compiler-errors`
2022-11-28Keep track of the start of the argument block of a closureSarthak Singh-1/+1
2022-11-28Rename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.Nicholas Nethercote-1/+1
We already use a mix of `Literal` and `Lit`. The latter is better because it is shorter without causing any ambiguity.
2022-11-28Rename `ast::Lit` as `ast::MetaItemLit`.Nicholas Nethercote-2/+3
2022-11-27Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillotMatthias Krüger-35/+38
Prefer doc comments over `//`-comments in compiler Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
2022-11-27Auto merge of #104983 - matthiaskrgr:rollup-018sk73, r=matthiaskrgrbors-15/+10
Rollup of 8 pull requests Successful merges: - #95836 (Use `rust_out{exe_suffix}` for doctests) - #104882 (notify lcnr on changes to `ObligationCtxt`) - #104892 (Explain how to get the discriminant out of a `#[repr(T)] enum` with payload) - #104917 (Allow non-org members to label `requires-debug-assertions`) - #104931 (Pretty-print generators with their `generator_kind`) - #104934 (Remove redundant `all` in cfg) - #104944 (Support unit tests for jsondoclint) - #104946 (rustdoc: improve popover focus handling JS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-27Rollup merge of #104931 - Swatinem:async-pretty, r=eholkMatthias Krüger-15/+10
Pretty-print generators with their `generator_kind` After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$async-type@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-21/+27
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-35/+38
2022-11-27Auto merge of #103917 - oli-obk:layout_math, r=RalfJung,lcnrbors-0/+12
Various cleanups around scalar layout restrictions Pulled out of https://github.com/rust-lang/rust/pull/103724
2022-11-27micro doc fixesMaybe Waffle-13/+12
2022-11-27Simplify `ty::ClosureKind::extends`Maybe Waffle-9/+1
This is valid per the comment of the `ClosureKind` defition
2022-11-27Add `TyCtxt::is_fn_trait`Maybe Waffle-0/+8
2022-11-27Remove `ty::ClosureKind::from_def_id`Maybe Waffle-12/+3
…in favour of `TyCtxt::fn_trait_kind_from_def_id`
2022-11-27Rename `fn_trait_kind_from_{from_lang=>def_id}` to better convey meaningMaybe Waffle-2/+2
2022-11-26Pretty-print generators with their `generator_kind`Arpad Borsos-15/+10
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$movability `async` $something@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-26Auto merge of #104945 - GuillaumeGomez:rollup-ygzbpbe, r=GuillaumeGomezbors-6/+27
Rollup of 7 pull requests Successful merges: - #104786 (Use the power of adding helper function to simplify code w/ `Mutability`) - #104788 (Do not record unresolved const vars in generator interior) - #104909 (Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds`) - #104921 (Remove unnecessary binder from `get_impl_future_output_ty`) - #104924 (jsondoclint: Accept trait alias is places where trait expected.) - #104928 (rustdoc: use flexbox CSS to align sidebar button instead of position) - #104943 (jsondoclint: Handle using enum variants and glob using enums.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-26Verify that HIR parenting and Def parenting match.Camille GILLOT-7/+2
2022-11-26Rollup merge of #104909 - ↵Guillaume Gomez-6/+6
compiler-errors:normalize_opaque_types-is-misleading, r=fee1-dead Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds` 1. The query name is a bit misleading, since it doesn't do any associated type normalization, and 2. since it only takes a predicate list, it sounds a bit more powerful than it actually is.
2022-11-26Rollup merge of #104788 - compiler-errors:unresolved-ct-in-gen, r=fee1-deadGuillaume Gomez-0/+9
Do not record unresolved const vars in generator interior Don't record types in the generator interior when we see unresolved const variables. We already do this for associated types -- this is important to avoid unresolved inference variables in the generator results during writeback, since the writeback results get stable hashed in incremental mode. Fixes #104787
2022-11-26Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errorsGuillaume Gomez-0/+12
Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
2022-11-26Auto merge of #104731 - compiler-errors:early-binder-iter-size-hint, r=cjgillotbors-0/+12
Add size hints to early binder iterator adapters probably doesn't do anything, but definitely doesn't hurt
2022-11-26Rollup merge of #104675 - SarthakSingh31:issue-101666, r=jyn514Matthias Krüger-2/+5
Unsupported query error now specifies if its unsupported for local or external crate Fixes #101666. I had to move `keys.rs` from `rustc_query_impl` to `rustc_middle`. I don't know if that is problematic. I couldn't think of any other way to get the needed information inside `rustc_middle`. r? ```@jyn514```
2022-11-26interpret: remove PartialOrd from a bunch of types that do not have or need ↵Ralf Jung-7/+7
a sensible order
2022-11-26Do not record unresolved const vars in generator interiorMichael Goulet-0/+9
2022-11-26simplify some binder shifting logicMichael Goulet-23/+24
2022-11-25Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwUbors-204/+203
Add `ConstKind::Expr` Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready. r? `@lcnr`
2022-11-25Rename normalize_opaque_types to reveal_opaque_types_in_boundsMichael Goulet-6/+6
2022-11-25Auto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgrbors-41/+6
Rollup of 8 pull requests Successful merges: - #104716 (move 2 candidates into builtin candidate) - #104760 (Clarify `SyntaxExtensionKind::LegacyDerive`.) - #104797 (rustc_codegen_ssa: write `.dwp` in a streaming fashion) - #104835 (Use infcx.partially_normalize_associated_types_in) - #104853 (Fix typo in miri sysroot) - #104879 (jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath) - #104887 (rustbuild: Don't build doc::SharedAssets when building JSON docs.) - #104896 (rustdoc: fix broken tooltip CSS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-25Cache Predicates' hash within themselvesOli Scherer-28/+59
2022-11-25Auto merge of #104846 - ↵bors-65/+94
spastorino:santa-clauses-make-goals-early-christmas-🎄, r=oli-obk Branch Clause from Predicate r? `@oli-obk` This is part of what's proposed in https://github.com/rust-lang/compiler-team/issues/531
2022-11-25remove `TypeError::ObjectUnsafeCoercion`lcnr-4/+1
2022-11-25Add documentation for `has_escaping_bound_vars`Deadbeef-1/+7
2022-11-25add commentlcnr-0/+6