Commit Graph

84056 Commits

Author SHA1 Message Date
QuietMisdreavus
1106577116 fix intra-links for trait impls 2018-09-20 05:54:31 -05:00
QuietMisdreavus
755c02dbd4 filter collected trait impls against items in the crate 2018-09-20 05:54:30 -05:00
QuietMisdreavus
354507e61f shuffle ownership of external_traits
constraints:

- clean/inline.rs needs this map to fill in traits when inlining
- fold.rs needs this map to allow passes to fold trait items
- html/render.rs needs this map to seed the Cache.traits map of all
  known traits

The first two are the real problem, since `DocFolder` only operates on
`clean::Crate` but `clean/inline.rs` only sees the `DocContext`. The
introduction of early passes means that these two now exist at the same
time, so they need to share ownership of the map. Even better, the use
of `Crate` in a rustc thread pool means that it needs to be Sync, so it
can't use `Lrc<Lock>` to manually activate thread-safety.

`parking_lot` is reused from elsewhere in the tree to allow use of its
`ReentrantMutex`, as the relevant parts of rustdoc are still
single-threaded and this allows for easier use in that context.
2018-09-20 05:54:26 -05:00
QuietMisdreavus
c754e8240c refactor: move access_levels into RenderInfo 2018-09-20 05:42:38 -05:00
QuietMisdreavus
87760e5f5e collect auto-/blanket-impls during collect-trait-impls 2018-09-20 05:42:37 -05:00
QuietMisdreavus
e854d39929 don't index trait impls if the trait isn't also documented 2018-09-20 05:42:36 -05:00
QuietMisdreavus
7e70fee0c7 add more tests for traits-in-non-module-scope 2018-09-20 05:42:35 -05:00
QuietMisdreavus
e79780f18f don't check visibility when inlining local impls
those get handled properly in strip-hidden anyway
2018-09-20 05:42:33 -05:00
QuietMisdreavus
a45d38744c swap external_traits into the crate before running strip_hidden 2018-09-20 05:42:32 -05:00
QuietMisdreavus
de6a89783c pull impl generics from HIR if available 2018-09-20 05:42:31 -05:00
QuietMisdreavus
fe26efe748 collect impl items from the HIR if available 2018-09-20 05:42:30 -05:00
QuietMisdreavus
978c13aa02 pull local types from the HIR instead of tcx 2018-09-20 05:42:29 -05:00
QuietMisdreavus
bfd2b34454 handle local names when registering FQNs 2018-09-20 05:42:28 -05:00
QuietMisdreavus
a893117f38 add a bunch of debug prints 2018-09-20 05:42:27 -05:00
QuietMisdreavus
50fa16f5b5 undo some tweaks to build_impl 2018-09-20 05:42:26 -05:00
QuietMisdreavus
804a1a6fa9 don't record an external trait if it's not external 2018-09-20 05:42:25 -05:00
QuietMisdreavus
6aa74939bf only move access_levels/external_traits after early passes 2018-09-20 05:42:24 -05:00
QuietMisdreavus
457efc111a ignore rustdoc/doc-proc-macro on stage1 2018-09-20 05:42:22 -05:00
QuietMisdreavus
5e0f9be670 print local inlined consts via the HIR map 2018-09-20 05:42:21 -05:00
QuietMisdreavus
02bea3c581 rustdoc: collect trait impls as an early pass 2018-09-20 05:42:20 -05:00
Ralf Jung
0309664491 fix stage 0 compilation 2018-09-20 12:27:50 +02:00
Ralf Jung
c711e15521 unsurprisingly, miri needs tcx 2018-09-20 12:06:39 +02:00
Ralf Jung
c16336a014 move loop detector constants to the module that uses them; make lifetime order in ConstPropagator consistent with Memory 2018-09-20 11:57:45 +02:00
bors
f7f4c500b4 Auto merge of #54255 - spastorino:use-of-moved-value-error, r=nikomatsakis
Inspect parents paths when checking for moves

Closes #52669
2018-09-20 09:02:46 +00:00
Ralf Jung
b1453dda0f make some things a bit more private 2018-09-20 10:36:25 +02:00
Ralf Jung
018d128325 rename evaluator -> interpreter to make eddyb happy 2018-09-20 10:36:25 +02:00
Ralf Jung
169f7911e9 move CTFE engine snapshot state out of miri engine into CTFE machine instance 2018-09-20 10:12:21 +02:00
Philip Munksgaard
06b197582e Add documentation about the edition flag 2018-09-20 08:36:07 +02:00
Philip Munksgaard
b01e0e43d4 Add a documentation banner for edition specific code 2018-09-20 08:36:07 +02:00
Philip Munksgaard
ac8d8d71fa Add test for doctest edition support 2018-09-20 08:36:07 +02:00
Jack O'Connor
d0e59f563d add tests for copy_within 2018-09-20 02:35:32 -04:00
bors
992d1e4d3d Auto merge of #54241 - vi:suggest_with_applicability, r=estebank
Remove usages of span_suggestion without Applicability

Use `Applicability::Unspecified` for all of them instead.

Shall deprecations for the non-`_with_applicability` functions be added?

Shall clippy be addressed somehow?

