106595 Commits

Author SHA1 Message Date
bors
c9290dceee Auto merge of #68558 - HeroicKatora:buf-writer-capacity, r=alexcrichton
Add a method to query the capacity of a BufWriter and BufReader

Besides the obvious of retrieving the parameter used to construct the writer, this method allows consumers to control the number of `flush` calls during write operations. For `BufReader` it gives an upper bound on the returned buffer in `fill_buf` which might influence the allocation behaviour of a consumer.
2020-02-04 20:30:53 +00:00
Dylan MacKenzie
3e9fd80bd7 Add tests for newly const arithmetic fns
Co-Authored-By: 9999years <rbt@sent.as>
2020-02-04 11:04:04 -08:00
Dylan MacKenzie
dda015aebc Make saturating arithmetic using intrinsics const 2020-02-04 11:04:04 -08:00
Dylan MacKenzie
526304da16 Make checked division const 2020-02-04 11:04:04 -08:00
Dylan MacKenzie
d4529bec02 Const-stabilize some arithmetic intrinsics 2020-02-04 11:04:04 -08:00
Dylan MacKenzie
b46d1d2718 Make wrapping arithmetic const
Co-Authored-By: 9999years <rbt@sent.as>
2020-02-04 11:04:04 -08:00
Dylan MacKenzie
b422a19c43 Make saturating_mul a const fn
Co-Authored-By: 9999years <rbt@sent.as>
2020-02-04 11:04:04 -08:00
Dylan MacKenzie
de52a541d5 Make overflowing arithmetic const
Co-Authored-By: 9999years <rbt@sent.as>
2020-02-04 11:04:03 -08:00
Dylan MacKenzie
37c141885a Make checked arithmetic besides division const
Co-Authored-By: 9999years <rbt@sent.as>
2020-02-04 11:04:03 -08:00
Dylan MacKenzie
d9e3d2a531 Make euclidean division const
Co-Authored-By: 9999years <rbt@sent.as>
2020-02-04 11:04:03 -08:00
Aaron Hill
302f8c97ea
Remove the overlapping_marker_traits feature
See #29864

This has been replaced by `#[feature(marker_trait_attr)]`

A few notes:

* Due to PR #68057 not yet being in the bootstrap compiler, it's
  necessary to continue using `#![feature(overlapping_marker_traits)]`
  under `#[cfg(bootstrap)]` to work around type inference issues.
* I've updated tests that used `overlapping_marker_traits` to now use
  `marker_trait_attr` where applicable

The test `src/test/ui/overlap-marker-trait.rs` doesn't make any sense
now that `overlapping_marker_traits`, so I removed it.

