Commit Graph

99281 Commits

Author SHA1 Message Date
Ralf Jung
5462ecb4b1 update intern classification comment 2019-09-15 14:25:30 +02:00
Ralf Jung
224e2e5e9e explain ty == None 2019-09-15 14:25:30 +02:00
Ralf Jung
3424811852 assert that nobody asks for mutable constants 2019-09-15 14:25:30 +02:00
Ralf Jung
14e3506738 note a FIXME 2019-09-15 14:25:30 +02:00
Ralf Jung
b1d4d2bfea relocations -> allocations 2019-09-15 14:25:29 +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
Ralf Jung
75c82b4dd8 drop redundant ParamEnv, and avoid constructing InternVisitor without visiting 2019-09-15 14:23:14 +02:00
Ralf Jung
7b8693eff8 all memory behind a constant must be immutable 2019-09-15 13:57:59 +02:00
Ralf Jung
6137691933 const interning: move mutability computation into intern_shallow, and always intern constants as immutable 2019-09-15 13:57:58 +02: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
Matthew Jasper
b4ef99f4a6 Print visibility of macro items 2019-09-15 10:22:13 +01: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
Mark Rousskov
1d33f06de8 Don't mark expression with attributes as not needing parentheses
This is not perfectly correct as `#[attr] (5)` will still not lint, but
it does seem good enough, in particular as the parentheses in that case
are not unambiguously incorrect.
2019-09-14 18:43:48 -04:00
Igor Matuszewski
a946b8d6e1 save-analysis: Process bounds in impl trait only in argument position 2019-09-15 00:42:33 +02:00
Igor Matuszewski
30e39e871f save-analysis: Deduplicate lookup_{d,r}ef_id functions 2019-09-15 00:42:33 +02: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
Tim Vermeulen
72175915d6 Simplify Iterator::{min_by, max_by} using cmp::{min_by, max_by} 2019-09-14 21:52:08 +02:00
Tim Vermeulen
6e5ada43bf Add cmp::{min_by, min_by_key, max_by, max_by_key} 2019-09-14 21:52:08 +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
2a774b1e6b address Centril's comments 2019-09-14 11:26:59 -05: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
Mazdak Farrokhzad
1c7959bb5d
Rollup merge of #64439 - 12101111:fix-owned-box, r=Centril
fix #64430, confusing `owned_box` error message in no_std build

Fixes #64430
2019-09-14 16:42:42 +02:00
Mazdak Farrokhzad
bf1253b347
Rollup merge of #64435 - eddyb:arguments-against-arg, r=rkruppe
codegen: use "_N" (like for other locals) instead of "argN", for argument names.

Based on #64408 (second commit is new), fixing something I mentioned in #64408 (which turned to be an immediate blocker for unifying relevant codepaths).

Closes #64408 (by containing it).

r? @rkruppe
2019-09-14 16:42:40 +02:00
Mazdak Farrokhzad
5160e4bf91
Rollup merge of #64431 - pnkfelix:issue-63479-fnptr-is-structural-match, r=varkor
fn ptr is structural match

Make fn ptr always structural match, regardless of whether the formal parameter types or return type are.

Fix #63479.
2019-09-14 16:42:39 +02:00
Mazdak Farrokhzad
4398eb7b54
Rollup merge of #64425 - guanqun:typo-fix, r=matthewjasper
typo fix
2019-09-14 16:42:38 +02:00