r? @estebank
2018-09-20 06:34:22 +00:00
Scott McMurray
3932249249 Add marker_trait_attr to the unstable book 2018-09-19 22:41:07 -07:00
Scott McMurray
d5b562d4fc Improve error checking and reporting
- Check for valid attributes more reliably
- Don't bloat the error index for boring errors
- Do use real error codes for the interesting ones
2018-09-19 22:31:30 -07:00
Scott McMurray
2187e7a2c3 Enforce that #[marker] traits cannot have associated items 2018-09-19 22:31:30 -07:00
Scott McMurray
7cee7eee72 Require that marker impls are empty, but allow them to overlap 2018-09-19 22:31:30 -07:00
Scott McMurray
6149a83c0b Parse, feature-gate, and validate the #[marker] attribute 2018-09-19 22:31:30 -07:00
Scott McMurray
62c6e4e145 Add an is_marker flag to TraitDef 2018-09-19 22:31:30 -07:00
Jack O'Connor
b3ffd3344e define copy_within on slices
This is a safe wrapper around ptr::copy, for regions within a single
slice. Previously, safe in-place copying was only available as a side
effect of Vec::drain.
2018-09-20 00:57:05 -04:00
bors
d16f27f89a Auto merge of #54301 - alexcrichton:update-curl, r=Mark-Simulacrum
Update some `*-sys` dependencies of Cargo/RLS

This is intended to help solve #54206 on nightly where the RLS on MinGW is
having build issues with accidentally building a `curl` library which links to
pthread symbols on Windows (where it should use native mutex locking instead).
The build system for these `*-sys` crates have all been rewritten to be based on
`cc` to bypass native build systems and platform detection to make sure we
configure them correctly.
2018-09-20 02:51:56 +00:00
Sergio Benitez
adc2c04543 Make 'proc_macro::MultiSpan' public. 2018-09-19 19:22:21 -07:00
Alex Crichton
b1305c22e3 Update some *-sys dependencies of Cargo/RLS
This is intended to help solve #54206 on nightly where the RLS on MinGW is
having build issues with accidentally building a `curl` library which links to
pthread symbols on Windows (where it should use native mutex locking instead).
The build system for these `*-sys` crates have all been rewritten to be based on
`cc` to bypass native build systems and platform detection to make sure we
configure them correctly.
2018-09-19 18:17:58 -07:00
bors
1d33aedaa9 Auto merge of #54211 - nnethercote:keccak-Liveness-memory, r=nikomatsakis
Split `Liveness::users` into three.

This reduces memory usage on some benchmarks because no space is wasted
for padding. For a `check-clean` build of `keccak` it reduces `max-rss`
by 20%.

r? @nikomatsakis, but I want to do a perf run. Locally, I had these results:
- instructions: slight regression
- max-rss: big win on "Clean" builds
- faults: big win on "Clean" and "Nll" builds
- wall-time: small win on "Clean" and "Nll" builds

So I want to see how a different machine compares.
2018-09-20 00:16:46 +00:00
QuietMisdreavus
93321671ca add -Zui-testing to rustdoc 2018-09-19 18:39:39 -05:00
Nicholas Nethercote
99f05e800e Improve handling of type bounds in bit_set.rs.
Currently, `BitSet` doesn't actually know its own domain size; it just
knows how many words it contains. To improve things, this commit makes
the following changes.

- It changes `BitSet` and `SparseBitSet` to store their own domain size,
  and do more precise bounds and same-size checks with it. It also
  changes the signature of `BitSet::to_string()` (and puts it within
  `impl ToString`) now that the domain size need not be passed in from
  outside.

- It uses `derive(RustcDecodable, RustcEncodable)` for `BitSet`. This
  required adding code to handle `PhantomData` in `libserialize`.

- As a result, it removes the domain size from `HybridBitSet`, making a
  lot of that code nicer.

- Both set_up_to() and clear_above() were overly general, working with
  arbitrary sizes when they are only needed for the domain size. The
  commit removes the former, degeneralizes the latter, and removes the
  (overly general) tests.

- Changes `GrowableBitSet::grow()` to `ensure()`, fixing a bug where a
  (1-based) domain size was confused with a (0-based) element index.

- Changes `BitMatrix` to store its row count, and do more precise bounds
  checks with it.

- Changes `ty_params` in `select.rs` from a `BitSet` to a
  `GrowableBitSet` because it repeatedly failed the new, more precise
  bounds checks. (Changing the type was simpler than computing an
  accurate domain size.)

- Various other minor improvements.
2018-09-20 08:52:41 +10:00
Taylor Cramer
1b00f0b9fa Remove spawning from task::Context 2018-09-19 15:01:19 -07:00
Guillaume Gomez
2099b3c75c Reduce code block sides padding 2018-09-19 22:59:35 +02:00
Santiago Pastorino
ae42e537db
Add regression test for thread local static mut borrows 2018-09-19 17:54:24 -03:00
Matthew Jasper
bd0895d7d0 Update ui tests 2018-09-19 20:50:09 +01:00
Matthew Jasper
994dc4bd1e Classify outlives constraints when type checking
The MIR/NLL type checker is in a much better position to classify
constraints and already has to classify into boring and interesting.
Adds spans to Locations::All for error reporting
Adds more constraint categories
2018-09-19 20:50:09 +01:00