Commit Graph

109109 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
9da25d9faf
Rollup merge of #67761 - cjgillot:split_graph, r=Zoxc
Move the dep_graph construction to a dedicated crate.

The interface for librustc consists in two traits: `DepKind` and `DepContext`.

The `DepKind` is the main interface. It allows to probe properties of the dependency.
As before, `DepNode` is the pair of a `DepKind` object and a hash fingerprint.

The `DepContext` takes the place of the `TyCtxt`, and handles communication with the query engine.

The use of the `ImplicitCtxt` through `ty::tls` is done through the `DepKind` trait.
This may not be the best choice, but it seemed like the simplest.
2020-03-24 00:49:36 +01:00
Without Boats
3cc4ef9326 correct rustc version 2020-03-24 00:34:48 +01:00
Without Boats
4dda632faf IoSlice/IoSliceMut should be Send and Sync 2020-03-24 00:33:25 +01:00
Oliver Scherer
9b1893f310 Run rustfmt 2020-03-24 00:16:05 +01:00
Camille GILLOT
0f918cba3f Move import. 2020-03-23 23:19:08 +01:00
Camille GILLOT
9f4c8889e5 Fully qualify the path to DepKind.
This is needed since `middle::cstore` defines another type named
`DepKind`, and we should not rely on shadowing to get the right one.
2020-03-23 23:17:59 +01:00
Camille GILLOT
e0f7b897ba Address review. 2020-03-23 23:17:17 +01:00
Camille GILLOT
d08cc0ba67 Put extract_def_id back on DepNode. 2020-03-23 23:16:35 +01:00
Camille GILLOT
3a8bb20230 Remove assert_ignored and with_ignore_deps. 2020-03-23 23:15:51 +01:00
Camille GILLOT
2326ae39b2 Merge ensure_node_can_be_forced into force_from_dep_node. 2020-03-23 23:15:08 +01:00
Camille GILLOT
db7bd5f828 Fallout in other crates. 2020-03-23 23:14:26 +01:00
Camille GILLOT
6624dc4045 Make librustc_query_system compile. 2020-03-23 23:07:19 +01:00
Camille GILLOT
a7e2641b9a Move dep_graph to new crate librustc_query_system. 2020-03-23 23:07:19 +01:00
bors
c55c682e9b Auto merge of #70322 - matthiaskrgr:submodule_upd, r=Dylan-DPC
submodules: update clippy from d8e6e4cf to 1ff81c1b

Changes:
````
rustup https://github.com/rust-lang/rust/pull/69968/
Fix documentation generation for configurable lints
Fix single binding in closure
Improvement: Don't show function body in needless_lifetimes
````
Fixes #70310
r? @Dylan-DPC
2020-03-23 22:02:13 +00:00
Oliver Scherer
4f513b5fd7 Split out some impls from rustc::mir into a separate submodule 2020-03-23 22:39:59 +01:00
Oliver Scherer
5aa15bfa1c Remove leftover mentions of from_anon_const 2020-03-23 22:24:31 +01:00
Esteban Küber
e75158d486 Account for bad placeholder types in where clauses 2020-03-23 12:55:46 -07:00
Jeremy Stucki
3a65d380ae
Increase verbosity when using update syntax 2020-03-23 20:15:45 +01:00
bors
1edd389cc4 Auto merge of #70330 - Centril:rollup-ts0clvx, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #68700 (Add Wake trait for safe construction of Wakers.)
 - #69494 (Stabilize --crate-version option in rustdoc)
 - #70080 (rustc_mir: remove extra space when pretty-printing MIR.)
 - #70195 (Add test for issue #53275)
 - #70199 (Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.)
 - #70299 (add err_machine_stop macro)
 - #70300 (Reword unused variable warning)
 - #70315 (Rename remaining occurences of Void to Opaque.)
 - #70318 (Split long derive lists into two derive attributes.)

