summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/rmeta/encoder.rs
AgeCommit message (Collapse)AuthorLines
2024-11-19Implement ~const opaquesMichael Goulet-0/+4
2024-11-19Rename implied_const_bounds to explicit_implied_const_boundsMichael Goulet-4/+4
2024-11-04ty::KContainer -> ty::AssocItemContainer::KMichael Goulet-5/+5
2024-10-31Auto merge of #131186 - compiler-errors:precise-capturing-borrowck, r=estebankbors-4/+2
Try to point out when edition 2024 lifetime capture rules cause borrowck issues Lifetime capture rules in 2024 are modified to capture more lifetimes, which sometimes lead to some non-local borrowck errors. This PR attempts to link these back together with a useful note pointing out the capture rule changes. This is not a blocking concern, but I'd appreciate feedback (though, again, I'd like to stress that I don't want to block this PR on this): I'm worried about this note drowning in the sea of other diagnostics that borrowck emits. I was tempted to change the level of the note to `.span_warn` just so it would show up in a different color. Thoughts? Fixes #130545 Opening as a draft first since it's stacked on #131183. r? `@ghost`
2024-10-31Encode cross-crate opaque type originMichael Goulet-4/+2
2024-10-30Remove dead code stemming from the old effects desugaringLeón Orell Valerian Liehr-3/+0
2024-10-28fix clippy::clone_on_ref_ptr for compilerklensy-2/+2
2024-10-25tcx.is_const_fn doesn't work the way it is described, remove itRalf Jung-1/+1
Then we can rename the _raw functions to drop their suffix, and instead explicitly use is_stable_const_fn for the few cases where that is really what you want.
2024-10-24Be better at enforcing that const_conditions is only called on const itemsMichael Goulet-7/+11
2024-10-24Implement const effect predicate in new solverMichael Goulet-1/+7
2024-10-24Remove associated type based effects logicMichael Goulet-3/+0
2024-10-23nightly feature tracking: get rid of the per-feature bool fieldsRalf Jung-3/+3
2024-10-10Add variances to RPITITsMichael Goulet-1/+4
2024-10-02Move in_trait into OpaqueTyOriginMichael Goulet-2/+2
2024-10-02Use named fields for OpaqueTyOriginMichael Goulet-3/+3
2024-09-24Separate collection of crate-local inherent impls from error reportingMichael Goulet-2/+2
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-3/+3
2024-09-16Encode coroutine_by_move_body_def_id in crate metadataMichael Goulet-1/+10
2024-09-08Auto merge of #130036 - weiznich:diagnostic_unstable_tracking, r=compiler-errorsbors-2/+8
Correctly handle stability of `#[diagnostic]` attributes This commit changes the way we treat the stability of attributes in the `#[diagnostic]` namespace. Instead of relaying on ad-hoc checks to ensure at call side that a certain attribute is really usable at that location it centralises the logic to one place. For diagnostic attributes comming from other crates it just skips serializing attributes that are not stable and that do not have the corresponding feature enabled. For attributes from the current crate we can just use the feature information provided by `TyCtx`. r​? `@compiler-errors`
2024-09-06Auto merge of #128776 - Bryanskiy:deep-reject-ctxt, r=lcnrbors-1/+1
Use `DeepRejectCtxt` to quickly reject `ParamEnv` candidates The description is on the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/.5Basking.20for.20help.5D.20.60DeepRejectCtxt.60.20for.20param.20env.20candidates) r? `@lcnr`
2024-09-06Correctly handle stability of `#[diagnostic]` attributesGeorg Semmler-2/+8
This commit changes the way we treat the stability of attributes in the `#[diagnostic]` namespace. Instead of relaying on ad-hoc checks to ensure at call side that a certain attribute is really usable at that location it centralises the logic to one place. For diagnostic attributes comming from other crates it just skips serializing attributes that are not stable and that do not have the corresponding feature enabled. For attributes from the current crate we can just use the feature information provided by `TyCtx`.
2024-09-04Make supertrait and implied predicates queries defaultedMichael Goulet-4/+4
2024-09-02Use `DeepRejectCtxt` to quickly reject `ParamEnv` candidatesBryanskiy-1/+1
2024-09-01Revert "Auto merge of #127537 - veluca93:struct_tf, r=BoxyUwU"Jakub Beránek-3/+0
This reverts commit acb4e8b6251f1d8da36f08e7a70fa23fc581839e, reversing changes made to 100fde5246bf56f22fb5cc85374dd841296fce0e.
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-29Add `warn(unreachable_pub)` to `rustc_metadata`.Nicholas Nethercote-1/+1
2024-08-29Stop using ty::GenericPredicates for non-predicates_of queriesMichael Goulet-4/+8
2024-08-28Implement RFC 3525.Luca Versari-0/+3
2024-08-26Remove some unnecessary TODOsMichael Goulet-5/+0
2024-08-26Stop using a special inner body for the coroutine by-move body for async ↵Michael Goulet-11/+28
closures
2024-07-29Reformat `use` declarations.Nicholas Nethercote-7/+8
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-21Auto merge of #120812 - compiler-errors:impl-sorting, r=lcnrbors-65/+18
Remove unnecessary impl sorting in queries and metadata Removes unnecessary impl sorting because queries already return their keys in HIR definition order: https://github.com/rust-lang/rust/issues/120371#issuecomment-1926422838 r? `@cjgillot` or `@lcnr` -- unless I totally misunderstood what was being asked for here? 😆 fixes #120371
2024-07-18Move query providersMichael Goulet-25/+0
2024-07-18Avoid unnecessary sorting of traitsMichael Goulet-42/+20
2024-07-17Add cross-crate precise capturing support to rustdocMichael Goulet-0/+10
2024-06-29Auto merge of #120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obkbors-0/+6
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/+6
2024-06-27Make queries more explicitMichael Goulet-4/+4
2024-06-16Rename InstanceDef -> InstanceKindMichael Goulet-1/+1
2024-06-14Use is_lang_item more aggressivelyMichael Goulet-1/+1
2024-06-07Only compute specializes query if specialization is enabled in the crate of ↵Michael Goulet-0/+1
the specialized impl
2024-06-06Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk"Rémy Rakic-1/+1
This reverts commit eda4a35f365535af72118118a3597edf5a13c12d, reversing changes made to eb6b35b5bcb3c2a594cb29cd478aeb2893f49d30.
2024-05-29Make `body_owned_by` return the body directly.Oli Scherer-7/+7
Almost all callers want this anyway, and now we can use it to also return fed bodies
2024-05-23Auto merge of #125434 - nnethercote:rm-more-extern-tracing, r=jackh726bors-0/+1
Remove more `#[macro_use] extern crate tracing` Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via `#[macro_use]`. Continuing the work from #124511 and #124914. r? `@jackh726`
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_metadata`.Nicholas Nethercote-0/+1
2024-05-22rustc: Use `tcx.used_crates(())` moreVadim Petrochenkov-1/+1
And explain when it should be used.
2024-05-13Remove `extern crate rustc_middle` from `rustc_metadata`.Nicholas Nethercote-0/+1
2024-05-09Rename Generics::params to Generics::own_paramsMichael Goulet-1/+1
2024-04-11remove some things that do not need to beMatthias Krüger-1/+1
2024-03-28Replace `RemapFileNameExt::for_codegen` with explicit callsUrgau-11/+5