about summary refs log tree commit diff
path: root/src/librustc/ty/structural_impls.rs
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1082/+0
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-1/+1
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-23Remove `ReClosureBound`Matthew Jasper-2/+0
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2
2020-02-22Make return value of `check_generic_arg_count` semantically clearervarkor-6/+0
2020-02-22Refactor `create_substs_for_generic_args` a littlevarkor-6/+1
2020-02-13Constness -> enum Const { Yes(Span), No }Mazdak Farrokhzad-2/+2
Same idea for `Unsafety` & use new span for better diagnostics.
2020-02-07Auto merge of #65232 - nikomatsakis:lazy-norm-anon-const-push-2, r=matthewjasperbors-1/+1
replace the leak check with universes, take 2 This PR is an attempt to revive the "universe-based region check", which is an important step towards lazy normalization. Unlike before, we also modify the definition of `'empty` so that it is indexed by a universe. This sidesteps some of the surprising effects we saw before -- at the core, we no longer think that `exists<'a> { forall<'b> { 'b: 'a } }` is solveable. The new region lattice looks like this: ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` This PR has three effects: * It changes a fair number of error messages, I think for the better. * It fixes a number of bugs. The old algorithm was too conservative and caused us to reject legal subtypings. * It also causes two regressions (things that used to compile, but now do not). * `coherence-subtyping.rs` gets an additional error. This is expected. * `issue-57639.rs` regresses as before, for the reasons covered in #57639. Both of the regressions stem from the same underlying property: without the leak check, the instantaneous "subtype" check is not able to tell whether higher-ranked subtyping will succeed or not. In both cases, we might be able to fix the problem by doing a 'leak-check like change' at some later point (e.g., as part of coherence). This is a draft PR because: * I didn't finish ripping out the leak-check completely. * We might want to consider a crater run before landing this. * We might want some kind of design meeting to cover the overall strategy. * I just remembered I never finished 100% integrating this into the canonicalization code. * I should also review what happens in NLL region checking -- it probably still has a notion of bottom (empty set). r? @matthewjasper
2020-02-06index ReEmpty by universeNiko Matsakis-1/+1
We now make `'empty` indexed by a universe index, resulting in a region lattice like this: ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` Therefore, `exists<A> { forall<B> { B: A } }` is now unprovable, because A must be at least Empty(U1) and B is placeholder(U2), and hence the two regions are unrelated.
2020-02-02Add a resume type param to the generator substsJonas Schievink-2/+2
...and unify it with `()` for now
2020-01-26Auto merge of #68031 - Marwes:fold_list, r=estebankbors-17/+35
perf: Avoid creating a SmallVec if nothing changes during a fold Not sure if this helps but in theory it should be less work than what the current micro optimization does for `ty::Predicate` lists. (It would explain the overhead I am seeing from `perf`.)
2020-01-20Add `constness` field to `ty::Predicate::Trait`Dylan MacKenzie-2/+10
2020-01-13Explain fold_listMarkus Westerlind-0/+5
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-3/+3
2020-01-09Fix copy_from_slice which should be extend_from_sliceMarkus Westerlind-1/+1
2020-01-09Remove unused `struct ClosureUpvar`Shotaro Yamada-6/+0
2020-01-08perf: Avoid creating a SmallVec if nothing changes during a foldMarkus Westerlind-17/+30
Not sure if this helps but in theory it should be less work than what the current micro optimization does for `ty::Predicate` lists. (It would explain the overhead I am seeing from `perf`.)
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-10/+9
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-2/+2
2019-12-22Format the worldMark Rousskov-275/+150
2019-11-30rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.Eduard-Mihai Burtescu-2/+6
2019-11-29allow customising ty::TraitRef's printing behaviorMikhail Babenko-4/+1
fix clippy allow customising ty::TraitRef's printing behavior fix clippy stylistic fix
2019-11-21Aggregation of drive-by cosmetic changes.Alexander Regueiro-1/+2
2019-11-21reduce size of hir::ExprKindMazdak Farrokhzad-1/+1
2019-11-18Retire BraceStructLiftImpl.Camille GILLOT-23/+1
2019-11-17Auto merge of #66384 - cjgillot:typefoldable, r=Zoxcbors-190/+0
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-13Use TypeFoldable derive macro.Camille GILLOT-190/+0
2019-11-12Create intermediate enum ty::ConstKind.Camille GILLOT-14/+12
2019-10-23Auto merge of #57545 - bovinebuddha:object_safe_for_dispatch, r=nikomatsakisbors-0/+2
Object safe for dispatch cc #43561
2019-10-22RFC 2027: "first draft" of implementationMathias Blikstad-0/+2
These are a squashed series of commits.
2019-10-21Rename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`varkor-9/+5
2019-10-18rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole ↵Eduard-Mihai Burtescu-6/+0
struct.
2019-10-09Add InstanceDef::ReifyShim for track_caller functions.Adam Perry-1/+4
2019-10-08Auto merge of #64949 - nnethercote:avoid-SmallVec-collect, r=zackmdavisbors-2/+15
Avoid `SmallVec::collect` We can get sizeable speed-ups by avoiding `SmallVec::collect` when the number of elements is small.
2019-10-01Avoid `SmallVec::collect()` in `List<Predicate>::super_fold_with()`.Nicholas Nethercote-2/+15
Also avoid interning when it's not necessary. This commit reduces instruction counts for a couple of benchmarks by up to 1%.
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-1/+1
2019-09-25Rename surviving uses of `sty`varkor-4/+4
2019-09-25Rename `sty` to `kind`varkor-3/+3
2019-09-02Emit error on intrinsic to fn ptr castsMark Rousskov-0/+2
2019-08-02CTFE: simplify Value type by not checking for alignmentRalf Jung-2/+2
2019-07-02implement `TypeFoldable` for `Arc`Niko Matsakis-0/+10
2019-07-02rename to "member constraints"Niko Matsakis-1/+1
2019-07-02implement Lift for ArcNiko Matsakis-0/+8
2019-07-02[WIP] fix `Lift` impl for `Rc`Niko Matsakis-1/+1
2019-07-02propagate the pick-constraints through queriesNiko Matsakis-0/+7
2019-06-26Don't use lift to detect local typesJohn Kåre Alsaker-0/+7
2019-06-22Rollup merge of #61984 - ljedrz:more_node_id_pruning, r=ZoxcMazdak Farrokhzad-1/+1
More NodeId pruning Just another round of the `HirId`ification initiative. r? @Zoxc
2019-06-20rename hir::map::name_by_hir_id to ::nameljedrz-1/+1
2019-06-19Change `ByRef` to a struct variant to clarify its fields via namesOliver Scherer-2/+3
2019-06-19Remove the `AllocId` from `ByRef` valuesOliver Scherer-1/+1
`ByRef` const values have no identity beyond their value, we should not treat them as having identity. The `AllocId` often differed between equal constants, because of the way that the miri-engine evaluates constants.