Failed merges:

r? @ghost
2020-03-23 18:48:02 +00:00
Oliver Scherer
124ab20d4b Limit from_anon_const to AnonConsts. 2020-03-23 19:35:19 +01:00
John Kåre Alsaker
47a84f2170 Update tests 2020-03-23 19:31:41 +01:00
CDirkx
9fdde0a000 Merge tests.
Merge tests to a single test file.
2020-03-23 19:27:13 +01:00
Bastian Kauschke
d7ecc8c9bc query normalize_generic_arg_after_erasing_regions 2020-03-23 19:22:19 +01:00
Bastian Kauschke
bda976d42d add missing const super folds 2020-03-23 19:20:28 +01:00
Oliver Scherer
9bcd9fe674 Address review comments 2020-03-23 19:19:07 +01:00
CDirkx
f080f944f1 Add const generics test for all range types.
In addition to the regression test of `RangeInclusive` for #70155, now all range types are checked for usability within const generics:

- `RangeFrom`
- `RangeFull`
- `RangeToInclusive`
- `RangeTo`
- `Range`

The test are moved from `test\ui\const-generics\issues\issue-70155` to `test\ui\const-generics\std\range` in anticipation of future similar tests for std types.
2020-03-23 19:16:12 +01:00
Mazdak Farrokhzad
5b29348cfe
Rollup merge of #70318 - anyska:multiple-derives, r=Dylan-DPC
Split long derive lists into two derive attributes.
2020-03-23 19:04:57 +01:00
Mazdak Farrokhzad
176e2eb271
Rollup merge of #70315 - anyska:void-rename, r=Mark-Simulacrum
Rename remaining occurences of Void to Opaque.

Two mentions of the type were missed when the type was renamed.
2020-03-23 19:04:55 +01:00
Mazdak Farrokhzad
1bb0c929cb
Rollup merge of #70300 - aleksator:66636_reword_unused_variable_warning, r=Dylan-DPC
Reword unused variable warning

Fixes #66636
2020-03-23 19:04:54 +01:00
Mazdak Farrokhzad
8cb3daa368
Rollup merge of #70299 - RalfJung:err_machine_stop, r=oli-obk
add err_machine_stop macro

We have that for all other error kinds, but here I somehow forgot it.

r? @oli-obk
2020-03-23 19:04:52 +01:00
Mazdak Farrokhzad
560eae31c5
Rollup merge of #70199 - pnkfelix:issue-68808-dont-turn-dummy-spans-into-invalid-lines, r=estebank
Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.

This required revising some of the client code to stop relying on the returned set of lines being non-empty.

Fix #68808
2020-03-23 19:04:51 +01:00
Mazdak Farrokhzad
ad6d30314b
Rollup merge of #70195 - rylev:test-for-53275, r=Centril
Add test for issue #53275

Fixes #53275
2020-03-23 19:04:49 +01:00
Mazdak Farrokhzad
4d5eccae50
Rollup merge of #70080 - anyska:mir-double-space, r=oli-obk
rustc_mir: remove extra space when pretty-printing MIR.
2020-03-23 19:04:47 +01:00
Mazdak Farrokhzad
e37e81cad5
Rollup merge of #69494 - GuillaumeGomez:stabilize-crate-version, r=ehuss,aleksator,ollie27
Stabilize --crate-version option in rustdoc

I don't see any reason to not stabilize it anymore, so let's go!

cc @kinnison @ehuss

r? @ollie27
2020-03-23 19:04:45 +01:00
Mazdak Farrokhzad
e4d2f747e5
Rollup merge of #68700 - withoutboats:wake-trait, r=withoutboats
Add Wake trait for safe construction of Wakers.

Currently, constructing a waker requires calling the unsafe `Waker::from_raw` API. This API requires the user to manually construct a vtable for the waker themself - which is both cumbersome and very error prone. This API would provide an ergonomic, straightforward and guaranteed memory-safe way of constructing a waker.

