about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2018-11-03Rename `as_bound_var` to `assert_bound_var`scalexm-2/+2
2018-11-03Fix doc commentscalexm-2/+2
2018-11-03Extend `ty::fold::RegionReplacer` to `ty::fold::BoundVarReplacer`scalexm-65/+135
Use the new `BoundVarReplacer` to perform canonical substitutions.
2018-11-03Rename `Binder::no_late_bound_regions` to `Binder::no_bound_vars`scalexm-7/+7
2018-11-03Remove `ReCanonical` in favor of `ReLateBound`scalexm-33/+37
2018-11-03Adjust bound tys indices in canonicalizationscalexm-1/+4
2018-11-03Rename `BoundTy` field `level` -> `index`scalexm-7/+7
2018-11-03Rename `BoundTyIndex` to `BoundVar`scalexm-7/+7
2018-11-03Shift both late bound regions and bound typesscalexm-77/+123
2018-11-03Move `BoundTy` to `ty::TyKind`scalexm-22/+72
2018-11-03Fixed unsoundness hole.Alexander Regueiro-1/+1
2018-11-03Extended elaboration for trait aliases to include arbitrary bounds.Alexander Regueiro-7/+7
2018-11-03Added support for trait aliases as bounds.Alexander Regueiro-7/+21
2018-11-02Auto merge of #55316 - RalfJung:retagging, r=oli-obkbors-3/+1
Add Retagging statements This adds a `Retag` statement kind to MIR, used to perform the retagging operation from [Stacked Borrows](https://www.ralfj.de/blog/2018/08/07/stacked-borrows.html). It also kills the old `Validate` statements that I added last year. NOTE: This includes https://github.com/rust-lang/rust/pull/55270. Only [these commits are new](https://github.com/RalfJung/rust/compare/stacked-borrows-ng...RalfJung:retagging).
2018-11-02Auto merge of #55305 - nikomatsakis:universes-refactor-3, r=scalexmbors-14/+10
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-13/+0
2018-10-31fix bug in NLL error reportingNiko Matsakis-1/+8
Account for incompatible universes and higher-ranked subtyping.
2018-10-30Rollup merge of #55472 - ljedrz:use_option_take, r=cramertjkennytm-2/+1
Use opt.take() instead of mem::replace(opt, None) It's easier to read.
2018-10-30Rollup merge of #55205 - ljedrz:faster_fxhashmap/set_population, r=estebankkennytm-3/+6
Improve a few cases of collecting to an FxHash(Map/Set) Either use `collect` or procure specified capacity when possible.
2018-10-29Rename other occs of (Code/File)Map to Source(Map/File) #51574David Lavati-5/+5
2018-10-29Use opt.take() instead of mem::replace(opt, None)ljedrz-2/+1
2018-10-29Improve a few cases of collecting to an FxHash(Map/Set)ljedrz-3/+6
2018-10-29Emit Retag statements, kill Validate statementsRalf Jung-3/+1
Also "rename" -Zmir-emit-validate to -Zmir-emit-retag, which is just a boolean (yes or no).
2018-10-27Auto merge of #54183 - qnighy:by-value-object-safety, r=oli-obkbors-2/+101
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/+2
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-27Auto merge of #55274 - ↵bors-2/+50
pnkfelix:issue-54570-proj-path-into-pats-with-type-take-2, r=nikomatsakis Handle bindings in substructure of patterns with type ascriptions This attempts to follow the outline described by @nikomatsakis [here](https://github.com/rust-lang/rust/issues/47184#issuecomment-420041056). Its a bit more complicated than expected for two reasons: 1. In general it handles sets of type ascriptions, because such ascriptions can be nested within patterns 2. It has a separate types in the HAIR, `PatternTypeProjections` and `PatternTypeProjection`, which are analogues to the corresponding types in the MIR. The main reason I added the new HAIR types was because I am worried that the current implementation is inefficent, and asymptotically so: It makes copies of vectors as it descends the patterns, even when those accumulated vectors are never used. Longer term, I would like to used a linked tree structure for the `PatternTypeProjections` and `PatternTypeProjection`, and save the construction of standalone vectors for the MIR types. I didn't want to block landing this on that hypoethetical revision; but I figured I could at least make the future change easier by differentiating between the two types now. Oh, one more thing: This doesn't attempt to handle `ref x` (in terms of ensuring that any necessary types are ascribed to `x` in that scenario as well). We should open an issue to investigate supporting that as well. But I didn't want to block this PR on that future work. Fix #54570
2018-10-26Further foundational stuff on `ProjectionKind` before I add it to ↵Felix S. Klock II-0/+30
`AscribeUserType`.
2018-10-26Add intern table for `List<ProjectionElem<'tcx, (), ()>>`.Felix S. Klock II-2/+20
Also added alias `ProjectionKind<'tcx>` for `ProjectionElem<'tcx, (), ()>`.
2018-10-26Auto merge of #54929 - csmoe:cfg_lint, r=petrochenkovbors-1/+1
Suggest to remove prefix `b` in cfg attribute lint string Closes #54926 r? @estebank
2018-10-26Auto merge of #55382 - kennytm:rollup, r=kennytmbors-1/+1
Rollup of 21 pull requests Successful merges: - #54816 (Don't try to promote already promoted out temporaries) - #54824 (Cleanup rustdoc tests with `@!has` and `@!matches`) - #54921 (Add line numbers option to rustdoc) - #55167 (Add a "cheap" mode for `compute_missing_ctors`.) - #55258 (Fix Rustdoc ICE when checking blanket impls) - #55264 (Compile the libstd we distribute with -Ccodegen-unit=1) - #55271 (Unimplement ExactSizeIterator for MIR traversing iterators) - #55292 (Macro diagnostics tweaks) - #55298 (Point at macro definition when no rules expect token) - #55301 (List allowed tokens after macro fragments) - #55302 (Extend the impl_stable_hash_for! macro for miri.) - #55325 (Fix link to macros chapter) - #55343 (rustbuild: fix remap-debuginfo when building a release) - #55346 (Shrink `Statement`.) - #55358 (Remove redundant clone (2)) - #55370 (Update mailmap for estebank) - #55375 (Typo fixes in configure_cmake comments) - #55378 (rustbuild: use configured linker to build boostrap) - #55379 (validity: assert that unions are non-empty) - #55383 (Use `SmallVec` for the queue in `coerce_unsized`.) - #55391 (bootstrap: clean up a few clippy findings)
2018-10-26Auto merge of #53821 - oli-obk:sanity_query, r=RalfJungbors-165/+44
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-26Remove redundant cloneShotaro Yamada-1/+1
2018-10-25Report const eval error inside the queryOliver Schneider-165/+44
2018-10-25Auto merge of #55347 - pietroalbini:rollup, r=pietroalbinibors-1/+1
Rollup of 22 pull requests Successful merges: - #53507 (Add doc for impl From for Waker) - #53931 (Gradually expanding libstd's keyword documentation) - #54965 (update tcp stream documentation) - #54977 (Accept `Option<Box<$t:ty>>` in macro argument) - #55138 (in which unused-parens suggestions heed what the user actually wrote) - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type) - #55200 (Documents `From` implementations for `Stdio`) - #55245 (submodules: update clippy from 5afdf8b7 to b1d03437) - #55247 (Clarified code example in char primitive doc) - #55251 (Fix a typo in the documentation of RangeInclusive) - #55253 (only issue "variant of the expected type" suggestion for enums) - #55254 (Correct trailing ellipsis in name_from_pat) - #55269 (fix typos in various places) - #55282 (Remove redundant clone) - #55285 (Do some copy editing on the release notes) - #55291 (Update stdsimd submodule) - #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs) - #55306 (Regression test for #54478.) - #55328 (Fix doc for new copysign functions) - #55340 (Operands no longer appear in places) - #55345 (Remove is_null) - #55348 (Update RELEASES.md after destabilization of non_modrs_mods) Failed merges: r? @ghost
2018-10-25Rollup merge of #55282 - sinkuu:redundant_clone, r=estebankPietro Albini-1/+1
Remove redundant clone
2018-10-25Auto merge of #55323 - nikomatsakis:nll-ICE-55219-and-55241, r=pnkfelixbors-6/+28
introduce type-op for user-type ascription in NLL Handle user-type ascription in a type operator, which gives us a lot more flexibility around the order in which we resolve things. r? @pnkfelix Fixes #55219 Fixes #55241
2018-10-24introduce (but do not use) `ascribe_user_type` goalNiko Matsakis-6/+28
Lots of annoying boilerplate.
2018-10-24Move codegen_llvm::common::ty_fn_sig into rustc::ty::Instance.Masaki Hara-1/+62
2018-10-24Add vtable-shim helper methods for Instance.Masaki Hara-0/+27
2018-10-24Add InstanceDef::VtableShim.Masaki Hara-1/+12
2018-10-24Minor doc improvementsVadim Petrochenkov-2/+6
2018-10-24Add `extern crate` items to extern preludeVadim Petrochenkov-4/+4
2018-10-23Remove redundant cloneShotaro Yamada-1/+1
2018-10-22convert user-provided signatures into def-idNiko Matsakis-16/+2
2018-10-22add a table to track user-provided signaturesNiko Matsakis-6/+31
2018-10-20Rename InferTy::CanonicalTy to BoundTy and add DebruijnIndex to variant typeFabian Drinck-7/+15
2018-10-20Rename CanonicalVar to BoundTyIndexFabian Drinck-6/+6
2018-10-20Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasperbors-2/+2
Prefer unwrap_or_else to unwrap_or in case of function calls/allocations The contents of `unwrap_or` are evaluated eagerly, so it's not a good pick in case of function calls and allocations. This PR also changes a few `unwrap_or`s with `unwrap_or_default`. An added bonus is that in some cases this change also reveals if the object it's called on is an `Option` or a `Result` (based on whether the closure takes an argument).
2018-10-20Auto merge of #55114 - oli-obk:fx#map, r=nikomatsakisbors-53/+38
Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hack
2018-10-20handle errors based on parse_sesscsmoe-1/+1