about summary refs log tree commit diff
path: root/src/librustc/traits/select.rs
AgeCommit message (Collapse)AuthorLines
2019-04-26Update handling of Tuplevarkor-5/+9
2019-04-26Auto merge of #60167 - varkor:tidy-filelength, r=matthewjasperbors-0/+2
Add a tidy check for files with over 3,000 lines Files with a large number of lines can cause issues in GitHub (e.g. https://github.com/rust-lang/rust/issues/60015) and also tend to be indicative of opportunities to refactor into less monolithic structures. This adds a new check to tidy to warn against files that have more than 3,000 lines, as suggested in https://github.com/rust-lang/rust/issues/60015#issuecomment-483868594. (This number was chosen fairly arbitrarily as a reasonable indicator of size.) This check can be ignored with `// ignore-tidy-filelength`. Existing files with greater than 3,000 lines currently ignore the check, but this helps us spot when files are getting too large. (We might try to split up all files larger than this in the future, as in https://github.com/rust-lang/rust/issues/60015).
2019-04-25ignore-tidy-filelength on all files with greater than 3000 linesvarkor-0/+2
2019-04-22Remove redundant code in copy_clone_conditionsTyler Mandry-10/+4
This was left over from when closure copy and clone were gated behind feature flags.
2019-02-27Rename variadic to c_variadicDan Robertson-1/+1
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
2019-02-27rename Substs to InternalSubstscsmoe-2/+2
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-26replace &'tcx Substs with SubstsRefcsmoe-4/+4
2019-02-21partially revert 904a0bde93f0348f69914ee90b1f8b6e4e0d7cbcNiko Matsakis-1/+19
This preserves the error you currently get on stable for the old-lub-glb-object.rs test.
2019-02-21introduce a dummy leak check and invoke it in all the right placesNiko Matsakis-12/+34
This set of diffs was produced by combing through b68fad670bb3612cac26e50751e4fd9150e59977 and seeing where the `leak_check` used to be invoked and how.
2019-02-21s/skol_/placeholder_/Niko Matsakis-10/+10
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-1/+1
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-1/+1
2019-02-10rustc: doc commentsAlexander Regueiro-24/+23
2019-02-05move librustc to 2018Mark Mansi-13/+13
2019-01-27Mark non-static generators as always UnpinWim Looman-3/+15
2019-01-27Mark static generators as !UnpinWim Looman-0/+6
2019-01-19Rollup merge of #57502 - nikomatsakis:fix-trait-alias-1b, r=nikomatsakisMazdak Farrokhzad-1/+1
make trait-aliases work across crates This is rebase of a small part of @alexreg's PR #55994. It focuses just on the changes that integrate trait aliases properly into crate metadata, excluding the stylistic edits and the trait objects. The stylistic edits I also rebased and can open a separate PR. The trait object stuff I found challenging and decided it basically needed to be reimplemented. For now I've excluded it. Since this is really @alexreg's work (I really just rebased) I am going to make it r=me once it is working. Fixes #56488. Fixes #57023.
2019-01-19Auto merge of #56722 - Aaron1011:fix/blanket-eval-overflow, r=nikomatsakisbors-25/+73
Fix stack overflow when finding blanket impls Currently, SelectionContext tries to prevent stack overflow by keeping track of the current recursion depth. However, this depth tracking is only used when performing normal section (which includes confirmation). No such tracking is performed for evaluate_obligation_recursively, which can allow a stack overflow to occur. To fix this, this commit tracks the current predicate evaluation depth. This is done separately from the existing obligation depth tracking: an obligation overflow can occur across multiple calls to 'select' (e.g. when fulfilling a trait), while a predicate evaluation overflow can only happen as a result of a deep recursive call stack. Fixes #56701 I've re-used `tcx.sess.recursion_limit` when checking for predication evaluation overflows. This is such a weird corner case that I don't believe it's necessary to have a separate setting controlling the maximum depth.
2019-01-16Don't explicitly increment the depth for new trait predicatesAaron Hill-2/+1
2019-01-10integrate trait aliases into def-paths / metadataNiko Matsakis-1/+1
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2019-01-03Improve commentAaron Hill-1/+8
2019-01-03Cleanup codeAaron Hill-7/+1
2019-01-03Improve error generation, fixup recursion limitsAaron Hill-6/+28
2019-01-03More tidy fixesAaron Hill-3/+4
2019-01-03Ensure that we properly increment obligation depthAaron Hill-21/+24
2019-01-03Remove extra recursion_depth trackingAaron Hill-63/+41
2019-01-03Fix tidy errorsAaron Hill-6/+11
2019-01-03Fix stack overflow when finding blanket implsAaron Hill-31/+70
Currently, SelectionContext tries to prevent stack overflow by keeping track of the current recursion depth. However, this depth tracking is only used when performing normal section (which includes confirmation). No such tracking is performed for evaluate_obligation_recursively, which can allow a stack overflow to occur. To fix this, this commit tracks the current predicate evaluation depth. This is done separately from the existing obligation depth tracking: an obligation overflow can occur across multiple calls to 'select' (e.g. when fulfilling a trait), while a predicate evaluation overflow can only happen as a result of a deep recursive call stack. Fixes #56701
2019-01-04implement a hack to make traitobject 0.1.0 compileAriel Ben-Yehuda-1/+2
2019-01-04Revert "add coherence future-compat warnings for marker-only trait objects"Ariel Ben-Yehuda-10/+2
This reverts commit 760639635facb6c9a0926ac9278bcba71880b0b3.
2019-01-04add support for principal-less trait object typesAriel Ben-Yehuda-6/+15
should be a pure refactoring.
2019-01-02track if any region constraints involved placeholdersNiko Matsakis-4/+3
2019-01-02universe transitionNiko Matsakis-89/+33
Remove the leak-check and its associated machinery. Replace with making the solver aware of universes.
2019-01-02select.rs: unsizing coercion should use a subtypeNiko Matsakis-2/+2
When we coerce `dyn Foo` to `dyn Bar`, that is OK as long as `Foo` is usable in all contexts where `Bar` is usable (hence using the source must be a subtype of the target). This is needed for the universe-based code to handle `old-lub-glb-object`; that test used to work sort of by accident before with the old code.
2019-01-02introduce ability to detect region constraints from snapshotNiko Matsakis-8/+22
2019-01-02make evaluation track whether outlives relationships matteredNiko Matsakis-91/+32
Previously, evaluation ignored outlives relationships. Since we using evaluation to skip the "normal" trait selection (which enforces outlives relationships) this led to incorrect results in some cases.
2019-01-02remove wrapper functions that had no purposeNiko Matsakis-56/+37
2019-01-02remove `commit_if_ok` wrapperNiko Matsakis-10/+1
2018-12-27Use `TraitEngine` in `enter_canonical_trait_query`scalexm-5/+8
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-14add coherence future-compat warnings for marker-only trait objectsAriel Ben-Yehuda-2/+10
The future-compat warnings break code that assumes that `dyn Send + Sync != dyn Sync + Send`, and are the first step in making them equal. cc #33140. It should be possible to revert this commit when we're done with the warnings.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-16/+16
2018-11-26rustc-guide has movedMark Mansi-3/+3
2018-11-24Move `BoundTy` debruijn index to the `TyKind` enum variantscalexm-3/+3
2018-11-24Instantiate all bound vars universallyscalexm-5/+5
2018-11-24Introduce `TyKind::Placeholder` variantscalexm-0/+3
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-1/+1
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-06refactor: use shorthand fieldsteresy-1/+1
2018-11-03Auto merge of #55101 - alexreg:trait-aliases, r=nikomatsakisbors-37/+107
Implement trait aliases (RFC 1733) Extends groundwork done in https://github.com/rust-lang/rust/pull/45047, and fully implements https://github.com/rust-lang/rfcs/pull/1733. CC @durka @nikomatsakis
2018-11-03Rename `Binder::no_late_bound_regions` to `Binder::no_bound_vars`scalexm-2/+2