about summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2019-10-21Use `Symbol` for codegen unit names.Nicholas Nethercote-3/+2
This is a straightforward replacement except for two places where we have to convert to `LocalInternedString` to get a stable sort.
2019-10-21Change `SymbolName::name` from `InternedString` to `Symbol`.Nicholas Nethercote-6/+19
This requires changing the `PartialOrd`/`Ord` implementations to look at the chars rather than the symbol index.
2019-10-21Convert fields within `DefPathData` from `InternedString` to `Symbol`.Nicholas Nethercote-6/+6
It's a full conversion, except in `DefKey::compute_stable_hash()` where a `Symbol` now is converted to an `InternedString` before being hashed. This was necessary to avoid test failures.
2019-10-21Remove unnecessary `Hash` bounds from various types.Nicholas Nethercote-4/+4
2019-10-21Remove unnecessary trait bounds from `keys::Keys`.Nicholas Nethercote-7/+2
2019-10-21Convert some `InternedString`s to `Symbols`.Nicholas Nethercote-29/+29
This avoids the needs for various conversions, and makes the code slightly faster, because `Symbol` comparisons and hashing is faster.
2019-10-20Fix resolve_type_vars_with_obligations not resolving const inferenceben-0/+3
variables.
2019-10-18Rollup merge of #65535 - eddyb:sliced-predicates, r=nikomatsakisTyler Mandry-45/+28
rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole struct. While rebasing #59789 I noticed we can do this now. However, it doesn't help much without changing `inferred_outlives_of` to the same type, which I might try next.
2019-10-18rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole ↵Eduard-Mihai Burtescu-45/+28
struct.
2019-10-17Create lint store during plugin registrationMark Rousskov-0/+4
Remove lint store from Session
2019-10-17Auto merge of #65495 - Centril:rollup-tguwjt5, r=Centrilbors-1/+1
Rollup of 8 pull requests Successful merges: - #65237 (Move debug_map assertions after check for err) - #65316 (make File::try_clone produce non-inheritable handles on Windows) - #65319 (InterpCx: make memory field public) - #65461 (Don't recommend ONCE_INIT in std::sync::Once) - #65465 (Move syntax::ext to a syntax_expand and refactor some attribute logic) - #65475 (add example for type_name) - #65478 (fmt::Write is about string slices, not byte slices) - #65486 (doc: fix typo in OsStrExt and OsStringExt) Failed merges: r? @ghost
2019-10-17Auto merge of #64595 - Mark-Simulacrum:trivial-query, r=pnkfelixbors-0/+1
Optimize dropck This does two things: caches the `trivial_dropck` check by making it a query, and shifts around the implementation of the primary dropck itself to avoid allocating many small vectors.
2019-10-16move syntax::ext to new crate syntax_expandMazdak Farrokhzad-1/+1
2019-10-15Rollup merge of #65444 - spastorino:as-ref-for-list, r=Mark-SimulacrumTyler Mandry-0/+7
Implement AsRef<[T]> for List<T> r? @Mark-Simulacrum
2019-10-15Rollup merge of #65389 - ecstatic-morse:zero-sized-array-no-drop, r=eddybTyler Mandry-0/+3
Return `false` from `needs_drop` for all zero-sized arrays. Resolves #65348. This changes the result of the `needs_drop` query from `true` to `false` for types such as `[Box<i32>; 0]`. I believe this change to be sound because a zero-sized array can never actually hold a value. This is an elegant way of resolving #65348 and #64945, but obviously it has much broader implications.
2019-10-15Rollup merge of #65293 - tmandry:turbo-expander, r=matthewjasperTyler Mandry-4/+17
Optimize `try_expand_impl_trait_type` A lot of time was being spent expanding some large `impl Future` types in fuchsia. This PR takes the number of types being visited in one expansion from >3 billion to about a thousand, and eliminates the compile time regression in https://github.com/rust-lang/rust/issues/65147 (in fact, compile times are better than they were before). Thanks to @Mark-Simulacrum for helping identify the issue and to @matthewjasper for suggesting this change. Fixes #65147. r? @matthewjasper,@nikomatsakis
2019-10-15Rollup merge of #64623 - matthewjasper:underscore-imports, r=petrochenkovTyler Mandry-1/+1
Remove last uses of gensyms Underscore bindings now use unique `SyntaxContext`s to avoid collisions. This was the last use of gensyms in the compiler, so this PR also removes them. closes #49300 cc #60869 r? @petrochenkov
2019-10-15Remove some mentions of gensymsMatthew Jasper-1/+1
2019-10-15Implement AsRef<[T]> for List<T>Santiago Pastorino-0/+7
2019-10-14Rollup merge of #65170 - petrochenkov:cload, r=eddybTyler Mandry-3/+8
rustc_metadata: Privatize private code and remove dead code Also some minor cleanup and documentation improvements. r? @eddyb
2019-10-14Only expand types that contain projectionsTyler Mandry-1/+3
2019-10-14Add expanded type cache to OpaqueTypeExpanderTyler Mandry-3/+14
2019-10-14Auto merge of #64987 - oli-obk:code_reuse_prevents_bugs, r=eddybbors-3/+7
Compute the layout of uninhabited structs fixes #64506 r? @eddyb
2019-10-14rustc_metadata: Remove resolutions for extern crate items from `CStore`Vadim Petrochenkov-3/+8
Use a more traditional scheme with providing them as a resolver output
2019-10-13Return `false` from `needs_drop` for all zero-sized arraysDylan MacKenzie-0/+3
2019-10-13Auto merge of #65182 - anp:reify-shim, r=eddybbors-1/+42
Add `Instance::resolve_for_fn_ptr` (RFC 2091 #2/N) Supercedes: https://github.com/rust-lang/rust/pull/65082 Depends on: https://github.com/rust-lang/rust/pull/65037 Tracking issue: https://github.com/rust-lang/rust/issues/47809 [RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md) steps taken: * [x] add a `ReifyShim` that is similar to `VirtualShim` in behavior (see #54183) * [x] add `ty::Instance::resolve_for_fn_ptr` (leave `ty::Instance::resolve_vtable` alone), migrate appropriate callers * [x] `resolve_for_fn_ptr` returns the shim if calling a `#[track_caller]` function
2019-10-12Make trivial dropck outlives a queryMark Rousskov-0/+1
This allows caching some recursive types and getting to an error much more quickly.
2019-10-11Rollup merge of #65263 - mbStavola:dedup-raw-item-fns, r=CentrilTyler Mandry-21/+12
Deduplicate is_{freeze,copy,sized}_raw Fixes #65259 Deduplicates `is_{freeze,copy,sized}_raw` by delegating to a new method which takes in a `LangItem`.
2019-10-11Rollup merge of #64986 - skinny121:fn-ptr-const-generics, r=varkorTyler Mandry-139/+137
Function pointers as const generic arguments Makes function pointers as const generic arguments usable. Fixes #62395 r? @varkor
2019-10-11resolve_for_fn_ptr checks that the instance is an Item before returning shim.Adam Perry-10/+12
2019-10-11Change untagged_unions to not allow union fields with dropUlrik Sverdrup-0/+2
Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in ManuallyDrop. The stable rule remains, that union fields must be Copy. We use the new rule for the `untagged_union` feature. See RFC 2514. Note for ui tests: We can't test move out through Box's deref-move since we can't have a Box in a union anymore.
2019-10-10Instance::resolve_for_fn_ptr unconditionally resolves first.Adam Perry-9/+13
Per review feedback.
2019-10-10Improve docs for InstanceDef::ReifyShim.Adam Perry-1/+4
2019-10-09Qualify LangItemMatt Stavola-1/+1
2019-10-09Delegate is_{freeze,copy,sized}_raw to is_item_rawMatt Stavola-21/+12
2019-10-09Clarify comment, dedupe match arms in shim.rs.Adam Perry-1/+3
Also add a missing terminal newline to a test.
2019-10-09Return ReifyShim from Instance::resolve_for_fn_ptr when track_caller present.Adam Perry-2/+2
This ICEs in MIR currently, which I think is to be expected since none of the MIR plumbing is set up. I added a test which confirms that the shim is being used for reifying a track_caller function.
2019-10-09Reifying callers of Instance::resolve use resolve_for_fn_ptr.Adam Perry-6/+3
2019-10-09Add Instance::resolve_for_fn_ptrAdam Perry-1/+23
2019-10-09Add InstanceDef::ReifyShim for track_caller functions.Adam Perry-1/+12
2019-10-10Pretty print raw pointers in consts as '{pointer}'.ben-0/+1
2019-10-09Refactor a nested `if` to a `match`Oliver Scherer-11/+7
2019-10-08Rollup merge of #65081 - Mark-Simulacrum:remove-profile-queries, ↵Mazdak Farrokhzad-50/+1
r=michaelwoerister Remove -Zprofile-queries r? @michaelwoerister Per [zulip thread](https://zulip-archive.rust-lang.org/131828tcompiler/57361RemoveZprofilequeries.html).
2019-10-09Refactor pretty print const to use a big match statementben-121/+104
2019-10-09Pretty print function pointer const values.ben-11/+15
2019-10-09Fix calling function pointer const parameters. Also fixes inference ofben-28/+38
function pointer const parameters.
2019-10-08Rollup merge of #65176 - nnethercote:rm-query-macros, r=michaelwoeristerMazdak Farrokhzad-32/+13
Remove query-related macros The query system has a few macros that only have one or two call sites, and I find they hurt readability. This PR removes them. r? @michaelwoerister
2019-10-08Rollup merge of #65162 - Mark-Simulacrum:no-cache-loading-map, ↵Mazdak Farrokhzad-8/+0
r=michaelwoerister Remove loaded_from_cache map from DepGraph It's now unused, even with -Zquery-dep-graph From https://github.com/rust-lang/rust/pull/63756/files#r316039379 -- it'll simplify that PR to get this landed separately so we can just remove some of the code that it touches. r? @Zoxc or @michaelwoerister
2019-10-08Auto merge of #64949 - nnethercote:avoid-SmallVec-collect, r=zackmdavisbors-12/+73
Avoid `SmallVec::collect` We can get sizeable speed-ups by avoiding `SmallVec::collect` when the number of elements is small.
2019-10-08Rollup merge of #65181 - nikomatsakis:lazy-norm-anon-const-push-1, r=varkorMazdak Farrokhzad-11/+24
fix bug in folding for constants These was a bug in the folding for constants that caused it to overlook bound regions. This branch includes some other little things that I did while trying to track the bug down. r? @oli-obk