about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2021-10-20Make EvaluationCache consider polarity as cache's keySantiago Pastorino-6/+24
2021-10-20Only assemble_candidates_from_impls for polarity NegativeSantiago Pastorino-58/+62
2021-10-20Consider negative polarity on trait selectionSantiago Pastorino-25/+23
2021-10-20Consider negative polarity on overlap checkSantiago Pastorino-16/+32
2021-10-20Add polarity to TraitPredicateSantiago Pastorino-0/+5
2021-10-20remove duplicate substEthan Brierley-1/+0
2021-10-19Address lcnr reviewEthan Brierley-3/+5
2021-10-19Reject closures in patternsTomasz Miąsko-1/+5
2021-10-19Auto merge of #89933 - est31:let_else, r=michaelwoeristerbors-13/+6
Adopt let_else across the compiler This performs a substitution of code following the pattern: ``` let <id> = if let <pat> = ... { identity } else { ... : ! }; ``` To simplify it to: ``` let <pat> = ... { identity } else { ... : ! }; ``` By adopting the `let_else` feature (cc #87335). The PR also updates the syn crate because the currently used version of the crate doesn't support `let_else` syntax yet. Note: Generally I'm the person who *removes* usages of unstable features from the compiler, not adds more usages of them, but in this instance I think it hopefully helps the feature get stabilized sooner and in a better state. I have written a [comment](https://github.com/rust-lang/rust/issues/87335#issuecomment-944846205) on the tracking issue about my experience and what I feel could be improved before stabilization of `let_else`.
2021-10-18Auto merge of #89229 - oli-obk:i_love_inferctxt, r=jackh726bors-142/+15
Remove redundant member-constraint check impl trait will, for each lifetime in the hidden type, register a "member constraint" that says the lifetime must be equal or outlive one of the lifetimes of the impl trait. These member constraints will be solved by borrowck But, as you can see in the big red block of removed code, there was an ad-hoc check for member constraints happening at the site where they get registered. This check had some minor effects on diagnostics, but will fall down on its feet with my big type alias impl trait refactor. So we removed it and I pulled the removal out into a (hopefully) reviewable PR that works on master directly.
2021-10-18Normalize obligations for closure confirmationjackh726-12/+38
2021-10-18Member constraints already covered all of E0482 already, so that error never ↵Oli Scherer-39/+2
occurred anymore
2021-10-18Guarding a loop with a check that it never runs is uselessOli Scherer-8/+5
2021-10-16Adopt let_else across the compilerest31-13/+6
This performs a substitution of code following the pattern: let <id> = if let <pat> = ... { identity } else { ... : ! }; To simplify it to: let <pat> = ... { identity } else { ... : ! }; By adopting the let_else feature.
2021-10-15Remove a now-unused structOli Scherer-13/+0
2021-10-15simplify constrain_opaque_typesNiko Matsakis-90/+16
2021-10-15Move some outlives bounds things from rustc_trait_selection to rustc_typeckjackh726-146/+1
2021-10-15allow `potential_query_instability` everywherelcnr-0/+1
2021-10-14Rollup merge of #89823 - jackh726:project-overflow, r=oli-obkMatthias Krüger-1/+1
Switch order of terms to prevent overflow Fixes #89639 r? ``@pnkfelix``
2021-10-14Auto merge of #89247 - fee1-dead:const-eval-select, r=oli-obkbors-2/+6
Add `const_eval_select` intrinsic Adds an intrinsic that calls a given function when evaluated at compiler time, but generates a call to another function when called at runtime. See https://github.com/rust-lang/const-eval/issues/7 for previous discussion. r? `@oli-obk.`
2021-10-12Switch order of terms to prevent overflowjackh726-1/+1
2021-10-12Add const_eval_select intrinsicDeadbeef-2/+6
2021-10-11Fix ICE 89775Gary Guo-1/+3
2021-10-10Fix spelling: Cannonical -> CanonicalJohn Kugelman-5/+5
2021-10-08Rollup merge of #89649 - matthiaskrgr:clippycompl, r=jyn514Guillaume Gomez-3/+3
clippy::complexity fixes
2021-10-08clippy::complexity fixesMatthias Krüger-3/+3
2021-10-08Auto merge of #89576 - tom7980:issue-89275-fix, r=estebankbors-13/+25
Prevent error reporting from outputting a recursion error if it finds an ambiguous trait impl during suggestions Closes #89275 This fixes the compiler reporting a recursion error during another already in progress error by trying to make a conversion method suggestion and encounters ambiguous trait implementations that can convert a the original type into a type that can then be recursively converted into itself via another method in the trait. Updated OverflowError struct to be an enum so I could differentiate between passes - it's no longer a ZST but I don't think that should be a problem as they only generate when there's an error in compiling code anyway
2021-10-07Auto merge of #89629 - GuillaumeGomez:rollup-s4r8me6, r=GuillaumeGomezbors-1/+79
Rollup of 7 pull requests Successful merges: - #89298 (Issue 89193 - Fix ICE when using `usize` and `isize` with SIMD gathers ) - #89461 (Add `deref_into_dyn_supertrait` lint.) - #89477 (Move items related to computing diffs to a separate file) - #89559 (RustWrapper: adapt for LLVM API change) - #89585 (Emit item no type error even if type inference fails) - #89596 (Make cfg imply doc(cfg)) - #89615 (Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-07Rollup merge of #89461 - crlf0710:dyn_upcasting_lint, r=nikomatsakisGuillaume Gomez-1/+79
Add `deref_into_dyn_supertrait` lint. Initial implementation of #89460. Resolves #89190. Maybe also worth a beta backport if necessary. r? `@nikomatsakis`
2021-10-06Introduce get_diagnostic_nameCameron Steffen-4/+4
2021-10-06Auto merge of #89323 - estebank:derive-binop, r=petrochenkovbors-1/+1
Consider unfulfilled obligations in binop errors When encountering a binop where the types would have been accepted, if all the predicates had been fulfilled, include information about the predicates and suggest appropriate `#[derive]`s if possible. Fix #84515.
2021-10-05Consider unfulfilled obligations in binop errorsEsteban Kuber-1/+1
When encountering a binop where the types would have been accepted, if all the predicates had been fulfilled, include information about the predicates and suggest appropriate `#[derive]`s if possible. Point at trait(s) that needs to be `impl`emented.
2021-10-05Issue 89275 fix and testTom Farmer-13/+25
Issue 89275 fix and test Fix librustdoc OverflowError usage rust tidy run Issue 89275 fix and test
2021-10-05Rollup merge of #89317 - JulianKnodt:precise_errors, r=BoxyUwUManish Goregaokar-43/+94
Move generic error message to separate branches This decomposes an error message in generic constants into more specific branches, for better readability. r? ``@lcnr``
2021-10-04Rollup merge of #89478 - zvavybir:master, r=jyn514Jubilee-2/+8
Fixed numerus of error message When there are redundant trait requirements and these are hidden, a message is generated by the following code snippet: `format!("{} redundant requirements hidden", count)` But if there is only a single hidden requirement, it will still print this message in plural instead of singular.
2021-10-04Rollup merge of #89413 - matthewjasper:spec-marker-fix, r=nikomatsakisJubilee-1/+3
Correctly handle supertraits for min_specialization Supertraits of specialization markers could circumvent checks for min_specialization. Elaborating predicates prevents this. r? ````@nikomatsakis````
2021-10-04Move generic error message to separate brancheskadmin-43/+94
This decomposes an error message in generic constants into more specific branches, for better readability.
2021-10-03Combined 4 commits into 1Matthias Kaak-2/+8
Fixed numerus of error message Removed superfluous argument Using pluralize!() instead of code duplication Adjusted a test
2021-10-03Practice diagnostic message conventionHirochika Matsumoto-2/+2
2021-10-03Add `deref_into_dyn_supertrait` lint.Charles Lew-1/+79
2021-10-03Auto merge of #89479 - camsteffen:diag-naming, r=Manishearthbors-5/+5
Make diangostic item naming consistent Right now there is about a 50/50 split of naming diagnostic items as `vec_type` vs `Vec`. So it is hard to guess a diagnostic item name with confidence. I know it's not great to change these retroactively, but I think it will be much easier to maintain consistency after consistency is established.
2021-10-02Make diangostic item names consistentCameron Steffen-5/+5
2021-10-02Auto merge of #89345 - jackh726:89333, r=estebankbors-16/+16
Don't lose binders when printing trait bound suggestion Fixes #89333
2021-10-01Rollup merge of #88963 - fee1-dead:const-iterator, r=oli-obkManish Goregaokar-9/+16
Coerce const FnDefs to implement const Fn traits You can now pass a FnDef to a function expecting `F` where `F: ~const FnTrait`. r? ``@oli-obk`` ``@rustbot`` label T-compiler F-const_trait_impl
2021-10-01Don't lose binders when printing trait bound suggestionjackh726-16/+16
2021-09-30Elaborate predicates in min_specialization checksMatthew Jasper-1/+3
Supertraits of specialization markers could circumvent checks for min_specialization. Elaborating predicates prevents this.
2021-09-28Improve help for recursion limit errorsRoss MacArthur-6/+14
2021-09-28More tracing instrumentationOli Scherer-17/+17
2021-09-27Auto merge of #89285 - jackh726:issue-88862, r=nikomatsakisbors-8/+8
Don't normalize opaque types with escaping late-bound regions Fixes #88862 Turns out, this has some really bad perf implications in large types (issue #88862). While we technically can handle them fine, it doesn't change test output either way. For now, revert with an added benchmark. Future attempts to change this back will have to consider perf. Needs a perf run once https://github.com/rust-lang/rustc-perf/pull/1033 is merged r? `@nikomatsakis`
2021-09-26Don't normalize opaque types with escaping late-bound regions.jackh726-8/+8
Turns out, this has some really bad perf implications in large types (issue #88862). While we technically can handle them fine, it doesn't change test output either way. For now, revert with an added benchmark. Future attempts to change this back will have to consider perf.