about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2022-07-07Track `WellFormed` obligations with an appropriate cause, instead of ↵Esteban Küber-6/+6
`MiscObligation`
2022-07-06Rollup merge of #98519 - TaKO8Ki:add-head-span-field-to-item-and-impl-item, ↵Guillaume Gomez-32/+11
r=cjgillot Replace some `guess_head_span` with `def_span` This patch fixes a part of #97417. r? `@cjgillot`
2022-07-06use `named_span` in case of tuple variantTakayuki Maeda-1/+1
2022-07-06replace `guess_head_span` with `def_span`Takayuki Maeda-32/+11
2022-07-06Rollup merge of #98884 - davidtwco:translation-on-lints-derive, r=oli-obkDylan DPC-2/+1
macros: `LintDiagnostic` derive - Move `LintDiagnosticBuilder` into `rustc_errors` so that a diagnostic derive can refer to it. - Introduce a `DecorateLint` trait, which is equivalent to `SessionDiagnostic` or `AddToDiagnostic` but for lints. Necessary without making more changes to the lint infrastructure as `DecorateLint` takes a `LintDiagnosticBuilder` and re-uses all of the existing logic for determining what type of diagnostic a lint should be emitted as (e.g. error/warning). - Various refactorings of the diagnostic derive machinery (extracting `build_field_mapping` helper and moving `sess` field out of the `DiagnosticDeriveBuilder`). - Introduce a `LintDiagnostic` derive macro that works almost exactly like the `SessionDiagnostic` derive macro except that it derives a `DecorateLint` implementation instead. A new derive is necessary for this because `SessionDiagnostic` is intended for when the generated code creates the diagnostic. `AddToDiagnostic` could have been used but it would have required more changes to the lint machinery. ~~At time of opening this pull request, ignore all of the commits from #98624, it's just the last few commits that are new.~~ r? `@oli-obk`
2022-07-06Auto merge of #98206 - eggyal:align-to-chalk-folding-api, r=jackh726bors-21/+27
Split TypeVisitable from TypeFoldable Impl of rust-lang/compiler-team#520 following MCP approval. r? `@ghost`
2022-07-06Update TypeVisitor pathsAlan Egerton-18/+22
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-4/+6
2022-07-05Add #[derive(TypeVisitable)]Alan Egerton-2/+2
2022-07-05Auto merge of #98936 - matthiaskrgr:rollup-dvr0ucm, r=matthiaskrgrbors-4/+3
Rollup of 6 pull requests Successful merges: - #98860 (adjust dangling-int-ptr error message) - #98888 (interpret: fix CheckedBinOp behavior when overflow checking is disabled) - #98889 (Add regression test for #79467) - #98895 (bootstrap.py: Always use `.exe` for Windows) - #98920 (adapt issue-37945 codegen test to accept any order of ops) - #98921 (Refactor: remove a redundant mutable variable) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-05Rollup merge of #98921 - TaKO8Ki:refactor-fulfillment-context-select, ↵Matthias Krüger-4/+3
r=Dylan-DPC Refactor: remove a redundant mutable variable
2022-07-05lint: `LintDiagnosticBuilder` into `rustc_errors`David Wood-2/+1
Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-05Auto merge of #98584 - lcnr:region-stuff-more-beans, r=oli-obkbors-112/+16
continue nll transition by removing stuff r? `@jackh726` for now building on #98641
2022-07-05refactor: remove a redundant mutable variableTakayuki Maeda-4/+3
2022-07-04region obligations, remove `body_id`lcnr-1/+1
2022-07-04implied bounds byebye nested hir idslcnr-21/+4
2022-07-04rip out `RegionCtxt` from hir typecklcnr-67/+3
2022-07-04remove an unused `DefId`lcnr-23/+8
2022-07-04remove unused function argumentlcnr-24/+3
2022-07-01Move Sized check before first error is createdMichael Goulet-31/+31
2022-07-01Don't point at Self type if we can't find an infer variable in ambiguous ↵Michael Goulet-27/+36
trait predicate
2022-07-01Show source of ambiguity in a few more placesMichael Goulet-3/+3
2022-07-01Only label place where type is needed if span is meaningfulMichael Goulet-2/+12
2022-06-30Make `evaluate_obligation` not succeed unconditionally if it registered new ↵Oli Scherer-0/+5
hidden types for opaque types
2022-06-29Rollup merge of #98668 - TaKO8Ki:avoid-many-&str-to-string-conversions, ↵Matthias Krüger-2/+1
r=Dylan-DPC Avoid some `&str` to `String` conversions with `MultiSpan::push_span_label` This patch removes some`&str` to `String` conversions with `MultiSpan::push_span_label`.
2022-06-29Rollup merge of #98499 - JulianKnodt:erase_lifetime, r=lcnrDylan DPC-1/+2
Erase regions in New Abstract Consts When an abstract const is constructed, we previously included lifetimes in the set of substitutes, so it was not able to unify two abstract consts if their lifetimes did not match but the values did, despite the values not depending on the lifetimes. This caused code that should have compiled to not compile. Fixes #98452 r? ```@lcnr```
2022-06-29avoid many `&str` to `String` conversions with `MultiSpan::push_span_label`Takayuki Maeda-2/+1
2022-06-29Auto merge of #98558 - nnethercote:smallvec-1.8.1, r=lqdbors-1/+1
Update `smallvec` to 1.8.1. This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc. r? `@lqd`
2022-06-29Auto merge of #98656 - Dylan-DPC:rollup-hhytn0c, r=Dylan-DPCbors-9/+9
Rollup of 7 pull requests Successful merges: - #97423 (Simplify memory ordering intrinsics) - #97542 (Use typed indices in argument mismatch algorithm) - #97786 (Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths) - #98277 (Fix trait object reborrow suggestion) - #98525 (Add regression test for #79224) - #98549 (interpret: do not prune requires_caller_location stack frames quite so early) - #98603 (Some borrowck diagnostic fixes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-29Erase regions in new abstract constskadmin-1/+2
2022-06-29Auto merge of #98542 - jackh726:coinductive-wf, r=oli-obkbors-15/+100
Make empty bounds lower to `WellFormed` and make `WellFormed` coinductive r? rust-lang/types
2022-06-29Avoid constructing an unnecessary `InferCtxt`.Nicholas Nethercote-4/+1
Currently, `search_for_structural_match_violation` constructs an `infcx` from a `tcx` and then only uses the `tcx` within the `infcx`. This is wasteful because `infcx` is a big type. This commit changes it to use the `tcx` directly. When compiling `pest-2.1.3`, this changes the memcpy stats reported by DHAT for a `check full` build from this: ``` 433,008,916 bytes (100%, 99,787.93/Minstr) in 2,148,668 blocks (100%, 495.17/Minstr), avg size 201.52 bytes ``` to this: ``` 101,422,347 bytes (99.98%, 25,243.59/Minstr) in 1,318,407 blocks (99.96%, 328.15/Minstr), avg size 76.93 bytes ``` This translates to a 4.3% reduction in instruction counts.
2022-06-29Change `Search::infcx` to `tcx`.Nicholas Nethercote-14/+10
Because the `infcx` isn't needed. This removes one lifetime from `Search`.
2022-06-28Note concrete type being coerced into objectMichael Goulet-2/+3
2022-06-28Fix trait object reborrow suggestionMichael Goulet-8/+7
2022-06-28Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obkDylan DPC-17/+4
Remove a back-compat hack on lazy TAIT This PR's motivation is here: https://github.com/rust-lang/rust/issues/72614#issuecomment-1134595446 ~~But removing a hack doesn't seem to reject the code on the issue, there're some more hacks?~~ r? ``@oli-obk``
2022-06-28Take into account trait predicate coinductivenessJack Huey-6/+36
2022-06-28Make empty bounds lower to WellFormed and make WellFormed coinductiveJack Huey-15/+70
2022-06-27Rollup merge of #98576 - lcnr:region-stuff-cool-beans, r=jackh726Matthias Krüger-6/+2
small regions refactoring these commits should be fairly self-contained r? rust-lang/types
2022-06-27Rollup merge of #98506 - compiler-errors:object-safety-suggestions, r=oli-obkMatthias Krüger-33/+45
Fix span issues in object safety suggestions Fixes #98500
2022-06-27outside of borrowck, do not provide an implicit_region_boundlcnr-6/+2
see comment added to the field in `VerifyBoundCx`.
2022-06-27Remove a back-compat hack on lazy TAITYuki Okushi-17/+4
2022-06-27Auto merge of #98221 - cjgillot:single-coh, r=lcnrbors-1/+1
Perform coherence checking per impl. r? `@ghost`
2022-06-27Update `smallvec` to 1.8.1.Nicholas Nethercote-1/+1
This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc.
2022-06-25Fix span issues in object safety suggestionsMichael Goulet-33/+45
2022-06-25Rollup merge of #98311 - eggyal:reverse-folder-hierarchy, r=jackh726Matthias Krüger-4/+2
Reverse folder hierarchy #91318 introduced a trait for infallible folders distinct from the fallible version. For some reason (completely unfathomable to me now that I look at it with fresh eyes), the infallible trait was a supertrait of the fallible one: that is, all fallible folders were required to also be infallible. Moreover the `Error` associated type was defined on the infallible trait! It's so absurd that it has me questioning whether I was entirely sane. This trait reverses the hierarchy, so that the fallible trait is a supertrait of the infallible one: all infallible folders are required to also be fallible (which is a trivial blanket implementation). This of course makes much more sense! It also enables the `Error` associated type to sit on the fallible trait, where it sensibly belongs. There is one downside however: folders expose a `tcx` accessor method. Since the blanket fallible implementation for infallible folders only has access to a generic `F: TypeFolder`, we need that trait to expose such an accessor to which we can delegate. Alternatively it's possible to extract that accessor into a separate `HasTcx` trait (or similar) that would then be a supertrait of both the fallible and infallible folder traits: this would ensure that there's only one unambiguous `tcx` method, at the cost of a little additional boilerplate. If desired, I can submit that as a separate PR. r? ````@jackh726````
2022-06-23Rollup merge of #98365 - jyn514:improve-obligation-errors-review-comments, ↵Michael Goulet-22/+4
r=eholk Address review comments from #98259 It got approved so fast I didn't have time to make changes xD r? ``@eholk``
2022-06-23Rollup merge of #98259 - jyn514:improve-obligation-errors, r=estebankMichael Goulet-12/+93
Greatly improve error reporting for futures and generators in `note_obligation_cause_code` Most futures don't go through this code path, because they're caught by `maybe_note_obligation_cause_for_async_await`. But all generators do, and `maybe_note` is imperfect and doesn't catch all futures. Improve the error message for those it misses. At some point, we may want to consider unifying this with the code for `maybe_note_async_await`, so that `async_await` notes all parent constraints, and `note_obligation` can point to yield points. But both functions are quite complicated, and it's not clear to me how to combine them; this seems like a good incremental improvement. Helps with https://github.com/rust-lang/rust/issues/97332. r? ``@estebank`` cc ``@eholk`` ``@compiler-errors``
2022-06-22Perform coherence checking per impl.Camille GILLOT-1/+1
2022-06-21Point at return expression for RPIT-related errorMichael Goulet-0/+11