about summary refs log tree commit diff
path: root/src/librustc/traits
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-2371/+0
2020-03-26Rollup merge of #69866 - estebank:guess_head_span, r=eddybMazdak Farrokhzad-1/+3
Rename `def_span` to `guess_head_span` r? @eddyb
2020-03-25Rename `def_span` to `guess_head_span`Esteban Küber-1/+3
2020-03-25Rollup merge of #70319 - lcnr:issue63695, r=eddybDylan DPC-0/+14
correctly normalize constants closes #70317 implements https://github.com/rust-lang/rust/issues/70125#issuecomment-602133708 r? eddyb cc @varkor
2020-03-23add missing visit_constsBastian Kauschke-0/+14
2020-03-21rustc: keep upvars tupled in {Closure,Generator}Substs.Eduard-Mihai Burtescu-2/+2
2020-03-15Avoid ICEs when we emit errors constructing the specialization graphMatthew Jasper-10/+19
2020-03-14Move IntercrateAmbiguityCause back to rustc::traits::select.Camille GILLOT-0/+41
2020-03-12Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbiniMazdak Farrokhzad-4/+4
Rename rustc guide This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470 Needs to be merged after we actually rename the guide. Have used this to rename: `git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'` `git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'` `git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-2/+2
2020-03-10Rename rustc guide to rustc dev guideSantiago Pastorino-4/+4
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-2/+2
2020-03-06Don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-3/+3
2020-03-04Use .map() to modify data inside Options instead of using .and_then(|x| ↵Matthias Krüger-3/+3
Some(y)) (clippy::option_and_then_some)
2020-03-03Rollup merge of #69619 - matthiaskrgr:misc, r=eddybYuki Okushi-1/+1
more cleanups * use starts_with() instead of chars().next() == Some(x) * use subsec_micros() instead of subsec_nanos() / 1000 * use for (idx, item) in iter.enumerate() instead of manually counting loop iterations with variables * use values() or keys() respectively when iterating only over keys or values of maps.
2020-03-02Remove chalk integrationCAD97-115/+0
2020-03-02use values() or keys() respectively when iterating only over keys or values ↵Matthias Krüger-1/+1
of maps.
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2
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-21Auto merge of #69242 - cjgillot:object_violations, r=Zoxcbors-0/+132
Querify object_safety_violations. Split from #69076 r? @Zoxc
2020-02-19Make lookup of associated item by name O(log n)Dylan MacKenzie-3/+3
2020-02-17Querify object_safety_violations.Camille GILLOT-0/+132
2020-02-16Make librustc compile.Camille GILLOT-0/+3
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-16978/+0
2020-02-15Rollup merge of #68475 - Aaron1011:fix/forest-caching, r=nikomatsakisYuki Okushi-3/+6
Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest` Previously, we used a plain `Predicate` to cache results (e.g. successes and failures) in ObligationForest. However, fulfillment depends on the precise `ParamEnv` used, so this is unsound in general. This commit changes the impl of `ForestObligation` for `PendingPredicateObligation` to use `ParamEnvAnd<Predicate>` instead of `Predicate` for the associated type. The associated type and method are renamed from 'predicate' to 'cache_key' to reflect the fact that type is no longer just a predicate.
2020-02-13Constness -> enum Const { Yes(Span), No }Mazdak Farrokhzad-7/+6
Same idea for `Unsafety` & use new span for better diagnostics.
2020-02-13Rollup merge of #69082 - estebank:boxfuture-box-pin, r=tmandryDylan DPC-4/+11
When expecting `BoxFuture` and using `async {}`, suggest `Box::pin` Fix #68197, cc #69083.
2020-02-12Add trait `Self` filtering to `rustc_on_unimplemented`Esteban Küber-0/+10
2020-02-12When expecting `BoxFuture` and using `async {}`, suggest `Box::pin`Esteban Küber-4/+1
2020-02-12Auto merge of #68679 - matthewjasper:needs-type-op, r=varkorbors-133/+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-11Review comments.Camille GILLOT-3/+3
2020-02-11Move lang_items definitions to librustc_lang_items.Camille GILLOT-4/+3
2020-02-11Auto merge of #69062 - Dylan-DPC:rollup-7wpjpqu, r=Dylan-DPCbors-34/+48
Rollup of 8 pull requests Successful merges: - #66498 (Remove unused feature gates) - #68816 (Tweak borrow error on `FnMut` when `Fn` is expected) - #68824 (Enable Control Flow Guard in rustbuild) - #69022 (traits: preallocate 2 Vecs of known initial size) - #69031 (Use `dyn Trait` more in tests) - #69044 (Don't run coherence twice for future-compat lints) - #69047 (Don't rustfmt check the vendor directory.) - #69055 (Clean up E0307 explanation) Failed merges: r? @ghost
2020-02-11Rollup merge of #69044 - jonas-schievink:dont-run-coherence-twice, r=davidtwcoDylan DPC-30/+43
Don't run coherence twice for future-compat lints This fixes the regression introduced by https://github.com/rust-lang/rust/pull/65232 (which I mentioned in https://github.com/rust-lang/rust/pull/65232#issuecomment-583739037). Old algorithm: * Run coherence with all future-incompatible checks off, reporting errors on any overlap. * If there's no overlap (common case), run it *again*, with the future-incompatible checks on. Report warnings for any overlap found. New algorithm: * Run coherence with all additional future-incompatible checks *on*, which means that we'll find *all* potentially overlapping impls immediately. * If this found overlap, run coherence again, with the future-incompatible checks off. If that *still* gives an error, we report it. If not, it ought to be a warning. This reduces time spent in coherence checking for the nrf52810-pac by roughly 50% relative to current master.
2020-02-11Rollup merge of #69022 - ljedrz:traits_tweak_vecs, r=petrochenkovDylan DPC-4/+5
traits: preallocate 2 Vecs of known initial size The 2 preallocations are pretty obvious; both vectors will be as big as or larger than the collections they are created from. In `WfPredicates::normalize` the change from a functional style improves readability and should be perf-friendly, too.
2020-02-11Run RustFmtjumbatm-7/+15
2020-02-11Invert control in struct_lint_level.jumbatm-78/+92
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-11Auto merge of #68929 - matprec:consistent-issue-references, r=Dylan-DPCbors-8/+8
Make issue references consistent Fixes https://github.com/rust-lang/rust/issues/62976 cc https://github.com/rust-lang/rust/pull/63008 r? @varkor because you reviewed the original pr
2020-02-11Don't run coherence twice for future-compat lintsJonas Schievink-30/+43
2020-02-10preallocate 2 Vecs in traits; tweak WfPredicates::normalizeljedrz-4/+5
2020-02-10Auto merge of #69012 - Dylan-DPC:rollup-13qn0fq, r=Dylan-DPCbors-93/+48
Rollup of 6 pull requests Successful merges: - #68694 (Reduce the number of `RefCell`s in `InferCtxt`.) - #68966 (Improve performance of coherence checks) - #68976 (Make `num::NonZeroX::new` an unstable `const fn`) - #68992 (Correctly parse `mut a @ b`) - #69005 (Small graphviz improvements for the new dataflow framework) - #69006 (parser: Keep current and previous tokens precisely) Failed merges: r? @ghost
2020-02-10Rollup merge of #68966 - jonas-schievink:coherence-perf, r=varkorDylan DPC-83/+28
Improve performance of coherence checks The biggest perf improvement in here is expected to come from the removal of the remaining #43355 warning code since that effectively runs the expensive parts of coherence *twice*, which can even be visualized by obtaining a flamegraph: ![image](https://user-images.githubusercontent.com/5047365/74091959-e1f41200-4a8b-11ea-969d-2849d3f86c63.png)
2020-02-10Rollup merge of #68694 - nnethercote:reduce-RefCells-in-InferCtxt, r=varkorDylan DPC-10/+20
Reduce the number of `RefCell`s in `InferCtxt`. `InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places. r? @varkor
2020-02-09Remove vestigial #43355-compat codeJonas Schievink-83/+28
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-09Auto merge of #67665 - Patryk27:master, r=zackmdavisbors-84/+236
Improve reporting errors and suggestions for trait bounds Fix #66802 - When printing errors for unsized function parameter, properly point at the parameter instead of function's body. - Improve `consider further restricting this bound` (and related) messages by separating human-oriented hints from the machine-oriented ones.
2020-02-10Reduce the number of `RefCell`s in `InferCtxt`.Nicholas Nethercote-10/+20
`InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places.
2020-02-09Make issue references consistentMatthias Prechtl-8/+8
2020-02-09Rollup merge of #68911 - jonas-schievink:inherent-overlap, r=petrochenkovJonas Schievink-8/+17
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-09Improve reporting errors and suggestions for trait boundsPatryk Wychowaniec-84/+236