summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query
AgeCommit message (Collapse)AuthorLines
2024-10-04Simplify bound var resolution.Camille GILLOT-3/+3
2024-10-04WfCheck opaques.Camille GILLOT-1/+1
2024-10-04Make naming more consistent.Camille GILLOT-10/+10
2024-10-04Make query backtrace more useful.Camille GILLOT-8/+8
2024-09-27Auto merge of #130946 - matthiaskrgr:rollup-ia4mf0y, r=matthiaskrgrbors-6/+6
Rollup of 6 pull requests Successful merges: - #130718 (Cleanup some known-bug issues) - #130730 (Reorganize Test Headers) - #130826 (Compiler: Rename "object safe" to "dyn compatible") - #130915 (fix typo in triagebot.toml) - #130926 (Update cc to 1.1.22 in library/) - #130932 (etc: Add sample rust-analyzer configs for eglot & helix) r? `@ghost` `@rustbot` modify labels: rollup
2024-09-27Rollup merge of #130826 - fmease:compiler-mv-obj-safe-dyn-compat, ↵Matthias Krüger-6/+6
r=compiler-errors Compiler: Rename "object safe" to "dyn compatible" Completed T-lang FCP: https://github.com/rust-lang/lang-team/issues/286#issuecomment-2338905118. Tracking issue: https://github.com/rust-lang/rust/issues/130852 Excludes `compiler/rustc_codegen_cranelift` (to be filed separately). Includes Stable MIR. Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language). r? ghost
2024-09-26Use `&raw` in the compilerJosh Stone-2/+2
Like #130865 did for the standard library, we can use `&raw` in the compiler now that stage0 supports it. Also like the other issue, I did not make any doc or test changes at this time.
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-6/+6
2024-09-24Separate collection of crate-local inherent impls from error reportingMichael Goulet-4/+16
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-26/+23
2024-09-05Rollup merge of #101339 - the8472:ci-randomize-debug, r=Mark-SimulacrumMatthias Krüger-0/+1
enable -Zrandomize-layout in debug CI builds This builds rustc/libs/tools with `-Zrandomize-layout` on *-debug CI runners. Only a handful of tests and asserts break with that enabled, which is promising. One test was fixable, the rest is dealt with by disabling them through new cargo features or compiletest directives. The config.toml flag `rust.randomize-layout` defaults to false, so it has to be explicitly enabled for now.
2024-09-02Rollup merge of #129877 - Sajjon:sajjon_fix_typos_batch_2, r=fee1-deadMatthias Krüger-1/+1
chore: Fix typos in 'compiler' (batch 2) Batch 2/3: Fixes typos in `compiler` (See [issue](https://github.com/rust-lang/rust/issues/129874) tracking all PRs with typos fixes)
2024-09-02chore: Fix typos in 'compiler' (batch 2)Alexander Cyon-1/+1
2024-09-01Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU"Jakub Beránek-6/+1
This reverts commit acb4e8b6251f1d8da36f08e7a70fa23fc581839e, reversing changes made to 100fde5246bf56f22fb5cc85374dd841296fce0e.
2024-08-31disable size asserts in the compiler when randomizing layoutsThe 8472-0/+1
2024-08-31Rollup merge of #129725 - compiler-errors:predicates-of, r=fmeaseMatthias Krüger-4/+8
Stop using `ty::GenericPredicates` for non-predicates_of queries `GenericPredicates` is a struct of several parts: A list of of an item's own predicates, and a parent def id (and some effects related stuff, but ignore that since it's kinda irrelevant). When instantiating these generic predicates, it calls `predicates_of` on the parent and instantiates its predicates, and appends the item's own instantiated predicates too: https://github.com/rust-lang/rust/blob/acb4e8b6251f1d8da36f08e7a70fa23fc581839e/compiler/rustc_middle/src/ty/generics.rs#L407-L413 Notice how this should result in a recursive set of calls to `predicates_of`... However, `GenericPredicates` is *also* misused by a bunch of *other* queries as a convenient way of passing around a list of predicates. For these queries, we don't ever set the parent def id of the `GenericPredicates`, but if we did, then this would be very easy to mistakenly call `predicates_of` instead of some other intended parent query. Given that footgun, and the fact that we don't ever even *use* the parent def id in the `GenericPredicates` returned from queries like `explicit_super_predicates_of`, It really has no benefit over just returning `&'tcx [(Clause<'tcx>, Span)]`. This PR additionally opts to wrap the results of `EarlyBinder`, as we've tended to use that in the return type of these kinds of queries to properly convey that the user has params to deal with, and it also gives a convenient way of iterating over a slice of things after instantiating.
2024-08-29Stop using ty::GenericPredicates for non-predicates_of queriesMichael Goulet-4/+8
2024-08-28Implement RFC 3525.Luca Versari-1/+6
2024-08-28Auto merge of #129546 - compiler-errors:no-pred-on, r=fee1-deadbors-19/+0
Get rid of `predicates_defined_on` This is the uncontroversial part of #129532. This simply inlines the `predicates_defined_on` into into `predicates_of`. Nothing should change here logically.
2024-08-26Stop using a special inner body for the coroutine by-move body for async ↵Michael Goulet-0/+15
closures
2024-08-24Get rid of predicates_defined_onMichael Goulet-19/+0
2024-08-17Use cnum for extern crate dataMichael Goulet-1/+1
2024-08-14Remove redundant type opsMichael Goulet-24/+3
2024-08-10Auto merge of #128746 - compiler-errors:cache-super-outlives, r=lcnrbors-0/+4
Cache supertrait outlives of impl header for soundness check This caches the results of computing the transitive supertraits of an impl and filtering it to its outlives obligations. This is purely an optimization to improve https://github.com/rust-lang/rust/pull/124336.
2024-08-07Disallow enabling features without their implied featuresCaleb Zulawski-1/+1
2024-08-07Add implied target features to target_feature attributeCaleb Zulawski-0/+6
2024-08-06Cache supertrait outlives of impl header for soundness checkMichael Goulet-0/+4
2024-07-29Delegation: support generics for delegation from free functionsBryanskiy-0/+4
2024-07-29Reformat `use` declarations.Nicholas Nethercote-88/+77
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-20Auto merge of #127658 - compiler-errors:precise-capturing-rustdoc-cross, ↵bors-0/+8
r=fmease Add cross-crate precise capturing support to rustdoc Follow-up to #127632. Fixes #127228. r? `@fmease` Tracking: * https://github.com/rust-lang/rust/issues/123432
2024-07-18valtree construction: keep track of which type was valtree-incompatibleRalf Jung-3/+4
2024-07-17Add cross-crate precise capturing support to rustdocMichael Goulet-0/+8
2024-07-14find_field does not need to be a query.Camille GILLOT-4/+0
2024-07-02Miscellaneous renamingMichael Goulet-2/+2
2024-06-29Auto merge of #120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obkbors-0/+8
Implement new effects desugaring cc `@rust-lang/project-const-traits.` Will write down notes once I have finished. * [x] See if we want `T: Tr` to desugar into `T: Tr, T::Effects: Compat<true>` * [x] Fix ICEs on `type Assoc: ~const Tr` and `type Assoc<T: ~const Tr>` * [ ] add types and traits to minicore test * [ ] update rustc-dev-guide Fixes #119717 Fixes #123664 Fixes #124857 Fixes #126148
2024-06-28implement new effects desugaringDeadbeef-0/+8
2024-06-27Make queries more explicitMichael Goulet-13/+19
2024-06-26coverage: Apply `#[coverage(..)]` recursively to nested functionsZalathar-1/+2
2024-06-26coverage: Detach `#[coverage(..)]` from codegen attribute handlingZalathar-0/+8
2024-06-20Auto merge of #126409 - pacak:incr-uplorry, r=michaelwoeristerbors-4/+4
Trying to address an incremental compilation issues This pull request contains two independent changes, one makes it so when `try_force_from_dep_node` fails to recover a query - it marks the node as "red" instead of "green" and the second one makes Debug impl for `DepNode` less panicky if it encounters something from the previous compilation that doesn't map to anything in the current one. I'm not 100% confident that this is the correct approach, but so far I managed to find a bunch of comments suggesting that some things are allowed to fail in a certain way and changes I made are allowing for those things to fail this way and it fixes all the small reproducers I managed to find. Compilation panic this pull request avoids is caused by an automatically generated code on an associated type and it is not happening if something else marks it as outdated first (or close like that, but scenario is quite obscure). Fixes https://github.com/rust-lang/rust/issues/107226 Fixes https://github.com/rust-lang/rust/issues/125367
2024-06-19local_def_path_hash_to_def_id can failMichael Baikov-4/+4
local_def_path_hash_to_def_id is used by Debug impl for DepNode and it looks for DefPathHash inside the current compilation. During incremental compilation we are going through nodes that belong to a previous compilation and might not be present and a simple attempt to print such node with tracing::debug (try_mark_parent_green does it for example) results in a otherwise avoidable panic Panic was added in https://github.com/rust-lang/rust/pull/82183, specifically in 2b60338ee9, with a comment "We only use this mapping for cases where we know that it must succeed.", but I'm not sure if this property holds when we traverse nodes from the old compilation in order to figure out if they are valid or not
2024-06-18Make async drop code more consistent with regular drop codeDaria Sukhonina-6/+27
Fixes #126573
2024-06-16Rename InstanceDef -> InstanceKindMichael Goulet-9/+9
2024-06-14Only compute vtable information during codegenMichael Goulet-1/+14
2024-06-07Only compute specializes query if specialization is enabled in the crate of ↵Michael Goulet-0/+5
the specialized impl
2024-06-06Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk"Rémy Rakic-13/+4
This reverts commit eda4a35f365535af72118118a3597edf5a13c12d, reversing changes made to eb6b35b5bcb3c2a594cb29cd478aeb2893f49d30.
2024-06-05Rollup merge of #123168 - joshtriplett:size-of-prelude, r=AmanieuJubilee-1/+1
Add `size_of` and `size_of_val` and `align_of` and `align_of_val` to the prelude (Note: need to update the PR to add `align_of` and `align_of_val`, and remove the second commit with the myriad changes to appease the lint.) Many, many projects use `size_of` to get the size of a type. However, it's also often equally easy to hardcode a size (e.g. `8` instead of `size_of::<u64>()`). Minimizing friction in the use of `size_of` helps ensure that people use it and make code more self-documenting. The name `size_of` is unambiguous: the name alone, without any prefix or path, is self-explanatory and unmistakeable for any other functionality. Adding it to the prelude cannot produce any name conflicts, as any local definition will silently shadow the one from the prelude. Thus, we don't need to wait for a new edition prelude to add it.
2024-06-03check_is_object_safe -> is_object_safeMichael Goulet-1/+1
2024-05-29Start implementing needs_async_drop and relatedDaria Sukhonina-8/+11
2024-05-26Give EarlyBinder a tcx parameterMichael Goulet-21/+23
We are gonna need it to uplift EarlyBinder