1365 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
45f27643db prepare moving HardwiredLints to rustc_session 2020-01-11 03:26:16 +01:00
Mazdak Farrokhzad
7dbccf5b55 buffered lint infra -> rustc_session 2020-01-11 03:21:34 +01:00
Yuki Okushi
7ae0618e0a
Rollup merge of #68050 - Centril:canon-error, r=Mark-Simulacrum
Canonicalize rustc_error imports

r? @Mark-Simulacrum
2020-01-11 04:50:53 +09:00
Mazdak Farrokhzad
8bd3d240e3 nix syntax::errors & prefer rustc_errors over errors 2020-01-10 07:41:30 +01:00
Mazdak Farrokhzad
d5598aa7a0 Introduce #![feature(half_open_range_patterns)].
This feature adds `X..`, `..X`, and `..=X` patterns.
2020-01-10 07:29:04 +01:00
Yuki Okushi
a366aa6249
Rollup merge of #68040 - sinkuu:unused, r=petrochenkov
Cleanup
2020-01-10 04:18:42 +09:00
John Kåre Alsaker
5427601e9e Change -Z time event naming scheme and make them generic activities 2020-01-09 07:06:40 +01:00
Shotaro Yamada
f443ae68c2 Remove unused dependencies 2020-01-09 11:52:03 +09:00
Mazdak Farrokhzad
0997388b87 normalize rustc::hir::intravisit imports 2020-01-08 22:09:42 +01:00
Mazdak Farrokhzad
8351667091 intravisit: abstract over HIR Map 2020-01-08 22:01:07 +01:00
Camille GILLOT
700ac84eae Rename traits::drop -> traits::misc. 2020-01-07 19:36:50 +01:00
Camille GILLOT
f629baf96c Move magic traits queries to rustc::traits::drop. 2020-01-07 18:14:32 +01:00
Yuki Okushi
b065031096
Rollup merge of #67936 - euclio:assoc-type-bad-style, r=Centril
fire "non_camel_case_types" for associated types

Fixes #67920.
2020-01-07 13:46:13 +09:00
Andy Russell
a7727c59ac
fire "non_camel_case_types" for associated types 2020-01-06 09:51:23 -05:00
Mazdak Farrokhzad
ebfd8673a7 Remove rustc_hir reexports in rustc::hir. 2020-01-05 12:49:22 +01:00
Mazdak Farrokhzad
62ac10ffde simplify reexports in rustc::hir 2020-01-05 12:47:11 +01:00
John Kåre Alsaker
5a485ce4a3 Use self profile infrastructure for -Z time and -Z time-passes 2020-01-05 02:57:14 +01:00
Mazdak Farrokhzad
2f64ab6633 {HirId,ItemLocal}{Map,Set} -> rustc::hir & nix rustc::nodemap 2020-01-04 19:01:42 +01:00
Mazdak Farrokhzad
7901c7f707 canonicalize FxHash{Map,Set} imports 2020-01-04 18:57:22 +01:00
bors
79cf5e4fe2 Auto merge of #67788 - cjgillot:delint-day, r=Zoxc
Move early and late lint mechanisms to librustc_lint.

As requested, split from #67737

r? @Zoxc
2020-01-04 09:32:29 +00:00
Mazdak Farrokhzad
b32dc91372
Rollup merge of #67810 - crlf0710:uncommon_codepoints_lint, r=Manishearth
Implement uncommon_codepoints lint.

Part of #55467 .  The checks of `$crate` and `{{root}}` are very unfortunate. But i'm not sure where they belongs to.
2020-01-04 02:19:52 +01:00
Charles Lew
485e98aae2 Implement uncommon_codepoints lint. 2020-01-03 08:20:12 +08:00
Mazdak Farrokhzad
b1aad76586 Normalize syntax::edition imports. 2020-01-02 19:31:38 +01:00
Mazdak Farrokhzad
4ff12ce4c1 Normalize syntax::symbol imports. 2020-01-02 13:57:04 +01:00
Mazdak Farrokhzad
75e4783f63 Normalize syntax::source_map imports. 2020-01-02 13:57:04 +01:00
Camille GILLOT
1fab03e908 Move lint levels machanism in librustc_lint. 2020-01-01 13:20:33 +01:00
Camille GILLOT
96180ff655 Move late lint machanism in librustc_lint. 2020-01-01 13:20:18 +01:00
Camille GILLOT
3a350e1a39 Move early lint machanism in librustc_lint. 2020-01-01 13:16:43 +01:00
Vadim Petrochenkov
70f1d57048 Rename syntax_pos to rustc_span in source code 2020-01-01 09:15:18 +03:00
Mazdak Farrokhzad
52179c56be librustc_ast_lowering: fix misc fallout. 2019-12-31 17:56:25 +01:00
bors
bf2d145c62 Auto merge of #67032 - cjgillot:hirene, r=Zoxc
Allocate HIR on an arena 4/4

This is the fourth and last PR in the series started by #66931, #66936 and #66942.

The last commits should compile on their own.
The difference with the previous PR is given by https://github.com/cjgillot/rust/compare/hirene-ty...hirene

