Commit Graph

104400 Commits

Author SHA1 Message Date
Mark Rousskov
380afc1fac
Rollup merge of #67351 - Mark-Simulacrum:always-channel, r=pietroalbini
Set release channel on non-dist builders

Toolstate publication only runs if the channel is "nightly" and
previously the toolstate builders did not know that the channel was
nightly (since they are not dist builders).

A look through bootstrap seems to indicate that nothing should directly
depend on the channel being set to `-dev` on the test builders, though
this may cause some problems with UI tests (if for some reason they're
dumping the channel into stderr), but we cannot find evidence of such so
hopefully this is fine.

r? @pietroalbini
2019-12-19 17:53:54 -05:00
Mark Rousskov
9d1baaf11d
Rollup merge of #67281 - llogiq:nonoverlapping-insert, r=alexcrichton
add string.insert benchmarks

This adds benchmarks for `String::insert` and `String::insert_str`
2019-12-19 17:53:53 -05:00
Mark Rousskov
939beb58d3
Rollup merge of #67253 - elichai:2019-12-fmt, r=Dylan-DPC
Add more delegations to the fmt docs and add doctests

HI,
this is a continuation to #67021
I replaced the `Debug` example with one that use the `Debug*` helpers so that padding etc will work too.
I also added asserts for the doctests as @RalfJung asked :)

The only thing I left with the `write!` macro is the `Display` example as I didn't know if there's a better way to do that.

r? @QuietMisdreavus
2019-12-19 17:53:52 -05:00
Mazdak Farrokhzad
6286a1d7eb slice_or_array_pattern: remove dead code.
After #62550, it is no longer possible for `slice`
to be other than `None | Some(Binding(..) | Wild)`.
In particular, `lower_pat_slice` may never generate
`Some(Array(..) | Slice(..))` and so there is nothing
to flatten into `slice`.
2019-12-19 23:31:27 +01:00
Mazdak Farrokhzad
cc3160bbbf lower_pattern_unadjusted: simplify Or(..) branch. 2019-12-19 23:14:52 +01:00
Mazdak Farrokhzad
d63c324a15 lower_pattern_unadjusted: extract lower_tuple_subpats. 2019-12-19 23:09:33 +01:00
Mazdak Farrokhzad
eb020bc245 lower_pattern_unadjusted: simplify Binding(..) branch.
Avoid calling `.node_type(...)` again.
2019-12-19 22:58:20 +01:00
Mazdak Farrokhzad
be6381e9e0 lower_pattern_unadjusted: cleanup Tuple(..) branch. 2019-12-19 22:51:32 +01:00
Mazdak Farrokhzad
3b0af1d87d lower_pattern_unadjusted: cleanup Slice(..) branch. 2019-12-19 22:45:42 +01:00
Mazdak Farrokhzad
2a9f1f8c02 lower_pattern_unadjusted: extract common ty::Error code. 2019-12-19 22:41:34 +01:00
Mazdak Farrokhzad
ceaec1da06 check_pat_slice: extract check_aray_pat_len.
Also use `types.err` when matching on `expected.kind`s
which don't match `ty::Array(..) | ty::Slice(_)`.
2019-12-19 22:27:06 +01:00
Matthew Jasper
97219d87fe Don't suppress move errors for union fields 2019-12-19 20:28:57 +00:00
Mark Rousskov
1787b2b5ab Fix toolstate history format
We were inserting *before* the existing newline, so we should prepend it
not append it to our inserted string.
2019-12-19 13:48:36 -05:00
Mazdak Farrokhzad
13b71018c1 lower_pattern_unadjusted: remove dead code.
The code is dead because `check_pat_slice` will never have
`expected = ty::Ref(...)` due to default-binding-modes
(see `is_non_ref_pat`, `peel_off_references`).

