about summary refs log tree commit diff
path: root/src/librustc/traits/mod.rs
AgeCommit message (Collapse)AuthorLines
2019-04-28Fix lint findings in librustcflip1995-1/+1
2019-04-12Rollup merge of #59859 - davidtwco:issue-59756, r=cramertjMazdak Farrokhzad-0/+1
Suggest removing `?` to resolve type errors. Fixes #59756.
2019-04-10Suggest removing `?` to resolve type errors.David Wood-0/+1
This commit adds a suggestion to remove the `?` from expressions if removing the `?` would resolve a type error.
2019-04-05Introduce an arena type which may be used to allocate a list of types with ↵John Kåre Alsaker-4/+3
destructors
2019-03-15rustc: rename item_path to def_path (except the module in ty).Eduard-Mihai Burtescu-4/+4
2019-03-13Use derive macro for HashStableJohn Kåre Alsaker-20/+21
2019-03-05Handle const generics elsewherevarkor-1/+2
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-27rename Substs to InternalSubstscsmoe-3/+3
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-26replace &'tcx Substs with SubstsRefcsmoe-5/+5
2019-02-24hir: remove NodeId from Exprljedrz-2/+2
2019-02-14Rollup merge of #58267 - estebank:match-arms, r=matthewjasperMazdak Farrokhzad-0/+3
Tweak "incompatible match arms" error - Point at the body expression of the match arm with the type error. - Point at the prior match arms explicitly stating the evaluated type. - Point at the entire match expr in a secondary span, instead of primary. - For type errors in the first match arm, the cause is outside of the match, treat as implicit block error to give a more appropriate error. Fix #46776, fix #57206. CC #24157, #38234.
2019-02-13HirId-ify hir::BodyIdljedrz-9/+9
2019-02-10rustc: doc commentsAlexander Regueiro-37/+36
2019-02-08review comments: (marginally) reduce memory consumtionEsteban Küber-1/+2
2019-02-07Reweork incompatible match arms errorEsteban Küber-0/+2
- Point at the body expression of the match arm with the type error. - Point at the prior match arms explicitely stating the evaluated type. - Point at the entire match expr in a secondary span, instead of primary. - For type errors in the first match arm, the cause is outside of the match, treat as implicit block error to give a more appropriate error.
2019-02-05move librustc to 2018Mark Mansi-11/+11
2019-01-13Suggest removal of semicolon when appropriateEsteban Küber-0/+1
2019-01-13Tweak output of type mismatch between "then" and `else` `if` armsEsteban Küber-1/+4
2019-01-12Point at the match discriminant when arm pattern has a type mismatchEsteban Küber-2/+7
2019-01-02try to detect affected code and direct people to #56105Niko Matsakis-1/+2
2019-01-02make evaluation track whether outlives relationships matteredNiko Matsakis-11/+11
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.
2018-12-27Handle sub-typing in chalk-enginescalexm-0/+1
2018-12-27Integrate chalk enginescalexm-2/+8
2018-12-27Add a def-id in `ty::ParamEnv`scalexm-5/+15
2018-12-27Implement "lifetime juggling" methods from chalk integration traitscalexm-1/+13
Fixes #55097.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-14add coherence future-compat warnings for marker-only trait objectsAriel Ben-Yehuda-0/+2
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-07Re-added accidentally-removed imports.Alexander Regueiro-0/+3
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-32/+32
2018-11-29Add inline attributes and add unit to CommonTypesJohn Kåre Alsaker-0/+1
2018-11-26rustc-guide has movedMark Mansi-1/+1
2018-11-16improve debug output related to bound calculationNiko Matsakis-1/+6
2018-11-07Added error for duplicate bindings of associated type.Alexander Regueiro-5/+2
2018-11-03Auto merge of #55101 - alexreg:trait-aliases, r=nikomatsakisbors-9/+25
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-1/+1
2018-11-03Added support for trait aliases as bounds.Alexander Regueiro-9/+25
2018-10-25preserve const eval error information through trait error systemRalf Jung-1/+2
2018-10-25Report const eval error inside the queryOliver Schneider-2/+1
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-1/+1
2018-10-17Categorize chalk clausesscalexm-1/+21
2018-10-17Implement the `environment` queryscalexm-6/+7
2018-10-17Use `Environment` instead of `ty::ParamEnv` in chalk contextscalexm-0/+30
2018-10-08Pass around interned refs to goals and not goalsscalexm-10/+12
2018-10-01normalize param-env type-outlives predicates lastAriel Ben-Yehuda-56/+117
The normalization of type-outlives predicates can depend on misc. environment predicates, but not the other way around. Inferred lifetime bounds can propagate type-outlives bounds far and wide, so their normalization needs to work well. Fixes #54467
2018-09-30Auto merge of #53255 - orium:fix-bug-overflow-send, r=arielb1bors-1/+1
Add a per-tree error cache to the obligation forest This implements part of what @nikomatsakis mentioned in https://github.com/rust-lang/rust/pull/30533#issuecomment-170705871: > 1. If you find that a new obligation is a duplicate of one already in the tree, the proper processing is: > * if that other location is your parent, you should abort with a cycle error (or accept it, if coinductive) > * if that other location is not an ancestor, you can safely ignore the new obligation In particular it implements the "if that other location is your parent accept it, if coinductive" part. This fixes #40827. I have to say that I'm not 100% confident that this is rock solid. This is my first pull request :tada:, and I didn't know anything about the trait resolver before this. In particular I'm not totally sure that comparing predicates is enough (for instance, do we need to compare `param_env` as well?). Also, I'm not sure what @nikomatsakis mentions [here](https://github.com/rust-lang/rust/issues/30977#issue-127091096), but it might be something that affects this PR: > In particular, I am wary of getting things wrong around inference variables! We can always add things to the set in their current state, and if unifications occur then the obligation is just kind of out-of-date, but I want to be sure we don't accidentally fail to notice that something is our ancestor. I decided this was subtle enough to merit its own PR. Anyway, go ahead and review :slightly_smiling_face:. Ref #30977. # Performance We are now copying vectors around, so I decided to do some benchmarking. A simple benchmark shows that this does not seem to affect performance in a measurable way: I ran `cargo clean && cargo build` 20 times on actix-web (84b27db) and these are the results: ```text rustc master: Mean Std.Dev. Min Median Max real 66.637 2.996 57.220 67.714 69.314 user 307.293 14.741 258.093 312.209 320.702 sys 12.524 0.653 10.499 12.726 13.193 rustc fix-bug-overflow-send: Mean Std.Dev. Min Median Max real 66.297 4.310 53.532 67.516 70.348 user 306.812 22.371 236.917 314.748 326.229 sys 12.757 0.952 9.671 13.125 13.544 ``` I will do a more comprehensive benchmark (compiling rustc stage1) and post the results. r? @nikomatsakis, @nnethercote PS: It is better to review this commit-by-commit.
2018-09-30Typos and style fixes.Diogo Sousa-1/+1
2018-09-29don't elide lifetimes in paths in librustc/Zack M. Davis-1/+1
This seemed like a good way to kick the tires on the elided-lifetimes-in-paths lint (#52069)—seems to work! This was also pretty tedious—it sure would be nice if `cargo fix` worked on this codebase (#53896)!
2018-09-28rustc: keep a Span for each predicate in ty::GenericPredicates.Eduard-Mihai Burtescu-2/+1
2018-09-26convert from an `UnlessNll` flag to a `SuppressRegionErrors` flagNiko Matsakis-2/+2
Hopefully this will help clarify the behavior in the various borrowck modes
2018-09-26use a `UnlessNll` flag to consolidate error reporting pathsNiko Matsakis-1/+7