Commit Graph

99009 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
56b055a6ab or-patterns: HAIR: Arm.patterns: Vec<Pattern<'_>> -> .pattern: Pattern<'_>. 2019-09-16 15:46:35 +02:00
Mazdak Farrokhzad
549756bef8 or-patterns: check_match: nix top_pats_hack passed to check_patterns. 2019-09-16 03:13:02 +02:00
Mazdak Farrokhzad
6bd8c6d4f4 or-patterns: check_match: remove top_pats_hack for check_for_bindings_named_same_as_variants. 2019-09-16 03:13:02 +02:00
Mazdak Farrokhzad
9b406f1069 or-patterns: regionck/link_match: remove top_pats_hack. 2019-09-16 03:13:02 +02:00
Mazdak Farrokhzad
38a5ae9cc1 or-patterns: regionck/visit_arm: remove top_pats_hack. 2019-09-16 03:13:02 +02:00
Mazdak Farrokhzad
0dfd706257 or-patterns: rvalue_promotion: remove top_pats_hack. 2019-09-16 03:13:02 +02:00
Mazdak Farrokhzad
07deb93bb2 or-patterns: middle/dead: make a hack less hacky. 2019-09-16 03:13:02 +02:00
Mazdak Farrokhzad
d7139f3e6d or-patterns: euv/walk_arm: remove top_pats_hack. 2019-09-16 03:13:02 +02:00
Mazdak Farrokhzad
fb2cfec433 or-patterns: euv/arm_move_mode: remove top_pats_hack. 2019-09-16 03:13:02 +02:00
Mazdak Farrokhzad
57eeb61cc8 or-patterns: remove Arm::contains_explicit_ref_binding. 2019-09-16 03:13:02 +02:00
Mazdak Farrokhzad
9ca42a5600 or-patterns: liveness: generalize + remove top_pats_hack. 2019-09-16 03:12:00 +02:00
Mazdak Farrokhzad
cc5fe6d520 or-patterns: liveness/visit_arm: remove top_pats_hack. 2019-09-16 03:11:08 +02:00
Mazdak Farrokhzad
9d1c3c96e7 simplify hir::Pat::walk_. 2019-09-15 18:50:44 +02:00
Mazdak Farrokhzad
4c346939b0 or-patterns: fix problems in typeck. 2019-09-15 18:50:44 +02:00
Mazdak Farrokhzad
89bbef3026 check_match: misc cleanup. 2019-09-15 18:50:44 +02:00
Mazdak Farrokhzad
75fb42a11f or-patterns: use top_pats_hack to make things compile. 2019-09-15 18:50:44 +02:00
Mazdak Farrokhzad
6579d136b1 or-patterns: normalize HIR pretty priting. 2019-09-15 18:50:44 +02:00
Mazdak Farrokhzad
b2f903c066 or-patterns: hir::Arm::pats -> ::pat + Arm::top_pats_hack. 2019-09-15 18:50:44 +02:00
Mazdak Farrokhzad
146cb8eda6 or-patterns: remove hack from lowering. 2019-09-15 18:50:43 +02:00
bors
60895fd1f9 Auto merge of #64483 - petrochenkov:expectattr2, r=Centril
resolve: Tweak some "cannot find" wording for macros
2019-09-15 12:24:32 +00:00
Vadim Petrochenkov
f7f8d6584b resolve: Remove ! from "cannot find" diagnostics for macros 2019-09-15 13:22:07 +03:00
Vadim Petrochenkov
42a19dde82 resolve: Tweak "cannot find" wording for attributes 2019-09-15 13:10:12 +03:00
bors
117cdf35d4 Auto merge of #64469 - matthewjasper:increase-hygiene-use, r=petrochenkov
Cleanup handling of hygiene for built-in macros

This makes most identifiers generated by built-in macros use def-site hygiene, not only the ones that previously used gensyms.

* `ExtCtxt::ident_of` now takes a `Span` and is preferred to `Ident::{from_str, from_str_and_span}`
* Remove `Span::with_legacy_ctxt`
    * `assert` now uses call-site hygiene because it needs to resolve `panic` unhygienically.
    * `concat_idents` now uses call-site hygiene because it wouldn't be very useful with def-site hygiene.
    * everything else is moved to def-site hygiene

