about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
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-14Simplify function signature in opaque_typesMatthew Jasper-8/+4
2020-02-14Give some more queries descriptionsMatthew Jasper-1/+6
2020-02-14Distinguish RPIT from other impl traitMatthew Jasper-0/+1
2020-02-14Auto merge of #69100 - cjgillot:resolve_instance, r=Zoxcbors-123/+21
Move resolve_instance to rustc_ty. r? @Zoxc
2020-02-13Add `Place` getter to `Operand`Dylan MacKenzie-0/+9
2020-02-14Auto merge of #68693 - Zoxc:query-no-arc, r=michaelwoeristerbors-159/+312
Construct query job latches on-demand r? @michaelwoerister
2020-02-13Rollup merge of #69108 - cjgillot:trait_candidate, r=ZoxcDylan DPC-2/+5
Use HirId in TraitCandidate. I had to duplicate the `TraitMap` type to hold `NodeId`s until AST->HIR lowering is done. r? @Zoxc
2020-02-13Don't instantiate so many copies of `drop_in_place`Matthew Jasper-4/+21
2020-02-13Move resolve_instance to rustc_ty.Camille GILLOT-123/+21
2020-02-13Make TraitCandidate generic.Camille GILLOT-21/+6
2020-02-13Use HirId in TraitCandidate.Camille GILLOT-2/+20
2020-02-13Auto merge of #68969 - RalfJung:dont-panic, r=oli-obkbors-122/+115
remove Panic variant from InterpError The interpreter engine itself does not raise `Panic` errors any more, so remove them from the error enum. Instead, const-prop and const-eval have to do their own handling of panics. I used the opportunity to refactor the const-eval error handling a bit to use the `MachineStop` variant. Also, in const-prop I could do some cleanup as now, no more lints are being reported in `use_ecx`. However, I am quite puzzled by why exactly the linting there works the way it does -- the code can certainly be cleaned up more, but I don't know enough of the intent to do that. I left some questions for the most confusing parts, but for now behavior should be unchanged by this PR (so, all that weirdness I am asking about is pre-existing and merely maintained here). Cc @wesleywiser Fixes https://github.com/rust-lang/rust/issues/66902 r? @oli-obk
2020-02-13rename PanicInfo -> AssertKindRalf Jung-10/+10
2020-02-13improve comments:Ralf Jung-0/+1
- comment for special handling of Shl/Shr - reference a PR
2020-02-13small cleanup in ConstEvalErr::struct_genericRalf Jung-31/+40
2020-02-13move PanicInfo to mir moduleRalf Jung-63/+59
2020-02-13remove PanicInfo::Panic variant that MIR does not use or needRalf Jung-12/+5
2020-02-13remove Panic variant from InterpErrorRalf Jung-21/+15
2020-02-13Constness -> enum Const { Yes(Span), No }Mazdak Farrokhzad-13/+13
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-159/+118
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-12Address commentsJohn Kåre Alsaker-24/+21
2020-02-12Rollup merge of #69059 - ljedrz:unused_stuff, r=Dylan-DPCDylan DPC-2/+0
Remove a few unused objects As far as I can tell, these won't be missed: - `infer::region_constraints::ConstraintInfo` - `driver::DefaultCallbacks` - ~~`hir::intravisit::ParDeepVisitor`~~
2020-02-12Drop the lock guardJohn Kåre Alsaker-3/+3
2020-02-12Use a counter instead of pointers to the stackJohn Kåre Alsaker-74/+106
2020-02-12Rollup merge of #69077 - jumbatm:fix-comment, r=Dylan-DPCYuki Okushi-4/+3
Fix outdated doc comment. r? @RalfJung
2020-02-12Rollup merge of #68554 - cjgillot:lang_items, r=ZoxcYuki Okushi-737/+40
Split lang_items to crates `rustc_hir` and `rustc_passes`. As discussed in comment https://github.com/rust-lang/rust/pull/67688#discussion_r368289946
2020-02-12Construct query job latches on-demandJohn Kåre Alsaker-151/+275
2020-02-12remove some unused objectsljedrz-2/+0
2020-02-12Fix outdated doc comment.jumbatm-4/+3
2020-02-11Review comments.Camille GILLOT-6/+6
2020-02-11Merge rustc::middle::*lang_items.Camille GILLOT-33/+24
2020-02-11Move it all into rustc_hir.Camille GILLOT-6/+3
2020-02-11Move weak_lang_items checking to librustc_passes.Camille GILLOT-0/+32
2020-02-11Move weak_lang_items.rs to librustc_passes.Camille GILLOT-130/+0
2020-02-11Move weak lang items to librustc_lang_items.Camille GILLOT-68/+31
2020-02-11Move get_lang_items query in librustc_passes.Camille GILLOT-172/+1
2020-02-11Move lang_items definitions to librustc_lang_items.Camille GILLOT-281/+64
2020-02-11Move hir::check_attr::Target to librustc_lang_items.Camille GILLOT-127/+2
2020-02-11Move macro enum_from_u32 to rustc_data_structures.Camille GILLOT-37/+0
2020-02-11Auto merge of #68491 - pnkfelix:hide-niches-under-unsafe-cell, r=olibors-8/+25
Hide niches under UnsafeCell Hide any niche of T from type-construction context of `UnsafeCell<T>`. Fix #68303 Fix #68206
2020-02-11Auto merge of #69062 - Dylan-DPC:rollup-7wpjpqu, r=Dylan-DPCbors-41/+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-11Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPCDylan DPC-7/+0
Remove unused feature gates I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-11Run RustFmtjumbatm-23/+31
2020-02-11Box `decorate` to avoid code bloat.jumbatm-107/+119