It has been our longstanding intention that the `Waker` type essentially function as an `Arc<dyn Wake>`, with a `Wake` trait as defined here. Two considerations prevented the original API from being shipped as simply an `Arc<dyn Wake>`:

- We want to support futures on embedded systems, which may not have an allocator, and in optimized executors for which this API may not be best-suited. Therefore, we have always explicitly supported the maximally-flexible (but also memory-unsafe) `RawWaker` API, and `Waker` has always lived in libcore.
- Because `Waker` lives in libcore and `Arc` lives in liballoc, it has not been feasible to provide a constructor for `Waker` from `Arc<dyn Wake>`.

Therefore, the Wake trait was left out of the initial version of the task waker API.

However, as Rust 1.41, it is possible under the more flexible orphan rules to implement `From<Arc<W>> for Waker where W: Wake` in liballoc. Therefore, we can now define this constructor even though `Waker` lives in libcore.

This PR adds these APIs:

- A `Wake` trait, which contains two methods
    - A required method `wake`, which is called by `Waker::wake`
    - A provided method `wake_by_ref`, which is called by `Waker::wake_by_ref` and which implementors can override if they can optimize this use case.
- An implementation of `From<Arc<W>> for Waker where W: Wake + Send + Sync + 'static`
- A similar implementation of `From<Arc<W>> for RawWaker`.
2020-03-23 19:04:43 +01:00
Bastian Kauschke
513ea6405b add missing visit_consts 2020-03-23 18:39:25 +01:00
Felix S Klock II
763121d68b
Update src/librustc_span/source_map.rs
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-03-23 13:32:23 -04:00
John Kåre Alsaker
e8f0a64cf1 Make the type_of return a generic type for generators 2020-03-23 17:57:47 +01:00
Bastian Kauschke
0a17c4c190
fix comment 2020-03-23 17:08:41 +01:00
bors
55299b2ba9 Auto merge of #70311 - RalfJung:miri, r=RalfJung
update miri

r? @ghost Cc @oli-obk

Fixes https://github.com/rust-lang/rust/issues/70220
2020-03-23 15:47:42 +00:00
Matthias Krüger
454ba778d4 submodules: update clippy from d8e6e4cf to 1ff81c1b
Changes:
````
rustup https://github.com/rust-lang/rust/pull/69968/
Fix documentation generation for configurable lints
Fix single binding in closure
Improvement: Don't show function body in needless_lifetimes
````
2020-03-23 16:46:46 +01:00
Matthew Jasper
c3b98813c4 Remove ReClosureBound 2020-03-23 15:33:07 +00:00
Adam Perry
a7ab7b136e #[track_caller] on core::ops::{Index, IndexMut}. 2020-03-23 08:01:49 -07:00
Ana-Maria Mihalache
fcb4e771a6 Split long derive lists into two derive attributes. 2020-03-23 14:48:59 +00:00
Saoirse Shipwreckt
32f5724e8a Apply suggestions from code review
Co-Authored-By: Ashley Mannix <ashleymannix@live.com.au>
2020-03-23 15:45:30 +01:00
Saoirse Shipwreckt
caff9f92ab Update src/liballoc/task.rs
Co-Authored-By: Ashley Mannix <ashleymannix@live.com.au>
2020-03-23 15:45:30 +01:00
Saoirse Shipwreckt
a4875a797d Update src/libstd/lib.rs
Co-Authored-By: Ashley Mannix <ashleymannix@live.com.au>
2020-03-23 15:45:30 +01:00
Without Boats
3ae74cafe4 More explicit; CFG on atomic pointer 2020-03-23 15:45:30 +01:00
Without Boats
ede03a4175 typo 2020-03-23 15:45:30 +01:00
Without Boats
c9acdb0bd4 Improve safety implementation, fix typos 2020-03-23 15:45:30 +01:00