Commit graph

655 commits

Author SHA1 Message Date
Matthew Jasper
199931ce91 Make register_[long_]diagnostics hygienic 2019-07-13 10:25:57 +01:00
Alex Crichton
345ba505ec rustc: Remove dylib crate type from most rustc crates
Now that procedural macros no longer link transitively to libsyntax,
this shouldn't be needed any more! This commit is an experiment in
removing all dynamic libraries from rustc except for librustc_driver
itself. Let's see how far we can get with that!
2019-07-07 03:23:00 +02:00
Mazdak Farrokhzad
f8b32dfb27 Remove ExprKind::While from HIR. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
2e86c006f7
Rollup merge of #62168 - ljedrz:the_culmination_of_hiridification, r=Zoxc
The (almost) culmination of HirIdification

It's finally over.

This PR removes old `FIXME`s and renames some functions so that the `HirId` variant has the shorter name.
All that remains (and rightfully so) is stuff in `resolve`, `save_analysis` and (as far as I can tell) in a few places where we can't replace `NodeId` with `HirId`.
2019-07-05 20:26:56 +02:00
Mazdak Farrokhzad
485a084b45
Rollup merge of #61545 - flip1995:internal_lints, r=oli-obk
Implement another internal lints

cc #49509

This adds ~~two~~ one internal lint~~s~~:
1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669
2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~

~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~

