Commit Graph

656 Commits

Author SHA1 Message Date
varkor
e3a8ea4e18 Use to_option in various places 2019-12-06 12:23:23 +00:00
Mark Rousskov
cc2c33a156 Move Session to librustc_session 2019-12-03 12:19:16 -05:00
Matthew Jasper
5bc15866d7 Move ExprUseVisitor and mem_categorization to rustc_typeck
`MemCategorizationContext` is now private, the remaining types and
traits remain public for Clippy.
2019-11-27 19:47:12 +00:00
Mazdak Farrokhzad
15c30ddd69 Stabilize the never_type, written !. 2019-11-21 14:55:32 +01:00
Yuki Okushi
22c0f628df
Rollup merge of #66013 - nnethercote:avoid-hashing-twice-in-get_query, r=Zoxc
Avoid hashing the key twice in `get_query()`.

For a single-threaded parallel compiler, this reduces instruction counts
across several benchmarks, by up to 2.8%.

The commit also adds documentation about `Sharded`'s use of `FxHasher`.

r? @Zoxc
2019-11-15 18:36:20 +09:00
Guillaume Gomez
798e389e57 Update to use new librustc_error_codes library 2019-11-14 13:05:42 +01:00
Yuki Okushi
fab583bdfc
Rollup merge of #66335 - Mark-Simulacrum:self-profile-to-data, r=michaelwoerister
Move self-profile infrastructure to data structures

The single dependency on queries (QueryName) can be fairly easily
abstracted via a trait and this further decouples Session from librustc
(the primary goal).

This is intended as a precursor to moving Session out of librustc, but since that involves lots of smaller steps that move around code I'm splitting it up into separate PRs.
2019-11-13 22:09:29 +09:00
Mark Rousskov
997feacddd Snap cfgs 2019-11-12 16:36:57 -05:00
Mark Rousskov
f696b21c5f Move self-profile infrastructure to data structures
The single dependency on queries (QueryName) can be fairly easily
abstracted via a trait and this further decouples Session from librustc
(the primary goal).
2019-11-12 12:48:04 -05:00
Nicholas Nethercote
1aceaaa969 Avoid hashing the key twice in get_query().
For a single-threaded parallel compiler, this reduces instruction counts
across several benchmarks, by up to 2.8%.