r? @petrochenkov
2019-09-15 08:17:57 +00:00
Matthew Jasper
8ab67c8f56 Remove with_legacy_ctxt 2019-09-15 09:15:38 +01:00
Matthew Jasper
5ae3830d58 Give more Idents spans 2019-09-15 09:15:38 +01:00
Matthew Jasper
57a45e9cbd Avoid some unnecessary &str to Ident conversions 2019-09-15 09:15:37 +01:00
Matthew Jasper
e8d2f62924 Prefer Symbol to Ident when there's no sensible Span 2019-09-15 09:15:37 +01:00
bors
8bf776d5c2 Auto merge of #64478 - Centril:rollup-bnt51w1, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #64457 (def_collector: Do not ICE on attributes on unnamed fields)
 - #64463 (resolve: Tweak some expected/found wording)
 - #64471 (Warn on no_start, crate_id attribute use)
 - #64473 (Use try_fold instead of manually carrying an accumulator)
 - #64475 (simplify the initialization)

Failed merges:

r? @ghost
2019-09-15 03:59:08 +00:00
Mazdak Farrokhzad
88bd5646f1
Rollup merge of #64475 - guanqun:use-same-name, r=Centril
simplify the initialization
2019-09-15 02:29:49 +02:00
Mazdak Farrokhzad
82927cf826
Rollup merge of #64473 - spastorino:use-try-fold, r=Centril
Use try_fold instead of manually carrying an accumulator

r? @RalfJung
2019-09-15 02:29:47 +02:00
Mazdak Farrokhzad
3e4c7786e9
Rollup merge of #64471 - Mark-Simulacrum:warn-depr-attr, r=Centril
Warn on no_start, crate_id attribute use

These attributes are now deprecated; they don't have any use anymore.

`no_start` stopped being applicable in 3ee916e50b as part of #18967. Ideally we would've removed it pre-1.0, but since that didn't happen let's at least mark it deprecated.

`crate_id` was renamed to `crate_name` in 50ee1ec1b4 as part of #15319. Ideally we would've followed that up with a removal of crate_id itself as well, but that didn't happen; this PR finally marks it as deprecated at least.

Fixes https://github.com/rust-lang/rust/issues/43142 and resolves https://github.com/rust-lang/rust/issues/43144.
2019-09-15 02:29:46 +02:00
Mazdak Farrokhzad
17798939f2
Rollup merge of #64463 - petrochenkov:expectattr, r=Centril
resolve: Tweak some expected/found wording
2019-09-15 02:29:44 +02:00
Mazdak Farrokhzad
8f55245fdc
Rollup merge of #64457 - petrochenkov:macunfield, r=matthewjasper
def_collector: Do not ICE on attributes on unnamed fields

The primary issue here is that the expansion infra needs to visit a field in isolation, and fields don't know their own indices during expansion, so they have to be kept in some other place (e.g. `struct Definitions`).

Fixes https://github.com/rust-lang/rust/issues/64385
2019-09-15 02:29:43 +02:00
bors
572d3d9634 Auto merge of #60584 - jonas-schievink:ice-panic-hook, r=oli-obk
Use `panic::set_hook` to print the ICE message

This allows custom frontends and backends to override the hook with their own, for example to point people to a different issue tracker.

ICE messages are printed in a slightly different order now. Nightly prints:

```
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.36.0-nightly (08bfe1612 2019-05-02) running on x86_64-unknown-linux-gnu
```

After this PR, rustc prints:

```
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.36.0-dev running on x86_64-unknown-linux-gnu

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.
```
2019-09-15 00:10:08 +00:00
Mark Rousskov
a0e48b6d25 Warn on no_start, crate_id attribute use
These attributes are now deprecated; they don't have any use anymore.
2019-09-14 19:43:39 -04:00
Guanqun Lu
71d45499a5 simply the initialization 2019-09-15 07:38:18 +08:00
Santiago Pastorino
8ee77a268f
Use try_fold instead of manually carrying an accumulator 2019-09-14 19:51:40 -03:00
Jonas Schievink
dab68131d3 Try to fix the test output normalization 2019-09-14 23:02:22 +02:00
bors
b35ebac961 Auto merge of #64466 - Centril:rollup-s3nlb9e, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #61797 (Stabilise weak_ptr_eq)
 - #64290 (Provide a span if main function is not present in crate)
 - #64406 (Ban non-extern rust intrinsics)
 - #64462 (feature_gate: Remove dead code from attribute checking)

