about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
AgeCommit message (Collapse)AuthorLines
2023-04-19small type system cleanuplcnr-20/+11
2023-04-19Rollup merge of #110510 - bryangarza:issue-110467-safe-transmute, ↵Matthias Krüger-1/+1
r=compiler-errors Fix ICE for transmutability in candidate assembly Don't skip transmutability check just because there may be generics in the ParamEnv. Fixes #110467
2023-04-19Rollup merge of #110498 - kylematsuda:earlybinder-rpitit-tys, r=compiler-errorsMatthias Krüger-5/+4
Switch to `EarlyBinder` for `collect_return_position_impl_trait_in_trait_tys` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `collect_return_position_impl_trait_in_trait_tys` query and removes `bound_return_position_impl_trait_in_trait_tys`. r? `@lcnr`
2023-04-19Remove find_map_relevant_implMichael Goulet-71/+96
2023-04-18Fix ICE for transmutability in candidate assemblyBryan Garza-1/+1
Don't skip transmutability check just because there may be generics in the ParamEnv. Fixes #110467
2023-04-18add EarlyBinder to return type of ↵Kyle Matsuda-5/+4
collect_return_position_impl_trait_in_trait_tys query; remove bound_X version
2023-04-17Spelling - compilerJosh Soref-7/+7
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-17Rollup merge of #110404 - matthiaskrgr:mapmap, r=NilstriebMatthias Krüger-7/+2
fix clippy::toplevel_ref_arg and ::manual_map r? ``@Nilstrieb``
2023-04-16Erase regions when confirming transmutability candidateMichael Goulet-34/+36
2023-04-16fix clippy::toplevel_ref_arg and ::manual_mapMatthias Krüger-7/+2
2023-04-16Rollup merge of #110345 - nnethercote:rm-Super-impls-for-Region, ↵fee1-dead-1/+1
r=compiler-errors Remove `TypeSuper{Foldable,Visitable}` impls for `Region`. These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods. r? `@compiler-errors`
2023-04-16Rollup merge of #109665 - fee1-dead-contrib:rm-remap-queries, r=oli-obkfee1-dead-7/+1
Remove `remap_env_constness` in queries This removes some of the complexities with const traits. #88119 used to be caused by this but was fixed by `param_env = param_env.without_const()`.
2023-04-16Remove `TypeSuper{Foldable,Visitable}` impls for `Region`.Nicholas Nethercote-1/+1
These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods.
2023-04-16Rollup merge of #110364 - matthiaskrgr:anti_clone, r=NilstriebYuki Okushi-6/+9
remove redundant clones
2023-04-16Rollup merge of #110272 - Ezrashaw:fix-unconned-lt-in-implbounds, r=aliemjayYuki Okushi-1/+12
fix: skip implied bounds if unconstrained lifetime exists Fixes #110161 r? ````@aliemjay````
2023-04-15remove redundant clonesMatthias Krüger-6/+9
2023-04-15Update compiler/rustc_trait_selection/src/traits/outlives_bounds.rsAli MJ Al-Nasrawy-2/+3
2023-04-14implement review suggestionsEzra Shaw-2/+3
2023-04-14Rollup merge of #110299 - kylematsuda:earlybinder-impl-subject, ↵Matthias Krüger-2/+2
r=compiler-errors Switch to `EarlyBinder` for `impl_subject` query Part of the work to finish https://github.com/rust-lang/rust/issues/105779. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `impl_subject` query and removes `bound_impl_subject`. r? ```@lcnr```
2023-04-14Rollup merge of #109800 - bryangarza:safe-transmute-improved-errors, ↵Matthias Krüger-24/+104
r=compiler-errors Improve safe transmute error reporting This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason. Also, fix some small bugs that occur when computing the `Answer` for transmutability.
2023-04-13Improve safe transmute error reportingBryan Garza-24/+104
This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason. Also, fix some small bugs that occur when computing the `Answer` for transmutability.
2023-04-13make tcx.impl_subject return EarlyBinder, remove bound_impl_subject, rename ↵Kyle Matsuda-2/+2
usages of bound_impl_subject to impl_subject
2023-04-13change usage of bound_impl_subject to impl_subjectKyle Matsuda-1/+1
2023-04-13Rollup merge of #110193 - compiler-errors:body-owner-issue, r=WaffleLapkinMatthias Krüger-1/+1
Check for body owner fallibly in error reporting Sometimes the "body id" we use for an obligation cause is not actually a body owner, like when we're doing WF checking on items. Fixes #110157
2023-04-13Rollup merge of #110220 - lcnr:regionzz, r=compiler-errorsMatthias Krüger-9/+27
cleanup our region error API - require `TypeErrCtxt` to always result in an error, closing #108810 - move `resolve_regions_and_report_errors` to the `ObligationCtxt` - call `process_registered_region_obligations` in `resolve_regions` - move `resolve_regions` into the `outlives` submodule - add `#[must_use]` to functions returning lists of errors r? types
2023-04-13fix: skip implied bounds if unconstrained lifetime existsEzra Shaw-1/+10
2023-04-13Remove some unused type folders.Nicholas Nethercote-21/+0
I'm surprised the compiler doesn't warn about these. It appears having an `impl` on a struct is enough to avoid a warning about it never being constructed.
2023-04-12Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgrbors-5/+28
Rollup of 8 pull requests Successful merges: - #109810 (Replace rustdoc-ui/{c,z}-help tests with a stable run-make test ) - #110035 (fix: ensure bad `#[test]` invocs retain correct AST) - #110089 (sync::mpsc: synchronize receiver disconnect with initialization) - #110103 (Report overflows gracefully with new solver) - #110122 (Fix x check --stage 1 when download-ci-llvm=false) - #110133 (Do not use ImplDerivedObligationCause for inherent impl method error reporting) - #110135 (Revert "Don't recover lifetimes/labels containing emojis as character literals") - #110235 (Fix `--extend-css` option) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-12fix commentlcnr-1/+2
2023-04-12Rollup merge of #110103 - compiler-errors:new-solver-overflows, r=lcnrMatthias Krüger-5/+28
Report overflows gracefully with new solver avoid reporting overflows as ambiguity errors, so that the error message is clearer. r? ```@lcnr```
2023-04-12Rollup merge of #110153 - DaniPopes:compiler-typos, r=NilstriebMatthias Krüger-2/+2
Fix typos in compiler I ran [`typos -w compiler`](https://github.com/crate-ci/typos) to fix typos in the `compiler` directory. Refs #110150
2023-04-12`#[must_use]` for fns returning a list of errorslcnr-1/+5
2023-04-12region error cleanuplcnr-8/+21
- require `TypeErrCtxt` to always result in an error - move `resolve_regions_and_report_errors` to the `ObligationCtxt` - merge `process_registered_region_obligations` into `resolve_regions`
2023-04-11Split implied and super predicate queriesMichael Goulet-1/+1
2023-04-11Check for body owner falliblyMichael Goulet-1/+1
2023-04-10Fix typos in compilerDaniPopes-2/+2
2023-04-10Report overflows gracefully with new solverMichael Goulet-5/+28
2023-04-09Auto merge of #109413 - compiler-errors:pointer-like-abi, r=cjgillotbors-8/+7
Enforce that `PointerLike` requires a pointer-like ABI At least temporarily, let's ban coercing things that are pointer-sized and pointer-aligned but *not* `Abi::Scalar(..)` into `dyn*`. See: https://github.com/rust-lang/rust/pull/104694#discussion_r1142522073 This can be lifted in the future if we decie that we *want* to be able to coerce something `repr(C)` into a `dyn*`, but we'll have to figure out what to do with Miri and codegen... r? compiler
2023-04-09Auto merge of #110031 - compiler-errors:generic-elaboration, r=b-naberbors-19/+15
Make elaboration generic over input Combines all the `elaborate_*` family of functions into just one, which is an iterator over the same type that you pass in (e.g. elaborating `Predicate` gives `Predicate`s, elaborating `Obligation`s gives `Obligation`s, etc.)
2023-04-08Enforce that PointerLike requires a pointer-like ABIMichael Goulet-8/+7
2023-04-08Remove `remap_env_constness` in queriesDeadbeef-7/+1
2023-04-07Switched provisional evaluation cache map to FxIndexMap, and replaced ↵Andrew Xie-15/+9
map.drain_filter with map.retain
2023-04-06Remove index from BrAnonJack Huey-2/+2
2023-04-06Use BoundTy and BoundRegion instead of kind of PlaceholderTy and ↵Jack Huey-3/+3
PlaceholderRegion
2023-04-06Get rid of elaborate_trait_ref{s} tooMichael Goulet-3/+4
2023-04-06Make elaborator genericMichael Goulet-18/+13
2023-04-04Auto merge of #109917 - compiler-errors:remove-relation-methods, r=oli-obkbors-8/+0
Remove `intercrate` and `mark_ambiguous` from `TypeRelation` Fixes #109863 Pulls this logic into `super_combine_tys`, which has access to `InferCtxt` and takes a `ObligationEmittingRelation` -- both of which simplify the logic here. r? `@oli-obk` `@aliemjay`
2023-04-04Remove intercrate and mark_ambiguous from RelationMichael Goulet-8/+0
2023-04-03Never consider int and float vars for `FnPtr` candidatesNilstrieb-8/+14
This solves a regression where `0.0.cmp()` was ambiguous when a custom trait with a `cmp` method was in scope. FOr integers it shouldn't be a problem in practice so I wasn't able to add a test.
2023-04-02Rollup merge of #109846 - matthiaskrgr:clippy2023_04_III, r=NilstriebNilstrieb-3/+1
more clippy::complexity fixes (iter_kv_map, map_flatten, nonminimal_bool)