The commit also adds documentation about `Sharded`'s use of `FxHasher`.
2019-11-04 10:15:55 +11:00
David Wood
e0590ea76f
RFC 2008: Stabilization
This commit stabilizes RFC 2008 (#44109) by removing the feature gate.

Signed-off-by: David Wood <david@davidtw.co>
2019-10-25 09:34:05 +01:00
Ralf Jung
50ddcbb2f5 also check the iterator is not too long 2019-10-20 12:06:03 +02:00
Vadim Petrochenkov
b39e188dda Stabilize proc macros generating macro_rules items 2019-10-15 10:03:51 +03:00
Jon Gjengset
45aca119a6
Stabilize mem::take (mem_take)
Tracking issue: https://github.com/rust-lang/rust/issues/61129
2019-10-08 18:04:18 -04:00
Tyler Mandry
2c8cbcca54
Rollup merge of #65105 - Mark-Simulacrum:split-librustc, r=nikomatsakis
Split out some passes from librustc

This is just moving them out to librustc_passes -- I've not measured compile time or run time. I don't expect any significant impact, but this seems prudent regardless.
2019-10-05 21:55:00 -07:00
Tyler Mandry
008526340a
Rollup merge of #64708 - SimonSapin:option-deref, r=Centril
Stabilize `Option::as_deref` and `Option::as_deref_mut`

The tracking issue https://github.com/rust-lang/rust/issues/50264 still has unresolved question for the corresponding `Result` methods.
2019-10-05 21:54:47 -07:00
Mark Rousskov
7c3f65b3c4 middle::intrinsicck -> rustc_passes 2019-10-04 11:11:33 -04:00
Mark Rousskov
82bfd8eb0d middle::entry -> rustc_passes 2019-10-04 11:11:33 -04:00
Mark Rousskov
bb707824d0 middle::dead -> rustc_passes 2019-10-04 11:11:33 -04:00
Mark Rousskov
91a096a9b8 move middle::liveness to rustc_passes 2019-10-04 11:11:33 -04:00
Mazdak Farrokhzad
dfd365f3e4 cleanup dead ast-borrowck / migrate-mode code. 2019-09-27 19:48:07 +02:00
Simon Sapin
0797712e29 Stabilize Option::deref and Option::deref_mut
The tracking issue https://github.com/rust-lang/rust/issues/50264
still has unresolved question for the corresponding `Result` methods.
2019-09-23 17:14:26 +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
Mazdak Farrokhzad
89a69fd76d
Rollup merge of #64139 - Mark-Simulacrum:strip-legacy-proc-macro, r=petrochenkov
Migrate internal diagnostic registration to macro_rules

Review is best done commit-by-commit.

Fixes #64132.
2019-09-07 20:01:44 +02:00
Matthew Jasper
10f46b69bc Move the HIR cfg to rustc_ast_borrowck
No new code should be using it.
2019-09-06 18:02:12 +01:00
Mark Rousskov
41b39fce98 Remove rustc_diagnostic_macros feature 2019-09-05 12:35:18 -04:00
Mark Rousskov
b437240cee Replace diagnostic plugins with macro_rules 2019-09-05 12:35:15 -04:00
Jonas Schievink
e296ed321e Move librustc panic handler into the new one 2019-08-30 12:34:20 +02:00
Oliver Scherer
26e9990198 Add a "diagnostic item" scheme
This allows lints and other diagnostics to refer to items
by a unique ID instead of relying on whacky path
resolution schemes that may break when items are
relocated.
2019-08-30 01:00:55 +02:00
Ilija Tovilo
3a6a29b4ec
Use associated_type_bounds where applicable - closes #61738 2019-08-08 22:39:15 +02:00
Vadim Petrochenkov
ca0ef0fcf6 librustc: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
Vadim Petrochenkov
676d282dd3 Deny unused_lifetimes through rustbuild 2019-07-28 18:47:02 +03:00
Vadim Petrochenkov
434152157f Remove lint annotations in specific crates that are already enforced by rustbuild
Remove some random unnecessary lint `allow`s
2019-07-28 18:46:24 +03:00
Mazdak Farrokhzad
e1de70b045
Rollup merge of #62735 - petrochenkov:galloc, r=alexcrichton
Turn `#[global_allocator]` into a regular attribute macro

It was a 99% macro with exception of some diagnostic details.

As a result of the change, `#[global_allocator]` now works in nested modules and even in nameless blocks.

Fixes https://github.com/rust-lang/rust/issues/44113
Fixes https://github.com/rust-lang/rust/issues/58072
2019-07-25 23:21:00 +02:00
Vadim Petrochenkov
a93fdfedf3 Merge rustc_allocator into libsyntax_ext 2019-07-24 12:27:58 +03:00
Vadim Petrochenkov
614037171b cleanup: Remove extern crate serialize as rustc_serializes 2019-07-23 19:20:16 +03:00
Matthew Jasper
313ba7c4d1 Make newtype_index hygienic and use allow_internal_unstable 2019-07-13 10:25:57 +01:00
John Kåre Alsaker
60c49bcb55 Remove some dummy dependencies 2019-07-07 03:23:00 +02: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
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
Mazdak Farrokhzad
88c007cd04
Rollup merge of #62249 - czipperz:use-mem-take-instead-of-replace-default, r=dtolnay,Centril
Use mem::take instead of mem::replace with default
2019-07-04 01:38:46 +02:00
Chris Gregory
b0c199a969 Enable mem_take feature in relevant crates 2019-07-01 20:21:53 -07:00
Eduard-Mihai Burtescu
c6374cfbe2 rustc: use a separate copy of P for HIR than for AST. 2019-07-01 14:34:34 +03:00
flip1995
084c829fb8
Enable internal lints in bootstrap 2019-06-24 10:45:20 +02:00
Matthew Jasper
d0311e7154 Deny explicit_outlives_requirements in the compiler 2019-06-22 17:13:19 +01:00
Eduard-Mihai Burtescu
774724be3c rustc: deny(unused_lifetimes). 2019-06-11 14:11:58 +03:00
Mazdak Farrokhzad
4bd36ab64c Introduce hir::ExprKind::Use and employ in for loop desugaring.
Here, ExprKind::Use(P<Expr>) tweaks the drop order to act the
same way as '{ let _tmp = expr; _tmp }' does.
2019-04-25 11:51:53 +02:00
bors
d6f513ec7d Auto merge of #60025 - JohnTitor:rename-files, r=petrochenkov
Rename files about error codes

fixes #60017

This PR will be failed in tidy.

<details>
<summary>The log is here:</summary>

```
tidy check
tidy error: duplicate error code: 411
tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:83:             __diagnostic_used!(E0411);
tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:84:             err.code(DiagnosticId::Error("E0411".to_owned()));
tidy error: duplicate error code: 424
tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:90:             debug!("smart_resolve_path_fragment: E0424, source={:?}", source);
tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:92:             __diagnostic_used!(E0424);
tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:93:             err.code(DiagnosticId::Error("E0424".to_owned()));
some tidy checks failed
```

</details>

I'd like to fix this but I don't know what to do.
I will work on later. Please let me know if you have any solutions.

r? @petrochenkov
2019-04-18 14:52:45 +00:00
Yuki OKUSHI
9ad56e3b94 Rename modules 2019-04-17 18:21:34 +09:00
Mateusz Mikuła
87e4b43d51 Deny internal in stage0 2019-04-17 05:15:00 +02:00