about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2022-05-11Gracefully fail to resolve associated items instead of `delay_span_bug`.Camille GILLOT-75/+16
2022-05-10Introduce EarlyBinderJack Huey-58/+62
2022-05-10Auto merge of #96736 - oli-obk:tait_missing_wf_check, r=davidtwcobors-3/+71
Check hidden types for well formedness at the definition site instead of only at the opaque type itself work towards #90409 . We'll need to look into closure and generator bodies of closures and generators nested inside the hidden type in order to fix that. In hindsight this PR is not necessary for that, but it may be a bit easier with it and we'll get better diagnostics from it on its own.
2022-05-10Use InternedObligationCauseCode everywhereOli Scherer-11/+11
2022-05-10Make `FunctionArgumentObligation` also use the "no allocation for misc" trickOli Scherer-1/+1
2022-05-10Make the derived obligation cause parent privateOli Scherer-11/+10
2022-05-10Add a helper function for a common piece of codeOli Scherer-55/+17
2022-05-10Remove `clone_code` methodOli Scherer-23/+14
2022-05-10Remove another use of clone_codeOli Scherer-12/+10
2022-05-10only_local: always check for misuselcnr-6/+4
2022-05-10Move an extension trait method onto the type directly and reuse itOli Scherer-45/+4
2022-05-10Don't lose an obligation causeOli Scherer-2/+0
2022-05-10Remove some unnecessary clonesOli Scherer-19/+17
2022-05-10Simplify derived obligation peelingOli Scherer-15/+5
2022-05-10Check hidden types for well formedness at the definition site instead of ↵Oli Scherer-3/+71
only at the opaque type itself
2022-05-10update coherence docs, fix opaque type + generator icelcnr-22/+35
2022-05-10Auto merge of #96808 - cjgillot:impossible-trait, r=compiler-errorsbors-0/+14
Detect trait fulfillment in `subst_and_check_impossible_predicates` Split from https://github.com/rust-lang/rust/pull/91743 r? `@compiler-errors`
2022-05-10Auto merge of #96715 - cjgillot:trait-alias-loop, r=compiler-errorsbors-1/+2
Fortify handing of where bounds on trait & trait alias definitions Closes https://github.com/rust-lang/rust/issues/96664 Closes https://github.com/rust-lang/rust/issues/96665 Since https://github.com/rust-lang/rust/pull/93803, when listing all bounds and predicates we now need to account for the possible presence of predicates on any of the generic parameters. Both bugs were hidden by the special handling of bounds at the generic parameter declaration position. Trait alias expansion used to confuse predicates on `Self` and where predicates. Exiting too late when listing all the bounds caused a cycle error.
2022-05-08Rollup merge of #96617 - ↵Matthias Krüger-9/+19
ken-matsui:fix-incorrect-syntax-suggestion-with-pub-async-fn, r=cjgillot Fix incorrect syntax suggestion with `pub async fn` This PR closes: https://github.com/rust-lang/rust/issues/96555
2022-05-08Fix incorrect syntax suggestion with `pub async fn`Ken Matsui-9/+19
2022-05-07Do not report overflow error.Camille GILLOT-0/+3
2022-05-07Cleanup opaque type storage after checking impossible predicates.Camille GILLOT-0/+3
2022-05-07Also check TraitRef with impossible predicates.Camille GILLOT-0/+8
2022-05-07Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errorsbors-34/+34
Begin fixing all the broken doctests in `compiler/` Begins to fix #95994. All of them pass now but 24 of them I've marked with `ignore HELP (<explanation>)` (asking for help) as I'm unsure how to get them to work / if we should leave them as they are. There are also a few that I marked `ignore` that could maybe be made to work but seem less important. Each `ignore` has a rough "reason" for ignoring after it parentheses, with - `(pseudo-rust)` meaning "mostly rust-like but contains foreign syntax" - `(illustrative)` a somewhat catchall for either a fragment of rust that doesn't stand on its own (like a lone type), or abbreviated rust with ellipses and undeclared types that would get too cluttered if made compile-worthy. - `(not-rust)` stuff that isn't rust but benefits from the syntax highlighting, like MIR. - `(internal)` uses `rustc_*` code which would be difficult to make work with the testing setup. Those reason notes are a bit inconsistently applied and messy though. If that's important I can go through them again and try a more principled approach. When I run `rg '```ignore \(' .` on the repo, there look to be lots of different conventions other people have used for this sort of thing. I could try unifying them all if that would be helpful. I'm not sure if there was a better existing way to do this but I wrote my own script to help me run all the doctests and wade through the output. If that would be useful to anyone else, I put it here: https://github.com/Elliot-Roberts/rust_doctest_fixing_tool
2022-05-05Don't cache results of coinductive cycleAaron Hill-59/+18
Fixes #96319 The logic around handling co-inductive cycles in the evaluation cache is confusing and error prone. Fortunately, a perf run showed that it doesn't actually appear to improve performance, so we can simplify this code (and eliminate a source of ICEs) by just skipping caching the evaluation results for co-inductive cycle participants. This commit makes no changes to any of the other logic around co-inductive cycle handling. Thus, while this commit could potentially expose latent bugs that were being hidden by caching, it should not introduce any new bugs.
2022-05-05Auto merge of #96720 - JohnTitor:rollup-9jaaekr, r=JohnTitorbors-1/+0
Rollup of 7 pull requests Successful merges: - #96603 (Enable full revision in const generics ui tests) - #96616 (Relax memory ordering used in `min_stack`) - #96619 (Relax memory ordering used in SameMutexCheck) - #96628 (Stabilize `bool::then_some`) - #96658 (Move callback to the () => {} syntax.) - #96677 (Add more tests for label-break-value) - #96697 (Enable tracing for all queries) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-05Rollup merge of #96628 - joshtriplett:stabilize-then-some, r=m-ou-seYuki Okushi-1/+0
Stabilize `bool::then_some` FCP completed in https://github.com/rust-lang/rust/issues/80967
2022-05-05Auto merge of #96593 - jackh726:issue-93262, r=compiler-errorsbors-16/+8
Revert "Prefer projection candidates instead of param_env candidates for Sized predicates" Fixes #93262 Reopens #89352 This was a hack that seemed to have no negative side-effects at the time. Given that the latter has a workaround and likely less common than the former, it makes sense to revert this change. r? `@compiler-errors`
2022-05-04Add debug statements.Camille GILLOT-1/+2
2022-05-04Stabilize `bool::then_some`Josh Triplett-1/+0
2022-05-04Rollup merge of #96679 - ricked-twice:issue-96223-fix, r=jackh726Yuki Okushi-1/+7
Quick fix for #96223. This PR is a quick fix regarding #96223. As mentioned in the issue, others modification could be added to not elide types with bound vars from suggestions. Special thanks to ``@jackh726`` for mentoring and ``@Manishearth`` for minimal test case. r? ``@jackh726``
2022-05-04Revert #92191 Prefer projection candidates instead of param_env candidates ↵Jack Huey-16/+8
for Sized predicates
2022-05-03Taking review hints into account.ricked-twice-1/+1
2022-05-03Auto merge of #96558 - bjorn3:librarify_parse_format, r=davidtwcobors-60/+61
Make rustc_parse_format compile on stable This allows it to be used by lightweight formatting systems and may allow it to be used by rust-analyzer.
2022-05-03Quick fix for #96223.ricked-twice-1/+7
2022-05-03Make rustc_parse_format compile on stablebjorn3-60/+61
This allows it to be used by lightweight formatting systems and may allow it to be used by rust-analyzer.
2022-05-02fix most compiler/ doctestsElliot Roberts-34/+34
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-1/+1
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-04-30Store all generic bounds as where predicates.Camille GILLOT-36/+16
2022-04-30Inline WhereClause into Generics.Camille GILLOT-12/+7
2022-04-29Auto merge of #95819 - oli-obk:mir_can't_hold_all_these_lifetimes, r=estebankbors-1/+1
Enforce Copy bounds for repeat elements while considering lifetimes fixes https://github.com/rust-lang/rust/issues/95477 this is a breaking change in order to fix a soundness bug. Before this PR we only checked whether the repeat element type had an `impl Copy`, but not whether that impl also had the appropriate lifetimes. E.g. if the impl was for `YourType<'static>` and not a general `'a`, then copying any type other than a `'static` one should have been rejected, but wasn't. r? `@lcnr`
2022-04-28Auto merge of #95976 - b-naber:valtree-constval-conversion, r=oli-obkbors-12/+16
Implement Valtree to ConstValue conversion Once we start to use `ValTree`s in the type system we will need to be able to convert them into `ConstValue` instances, which we want to continue to use after MIR construction. r? `@oli-obk` cc `@RalfJung`
2022-04-28Update the diagnostic message to match the new spanOli Scherer-1/+1
2022-04-26Better error messages when collecting into `[T; n]`Michael Goulet-11/+31
2022-04-26add hacky closure to struct_tail_with_normalize in order to allow us to walk ↵b-naber-12/+16
valtrees in lockstep with the type
2022-04-25do not consider two extern types to be similarlcnr-0/+1
2022-04-19Rollup merge of #94493 - ↵Dylan DPC-40/+160
oribenshir:feature/ISSUE-78543_async_fn_in_foreign_crate_diag_2, r=davidtwco Improved diagnostic on failure to meet send bound on future in a foreign crate Provide a better diagnostic on failure to meet send bound on futures in a foreign crate. fixes #78543
2022-04-16Rollup merge of #96023 - matthiaskrgr:clippyper1304, r=lcnrDylan DPC-2/+2
couple of clippy::perf fixes
2022-04-16Provide a better diagnostic on failure to meet send bound on futures in a ↵oribenshir-40/+160
foreign crate Adding diagnostic data on generators to the crate metadata and using it to provide a better diagnostic on failure to meet send bound on futures originated from a foreign crate
2022-04-16Auto merge of #92364 - jackh726:Quantumplation/65853/param-heuristics, ↵bors-1/+9
r=estebank Better method call error messages Rebase/continuation of #71827 ~Based on #92360~ ~Based on #93118~ There's a decent description in #71827 that I won't copy here (for now at least) In addition to rebasing, I've tried to restore most of the original suggestions for invalid arguments. Unfortunately, this does make some of the errors a bit verbose. To fix this will require a bit of refactoring to some of the generalized error suggestion functions, and I just don't have the time to go into it right now. I think this is in a state that the error messages are overall better than before without a reduction in the suggestions given. ~I've tried to split out some of the easier and self-contained changes into separate commits (mostly in #92360, but also one here). There might be more than can be done here, but again just lacking time.~ r? `@estebank` as the original reviewer of #71827