TODO (not directly relevant for review):
- [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) 🤔 cc @eddyb)
- [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870
- [x] Check explicitly for the `{declare,impl}_lint_pass!` macros

r? @oli-obk
2019-07-05 20:26:51 +02:00
ljedrz
37d7e1f22a rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-04 12:53:12 +02:00
Jeremy Stucki
ec711767a7
Remove needless lifetimes 2019-07-03 10:01:02 +02:00
Mazdak Farrokhzad
ce1d95af4c Always parse 'async unsafe fn' + properly ban in 2015. 2019-06-29 21:38:26 +02:00
flip1995
084c829fb8
Enable internal lints in bootstrap 2019-06-24 10:45:20 +02:00
ljedrz
f05cbc98f8 HIR: rename find_by_hir_id to find 2019-06-24 09:58:49 +02:00
Mazdak Farrokhzad
7abb2350df let_chains: Revert 'fn with' in ast_validation. 2019-06-23 01:39:13 +02:00
Mazdak Farrokhzad
2017be4ef6 let_chains: Remove ast_validation logic in favor of lowering with recovery. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
d551880267 let_chains: Inline visit_expr_with_let_maybe_allowed. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
a80aa34951 let_chains: Change AST validation strategy slightly. 2019-06-23 01:29:29 +02:00
Mazdak Farrokhzad
a7b00f5807 let_chains: Handle disallowing of let chains in places lowering won't support. 2019-06-23 01:29:29 +02:00
ljedrz
fe044a8bc2 rename hir::map::expect_expr_by_hir_id to expect_expr 2019-06-20 12:47:26 +02:00
Mazdak Farrokhzad
fde341a4ef
Rollup merge of #61941 - cramertj:no-more-yield-errors, r=centril
Preserve generator and yield source for error messages

Previously, error messages after HIR lowering all referred
to generators and yield, regardless of whether the original
source was a generator or an async/await body. This change
tracks the kind of each generator and yield source in order
to provide appropriately tailored error messages.

Fixes #60615.
2019-06-19 01:52:13 +02:00
Taylor Cramer
d67db0042c Preserve generator and yield source for error messages
Previously, error messages after HIR lowering all referred
to generators and yield, regardless of whether the original
source was a generator or an async/await body. This change
tracks the kind of each generator and yield source in order
to provide appropriately tailored error messages.
2019-06-18 16:22:22 -07:00
Eduard-Mihai Burtescu
b25b466a88 rustc: remove 'x: 'y bounds (except from comments/strings). 2019-06-18 18:10:21 +03:00
ljedrz
d996c4d5a3 remove _by_hir_id if there is no NodeId counterpart 2019-06-17 18:57:21 +02:00
ljedrz
61964d9732 replace some uses of NodeId with HirId 2019-06-17 18:57:20 +02:00
Eduard-Mihai Burtescu
f3f9d6dfd9 Unify all uses of 'gcx and 'tcx. 2019-06-14 18:58:23 +03:00
Eduard-Mihai Burtescu
fff08cb043 Run rustfmt --file-lines ... for changes from previous commits. 2019-06-12 13:38:28 +03:00
Eduard-Mihai Burtescu
21ac960334 rustc: remove some unnecessary lifetimes in -> TyCtxt methods. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
17cdd356da rustc: replace TyCtxt<'tcx, 'gcx, 'tcx> with TyCtxt<'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
2441253508 Fix fallout from deny(unused_lifetimes). 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
37799a5552 rustc: replace TyCtxt<'a, 'gcx, 'tcx> with TyCtxt<'tcx, 'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
bors
3f511ade5b Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkov
Allow attributes in formal function parameters

Implements https://github.com/rust-lang/rust/issues/60406.

This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made.

**TODO**

- [x] Forbid some built-in attributes.
- [x] Expand cfg/cfg_attr
2019-06-12 07:38:01 +00:00
Eduard-Mihai Burtescu
630ec8880c Add deny(unused_lifetimes) to all the crates that have deny(internal). 2019-06-11 14:11:59 +03:00
Caio
1eaaf440d5 Allow attributes in formal function parameters 2019-06-09 07:58:40 -03:00
Alexander Regueiro
01f49f0bb2 Use both existential-type desugaring and where-clause (predicate) desugaring depending on context. 2019-06-05 21:09:26 +01:00
Alexander Regueiro
3816958f18 Implemented for function bounds, type bounds, and named existential types. 2019-06-05 21:09:26 +01:00
Alexander Regueiro
35585c499f Aggregation of drive-by cosmetic changes. 2019-06-05 21:09:26 +01:00
Eduard-Mihai Burtescu
d0c78dd7aa
syntax: revert ast::AsyncArgument and associated changes.
Here follows the main reverts applied in order to make this commit:

Revert "Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj"

This reverts commit 45b09453db, reversing
changes made to f6df1f6c30.

Revert "Rollup merge of #60437 - davidtwco:issue-60236, r=nikomatsakis"

This reverts commit 16939a50ea, reversing
changes made to 12bf981552.

Revert "Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj"

This reverts commit 62d1574876, reversing
changes made to 4eff8526a7.
2019-06-03 10:20:35 +01:00
Eduard-Mihai Burtescu
1768030791 rustc: track the body owner DefId in MC and EUV. 2019-06-01 19:17:23 +03:00
Andrew Xu
46b9ed4fa1 Rename "Associated*" to "Assoc*"
We are going to uniform the terminology of all associated items.
Methods that may or may not have `self` are called "associated
functions". Because `AssociatedFn` is a bit long, we rename `Associated`
to `Assoc`.
2019-05-26 17:49:02 +08:00
varkor
7948b68d02 Remove ObsoleteInPlace 2019-05-24 01:27:32 +01:00
bors
85334c5092 Auto merge of #60174 - matthewjasper:add-match-arm-scopes, r=pnkfelix
Add match arm scopes and other scope fixes

* Add drop and lint scopes for match arms.
* Lint attributes are now respected on match arms.
* Make sure we emit a StorageDead if we diverge when initializing a temporary.
* Adjust MIR pretty printing of scopes for locals.
* Don't generate duplicate lint scopes for `let statements`.
* Add some previously missing fake borrows for matches.

closes #46525

cc @rust-lang/compiler
2019-05-23 04:48:21 +00:00
Vadim Petrochenkov
59a382122f Simplify use of keyword symbols 2019-05-22 19:48:56 +03:00
Matthew Jasper
4bfb0453f5 Give match arms an HirId and a Span 2019-05-21 19:37:38 +01:00
bors
fe5f42cdb8 Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkov
Use `Symbol` more

A `Symbol` can be equated with a string (e.g. `&str`). This involves a
TLS lookup to get the chars (and a Mutex lock in a parallel compiler)
and then a char-by-char comparison. This functionality is convenient but
avoids one of the main benefits of `Symbol`s, which is fast equality
comparisons.

This PR removes the `Symbol`/string equality operations, forcing a lot
of existing string occurrences to become `Symbol`s. Fortunately, these
are almost all static strings (many are attribute names) and we can add
static `Symbol`s as necessary, and very little extra interning occurs.
The benefits are (a) a slight speedup (possibly greater in a parallel
compiler), and (b) the code is a lot more principled about `Symbol` use.
The main downside is verbosity, particularly with more `use
syntax::symbol::symbols` items.

r? @Zoxc
2019-05-13 00:28:38 +00:00
Nicholas Nethercote
ea9fac5687 Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
Nicholas Nethercote
fb084a48e2 Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
Mazdak Farrokhzad
0535e42678 ast_validation: comments -> doc comments 2019-05-12 01:52:46 +02:00
Mazdak Farrokhzad
5cccda1770 Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match. 2019-05-10 19:41:10 +02:00
bors
40bd145cbe Auto merge of #60567 - Manishearth:rollup-rjagqnw, r=Manishearth
Rollup of 5 pull requests

Successful merges:

 - #60131 (Fix broken link in rustc_plugin doc)
 - #60426 (Stop `-O`/`-C opt-level` and `-g`/`-C debuginfo` conflicting)
 - #60515 (use span instead of div for since version)
 - #60530 (rustc: rename all occurences of "freevar" to "upvar".)
 - #60536 (Correct code points to match their textual description)

Failed merges:

r? @ghost
2019-05-05 21:11:47 +00:00
bors
d628c2e642 Auto merge of #60237 - saleemjaffer:issue-56166-miri-fntype-arg-passing, r=eddyb
Move pointee_info_at from rustc_codegen_llvm to rustc_target.

Makes progress towards #56166.

This is a continuation of https://github.com/rust-lang/rust/pull/57150.

@oli-obk Should I close the older PR?
2019-05-05 18:25:13 +00:00
Eduard-Mihai Burtescu
8d9f4a128c rustc: rename all occurences of "freevar" to "upvar". 2019-05-05 18:49:32 +03:00
Eduard-Mihai Burtescu
125dc60dab rustc: replace uses of with_freevars with the freevars query. 2019-05-05 18:48:42 +03:00
varkor
3e6787cb4c Early error for mixing order of const and type parameters 2019-05-04 22:28:08 +01:00