A few more cleanups may be necessary, please tell me.

r? @eddyb like the other
cc @Zoxc
2019-12-31 03:27:36 +00:00
Vadim Petrochenkov
b9a9c5b4fd Make things build again 2019-12-30 19:18:16 +03:00
Camille GILLOT
aa3678d4f4 Remove HirVec from Generics. 2019-12-30 11:29:29 +01:00
bors
2ba0d2acbd Auto merge of #66942 - cjgillot:hirene-ty, r=Zoxc
Allocate HIR on an arena 3/4 -- Ty

This is the third PR in the series started by #66931 and #66936

Once again, commits don't really make sense on their own.
They are mostly split by type of compile error.

The additional diff is here: https://github.com/cjgillot/rust/compare/hirene-expr...hirene-ty
2019-12-29 22:51:02 +00:00
Vadim Petrochenkov
3d57b8bcc0 doc comments: Less attribute mimicking 2019-12-28 12:33:18 +03:00
Camille GILLOT
36f95ab3fa Fallout in other crates. 2019-12-27 19:20:28 +01:00
Camille GILLOT
66f9198047 Use Arena inside hir::TraitMethod. 2019-12-27 19:20:28 +01:00
Simon Sapin
1c572a2d6e Stabilize the matches! macro
Fixes https://github.com/rust-lang/rust/issues/65721

FCP: https://github.com/rust-lang/rust/issues/65721#issuecomment-569118119
2019-12-27 14:07:16 +01:00
Camille GILLOT
8284035372 Fallout in other crates. 2019-12-26 23:38:46 +01:00
bors
ed33453a37 Auto merge of #67524 - LukasKalbertodt:improve-into-iter-lint, r=matthewjasper
Generalize `array_into_iter` lint to also lint for boxed arrays

`Box` is special in that a method call on a box can move the value out
of the box. Thus, the same backwards-compatibility problem can arise
for boxed arrays as for simple arrays.

---

CC #66145
r? @matthewjasper  (as you reviewed the first PR)
2019-12-25 10:20:48 +00:00
Lukas Kalbertodt
f934b836ce
Generalize array_into_iter lint to also lint for boxed arrays
`Box` is special in that a method call on a box can move the value out
of the box. Thus, the same backwards-compatibility problem can arise
for boxed arrays as for simple arrays.
2019-12-24 18:30:04 +01:00
Mazdak Farrokhzad
41647613b1
Rollup merge of #67538 - varkor:lhs-assign-diagnostics, r=Centril
Improve diagnostics for invalid assignment

- Improve wording and span information for invalid assignment diagnostics.
- Link to https://github.com/rust-lang/rfcs/issues/372 when it appears the user is trying a destructuring assignment.
- Make the equality constraint in `where` clauses error consistent with the invalid assignment error.
2019-12-23 15:16:29 +01:00
Mazdak Farrokhzad
dd7f49301e is_range_literal: fix fallout 2019-12-23 13:11:10 +01:00
varkor
35979a92bf Add span information to ExprKind::Assign 2019-12-23 11:20:13 +00:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Mazdak Farrokhzad
97bee3a793
Rollup merge of #66877 - skinny121:const-eval-entry-points, r=oli-obk
Add simpler entry points to const eval for common usages.

I found the `tcx.const_eval` API to be complex/awkward to work with, because of the inherent complexity from all of the different situations it is called from. Though it mainly used in one of the following ways:
- Evaluates the value of a constant without any substitutions, e.g. evaluating a static, discriminant, etc.
- Evaluates the value of a resolved instance of a constant. this happens when evaluating unevaluated constants or normalising trait constants.
- Evaluates a promoted constant.

This PR adds three new functions `const_eval_mono`, `const_eval_resolve`, and `const_eval_promoted` to `TyCtxt`, which each cater to one of the three ways `tcx.const_eval`
 is normally used.
2019-12-22 19:46:07 +01:00
bors
26286c7ad0 Auto merge of #66931 - cjgillot:hirene-preamble, r=eddyb
Allocate HIR on an arena 1/4

This PR is the first in a series of 4, aiming at allocating the HIR on an arena, as a memory optimisation.

1. This first PR lays the groundwork and migrates some low-hanging fruits.
2. The second PR will migrate `hir::Expr`, `hir::Pat` and related.
3. The third PR will migrate `hir::Ty` and related.
4. The final PR will be dedicated to eventual cleanups.

In order to make the transition as gradual as possible, some lowering routines receive `Box`-allocated data and move it into the arena. This is a bit wasteful, but hopefully temporary.
Nonetheless, special care should be taken to avoid double arena allocations.

Work mentored by @Zoxc.
2019-12-22 10:30:51 +00:00
Yuki Okushi
30e84b0244 Tweak non_shorthand_field_patterns' suggestion 2019-12-22 08:21:36 +09:00
Camille GILLOT
5f5b6e7c67 Tidy. 2019-12-21 23:40:55 +01:00
Camille GILLOT
9694ab9e18 Use Arena inside hir::Body. 2019-12-21 23:39:19 +01:00