about summary refs log tree commit diff
path: root/src/librustc/ich
AgeCommit message (Collapse)AuthorLines
2018-10-29Emit Retag statements, kill Validate statementsRalf Jung-20/+3
Also "rename" -Zmir-emit-validate to -Zmir-emit-retag, which is just a boolean (yes or no).
2018-10-28remove some unused CTFE error variantsRalf Jung-42/+0
2018-10-27Auto merge of #54183 - qnighy:by-value-object-safety, r=oli-obkbors-0/+3
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-27extend query response to potentially contain fresh universesNiko Matsakis-0/+1
The idea here is that an incoming query may refer to some universes, and they query response may contain fresh universes that go beyond those. When we instantiate the query response in the caller's scope, therefore, we map those new universes into fresh universes for the caller.
2018-10-27allow canonicalized regions to carry universe and track max-universeNiko Matsakis-2/+2
But.. we don't really use it for anything right now.
2018-10-26Add the actual chain of projections to `UserTypeProjection`.Felix S. Klock II-1/+1
Update the existing NLL `patterns.rs` test accordingly. includes changes addressing review feedback: * Added example to docs for `UserTypeProjections` illustrating how we build up multiple projections when descending into a pattern with type ascriptions. * Adapted niko's suggested docs for `UserTypeProjection`. * Factored out `projection_ty` from more general `projection_ty_core` (as a drive-by, made its callback an `FnMut`, as I discovered later that I need that). * Add note to docs that `PlaceTy.field_ty(..)` does not normalize its result. * Normalize as we project out `field_ty`.
2018-10-26Checkpoint: Added abstraction over collection of projections into user type.Felix S. Klock II-0/+1
I did not think I would need this in the MIR, but in general local decls are going to need to support this. (That, or we need to be able define a least-upper-bound for a collection of types encountered via the pattern compilation.)
2018-10-26Added `mir::UserTypeProjection`, a stub for a structure that projects *into* ↵Felix S. Klock II-0/+2
a given UserTypeAnnotation. (That is, it will pull out some component type held or referenced by the type annotation.) Note: this still needs to actually do projection itself. That comes in a later commit
2018-10-26Auto merge of #53821 - oli-obk:sanity_query, r=RalfJungbors-8/+4
Report const eval error inside the query Functional changes: We no longer warn about bad constants embedded in unused types. This relied on being able to report just a warning, not a hard error on that case, which we cannot do any more now that error reporting is consistently centralized. r? @RalfJung fixes #53561
2018-10-26dump refs for path segments in save-analysisNick Cameron-0/+1
Requires adding path segments to the hir map
2018-10-26Store a resolved def on hir::PathSegmentNick Cameron-0/+1
2018-10-25Don't extend `hir::Def` when there's already a dedicated "function-like" ↵Oliver Schneider-1/+0
detector
2018-10-25Report const eval error inside the queryOliver Schneider-8/+5
2018-10-24Add InstanceDef::VtableShim.Masaki Hara-0/+3
2018-10-23Remove redundant cloneShotaro Yamada-1/+1
2018-10-21Auto merge of #52984 - fabric-and-ink:remove-canonical-var, r=scalexmbors-2/+2
Replace CanonicalVar with DebruijnIndex Close #49887
2018-10-20Use more accurate `ConstraintCategory`sMatthew Jasper-0/+2
Adds UseAsConst and UseAsStatic to replace Return in consts/statics. Don't report the arguments to an overloaded operator as CallArguments. Also don't report "escaping data" in these items.
2018-10-20Rename InferTy::CanonicalTy to BoundTy and add DebruijnIndex to variant typeFabian Drinck-1/+1
2018-10-20Rename CanonicalVar to BoundTyIndexFabian Drinck-1/+1
2018-10-20Auto merge of #55114 - oli-obk:fx#map, r=nikomatsakisbors-2/+2
Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hack
2018-10-19Auto merge of #55162 - nikomatsakis:issue-54902-underscore-bound, r=tmandrybors-4/+8
handle underscore bounds in unexpected places Per the discussion on #54902, I made it a hard error to use lifetime bounds in various places where they used to be permitted: - `where Foo: Bar<'_>` for example I also moved error reporting to HIR lowering and added `Error` variants to let us suppress downstream errors that result. I (imo) improved the error message wording to be clearer, as well. In the process, I fixed the ICE in #52098. Fixes #54902 Fixes #52098
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-2/+2
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-2/+2
2018-10-19replace `UserTypeAnnotation::AdtDef` with `TypeOf`Niko Matsakis-4/+0
2018-10-19convert `FnDef` to `TypeOf`, which is more generalNiko Matsakis-1/+1
2018-10-17move E0637 to lowering and improve output, add more testsNiko Matsakis-4/+8
2018-10-17Re-use memory in `program_clauses_for_env`scalexm-3/+0
2018-10-17Categorize chalk clausesscalexm-1/+7
2018-10-17Use `Environment` instead of `ty::ParamEnv` in chalk contextscalexm-0/+8
2018-10-15introduce a more expressive `UserSubsts`Niko Matsakis-0/+5
2018-10-15introduce `FnDef` and `AdtDef` to `UserTypeAnnotation`Niko Matsakis-0/+8
2018-10-15introduce a `UserTypeAnnotation` enumNiko Matsakis-0/+13
2018-10-15rename `QueryResult` to `QueryResponse`Niko Matsakis-1/+1
`Result` really sounds like the rustc result type
2018-10-13Auto merge of #54945 - estebank:asm-span, r=petrochenkovbors-1/+2
Point to variable in `asm!` macro when failing borrowck Fix #34940.
2018-10-10Rollup merge of #54909 - scalexm:finish-rules, r=nikomatsakisManish Goregaokar-1/+1
Fixes #47311. r? @nrc
2018-10-10miri engine: basic support for pointer provenance trackingRalf Jung-23/+33
2018-10-09Point to variable in `asm!` macro when failing borrowckEsteban Küber-1/+2
2018-10-09Auto merge of #54762 - RalfJung:miri-validate, r=oli-obkbors-0/+4
Prepare miri engine for enforcing validity invariant during execution In particular, make recursive checking of references optional, and add a `const_mode` parameter that says whether `usize` is allowed to contain a pointer. Also refactor validation a bit to be type-driven at the "leafs" (primitive types), and separately validate scalar layout to catch `NonNull` violations (which it did not properly validate before). Fixes https://github.com/rust-lang/rust/issues/53826 Also fixes https://github.com/rust-lang/rust/issues/54751 r? @oli-obk
2018-10-09miri engine: also check return type before calling functionRalf Jung-0/+4
2018-10-09Auto merge of #54798 - matthewjasper:free-region-closure-errors, r=nikomatsakisbors-1/+17
[NLL] Improve closure region bound errors Previously, we would report free region errors that originate from closure with the span of the closure and a "closure body requires ..." message. This is now updated to use a reason and span from inside the closure.
2018-10-08Pass around interned refs to goals and not goalsscalexm-1/+1
2018-10-07Auto merge of #54782 - pnkfelix:issue-54556-semi-on-tail-diagnostic, ↵bors-0/+1
r=nikomatsakis NLL: temps in block tail expression diagnostic This change adds a diagnostic that explains when temporaries in a block tail expression live longer than block local variables that they borrow, and attempts to suggest turning the tail expresion into a statement (either by adding a semicolon at the end, when its result value is clearly unused, or by introducing a `let`-binding for the result value and then returning that). Fix #54556
2018-10-06Move ConstraintCategory to rustc::mirMatthew Jasper-1/+17
Allows us to use the category of outlive requirements inside a closure when reporting free region errors caused by its closure bounds.
2018-10-05Auto merge of #54741 - oli-obk:impl_trait_hierarchy, r=cramertjbors-0/+1
Nest the `impl Trait` existential item inside the return type fixes #54045 r? @cramertj
2018-10-05Add flag to `mir::LocalDecl` to track whether its a temp from some subexpr a ↵Felix S. Klock II-0/+1
block tail expression. Slightly refactored the `LocalDecl` construction API in the process.
2018-10-05resolve: Integrate inert attributes registererd by legacy plugins into macro ↵Vadim Petrochenkov-0/+1
resolution
2018-10-04Auto merge of #54649 - nikomatsakis:universes-refactor-1, r=scalexmbors-1/+1
adopt "placeholders" to represent universally quantified regions This does a few preliminary refactorings that lay some groundwork for moving towards universe integration. Two things, primarily: - Rename from "skolemized" to "placeholder" - When instantiating `for<'a, 'b, 'c>`, just create one universe for all 3 regions, and distinguish them from one another using the `BoundRegion`. - This is more accurate, and I think that in general we'll be moving towards a model of separating "binder" (universe, debruijn index) from "index within binder" in a number of places. - In principle, it feels the current setup of making lots of universes could lead to us doing the wrong thing, but I've actually not been able to come up with an example where this is so. r? @scalexm cc @arielb1
2018-10-04Auto merge of #54666 - matthewjasper:mir-function-spans, r=pnkfelixbors-1/+3
[NLL] Improve "borrow later used here" messages * In the case of two conflicting borrows, the later used message says which borrow it's referring to * If the later use is a function call (from the users point of view) say that the later use is for the call. Point just to the function. r? @pnkfelix Closes #48643
2018-10-04rename skolemized to placeholderNiko Matsakis-1/+1
2018-10-04Rollup merge of #54789 - scalexm:unnormalized, r=nikomatsakisPietro Albini-2/+2
Introduce `TyKind::UnnormalizedProjection` Introduce a new variant used for lazy normalization in chalk integration. Mostly `bug!` everywhere. r? @nikomatsakis