104112 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
98df677c3f
Rollup merge of #67247 - JohnTitor:fix-sugg, r=estebank
Don't suggest wrong snippet in closure

Fixes #67190

r? @estebank
2019-12-13 04:21:30 +01:00
Mazdak Farrokhzad
87f3b16e0b
Rollup merge of #67243 - jonas-schievink:linkedlist-drop, r=KodrAus
LinkedList: drop remaining items when drop panics

https://github.com/rust-lang/rust/pull/67235, but for `LinkedList`, which has the same issue.

I've also copied over the other drop-related tests from `VecDeque` since AFAICT `LinkedList` didn't have any.
2019-12-13 04:21:27 +01:00
Mazdak Farrokhzad
2ca7b7e539
Rollup merge of #66341 - crgl:vec-deque-extend, r=Amanieu
Match `VecDeque::extend` to `Vec::extend_desugared`

Currently, `VecDeque::extend` [does not reserve at all](https://github.com/rust-lang/rust/pull/65069#discussion_r333166522). This implementation still runs a check every iteration of the loop, but should reallocate at most once for the common cases where the `size_hint` lower bound is exact. Further optimizations in the future could improve this for some common cases, but given the complexity of the `Vec::extend` implementation it's not immediately clear that this would be worthwhile.
2019-12-13 04:21:22 +01:00
Mazdak Farrokhzad
45c1e38147 parser: recover on &'lifetime mut $pat. 2019-12-13 02:36:25 +01:00
Alex Crichton
2fee28e713 std: Implement LineWriter::write_vectored
This commit implements the `write_vectored` method of the `LineWriter`
type. First discovered in bytecodealliance/wasmtime#629 the
`write_vectored` method of `Stdout` bottoms out here but only ends up
writing the first buffer due to the default implementation of
`write_vectored`.

Like `BufWriter`, however, `LineWriter` can have a non-default
implementation of `write_vectored` which tries to preserve the
vectored-ness as much as possible. Namely we can have a vectored write
for everything before the newline and everything after the newline if
all the stars align well.

Also like `BufWriter`, though, special care is taken to ensure that
whenever bytes are written we're sure to signal success since that
represents a "commit" of writing bytes.
2019-12-12 16:51:25 -08:00
Alex Crichton
641ccd58c1 Fix signature of __wasilibc_find_relpath
Looks like this function changed upstream, so it needs to be adjusted
for when used by libstd.
2019-12-12 14:48:47 -08:00
Nicholas Nethercote
cb212938d4 Avoid re-processing nodes in find_cycles_from_node. 2019-12-13 08:36:25 +11:00
Nicholas Nethercote
76916d7a4b Remove an unnecessary local variable. 2019-12-13 08:36:25 +11:00
Nicholas Nethercote
4ec87d5cd2 Remove some debug! statements.
Because I am tired of looking at them.
2019-12-13 08:36:25 +11:00
Nicholas Nethercote
7d550445e2 Move functions around.
In particular, it has bugged me for some time that `process_cycles` is
currently located before `mark_still_waiting_nodes` despite being called
afterwards.
2019-12-13 08:36:25 +11:00
Nicholas Nethercote
a8207b1958 Remove NodeState::{Waiting,Done}.
`NodeState` has two states, `Success` and `Done`, that are only used
within `ObligationForest` methods. This commit removes them, and renames
the existing `Waiting` state as `Success`.

We are left with three states: `Pending`, `Success`, and `Error`.
`Success` is augmented with a new `WaitingState`, which indicates when
(if ever) it was last waiting on one or more `Pending` nodes. This
notion of "when" requires adding a "process generation" to
`ObligationForest`; it is incremented on each call to
`process_obligtions`.

This commit is a performance win.

- Most of the benefit comes from `mark_as_waiting` (which the commit
  renames as `mark_still_waiting_nodes`). This function used to do two
  things: (a) change all `Waiting` nodes to `Success`, and (b) mark all
  nodes that depend on a pending node as `Waiting`. In practice, many
  nodes went from `Waiting` to `Success` and then immediately back to
  `Waiting`. The use of generations lets us skip step (a).

- A smaller benefit comes from not having to change nodes to the `Done`
  state in `process_cycles`.
2019-12-13 08:36:25 +11:00
Andy Russell
94630d4c8b
replace serialize with serde in rustdoc 2019-12-12 16:33:25 -05:00
Andrea Canciani
de7fefa04c Minor cleanup in Pattern::{is_prefix_of,is_suffix_of} for char 2019-12-12 21:09:17 +01:00
LeSeulArtichaut
e4abcfbd34 Added missing backticks 2019-12-12 20:56:14 +01:00
LeSeulArtichaut
eac6fac10b Update tests 2019-12-12 20:56:14 +01:00
LeSeulArtichaut
27810e246c Restore note for PartialOrd and PartialEq 2019-12-12 20:56:14 +01:00
LeSeulArtichaut
3bd46f1aec Update UI test expectations 2019-12-12 20:56:14 +01:00
LeSeulArtichaut
cf8c0d7a04 I have to revise left and right 2019-12-12 20:56:14 +01:00
LeSeulArtichaut
8fb729ccda Comply to tidy checks 2019-12-12 20:56:14 +01:00
LeSeulArtichaut
29e5f8e9bc E0369 messages mimics E0277 2019-12-12 20:56:14 +01:00
bors
3eeb8d4f2f Auto merge of #67172 - jethrogb:jb/bootstrap-linker, r=alexcrichton
Bootstrap: change logic for choosing linker and rpath

This is a follow-up from #66957 and #67023. Apparently there was one more location with a hard-coded list of targets to influence linking.

I've filed #67171 to track this madness.

r? @alexcrichton
2019-12-12 19:52:27 +00:00
Mazdak Farrokhzad
054458b48d make visitor uses more robust 2019-12-12 18:05:05 +01:00
Mazdak Farrokhzad
74d4fbc5f5 De-fatalize ... parsing.
Also fix error the code description.
2019-12-12 18:05:05 +01:00
Mazdak Farrokhzad
e52f902a8a AssocImplKind::{Method -> Fn}. 2019-12-12 18:05:05 +01:00
Mazdak Farrokhzad
abf2e7aa95 Remove ast::{Impl,Trait}{Item,ItemKind}. 2019-12-12 18:05:05 +01:00
Mazdak Farrokhzad
35e9e097e7 More c-variadic errors as semantic restrictions. 2019-12-12 18:01:33 +01:00
Mazdak Farrokhzad
3a57a2cca4 ast_validation: move trait item logic to proper place. 2019-12-12 18:01:33 +01:00
Mazdak Farrokhzad
0d41d0fe14 Move allow_c_varadic logic to ast_validation. 2019-12-12 18:01:33 +01:00
Mazdak Farrokhzad
b499a88dfc Unify assoc item visitors more. 2019-12-12 18:01:33 +01:00
Mazdak Farrokhzad
51ccdebe0b Unify associated item parsing more. 2019-12-12 18:00:00 +01:00
Mazdak Farrokhzad
0d8a9d74e3 Unify associated item visitor. 2019-12-12 18:00:00 +01:00
Mazdak Farrokhzad
c6c17e3e00 Simplify nt_to_tokenstream. 2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
76576d401c Unify associated item mut visitors. 2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
9193d7a07e Unify associated item pretty printing. 2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
34d91709b6 parse: refactor fun ret ty & param ty 2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
404013e015 Leave a FIXME re. allow_plus. 2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
fa828d7a05 Relocate is_const_item. 2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
63a9030e7b Unify associated item parsing.
An exception is `fn` params.
2019-12-12 17:54:49 +01:00
Mazdak Farrokhzad
7672bff378 Unify associated function parsing. 2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
10270bcd30 Fuse associated type parsing. 2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
2d92aa5535 Fuse associated constant parsing. 2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
92a372b020 Unify {Impl,Trait}Item as AssocItem. 2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
39073767a4 Unify {Trait,Impl}ItemKind::TyAlias structures. 2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
c02fd31302 TraitItemKind::Type -> TraitItemKind::TyAlias. 2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
f6403c6c76 Use Option in ImplItemKind::Method. 2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
73557faed2 Use Option in ImplItemKind::Const. 2019-12-12 17:54:48 +01:00
Mazdak Farrokhzad
c4bbe9cbbe Alias TraitItem & ImplItem.
Allow defaultness on trait items syntactically.
2019-12-12 17:54:48 +01:00
Antonio Huete Jimenez
0f47327a69
Remove i686-unknown-dragonfly target 2019-12-12 17:26:11 +01:00
Aaron Hill
47e932b96e
Fix weird implicit dependency between rustllvm and rustc_codegen_llvm
rustllvm relies on the `LLVMRustStringWriteImpl` symbol existing, but
this symbol was previously defined in a *downstream* crate
(rustc_codegen_llvm, which depends on rustc_llvm.

While this somehow worked under the old 'separate bootstrap step for
codegen' scheme, it meant that rustc_llvm could not actually be built by
itself, since it relied linking to the downstream rustc_codegen_llvm
crate.

Now that librustc_codegen_llvm is just a normal crate, we actually try
to build a standalone rustc_llvm when we run tests. This commit moves
`LLVMRustStringWriteImpl` into rustc_llvm (technically the rustllvm
directory, which has its contents built by rustc_llvm). This ensures
that we can build each crate in the graph by itself, without requiring
that any downstream crates be linked in as well.
2019-12-12 10:51:19 -05:00
Ralf Jung
14b2436993 avoid more intermediate allocations in validation errors 2019-12-12 16:48:46 +01:00