Moreover, if the type is not `ty::Array(_) | ty::Slice(_)`
then `check_pat_slice` enters an error branch.
2019-12-19 19:43:07 +01:00
Mazdak Farrokhzad
7d99e4e4c2 check_pat_slice: shadow 'expected' to make sure it's not used again 2019-12-19 19:18:41 +01:00
Jakub Kądziołka
df93bab135
Correct the todo! stabilization version 2019-12-19 19:09:20 +01:00
Mazdak Farrokhzad
3a93a0e860 HAIR lowering: improve code quality for slices 2019-12-19 18:19:14 +01:00
Mazdak Farrokhzad
4414f0d0e0 is_binding_pat: treat or-pat like tuple-pat 2019-12-19 17:33:10 +01:00
Mazdak Farrokhzad
ffbde9f44a is_binding_pat: don't use _ arm 2019-12-19 17:19:55 +01:00
Guillaume Gomez
94d207f4b2 Clean up E0121 long explanation 2019-12-19 13:45:36 +01:00
Guillaume Gomez
020be74f6b Clean up E0120 long explanation 2019-12-19 13:45:28 +01:00
LeSeulArtichaut
bfc02bdd3c
Fix documentation typo 2019-12-19 12:58:42 +01:00
bors
0de96d37fb Auto merge of #67419 - Centril:rollup-v7b0ypv, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #67189 (Unify binop wording)
 - #67270 (std: Implement `LineWriter::write_vectored`)
 - #67286 (Fix the configure.py TOML field for a couple LLVM options)
 - #67321 (make htons const fn)
 - #67382 (Remove some unnecessary `ATTR_*` constants.)
 - #67389 (Remove `SO_NOSIGPIPE` dummy variable on platforms that don't use it.)
 - #67394 (Remove outdated references to @T from comments)
 - #67406 (Suggest associated type when the specified one cannot be found)

Failed merges:

r? @ghost
2019-12-19 11:33:00 +00:00
Mazdak Farrokhzad
06985c6859
Rollup merge of #67406 - ohadravid:suggest-assoc-type, r=estebank
Suggest associated type when the specified one cannot be found

Fixes #67386, so code like this:
```
use std::ops::Deref;

fn homura<T: Deref<Trget = i32>>(_: T) {}

fn main() {}
```

results in:
```
error[E0220]: associated type `Trget` not found for `std::ops::Deref`
 --> type-binding.rs:6:20
  |
6 | fn homura<T: Deref<Trget = i32>>(_: T) {}
  |                    ^^^^^^^^^^^ help: there is an associated type with a similar name: `Target`

error: aborting due to previous error
```

(The `help` is new)

I used an `all_candidates: impl Fn() -> Iterator<...>` instead of `collect`ing to avoid the cost of allocating the Vec when no errors are found, at the expense of a little added complexity.

r? @estebank
2019-12-19 10:30:01 +01:00
Mazdak Farrokhzad
cfa7581028
Rollup merge of #67394 - matthew-healy:update-libsyntax-ptr-docs, r=Dylan-DPC
Remove outdated references to @T from comments

Closes #67341.

This removes all references to `@T` from the comment in libsyntax/ptr.rs.
2019-12-19 10:30:00 +01:00
Mazdak Farrokhzad
6d60606a17
Rollup merge of #67389 - reitermarkus:dummy-variable, r=shepmaster
Remove `SO_NOSIGPIPE` dummy variable on platforms that don't use it.
2019-12-19 10:29:59 +01:00
Mazdak Farrokhzad
126c8adb33
Rollup merge of #67382 - nnethercote:rm-unnecessary-ATTR-constants, r=michaelwoerister
Remove some unnecessary `ATTR_*` constants.

r? @michaelwoerister
2019-12-19 10:29:57 +01:00
Mazdak Farrokhzad
910bb6530c
Rollup merge of #67321 - lzutao:htons, r=dtolnay
make htons const fn

This may partially help #67315.
2019-12-19 10:29:56 +01:00
Mazdak Farrokhzad
0f19977797
Rollup merge of #67286 - cuviper:configure-llvm, r=Dylan-DPC
Fix the configure.py TOML field for a couple LLVM options

