summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-02-22partially revert 904a0bde93f0348f69914ee90b1f8b6e4e0d7cbcNiko Matsakis-1/+19
This preserves the error you currently get on stable for the old-lub-glb-object.rs test.
2019-02-22update test files to reflect new outputNiko Matsakis-0/+12
One surprise: old-lub-glb-object.rs, may indicate a bug
2019-02-22restore the actual leak-checkNiko Matsakis-14/+193
2019-02-22introduce a dummy leak check and invoke it in all the right placesNiko Matsakis-39/+105
This set of diffs was produced by combing through b68fad670bb3612cac26e50751e4fd9150e59977 and seeing where the `leak_check` used to be invoked and how.
2019-02-22reintroduce `commit_if_ok` calls to `subtype_predicate`Niko Matsakis-14/+16
2019-02-22reintroduce `commit_if_ok` call into `higher_ranked_sub`Niko Matsakis-20/+27
2019-02-22s/skol_/placeholder_/Niko Matsakis-10/+10
2019-02-22make generalization code create new variables in correct universeNiko Matsakis-21/+64
In our type inference system, when we "generalize" a type T to become a suitable value for a type variable V, we sometimes wind up creating new inference variables. So, for example, if we are making V be some subtype of `&'X u32`, then we might instantiate V with `&'Y u32`. This generalized type is then related `&'Y u32 <: &'X u32`, resulting in a region constriant `'Y: 'X`. Previously, however, we were making these fresh variables like `'Y` in the "current universe", but they should be created in the universe of V. Moreover, we sometimes cheat in an invariant context and avoid creating fresh variables if we know the result must be equal -- we can only do that when the universes work out.
2019-02-22Fix #57979 by allowing a legitimate type error to take precedence over an ICE.Felix S. Klock II-1/+10
2019-02-17Make `intern_lazy_const` actually intern its argument.Nicholas Nethercote-17/+19
Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
2019-01-24Fix typo bug in DepGraph::try_mark_green().Michael Woerister-1/+1
2019-01-14Rollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkovMazdak Farrokhzad-1/+1
Unaccept `extern_in_paths` Based on completed fcp-close in https://github.com/rust-lang/rust/issues/55600, this removes `extern_in_path` (e.g. `extern::foo::bar`) from the language. The changes are primarily reversing https://github.com/rust-lang/rust/commit/32db83b16e06cb5cca72d0e6a648a8008eda0fac. Closes https://github.com/rust-lang/rust/issues/55600 r? @petrochenkov
2019-01-14Rollup merge of #57570 - Xanewok:querify-some, r=ZoxcMazdak Farrokhzad-4/+0
Querify local `plugin_registrar_fn` and `proc_macro_decls_static` Instead of calculating them as part of the `Session`, we do that in the query system. It's also nice that these queries are already defined for external crates - here, we provide the queries for the local crate. r? @nikomatsakis
2019-01-14Rollup merge of #57480 - Zoxc:query-fix, r=michaelwoeristerMazdak Farrokhzad-20/+21
Clean up and fix a bug in query plumbing r? @michaelwoerister
2019-01-14Rollup merge of #57477 - euclio:clarify-lev-suggestion, r=zackmdavisMazdak Farrokhzad-1/+2
clarify resolve typo suggestion Include the kind of the binding that we're suggesting, and use a structured suggestion. Fixes #53445.
2019-01-14Rollup merge of #57232 - Zoxc:par-collector-misc, r=michaelwoeristerMazdak Farrokhzad-44/+57
Parallelize and optimize parts of HIR map creation r? @michaelwoerister
2019-01-14Auto merge of #57387 - euclio:nonstandard-style-suggestions, r=oli-obkbors-9/+9
Use structured suggestions for nonstandard style lints This PR modifies the lints in the nonstandard_style group to use structured suggestions. Note that there's a bit of tricky span calculation going on for the `crate_name` attribute. It also simplifies the code a bit: I don't think the "fallback" suggestions for these lints can actually be triggered. Fixes #48103. Fixes #52414.
2019-01-14Parallelize and optimize parts of HIR map creationJohn Kåre Alsaker-44/+57
2019-01-13Suggest removal of semicolon when appropriateEsteban Küber-2/+15
2019-01-13Tweak output of type mismatch between "then" and `else` `if` armsEsteban Küber-5/+12
2019-01-13Querify local plugin_registrar_fnIgor Matuszewski-2/+0
2019-01-13Querify local proc_macro_decls_staticIgor Matuszewski-2/+0
2019-01-13Auto merge of #57580 - Centril:rollup, r=Centrilbors-50/+84
Rollup of 4 pull requests Successful merges: - #56874 (Simplify foreign type rendering.) - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics) - #57366 (Point at match discriminant on type error in match arm pattern) - #57538 (librustc_mir: Fix ICE with slice patterns) Failed merges: - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms) r? @ghost
2019-01-13Rollup merge of #57366 - estebank:point-match-discrim, r=varkorMazdak Farrokhzad-4/+17
Point at match discriminant on type error in match arm pattern ``` error[E0308]: mismatched types --> src/main.rs:5:9 | 4 | let temp: usize = match a + b { | ----- this expression has type `usize` 5 | Ok(num) => num, | ^^^^^^^ expected usize, found enum `std::result::Result` | = note: expected type `usize` found type `std::result::Result<_, _>` ``` Fix #57279.
2019-01-13Rollup merge of #57113 - Zoxc:query-perf10, r=michaelwoeristerMazdak Farrokhzad-46/+67
Move diagnostics out from QueryJob and optimize for the case with no diagnostics r? @michaelwoerister
2019-01-13Auto merge of #51487 - Zoxc:incr-passes, r=michaelwoeristerbors-13/+193
Make more passes incremental r? @michaelwoerister
2019-01-13Auto merge of #57567 - Centril:stabilize-transpose, r=alexregbors-1/+0
Stabilize `transpose_result` in 1.33 fixes https://github.com/rust-lang/rust/issues/47338. FCP completed: https://github.com/rust-lang/rust/issues/47338#issuecomment-453762236 r? @alexreg
2019-01-13remove extern_in_paths.Mazdak Farrokhzad-1/+1
2019-01-13stabilize transpose_result in 1.33Mazdak Farrokhzad-1/+0
2019-01-13Rollup merge of #57547 - Xanewok:ptr-eq, r=petrochenkovMazdak Farrokhzad-10/+7
Use `ptr::eq` where applicable Stumbled upon a few of `A as *const _ as usize == B as *const as usize`, so I decided to follow the programming boy scout rule (:smile:) and replaced the pattern with more widely used `ptr::eq`.
2019-01-13Rollup merge of #57494 - dotdash:expand, r=nikomatsakisMazdak Farrokhzad-8/+23
Speed up item_bodies for large match statements involving regions These changes don't change anything about the complexity of the algorithms, but use some easy shortcuts or modifications to cut down some overhead. The first change, which incrementally removes the constraints from the set we're iterating over probably introduces some overhead for small to medium sized constraint sets, but it's not big enough for me to observe it in any project I tested against (not that many though). Though most other crates probably won't improve much at all, because huge matches aren't that common, the changes seemed simple enough for me to make them. Ref #55528 cc unicode-rs/unicode-normalization#29 r? @nikomatsakis
2019-01-12Don't add label to the match expr when the type is not fully realizedEsteban Küber-1/+3
2019-01-12Reword label as per review commentEsteban Küber-1/+1
2019-01-12Point at the match discriminant when arm pattern has a type mismatchEsteban Küber-4/+15
2019-01-12Auto merge of #56759 - petrochenkov:prestabuni, r=nikomatsakisbors-1/+1
Stabilize `uniform_paths` Address all the things described in https://github.com/rust-lang/rust/issues/56417. Assign visibilities to `macro_rules` items - `pub` to `macro_export`-ed macros and `pub(crate)` to non-exported macros, these visibilities determine how far these macros can be reexported with `use`. Prohibit use of reexported inert attributes and "tool modules", after renaming (e.g. `use inline as imported_inline`) their respective tools and even compiler passes won't be able to recognize and properly check them. Also turn use of uniform paths in 2015 macros into an error, I'd prefer to neither remove nor stabilize them right away because I still want to make some experiments in this area (uniform path fallback was added to 2015 macros used on 2018 edition in https://github.com/rust-lang/rust/pull/56053#issuecomment-441405140). UPDATE: The last commit also stabilizes the feature `uniform_paths`. Closes https://github.com/rust-lang/rust/issues/53130 Closes https://github.com/rust-lang/rust/issues/55618 Closes https://github.com/rust-lang/rust/issues/56326 Closes https://github.com/rust-lang/rust/issues/56398 Closes https://github.com/rust-lang/rust/issues/56417 Closes https://github.com/rust-lang/rust/issues/56821 Closes https://github.com/rust-lang/rust/issues/57252 Closes https://github.com/rust-lang/rust/issues/57422
2019-01-12Use `ptr::eq` where applicableIgor Matuszewski-10/+7
2019-01-12resolve: Prohibit use of imported non-macro attributesVadim Petrochenkov-1/+1
2019-01-12Rollup merge of #57535 - varkor:stabilise-if-while-let-patterns, r=CentrilMazdak Farrokhzad-1/+1
Stabilise irrefutable if-let and while-let patterns This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495). This replaces https://github.com/rust-lang/rust/pull/55639, as we want to stabilise this in time for the beta cut-off. Closes https://github.com/rust-lang/rust/pull/55639. r? @Centril
2019-01-12Rollup merge of #57434 - nnethercote:rm-CrateNum-Invalid, r=petrochenkovMazdak Farrokhzad-4/+0
Remove `CrateNum::Invalid`. It's unused.
2019-01-12Rollup merge of #57042 - ↵Mazdak Farrokhzad-1/+5
pnkfelix:issue-57038-sidestep-ice-in-fieldplacement-count, r=michaelwoerister Don't call `FieldPlacement::count` when count is too large Sidestep ICE in `FieldPlacement::count` by not calling it when count will not fit in host's usize. (I briefly played with trying to fix this by changing `FieldPlacement::count` to return a `u64`. However, based on how `FieldPlacement` is used, it seems like this would be a largely pointless pursuit... I'm open to counter-arguments, however.) Fix #57038
2019-01-12Rollup merge of #56906 - blitzerr:master, r=nikomatsakisMazdak Farrokhzad-0/+11
Issue #56905 Adding a map to TypeckTables to get the list of all the Upvars given a closureID. This is help us get rid of the recurring pattern in the codebase of iterating over the free vars using with_freevars.
2019-01-12Stabilise irrefutable if-let and while-let patternsvarkor-1/+1
This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495). Co-Authored-By: Sebastian Malton <sebastian@malton.name>
2019-01-11Auto merge of #57355 - arielb1:correct-subst, r=nikomatsakisbors-9/+24
use the correct supertrait substitution in `object_ty_for_trait` beta-nominating because regression. Fixes #57156.
2019-01-11Address commentsJohn Kåre Alsaker-22/+16
2019-01-11Make more passes incrementalJohn Kåre Alsaker-13/+199
2019-01-10Add a fast path for identical regions in lub_concrete_regionsBjörn Steinbrink-0/+7
In functions with lots of region constraint, if the fixed point iteration converges only slowly, a lot of the var/var constraints will have equal regions most of the time. Yet, we still perform the LUB calculation and try to intern the result. Especially the latter incurs quite some overhead. This reduces the take taken by the item bodies checking pass for the unicode_normalization crate by about 75%.
2019-01-10Drop "solved" constraints during region expansionBjörn Steinbrink-8/+16
Once a region has been expanded to cover a fixed region, a corresponding RegSubVar constraint won't have any effect on the expansion anymore, the same is true for constraints where the variable on the RHS has already reached static scope. By removing those constraints from the set that we're iterating over, we remove a lot of needless overhead in case of slow convergences (i.e. lots of iterations). For the unicode_normalization crate, this about cuts the time required for item_bodies checking in half.
2019-01-09Clean up and fix a bug in query plumbingJohn Kåre Alsaker-20/+21
2019-01-09clarify resolve typo suggestionAndy Russell-1/+2
Include the kind of the binding that we're suggesting, and use a structured suggestion.
2019-01-09Auto merge of #56614 - Zoxc:query-perf2, r=michaelwoeristerbors-19/+28
Replace LockCell with atomic types Split from https://github.com/rust-lang/rust/pull/56509 r? @michaelwoerister