about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-11-14Auto merge of #66233 - cjgillot:constkind, r=oli-obkbors-109/+166
Split ConstValue into two enums Hello, Issue #59210 appeared abandoned, so I gave it a go. Some further cleanup and refactoring may be mandated. I did not test beyond `x.py check`, since my home computer dies compiling librustc. Fixes #59210
2019-11-13Retire BraceStructTypeFoldableImpl and TupleStructTypeFoldableImpl.Camille GILLOT-2/+1
2019-11-13Use TypeFoldable derive macro.Camille GILLOT-261/+40
2019-11-13Rollup merge of #66335 - Mark-Simulacrum:self-profile-to-data, ↵Yuki Okushi-5/+17
r=michaelwoerister Move self-profile infrastructure to data structures The single dependency on queries (QueryName) can be fairly easily abstracted via a trait and this further decouples Session from librustc (the primary goal). This is intended as a precursor to moving Session out of librustc, but since that involves lots of smaller steps that move around code I'm splitting it up into separate PRs.
2019-11-13Rollup merge of #66334 - Mark-Simulacrum:sess-cstore, r=petrochenkovYuki Okushi-0/+9
Move Session fields to CrateStore `allocator_kind` and `injected_panic_runtime` are both query-like, this moves them out of Session and into CrateStore, avoiding the `Once` they previously had by clearing separating initialization and de-initialization.
2019-11-12Centril review.Camille GILLOT-4/+1
2019-11-12Remove cruft.Camille GILLOT-5/+0
2019-11-12Refactor pretty_print_const.Camille GILLOT-18/+41
2019-11-12Create intermediate enum ty::ConstKind.Camille GILLOT-113/+155
2019-11-12Register queries with self profiler in rustc_interfaceMark Rousskov-1/+3
2019-11-12Move self-profile infrastructure to data structuresMark Rousskov-5/+15
The single dependency on queries (QueryName) can be fairly easily abstracted via a trait and this further decouples Session from librustc (the primary goal).
2019-11-13update suggestion ui testcsmoe-4/+3
2019-11-12Rollup merge of #66276 - Mark-Simulacrum:sess-code-stats, r=nikomatsakisYuki Okushi-7/+7
Move lock into CodeStats Prevent (theoretical) accidental too-long borrows by ensuring only encapsulated locking.
2019-11-11Move allocator_kind to CrateStoreMark Rousskov-0/+5
Similarly to the previous commit, there's no need for this to be in Session and have a Once around it.
2019-11-11Move injected_panic_runtime to CrateStoreMark Rousskov-0/+4
This was essentially a "query" previously (with no key, just always run once when resolving the crate dependencies), and remains so, just now in a way that isn't on Session. This removes the need for the `Once` as well.
2019-11-11suggest to add a constraint except asyn-fn without explicit outputcsmoe-3/+5
2019-11-10Move lock into CodeStatsMark Rousskov-7/+7
Prevent accidental too-long borrows by ensuring only encapsulated locking.
2019-11-10Merge hir::GeneratorMovability into ast::Movability.Camille GILLOT-6/+5
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-31/+31
2019-11-10Rollup merge of #65831 - matthewjasper:array-ptr-cast, r=oli-obkYuki Okushi-0/+3
Don't cast directly from &[T; N] to *const T Split out from #64588 r? @oli-obk
2019-11-09Rollup merge of #65994 - estebank:where-bound, r=nikomatsakisMazdak Farrokhzad-12/+89
Point at where clauses where the associated item was restricted CC #57663. r? @nikomatsakis
2019-11-08Stop returning promotables from `mir_const_qualif`Dylan MacKenzie-1/+0
2019-11-08Rollup merge of #66190 - eddyb:primflt, r=CentrilYuki Okushi-8/+9
rustc_target: inline abi::FloatTy into abi::Primitive. This effectively undoes a small part of @oli-obk's #50967, now that the rest of the compiler doesn't use the `FloatTy` definition from `rustc_target`, post-#65884.
2019-11-07rustc_target: inline abi::FloatTy into abi::Primitive.Eduard-Mihai Burtescu-8/+9
2019-11-07Rollup merge of #63793 - oli-obk:🧹, r=dtolnayMazdak Farrokhzad-0/+3
Have tidy ensure that we document all `unsafe` blocks in libcore cc @rust-lang/libs I documented a few and added ignore flags on the other files. We can incrementally document the files, but won't regress any files this way.
2019-11-07Rollup merge of #65884 - Centril:non-hardcoded-abis, r=petrochenkovMazdak Farrokhzad-24/+17
syntax: ABI-oblivious grammar This PR has the following effects: 1. `extern $lit` is now legal where `$lit:literal` and `$lit` is substituted for a string literal. 2. `extern "abi_that_does_not_exist"` is now *syntactically* legal whereas before, the set of ABI strings was hard-coded into the grammar of the language. With this PR, the set of ABIs are instead validated and translated during lowering. That seems more appropriate. 3. `ast::FloatTy` is now distinct from `rustc_target::abi::FloatTy`. The former is used substantially more and the translation between them is only necessary in a single place. 4. As a result of 2-3, libsyntax no longer depends on librustc_target, which should improve pipe-lining somewhat. cc @rust-lang/lang -- the points 1-2 slightly change the definition of the language but in a way which seems consistent with our general principles (in particular wrt. the discussions of turning things into semantic errors). I expect this to be uncontroversial but it's worth letting y'all know. :) r? @varkor
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-24/+17
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-06review commentsEsteban Küber-11/+4
2019-11-06Rebase falloutOliver Scherer-0/+3
2019-11-06Rollup merge of #66139 - euclio:pluralize, r=nagisaMazdak Farrokhzad-7/+7
use American spelling for `pluralize!`
2019-11-06Rollup merge of #66086 - RalfJung:smallvec, r=nagisaMazdak Farrokhzad-5/+5
bump smallvec to 1.0 This includes https://github.com/servo/rust-smallvec/pull/162, fixing an unsoundness in smallvec. See https://github.com/servo/rust-smallvec/pull/175 for the 1.0 release announcement. Cc @mbrubeck @emilio
2019-11-06Rollup merge of #65776 - nnethercote:rename-LocalInternedString-and-more, ↵Mazdak Farrokhzad-1/+1
r=estebank Rename `LocalInternedString` and more This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses. r? @estebank
2019-11-06Rollup merge of #66027 - Mark-Simulacrum:panic-handler-query, r=alexcrichtonMazdak Farrokhzad-0/+5
Move has_panic_handler to query Moves us off of a global Once instead re-querying the lang item each time. The conditions on when we set it to true change a little (previously we'd make sure a few more lang items were `Some`) but I think they in practice don't matter, we won't compile later on if we don't have them.
2019-11-06Rollup merge of #66014 - dkadashev:47319-type-param-def-location, r=estebankMazdak Farrokhzad-3/+18
Show type parameter name and definition in type mismatch error messages Fixes #47319 r? estebank
2019-11-05use American spelling for `pluralize!`Andy Russell-7/+7
2019-11-05Rollup merge of #66025 - petrochenkov:lohi, r=eddybPietro Albini-5/+0
`Span` cannot represent `span.hi < span.lo` So we can remove the corresponding checks from various code
2019-11-05Rollup merge of #66012 - nnethercote:dequery-trivial_dropck_outlives, ↵Pietro Albini-1/+0
r=michaelwoerister De-querify `trivial_dropck_outlives`. It's sufficiently simple and fast that memoizing it is a slight pessimization. r? @michaelwoerister
2019-11-04bump smallvec to 1.0Ralf Jung-5/+5
2019-11-04Avoid hashing the key twice in `get_query()`.Nicholas Nethercote-3/+13
For a single-threaded parallel compiler, this reduces instruction counts across several benchmarks, by up to 2.8%. The commit also adds documentation about `Sharded`'s use of `FxHasher`.
2019-11-03rustc: rename {Fn,Arg}TypeExt to {Fn,Arg}AbiExt.Eduard-Mihai Burtescu-3/+3
2019-11-03rustc_target: rename {Fn,Arg}Type to {Fn,Arg}Abi.Eduard-Mihai Burtescu-12/+12
2019-11-02Prettify mismatched types error message in a special caseDmitry Kadashev-12/+12
Type parameters are referenced in the error message after the previous few commits (using span label). But when the main error message already references the very same type parameter it becomes clumsy. Do not show the additional label in this case as per code review comment by @estebank. Also this contains a small style fix.
2019-11-02Show type param definitions in type mismatch errorsDmitry Kadashev-2/+17
Fixes #47319. Shows the type parameter definition(s) on type mismatch errors so the context is clearer. Pretty much changes the following: ``` LL | bar1(t); | ^ | | | expected enum `std::option::Option`, found type parameter `T` ``` into: ``` LL | fn foo1<T>(t: T) { | - this type parameter LL | bar1(t); | ^ | | | expected enum `std::option::Option`, found type parameter `T` ```
2019-11-02Add type parameter name to type mismatch error messagesDmitry Kadashev-1/+1
Part of #47319. This just adds type parameter name to type mismatch error message, so e.g. the following: ``` expected enum `std::option::Option`, found type parameter ``` becomes ``` expected enum `std::option::Option`, found type parameter `T` ```
2019-11-01Move has_panic_handler to queryMark Rousskov-0/+5
2019-11-02Convert `x.as_str().to_string()` to `x.to_string()` where possible.Nicholas Nethercote-1/+1
2019-11-01`Span` cannot represent `span.hi < span.lo`Vadim Petrochenkov-5/+0
So we can remove the corresponding checks from various code
2019-11-01Rollup merge of #66018 - pnkfelix:issue-64872-revert-64324, r=alexcrichtonTyler Mandry-1/+7
Revert PR 64324: dylibs export generics again (for now) As discussed on PR #65781, this is a targeted attempt to undo the main semantic change from PR #64324, by putting `dylib` back in the set of crate types that export generic symbols. The main reason to do this is that PR #64324 had unanticipated side-effects that caused bugs like #64872, and in the opinion of @alexcrichton and myself, the impact of #64872 is worse than #64319. In other words, it is better for us, in the short term, to reopen #64319 as currently unfixed for now than to introduce new bugs like #64872. Fix #64872 Reopen #64319
2019-11-01targeted revert of PR rust-lang/rust#64324 (just undo change to dylib ↵Felix S. Klock II-1/+7
generics export). Includes the anticipated fallout to run-make-fulldeps test suite from this change. (We need to reopen issue 64319 as part of landing this.)
2019-11-01De-querify `trivial_dropck_outlives`.Nicholas Nethercote-1/+0
It's sufficiently simple and fast that memoizing it is a slight pessimization.