The actual fields in `config.toml.example` have dashes, not underscores.
2019-12-19 10:29:54 +01:00
Mazdak Farrokhzad
bd8862340d
Rollup merge of #67270 - alexcrichton:write-more-line-writer, r=sfackler
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-19 10:29:53 +01:00
Mazdak Farrokhzad
eac5fb8b0a
Rollup merge of #67189 - LeSeulArtichaut:binop-wording, r=estebank
Unify binop wording

Closes #60497
r? @estebank
2019-12-19 10:29:51 +01:00
Christoph Schmidler
12d65c28a6 Split up ptr/mod.rs in libcore, one with implementation detail for const ptr and the other with mut ptr 2019-12-19 09:01:26 +01:00
Mark Rousskov
cbd1e73124 Set release channel on non-dist builders
Toolstate publication only runs if the channel is "nightly" and
previously the toolstate builders did not know that the channel was
nightly (since they are not dist builders).

A look through bootstrap seems to indicate that nothing should directly
depend on the channel being set to `-dev` on the test builders, though
this may cause some problems with UI tests (if for some reason they're
dumping the channel into stderr), but we cannot find evidence of such so
hopefully this is fine.
2019-12-18 22:44:42 -05:00
Mark Mansi
7d268119f0 no need to bootstrap 2019-12-18 20:19:05 -06:00
Mark Mansi
253543560a add fixme 2019-12-18 20:19:05 -06:00
Mark Mansi
951f041347 fix import 2019-12-18 20:19:05 -06:00
Mark Mansi
baaf864e07 use usize::MAX instead of !0 2019-12-18 20:19:05 -06:00
Mark Mansi
3ec3fca414 remove a bit more hackery 2019-12-18 20:19:05 -06:00
Mark Mansi
17aa0cb2ca Remove a const-if-hack in RawVec 2019-12-18 20:19:05 -06:00
bors
c605199e89 Auto merge of #67402 - Mark-Simulacrum:stage0-step, r=alexcrichton
Switch bootstrap to 1.41

This updates the version number for master to 1.42 and switches the bootstrap compiler to yesterday's beta. Fallout of cfg(bootstrap) changes is also dealt with.
2019-12-18 22:03:29 +00:00
Mateusz Mikuła
44603a5cd6 Reenable static linking of libstdc++ on windows-gnu 2019-12-18 22:48:24 +01:00
Matthew Jasper
a74911662e Fix comment ordering 2019-12-18 20:30:00 +00:00
Matthew Jasper
6dcc78997f Add more tests for raw_ref_op 2019-12-18 20:30:00 +00:00
Matthew Jasper
15931947f5 Update test now that reference to pointer casts have more checks 2019-12-18 20:30:00 +00:00
Matthew Jasper
7b0cc6a439 Check const-propagation of borrows of unsized places 2019-12-18 20:09:11 +00:00
Matthew Jasper
7081c79b7e Add mir opt test for AddressOf 2019-12-18 20:09:11 +00:00
Matthew Jasper
5fb797ca75 Make slice drop shims use AddressOf 2019-12-18 20:09:10 +00:00
Matthew Jasper
35919ace70 Start generating AddressOf rvalues in MIR
`hir::BorrowKind::Raw` borrows and casting a reference to a raw
pointer no longer do a reborrow followed by a cast. Instead we
dereference and take the address.
2019-12-18 20:09:10 +00:00
Matthew Jasper
3a19fbf95d Add Rvalue::AddressOf to MIR
This operator creates a raw pointer to a Place directly, without first
creating a reference. See RFC #2582 for motivation.

The Rvalue is currently unused.
2019-12-18 20:09:10 +00:00
Ohad Ravid
a4a2fc0af3 Suggest associated type when the specified one cannot be found 2019-12-18 21:07:32 +01:00