about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2022-11-19Probe + better error messsage for need_migrate_deref_output_trait_objectMichael Goulet-32/+27
2022-11-19drive-by: PolyExistentialPredicateMichael Goulet-2/+2
2022-11-19Improve spans for RPITIT object-safety errorsMichael Goulet-6/+15
2022-11-18Auto merge of #104591 - Manishearth:rollup-b3ser4e, r=Manishearthbors-0/+28
Rollup of 8 pull requests Successful merges: - #102977 (remove HRTB from `[T]::is_sorted_by{,_key}`) - #103378 (Fix mod_inv termination for the last iteration) - #103456 (`unchecked_{shl|shr}` should use `u32` as the RHS) - #103701 (Simplify some pointer method implementations) - #104047 (Diagnostics `icu4x` based list formatting.) - #104338 (Enforce that `dyn*` coercions are actually pointer-sized) - #104498 (Edit docs for `rustc_errors::Handler::stash_diagnostic`) - #104556 (rustdoc: use `code-header` class to format enum variants) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-18Only enforce ABI-mandated align, not preferred align is compatibleMichael Goulet-1/+1
2022-11-18Check both align and size in PointerSizedMichael Goulet-1/+2
2022-11-18Enforce that dyn* casts are actually pointer-sizedMichael Goulet-0/+27
2022-11-18Revert "Normalize opaques with escaping bound vars"Michael Goulet-2/+2
This reverts commit 43119d643857efc366bfca527ac2dadfc3f2e906.
2022-11-18review commentEsteban Küber-8/+2
2022-11-18On E0275 do not print out the full type in the msgEsteban Küber-7/+41
When printing requirement overflow errors, do not print out the full type name when it is longer than 50 characters long.
2022-11-18On overflow errors, do not print out long typesEsteban Küber-4/+24
2022-11-18require an `ErrorGuaranteed` to taint infcx with errorsBoxy-1/+4
2022-11-18rename `is_tainted_by_errors` Boxy-11/+13
2022-11-18`InferCtxt::is_tainted_by_errors` returns `ErrorGuaranteed`Boxy-17/+13
2022-11-18Rollup merge of #103386 - compiler-errors:no-coerceunsized-to-dynstar, r=eholkMatthias Krüger-5/+9
Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting) This makes sure we don't accidentally allow coercions like `Box<T>` -> `Box<dyn* Trait>`, or in the case of this ICE, `&T` to `&dyn* Trait`. These coercions don't make sense, at least not via the `CoerceUnsized` trait. Fixes #102172 Fixes #102429
2022-11-18Rm diagnostic item, use lang itemDeadbeef-1/+1
2022-11-17Rollup merge of #104483 - oli-obk:santa-clauses-make-goals, r=compiler-errorsMatthias Krüger-130/+134
Convert predicates into Predicate in the Obligation constructor instead of having almost all callers do that. This reduces a bit of boilerplate, and also paves the way for my work towards https://github.com/rust-lang/compiler-team/issues/531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).
2022-11-17Auto merge of #104170 - cjgillot:hir-def-id, r=fee1-deadbors-3/+2
Record `LocalDefId` in HIR nodes instead of a side table This is part of an attempt to remove the `HirId -> LocalDefId` table from HIR. This attempt is a prerequisite to creation of `LocalDefId` after HIR lowering (https://github.com/rust-lang/rust/pull/96840), by controlling how `def_id` information is accessed. This first part adds the information to HIR nodes themselves instead of a table. The second part is https://github.com/rust-lang/rust/pull/103902 The third part will be to make `hir::Visitor::visit_fn` take a `LocalDefId` as last parameter. The fourth part will be to completely remove the side table.
2022-11-16Use `as_deref` in compiler (but only where it makes sense)Maybe Waffle-1/+1
2022-11-16Convert predicates into Predicate in the Obligation constructorOli Scherer-130/+134
2022-11-16cleanup and dedupe CTFE and Miri error reportingRalf Jung-24/+0
2022-11-15use `ocx` type relation routineslcnr-7/+19
2022-11-15Rollup merge of #104316 - cjgillot:simplify-async-suggestion, r=estebankMatthias Krüger-51/+42
Simplify suggestions for errors in generators. Split from https://github.com/rust-lang/rust/pull/101692/
2022-11-15Auto merge of #104428 - matthiaskrgr:rollup-jo3078i, r=matthiaskrgrbors-35/+8
Rollup of 13 pull requests Successful merges: - #103842 (Adding Fuchsia compiler testing script, docs) - #104354 (Remove leading newlines from `NonZero*` doc examples) - #104372 (Update compiler-builtins) - #104380 (rustdoc: remove unused CSS `code { opacity: 1 }`) - #104381 (Remove dead NoneError diagnostic handling) - #104383 (Remove unused symbols and diagnostic items) - #104391 (Deriving cleanups) - #104403 (Specify language of code comment to generate document) - #104404 (Fix missing minification for static files) - #104413 ([llvm-wrapper] adapt for LLVM API change) - #104415 (rustdoc: fix corner case in search keyboard commands) - #104422 (Fix suggest associated call syntax) - #104426 (Add test for #102154) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-14Rollup merge of #104229 - compiler-errors:overlap-full-path, r=davidtwcoMatthias Krüger-81/+78
Don't print full paths in overlap errors We don't print the full path in other diagnostics -- I don't think it particularly helps with the error message. I also delayed the printing until actually needing to render the error message. r? diagnostics
2022-11-13Remove dead NoneError error handlingmejrs-35/+8
2022-11-13Store a LocalDefId in hir::GenericParam.Camille GILLOT-3/+2
2022-11-12Simplify suggestions for errors in generators.Camille GILLOT-51/+42
2022-11-12Rollup merge of #104206 - compiler-errors:ocx-more-2, r=lcnrDylan DPC-26/+24
Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more r? ```@lcnr```
2022-11-12Rollup merge of #103970 - oli-obk:unhide_unknown_spans, r=estebankDylan DPC-2/+2
Unhide unknown spans r? ```@estebank```
2022-11-11Don't add message that will never be shown to usersOli Scherer-2/+2
It will still be used in json, as seen by the ui test changes
2022-11-10Unbreak upcastingMichael Goulet-3/+7
2022-11-10Don't CoerceUnsized dyn* to dyn*Michael Goulet-2/+2
2022-11-10Don't allow implement CoerceUnsized into dyn-starMichael Goulet-1/+1
2022-11-10More nitsMichael Goulet-4/+1
2022-11-10make `Sized` coinductivelcnr-1/+4
2022-11-10Rollup merge of #103863 - compiler-errors:fulfillcx-less, r=wesleywiserManish Goregaokar-9/+10
Use `TraitEngine` in more places, restrict visibility of `FulfillmentCtxt` constructor Most places that are constructing a `FulfillmentContext` should be constructing a `TraitEngine` generically, so later on if/when we're transitioning it'll be easier. Logical extension of #99746
2022-11-09Rollup merge of #102763 - compiler-errors:nits, r=cjgillotMichael Goulet-1/+1
Some diagnostic-related nits 1. Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>` 2. Make `diag.span_suggestions` take an `IntoIterator` instead of `Iterator`, just to remove some `.into_iter` calls on the caller. idk if I should add a lint to make sure people use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>` in cases where we're just, e.g., adding subdiagnostics to the diagnostic... maybe a followup.
2022-11-10Don't print full paths in overlap errorsMichael Goulet-81/+78
2022-11-10Use TraitEngine in more places, make FulfillmentCtxt constructor more privateMichael Goulet-9/+10
2022-11-09Remove save_and_restore_in_snapshot_flagMichael Goulet-26/+24
2022-11-09Rollup merge of #104156 - oli-obk:autoderef, r=estebankManish Goregaokar-8/+0
Cleanups in autoderef impl Just something I noticed. Turns out the `overloaded_span` is not actually used separately from the main span, so I merged them.
2022-11-09Make span_suggestions take IntoIteratorMichael Goulet-1/+1
2022-11-09Auto merge of #103723 - CastilloDel:master, r=jackh726bors-18/+24
Remove allow(rustc::potential_query_instability) in rustc_trait_selection Related to https://github.com/rust-lang/rust/issues/84447 This PR needs to be benchmarked to check for regressions.
2022-11-09Auto merge of #104180 - fee1-dead-contrib:fix-wf-fndef, r=oli-obkbors-1/+1
Use `nominal_obligations_without_const` in wf for FnDef Fixes #104155.
2022-11-09Auto merge of #104179 - Manishearth:rollup-yvsx5hh, r=Manishearthbors-3/+22
Rollup of 7 pull requests Successful merges: - #100508 (avoid making substs of type aliases late bound when used as fn args) - #101381 (Test that target feature mix up with homogeneous floats is sound) - #103353 (Fix Access Violation when using lld & ThinLTO on windows-msvc) - #103521 (Avoid possible infinite loop when next_point reaching the end of file) - #103559 (first move on a nested span_label) - #103778 (Update several crates for improved support of the new targets) - #103827 (Properly remap and check for substs compatibility in `confirm_impl_trait_in_trait_candidate`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-09Use `nominal_obligations_without_const` in wf for FnDefDeadbeef-1/+1
2022-11-08Rollup merge of #103827 - compiler-errors:rpitit-substs-compat, r=wesleywiserManish Goregaokar-3/+22
Properly remap and check for substs compatibility in `confirm_impl_trait_in_trait_candidate` Fixes #103824
2022-11-09Auto merge of #103171 - jackh726:gen-interior-hrtb-error, r=cjgillotbors-0/+1
Better error for HRTB error from generator interior cc #100013 This is just a first pass at an error. It could be better, and shouldn't really be emitted in the first place. But this is better than what was being emitted before.
2022-11-08Reduce the scope of allow(rustc::potential_query_instability) in ↵CastilloDel-18/+24
rustc_trait_selection Make InferCtxtExt use a FxIndexMap This should be faster, because the map is only being used to iterate, which is supposed to be faster with the IndexMap Make the user_computed_preds use an IndexMap It is being used mostly for iteration, so the change shouldn't result in a perf hit Make the RegionDeps fields use an IndexMap This change could be a perf hit. Both `larger` and `smaller` are used for iteration, but they are also used for insertions. Make types_without_default_bounds use an IndexMap It uses extend, but it also iterates and removes items. Not sure if this will be a perf hit. Make InferTtxt.reported_trait_errors use an IndexMap This change brought a lot of other changes. The map seems to have been mostly used for iteration, so the performance shouldn't suffer. Add FIXME to change ProvisionalEvaluationCache.map to use an IndexMap Right now this results in a perf hit. IndexMap doesn't have the `drain_filter` API, so in `on_completion` we now need to iterate two times over the map.