about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2022-11-30Remove PredicateS typeOli Scherer-52/+28
2022-11-30Update documentationOli Scherer-5/+5
2022-11-30Remove TySOli Scherer-95/+32
2022-11-30move WithCachedTypeInfo to rustc_type_irOli Scherer-5/+8
2022-11-30s/WithStableHash/WithCachedTypeInfo/Oli Scherer-34/+35
2022-11-30Auto merge of #105070 - matthiaskrgr:rollup-9b25khj, r=matthiaskrgrbors-3/+19
Rollup of 14 pull requests Successful merges: - #103876 (type alias impl trait: add tests showing that hidden type only outlives lifetimes that occur in bounds) - #104427 (Explain why `rematch_impl` fails to be infallible) - #104436 (Add slice to the stack allocated string comment) - #104523 (Don't use periods in target names) - #104627 (Print all features with --print target-features) - #104911 (Make inferred_outlives_crate return Clause) - #105002 (Add `PathBuf::as_mut_os_string` and `Path::as_mut_os_str`) - #105023 (Statics used in reachable function's inline asm are reachable) - #105045 (`rustc_ast_{passes,pretty}`: remove `ref` patterns) - #105049 (Hermit: Minor build fixes) - #105051 (Replace a macro with a function) - #105062 (rustdoc: use shorthand background for rustdoc toggle CSS) - #105066 (move `candidate_from_obligation` out of assembly) - #105068 (Run patchelf also on rust-analyzer-proc-macro-srv.) Failed merges: - #105050 (Remove useless borrows and derefs) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-29Rollup merge of #104911 - spastorino:inferred_outlives_crate-return-clause, ↵Matthias Krüger-3/+19
r=oli-obk Make inferred_outlives_crate return Clause r? ``@oli-obk``
2022-11-29Auto merge of #94487 - oli-obk:stable_hash_ty, r=fee1-deadbors-28/+59
Also cache the stable hash of interned Predicates continuation of https://github.com/rust-lang/rust/pull/94299 This is a small perf improvement and shares more code between `Ty` and `Predicate`
2022-11-29Make TyCtxtFeed::def_id private.Camille GILLOT-5/+12
2022-11-29Feedable queries must allow hashing.Camille GILLOT-13/+1
2022-11-29Only allow feeding a value to newly created definitions.Camille GILLOT-28/+42
2022-11-29Allow to set a query's result as a side effect.Camille GILLOT-0/+69
2022-11-29Make inferred_outlives_crate return ClauseSantiago Pastorino-3/+19
2022-11-29Auto merge of #105012 - WaffleLapkin:into, r=oli-obkbors-48/+30
Make `tcx.mk_const` more permissive wrt `kind` argument (`impl Into`) r? `@oli-obk` you've asked for this >:)
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/+10
- 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