about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2018-10-20Auto merge of #55007 - davidtwco:issue-39175, r=petrochenkovbors-10/+64
Help suggests non-existent package std::os::ext::process::CommandExt Fixes #39175.
2018-10-19Only suggest paths that exist.David Wood-10/+64
In order to output a path that could actually be imported (valid and visible), we need to handle re-exports correctly. For example, take `std::os::unix::process::CommandExt`, this trait is actually defined at `std::sys::unix::ext::process::CommandExt` (at time of writing). `std::os::unix` rexports the contents of `std::sys::unix::ext`. `std::sys` is private so the "true" path to `CommandExt` isn't accessible. In this case, the visible parent map will look something like this: (child) -> (parent) `std::sys::unix::ext::process::CommandExt` -> `std::sys::unix::ext::process` `std::sys::unix::ext::process` -> `std::sys::unix::ext` `std::sys::unix::ext` -> `std::os` This is correct, as the visible parent of `std::sys::unix::ext` is in fact `std::os`. When printing the path to `CommandExt` and looking at the current segment that corresponds to `std::sys::unix::ext`, we would normally print `ext` and then go to the parent - resulting in a mangled path like `std::os::ext::process::CommandExt`. Instead, we must detect that there was a re-export and instead print `unix` (which is the name `std::sys::unix::ext` was re-exported as in `std::os`).
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-45/+30
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-29/+29
2018-10-19Auto merge of #55194 - kennytm:rollup, r=kennytmbors-0/+2
Rollup of 7 pull requests Successful merges: - #54300 (Updated RELEASES.md for 1.30.0) - #55013 ([NLL] Propagate bounds from generators) - #55071 (Fix ICE and report a human readable error) - #55144 (Cleanup resolve) - #55166 (Don't warn about parentheses on `match (return)`) - #55169 (Add a `copysign` function to f32 and f64) - #55178 (Stabilize slice::chunks_exact(), chunks_exact_mut(), rchunks(), rchunks_mut(), rchunks_exact(), rchunks_exact_mut())
2018-10-19Rollup merge of #55071 - oli-obk:const_cast_🍨, r=RalfJungkennytm-0/+2
Fix ICE and report a human readable error fixes #55063 r? @RalfJung
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-2/+2
2018-10-19Auto merge of #55040 - scalexm:param-env, r=nikomatsakisbors-3/+24
Replace `ParamEnv` with a new type in chalk context. I left a few FIXMEs. r? @nikomatsakis
2018-10-18Rollup merge of #55016 - oli-obk:vtables💥_vtables_everywhere, r=RalfJungkennytm-8/+8
Deduplicate some code and compile-time values around vtables r? @RalfJung
2018-10-17Add `FromEnv` for input types in the environmentscalexm-3/+3
2018-10-17Implement the `environment` queryscalexm-0/+1
2018-10-17Use `Environment` instead of `ty::ParamEnv` in chalk contextscalexm-3/+23
2018-10-17Auto merge of #54671 - petrochenkov:extpre2015, r=nikomatsakisbors-3/+5
resolve: Scale back hard-coded extern prelude additions on 2015 edition https://github.com/rust-lang/rust/pull/54404 stabilized `feature(extern_prelude)` on 2015 edition, including the hard-coded parts not passed with `--extern`. First of all, I'd want to confirm that this is intended stabilization, rather than a part of the "extended beta" scheme that's going to be reverted before releasing stable. (EDIT: to clarify - this is a question, I'm \*asking\* for confirmation, rather than give it.) Second, on 2015 edition extern prelude is not so fundamentally tied to imports and is a mere convenience, so this PR scales them back to the uncontroversial subset. The "uncontroversial subset" means that if libcore is injected it brings `core` into prelude, if libstd is injected it brings `std` and `core` into prelude. On 2015 edition this can be implemented through the library prelude (rather than hard-coding in the compiler) right now, I'll do it in a follow-up PR. UPDATE: The change is done for both 2015 and 2018 editions now as discussed below. Closes https://github.com/rust-lang/rust/issues/53166
2018-10-16Auto merge of #55093 - nikomatsakis:nll-issue-54574-multisegment-path, ↵bors-31/+99
r=pnkfelix nll type annotations in multisegment path This turned out to be sort of tricky. The problem is that if you have a path like ``` <Foo<&'static u32>>::bar ``` and it comes from an impl like `impl<T> Foo<T>` then the self-type the user gave doesn't *directly* map to the substitutions that the impl wants. To handle this, then, we have to preserve not just the "user-given substs" we used to do, but also a "user-given self-ty", which we have to apply later. This PR makes those changes. It also removes the code from NLL relate-ops that handled canonical variables and moves to use normal inference variables instead. This simplifies a few things and gives us a bit more flexibility (for example, I predict we are going to have to start normalizing at some point, and it would be easy now). r? @matthewjasper -- you were just touching this code, do you feel comfortable reviewing this? Fixes #54574
2018-10-16fix commentNiko Matsakis-1/+1
2018-10-16Auto merge of #55067 - ljedrz:generic_iterator_related_improvements, ↵bors-1/+1
r=petrochenkov A few iterator-related improvements - typeck: don't collect into a vector when unnecessary - create only one vector when winnowing candidates - change a cloning map to `into_iter`
2018-10-15introduce a more expressive `UserSubsts`Niko Matsakis-31/+99
2018-10-15Uplift some comments to doc commentsOliver Scherer-8/+8
2018-10-15remove the sub/super terminology for universesNiko Matsakis-18/+22
Instead, we talk about: - creating the "next" universe - universes "extending" one another - and `u1.can_name(u2)`, meaning that `u1` contains all names from `u2`
2018-10-15convert `UniverseIndex` into a `newtype_index!`Niko Matsakis-38/+7
2018-10-15make `UniverseIndex` hashable, rename "sub-" to "superuniverse"Niko Matsakis-15/+18
The only name was silly. U1 can contain everything from U0 *plus* more things.
2018-10-15rename `QueryResult` to `QueryResponse`Niko Matsakis-10/+10
`Result` really sounds like the rustc result type
2018-10-14Auto merge of #55032 - oli-obk:the_early_unwrap_gets_the_panic, ↵bors-14/+11
r=Mark-Simulacrum Check the invariant for `principal` inside the method r? @Mark-Simulacrum
2018-10-14Fix ICE and report a human readable errorOliver Scherer-0/+2
2018-10-14change a cloning map to into_iterljedrz-1/+1
2018-10-13Copy extern prelude from resolver to global contextVadim Petrochenkov-3/+5
2018-10-13Check the invariant for `principal` inside the methodOliver Scherer-14/+11
2018-10-12Rollup merge of #54958 - RalfJung:static-assert, r=oli-obkkennytm-5/+2
add a macro for static (compile-time) assertions Cc @oli-obk
2018-10-10Rollup merge of #54909 - scalexm:finish-rules, r=nikomatsakisManish Goregaokar-13/+21
Fixes #47311. r? @nrc
2018-10-10add a macro for static assertionsRalf Jung-5/+2
2018-10-09miri engine: also check return type before calling functionRalf Jung-0/+4
2018-10-08Compute flags for `ty::UnnormalizedProjection`scalexm-1/+4
2018-10-08Pass around interned refs to goals and not goalsscalexm-12/+17
2018-10-07Auto merge of #54835 - ↵bors-1/+1
oli-obk:mögen_konstante_funktionen_doch_bitte_endlich_stabil_sein, r=Centril Stabilize `min_const_fn` tracking issue: #53555 r? @Centril
2018-10-06Auto merge of #54859 - pietroalbini:rollup, r=pietroalbinibors-389/+391
Rollup of 11 pull requests Successful merges: - #54078 (Expand the documentation for the `std::sync` module) - #54717 (Cleanup rustc/ty part 1) - #54781 (Add examples to `TyKind::FnDef` and `TyKind::FnPtr` docs) - #54787 (Only warn about unused `mut` in user-written code) - #54804 (add suggestion for inverted function parameters) - #54812 (Regression test for #32382.) - #54833 (make `Parser::parse_foreign_item()` return a foreign item or error) - #54834 (rustdoc: overflow:auto doesn't work nicely on small screens) - #54838 (Fix typo in src/libsyntax/parse/parser.rs) - #54851 (Fix a regression in 1.30 by reverting #53564) - #54853 (Remove unneccessary error from test, revealing NLL error.) Failed merges: r? @ghost
2018-10-05Rollup merge of #54781 - phansch:master, r=varkorPietro Albini-1/+16
Add examples to `TyKind::FnDef` and `TyKind::FnPtr` docs This adds two examples to the docs of `TyKind::FnDef` and `TyKind::FnPtr`. I found these two types a bit confusing when I learned about them and I think adding these examples might help others.
2018-10-05Rollup merge of #54717 - ljedrz:cleanup_ty_p1, r=davidtwcoPietro Albini-388/+375
Cleanup rustc/ty part 1 Part 2 will follow soon; I wouldn't want these changes to rot too quickly. - improve stack shifting and remove related allocations - move a faster early return up - improve allocations - use Cow<str> where applicable - simplify common patterns - whitespace fixes
2018-10-05Auto merge of #54743 - ljedrz:cleanup_ty_p2, r=zackmdavisbors-178/+146
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-05Stabilize `min_const_fn`Oliver Schneider-1/+1
2018-10-05Auto merge of #54703 - davidtwco:issue-52086, r=nikomatsakisbors-1/+37
error message when trying to move from an Rc or Arc is ungreat Fixes #52086. r? @nikomatsakis
2018-10-05rustc/ty: improve stack shifting and remove related allocationsljedrz-10/+10
2018-10-05rustc/ty: move a faster early return upljedrz-5/+5
2018-10-05rustc/ty: improve allocationsljedrz-38/+32
2018-10-05rustc/ty: simplify common patternsljedrz-41/+25
2018-10-05rustc/ty: use Cow<str> where applicableljedrz-248/+261
2018-10-05rustc/ty: whitespace fixesljedrz-46/+42
2018-10-04Further improve docs for `FnDef` and `FnPtr`Philipp Hansch-8/+6
2018-10-04remove occurences of `skolemization`Niko Matsakis-15/+13
2018-10-04remove all occurences of `skolemize`Niko Matsakis-1/+1
2018-10-04extend NLL universe code to have >1 placeholder within one universeNiko Matsakis-2/+14