Failed merges:

r? @ghost
2019-09-14 20:16:54 +00:00
Mazdak Farrokhzad
45e50e2fd2
Rollup merge of #64462 - petrochenkov:remattr, r=Centril
feature_gate: Remove dead code from attribute checking

https://github.com/rust-lang/rust/pull/63468 is merged, so all attributes go through name resolution now, so we can remove code that previously performed some checks for attributes not going through resolution.
2019-09-14 22:16:07 +02:00
Mazdak Farrokhzad
5f9b9b275a
Rollup merge of #64406 - Mark-Simulacrum:error-unknown-intrinsic, r=Centril
Ban non-extern rust intrinsics

Intrinsics can only be defined by the compiler.

Fixes https://github.com/rust-lang/rust/issues/36979
2019-09-14 22:16:06 +02:00
Mazdak Farrokhzad
d29df01b08
Rollup merge of #64290 - Mark-Simulacrum:span-no-main, r=estebank
Provide a span if main function is not present in crate

Unfortunately, the diagnostic machinery does not cope well with an empty
span which can happen if the crate is empty, in which case we merely set
a spanless note.

Tests are already updated for this change, so a dedicated test is not added.

Resolves #36561.
2019-09-14 22:16:05 +02:00
Mazdak Farrokhzad
dee08ba55a
Rollup merge of #61797 - Thomasdezeeuw:stablise-weak_ptr_eq, r=RalfJung
Stabilise weak_ptr_eq

Implemented in #55987.

Closes #55981.
2019-09-14 22:16:03 +02:00
Vadim Petrochenkov
f6a5b29d19 resolve: Tweak some expected/found wording 2019-09-14 22:36:58 +03:00
Vadim Petrochenkov
cb771fdd6c feature_gate: Eliminate check::Context
Use `PostExpansionVisitor` directly instead
2019-09-14 21:59:03 +03:00
Vadim Petrochenkov
a01ba39b4b feature_gate: Merge various attribute gating functions 2019-09-14 21:54:26 +03:00
Vadim Petrochenkov
966d96c9d2 feature_gate: Remove dead code from attribute checking
Same checks are performed during name resolution, and all attributes go through name resolution now
2019-09-14 21:54:26 +03:00
Mark Rousskov
7b3adc289e Ban non-extern rust intrinsics
Intrinsics can only be defined by the compiler.
2019-09-14 11:47:02 -04:00
Mark Rousskov
b7f20d06ea Provide a span if main function is not present in crate
Unfortunately, the diagnotic machinery does not cope well with an empty
span which can happen if the crate is empty, in which case we merely set
a spanless note.
2019-09-14 11:27:45 -04:00
bors
ca3766e2e5 Auto merge of #64456 - Centril:rollup-ytqdwaq, r=Centril
Rollup of 17 pull requests

Successful merges:

 - #63846 (Added table containing the system calls used by Instant and SystemTime.)
 - #64116 (Fix minor typo in docs.)
 - #64203 (A few cosmetic improvements to code & comments in liballoc and libcore)
 - #64302 (Shrink `ObligationCauseCode`)
 - #64372 (use randSecure and randABytes)
 - #64374 (Box `DiagnosticBuilder`.)
 - #64375 (Fast path for vec.clear/truncate )
 - #64378 (Fix inconsistent link formatting.)
 - #64384 (Trim rustc-workspace-hack)
 - #64393 ( declare EnvKey before use to fix build error)
 - #64420 (Inline `mark_neighbours_as_waiting_from`.)
 - #64422 (Remove raw string literal quotes from error index descriptions)
 - #64423 (Add self to .mailmap)
 - #64425 (typo fix)
 - #64431 (fn ptr is structural match)
 - #64435 (codegen: use "_N" (like for other locals) instead of "argN", for argument names.)
 - #64439 (fix #64430, confusing `owned_box` error message in no_std build)

Failed merges:

r? @ghost
2019-09-14 14:43:32 +00:00