The test `src/test/ui/traits/overlap-permitted-for-marker-traits-neg.rs`
now fails, since it's no longer possible to have multiple overlapping
negative impls of `Send`. I believe that this is the behavior we want
(assuming that `Send` is not going to become a `#[marker]` trait, so I
renamed the test to `overlap-permitted-for-marker-traits-neg`
2020-02-04 13:20:47 -05:00
bjorn3
3e61d52784 Remove unused feature gates from librustc_errors 2020-02-04 19:18:11 +01:00
bjorn3
cf862df494 Remove unused feature gates from librustc_driver 2020-02-04 19:18:11 +01:00
bjorn3
2a4596abfb Remove unused feature gates from librustc_data_structures 2020-02-04 19:18:10 +01:00
bjorn3
c2da8b3f0d Remove unused feature gates from cg_ssa and cg_utils 2020-02-04 19:18:10 +01:00
bjorn3
f9971c5cba Remove unused feature gates from cg_llvm
Also turns a few `box` into `Box::new`
2020-02-04 18:22:59 +01:00
bjorn3
095963f91d Remove unused feature gates from librustc 2020-02-04 18:22:59 +01:00
bjorn3
bdacdf49e5 Remove unused core_intrinsics feature gate from bootstrap 2020-02-04 18:22:59 +01:00
bors
5b0caef54a Auto merge of #68377 - estebank:fn-obligations-spans, r=oli-obk
Tweak obligation error output

- Point at arguments or output when fn obligations come from them, or ident when they don't
- Point at `Sized` bound (fix #47990)
- When object unsafe trait uses itself in associated item suggest using `Self` (fix #66424, fix #33375, partially address #38376, cc #61525)
-  Point at reason in object unsafe trait with `Self` in supertraits or `where`-clause (cc #40533, cc #68377)
- On implicit type parameter `Sized` obligations, suggest `?Sized` (fix #57744, fix #46683)
2020-02-04 17:17:55 +00:00
bors
126ad2b813 Auto merge of #68708 - Mark-Simulacrum:stage0-step, r=pietroalbini
Step stage0 to bootstrap from 1.42

This also includes a commit which fixes the rustfmt downloading logic to redownload when the rustfmt channel changes, and bumps rustfmt to a more recent version.
2020-02-04 14:16:18 +00:00
Jonas Schievink
fb66b9ee3b Don't emit StorageDead for the resume argument 2020-02-04 14:25:55 +01:00
Mark Rousskov
dbc9894095 Drop unused extern crates 2020-02-04 08:14:08 -05:00
Jonas Schievink
895aab2263 Take resume argument from the right generator type
I suppose we could also just put `tcx.mk_unit()` here, but this
works too
2020-02-04 13:52:09 +01:00
Jonas Schievink
72776e6b5d Remove obsolete test 2020-02-04 13:35:43 +01:00
Jonas Schievink
cc66d29e43 Update error message with too many parameters 2020-02-04 13:35:38 +01:00
Jonas Schievink
341eaf5f55 Add more tests for generator resume arguments 2020-02-04 13:18:29 +01:00
bors
bae3d0dfc7 Auto merge of #68804 - ecstatic-morse:qualif-cursor-lazy, r=estebank
Always use lazy qualif getters during const-checking

`has_mut_interior_eager_seek` was needed to work around an overly restrictive bound on the `per_local` argument to the `Qualif` trait. This PR makes that bound `FnMut` instead of `Fn` so we can seek cursors inside of it, resolving a FIXME in the const-checking code.
2020-02-04 10:58:45 +00:00
msizanoen1
39633874ae Add tests for RISC-V C ABI 2020-02-04 17:28:16 +07:00
bors
fc07615c49 Auto merge of #68601 - 0dvictor:split, r=tmandry
Split `join_codegen_and_link()` into two steps

`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
2020-02-04 05:48:54 +00:00
msizanoen1
e590164175 Implement proper C ABI lowering for RISC-V 2020-02-04 11:55:31 +07:00
Esteban Küber
109d5c189f Tweak borrow error on FnMut when Fn is expected 2020-02-03 18:02:44 -08:00
Esteban Küber
0f73133be6 Suggest split_at_mut on multiple mutable index access 2020-02-03 18:00:14 -08:00
Matthias Krüger
fe1314dbc4 fix couple of perf related clipyp warnings
librustc: don't clone a type that is copy
librustc_incremental: use faster vector initialization
librustc_typeck: don't clone a type that is copy
librustdoc: don't create a vector where a slice will do
2020-02-04 02:35:56 +01:00
Victor Ding
ae51d2ba32 Split join_codegen_and_link() into two steps
`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
2020-02-04 11:09:50 +11:00
Matthias Krüger
697ef95c9f remove redundant imports (clippy::single_component_path_imports) 2020-02-04 01:05:45 +01:00
Oliver Middleton
5f689fe466 Remove Copy impl from OnceWith
Iterators typically don't implement `Copy` and this shouldn't be an exception.
2020-02-03 22:30:17 +00:00
bors
42a0bd2091 Auto merge of #67668 - matthewjasper:or-patterns, r=pnkfelix
Implement MIR lowering for or-patterns

This is the last thing needed to get meaningful run-pass tests for or-patterns. There probably need to be more tests before stabilizing this, but the most important cases should have been covered.

Note: we can generate exponentially large MIR CFGs when using or-patterns containing bindings, type ascriptions, or that are for a match arm with a guard. `src/test/mir-opt/exponential-or.rs` shows the best case for what we currently do.

cc #54883
closes #60350
closes #67514

cc @Centril
r? @pnkfelix
2020-02-03 22:02:26 +00:00
Mark Mansi
5e086c842f some cleanup/fixes 2020-02-03 13:45:46 -06:00
Matthew Jasper
8dbbe4d144 Avoid scheduling repeated StorageDeads
Also add some comments
2020-02-03 19:42:15 +00:00
Matthew Jasper
9b9dafb2c8 Make use of Place: Copy 2020-02-03 19:42:15 +00:00
matthewjasper
1d90ed6370 Apply suggestions from code review
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-02-03 19:42:15 +00:00
Matthew Jasper
89e52e2ca9 Address review comments 2020-02-03 19:42:15 +00:00
Matthew Jasper
5f90dbd5e8 Make Candidate private 2020-02-03 19:42:15 +00:00
Matthew Jasper
c7e6f88926 Add more tests for or-patterns 2020-02-03 19:42:15 +00:00
Matthias Krüger
5f979e9afa bootstrap: fix clippy warnings 2020-02-03 20:26:36 +01:00
Mark Mansi
adc8cd9680 update rustc-guide 2020-02-03 12:57:39 -06:00
Esteban Küber
0e584114c6 Change wording for object unsafe because of assoc const 2020-02-03 10:54:16 -08:00
bors
8417d68de5 Auto merge of #68803 - Dylan-DPC:rollup-b4x6ghj, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #68678 (Install robots.txt into rust-docs tarballs)
 - #68711 (Added upper bound of what vecs and boxes can allocate)
 - #68744 (Do not ICE in `type-alias-impl-trait` with save-analysis)
 - #68777 (Clean up E0263 explanation)
 - #68787 (Optimize core::ptr::align_offset (part 1))
 - #68797 (Fix links to types instead of modules)
 - #68798 (Test that `#[track_caller]` as `fn()` respects RT / CTFE equivalence)
 - #68800 (Stabilize `core::iter::once_with()`)

Failed merges:

r? @ghost
2020-02-03 18:40:54 +00:00
Dylan MacKenzie
21a040e7ac Treat Rvalue::AddressOf the same as Rvalue::Ref 2020-02-03 10:38:32 -08:00
Dylan MacKenzie
110a7e25b6 Eliminate "eager" qualif getter
All qualif getters are now lazy
2020-02-03 10:33:33 -08:00