about summary refs log tree commit diff
path: root/src/librustc/traits/mod.rs
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-843/+0
2020-03-25Rename `def_span` to `guess_head_span`Esteban Küber-1/+3
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-1/+1
2020-03-10Rename rustc guide to rustc dev guideSantiago Pastorino-2/+2
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-1/+1
2020-03-02Remove chalk integrationCAD97-43/+0
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-1/+1
2020-02-28Track all predicates in errors, not just trait obligationsEsteban Küber-0/+14
Surface associated type projection bounds that could not be fulfilled in E0599 errors. Always present the list of unfulfilled trait bounds, regardless of whether we're pointing at the ADT or trait that didn't satisfy it.
2020-02-27don't use .into() to convert types into identical types.Matthias Krüger-2/+1
example: let s: String = format!("hello").into();
2020-02-17Querify object_safety_violations.Camille GILLOT-0/+132
2020-02-16Make librustc compile.Camille GILLOT-0/+739
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-645/+0
2020-02-12Auto merge of #68679 - matthewjasper:needs-type-op, r=varkorbors-1/+0
Improve `ty.needs_drop` * Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty * Avoid query in simple cases reopens #65918
2020-02-09Remove vestigial #43355-compat codeJonas Schievink-7/+0
This was previously a future-compat warning that has since been turned into hard error, but without actually removing all the code. Avoids a call to `traits::overlapping_impls`, which is expensive.
2020-02-09Rollup merge of #68911 - jonas-schievink:inherent-overlap, r=petrochenkovJonas Schievink-0/+1
Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in https://github.com/rust-lang/rust/pull/68837#discussion_r375701767.
2020-02-09Rollup merge of #68857 - Marwes:allocations, r=matthewjasperDylan DPC-1/+3
perf: Reduce Vec allocations in normalization by passing &mut Vec Complicates the code a bit but allocation/freeing were a few percent of the overall runtime in trait heavy code.
2020-02-08Reduce Vec allocations in normalization by passing &mut VecMarkus Westerlind-1/+3
2020-02-08Make `associated_items` query return a sliceJonas Schievink-0/+1
2020-02-06lint impls that will become incoherent when leak-check is removedNiko Matsakis-0/+22
2020-02-05Move traits::select datatypes to traits::types.Camille GILLOT-2/+1
2020-02-05Move traits::Reveal to traits::types.Camille GILLOT-1/+1
2020-02-05Move rustc::traits datatypes to module traits::types.Camille GILLOT-681/+4
2020-02-04remove redundant imports (clippy::single_component_path_imports)Matthias Krüger-1/+0
2020-02-02Improve needs_drop queryMatthew Jasper-1/+0
* Handle cycles in `needs_drop` correctly * Normalize types when computing `needs_drop` * Move queries from rustc to rustc_ty
2020-01-21Rollup merge of #68140 - ecstatic-morse:const-trait-bound-opt-out, r=oli-obkMazdak Farrokhzad-2/+2
Implement `?const` opt-out for trait bounds For now, such bounds are treated exactly the same as unprefixed ones in all contexts. [RFC 2632](https://github.com/rust-lang/rfcs/pull/2632) does not specify whether such bounds are forbidden outside of `const` contexts, so they are allowed at the moment. Prior to this PR, the constness of a trait bound/impl was stored in `TraitRef`. Now, the constness of an `impl` is stored in `ast::ItemKind::Impl` and the constness of a bound in `ast::TraitBoundModifer`. Additionally, constness of trait bounds is now stored in an additional field of `ty::Predicate::Trait`, and the combination of the constness of the item along with any `TraitBoundModifier` determines the constness of the bound in accordance with the RFC. Encoding the constness of impls at the `ty` level is left for a later PR. After a discussion in \#wg-grammar on Discord, it was decided that the grammar should not encode the mutual exclusivity of trait bound modifiers. The grammar for trait bound modifiers remains `[?const] [?]`. To encode this, I add a dummy variant to `ast::TraitBoundModifier` that is used when the syntax `?const ?` appears. This variant causes an error in AST validation and disappears during HIR lowering. cc #67794 r? @oli-obk
2020-01-21Rollup merge of #68297 - Aaron1011:fix/new-const-prop-bounds, r=oli-obkYuki Okushi-12/+8
Filter and test predicates using `normalize_and_test_predicates` for const-prop Fixes #68264 Previously, I attempted to use `substitute_normalize_and_test_predicates` to detect unsatisfiable bounds. Unfortunately, since const-prop runs in a generic environment (we don't have any of the function's generic parameters substituted), this could lead to cycle errors when attempting to normalize predicates. This check is replaced with a more precise check. We now only call `normalize_and_test_predicates` on predicates that have the possibility of being proved unsatisfiable - that is, predicates that don't depend on anything local to the function (e.g. generic parameters). This ensures that we don't hit cycle errors when we normalize said predicates, while still ensuring that we detect unsatisfiable predicates. I haven't been able to come up with a minimization of the Diesel issue - however, I've verified that it compiles successfully.
2020-01-20Add `ConstnessAnd` that implements `ToPredicate`Dylan MacKenzie-2/+2
2020-01-16Revert previous attempt at detecting unsatisfiable predicatesAaron Hill-12/+8
2020-01-16review commentsEsteban Küber-1/+1
2020-01-16review commentsEsteban Küber-7/+7
2020-01-16Specific error for unsized `dyn Trait` return typeEsteban Küber-0/+11
Suggest `impl Trait` when possible, and `Box<dyn Trait>` otherwise.
2020-01-13Use TraitQueryMode::Canonical when testing predicates in const propAaron Hill-7/+11
2020-01-07Rename traits::drop -> traits::misc.Camille GILLOT-2/+2
2020-01-07Move magic traits queries to rustc::traits::drop.Camille GILLOT-0/+2
2020-01-07Move structural_match to rustc::traits.Camille GILLOT-0/+4
2020-01-07Move ty::wf to traits.Camille GILLOT-0/+1
2020-01-07Make traits::util::* free functions.Camille GILLOT-0/+4
2020-01-07Make ↵Camille GILLOT-1/+4
rustc::traits::object_safety::{astconv_object_safety_violations,is_vtable_safe_method,object_safety_violations} free functions.
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-30discriminant -> scrutineeMazdak Farrokhzad-1/+1
2019-12-30Blame user type in pat type error.Mazdak Farrokhzad-2/+6
2019-12-30MatchExpressionArmPattern -> PatternMazdak Farrokhzad-2/+2
Current name is too specific for incoming changes.
2019-12-24x.py fmt after previous deignoreMark Rousskov-221/+232
2019-12-20Check associated type implementations for generic mismatchesMatthew Jasper-0/+7
2019-11-21Applied suggestions from code review.Alexander Regueiro-1/+1
2019-11-21Aggregation of drive-by cosmetic changes.Alexander Regueiro-18/+17
2019-11-18Retire EnumLiftImpl.Camille GILLOT-5/+5
2019-11-17Auto merge of #66384 - cjgillot:typefoldable, r=Zoxcbors-29/+19
Derive TypeFoldable using a proc-macro A new proc macro is added in librustc_macros. It is used to derive TypeFoldable inside librustc and librustc_traits. For now, the macro uses the `'tcx` lifetime implicitly, and does not allow for a more robust selection of the adequate lifetime. The Clone-based TypeFoldable implementations are not migrated. Closes #65674
2019-11-15Correct `const_in_array_repeat_expressions` feature nameYuki Okushi-1/+1