about summary refs log tree commit diff
path: root/src/librustc/ty/structural_impls.rs
AgeCommit message (Collapse)AuthorLines
2018-11-03Move `BoundTy` to `ty::TyKind`scalexm-6/+26
2018-11-02Auto merge of #55305 - nikomatsakis:universes-refactor-3, r=scalexmbors-2/+0
universes refactor 3 Some more refactorings from my universe branch. These are getting a bit more "invasive" -- they start to plumb the universe information through the canonicalization process. As of yet though I don't **believe** this branch changes our behavior in any notable way, though I'm marking the branch as `WIP` to give myself a chance to verify this. r? @scalexm
2018-10-31kill old-style-lub warningsNiko Matsakis-2/+0
2018-10-27Auto merge of #54183 - qnighy:by-value-object-safety, r=oli-obkbors-1/+4
Implement by-value object safety This PR implements **by-value object safety**, which is part of unsized rvalues #48055. That means, with `#![feature(unsized_locals)]`, you can call a method `fn foo(self, ...)` on trait objects. One aim of this is to enable `Box<FnOnce>` in the near future. The difficulty here is this: when constructing a vtable for a trait `Foo`, we can't just put the function `<T as Foo>::foo` into the table. If `T` is no larger than `usize`, `self` is usually passed directly. However, as the caller of the vtable doesn't know the concrete `Self` type, we want a variant of `<T as Foo>::foo` where `self` is always passed by reference. Therefore, when the compiler encounters such a method to be generated as a vtable entry, it produces a newly introduced instance called `InstanceDef::VtableShim(def_id)` (that wraps the original instance). the shim just derefs the receiver and calls the original method. We give different symbol names for the shims by appending `::{{vtable-shim}}` to the symbol path (and also adding vtable-shimness as an ingredient to the symbol hash). r? @eddyb
2018-10-26Further foundational stuff on `ProjectionKind` before I add it to ↵Felix S. Klock II-0/+12
`AscribeUserType`.
2018-10-25Report const eval error inside the queryOliver Schneider-159/+1
2018-10-24Add InstanceDef::VtableShim.Masaki Hara-1/+4
2018-10-15make `UniverseIndex` hashable, rename "sub-" to "superuniverse"Niko Matsakis-0/+1
The only name was silly. U1 can contain everything from U0 *plus* more things.
2018-10-09miri engine: also check return type before calling functionRalf Jung-0/+4
2018-10-05Auto merge of #54743 - ljedrz:cleanup_ty_p2, r=zackmdavisbors-20/+13
Cleanup rustc/ty part 2 The second part of cleanups and minor improvements for rustc/ty. - improve allocations - calculate span after a possible early continue - simplify some patterns - mark a comment as FIXME - whitespace fixes The PR is independent from from the first part.
2018-10-03Introduce `TyKind::UnnormalizedProjection`scalexm-1/+6
2018-10-03rustc/ty: simplify some patternsljedrz-13/+7
2018-10-03rustc/ty: whitespace fixesljedrz-7/+6
2018-09-24Shrink StatementKind::InlineAsm.Nicholas Nethercote-0/+10
This shrinks StatementKind from 64 bytes to 48 bytes on 64-bit.
2018-09-10generalize `AscribeUserType` to handle sub or super typeNiko Matsakis-0/+1
2018-09-08Auto merge of #53903 - GabrielMajeri:opt-miri-array-slice, r=oli-obkbors-1/+1
Optimize miri checking of integer array/slices This pull request implements the optimization described in #53845 (the `E-easy` part of that issue, not the refactoring). Instead of checking every element of an integral array, we can check the whole memory range at once. r? @RalfJung
2018-09-08Optimize miri checking of integer array/slicesGabriel Majeri-1/+1
Instead of checking every element, we can check the whole memory range at once.
2018-09-05Changing TyAnon -> TyOpaque and relevant functionsms2300-2/+2
2018-08-29re-do argument passing one more time to finally be saneRalf Jung-1/+3
2018-08-29Auto merge of #53659 - nnethercote:rm-AccumulateVec, r=Mark-Simulacrumbors-4/+4
Remove `AccumulateVec` and its uses. It's basically just a less capable version of `SmallVec`. FWIW, the only use of `ArrayVec` is now within `HybridIdxSet`. r? @Mark-Simulacrum
2018-08-29Remove `AccumulateVec` and its uses.Nicholas Nethercote-4/+4
It's basically just a less capable version of `SmallVec`.
2018-08-28address nitsRalf Jung-1/+1
2018-08-27Miri Memory WorkRalf Jung-2/+2
* Unify the two maps in memory to store the allocation and its kind together. * Share the handling of statics between CTFE and miri: The miri engine always uses "lazy" `AllocType::Static` when encountering a static. Acessing that static invokes CTFE (no matter the machine). The machine only has any influence when writing to a static, which CTFE outright rejects (but miri makes a copy-on-write). * Add an `AllocId` to by-ref consts so miri can use them as operands without making copies. * Move responsibilities around for the `eval_fn_call` machine hook: The hook just has to find the MIR (or entirely take care of everything); pushing the new stack frame is taken care of by the miri engine. * Expose the intrinsics and lang items implemented by CTFE so miri does not have to reimplement them.
2018-08-22Auto merge of #52011 - ↵bors-1/+5
oli-obk:dont_you_hate_it_too_when_everything_panics_constantly, r=eddyb Allow panicking with string literal messages inside constants r? @eddyb cc https://github.com/rust-lang/rust/issues/51999 we can't implement things like `panic!("foo: {}", x)` right now because we can't call trait methods (most notably `Display::fmt`) inside constants. Also most of these impls probably have loops and conditions, so it's messy anyway. But hey `panic!("foo")` works at least. cc @japaric got any test ideas for `#![no_std]`?
2018-08-22Allow panicking with string literal messages inside constantsOliver Schneider-1/+5
2018-08-22Remove Ty prefix from Ty{Bool|Char|Int|Uint|Float|Str}varkor-4/+4
2018-08-22Remove Ty prefix from Ty{Foreign|Param}varkor-2/+2
2018-08-22Remove Ty prefix from ↵varkor-36/+36
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-22Rename ty::Slice to ty::Listvarkor-3/+3
2018-07-21Convert implied_outlives_bounds to a queryTyler Mandry-0/+1
2018-07-04Add an `InfiniteLoop` variant to `EvalErrorKind`Dylan MacKenzie-0/+1
2018-06-30Added miri error for evaluating foreign statics.Alexander Regueiro-0/+1
Updated tests accordingly.
2018-06-28Merge `ConstVal` and `ConstValue`Oliver Schneider-7/+11
2018-06-28Move everything over from `middle::const_val` to `mir::interpret`Oliver Schneider-1/+1
2018-06-28Move the Lrc outside the error type and name the fieldsOliver Schneider-4/+4
2018-06-28Address review commentsOliver Schneider-1/+1
2018-06-28Eliminate old CTFE's `ErrKind`Oliver Schneider-17/+5
2018-06-05Remove another unused error variantOliver Schneider-1/+0
2018-06-05Remove unused IndexOutOfBounds variantOliver Schneider-2/+0
2018-06-05Properly report transitive errorsOliver Schneider-7/+2
2018-05-08Insert fields from TypeAndMut into TyRef to allow layout optimizationJohn Kåre Alsaker-3/+3
2018-05-08Store the GeneratorInterior in the new GeneratorSubstsJohn Kåre Alsaker-11/+10
2018-05-08Store generator movability outside GeneratorInteriorJohn Kåre Alsaker-5/+9
2018-04-30Unify MIR assert messages and const eval errorsOliver Schneider-6/+17
2018-04-30Merge ConstMathError into EvalErrorKindOliver Schneider-2/+4
2018-04-30Remove unused const error variantOliver Schneider-1/+0
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-1/+1
2018-04-24Make Binder's field private and clean up its usageTyler Mandry-3/+3
2018-04-13Don't abort const eval due to long running evals, just warnOliver Schneider-1/+0
2018-03-29Auto merge of #49313 - sgrif:sg-revert-stuff, r=nikomatsakisbors-24/+2
Remove universes from `ty::ParamEnv` This change was never meant to land. #48407 takes an alternate approach. However, that PR is now blocked on some issues with canonicalization, and rebasing these reverts gets harder each time, so let's just get this bit out of the way now. r? @nikomatsakis