Commit Graph

88759 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
ebbecac538
Rollup merge of #57296 - JosephTLyons:Fix-question-mark-operator-in-stdio-document, r=wesleywiser
Fixed the link to the ? operator

I'm working on updating all broken links, but figured I'd break up the pull requests so they are easier to review, versus just one big pull request.
2019-01-12 10:54:58 +01:00
Mazdak Farrokhzad
40a819b7df
Rollup merge of #57192 - czipperz:error_trait_doc_cause_to_source, r=wesleywiser
Change std::error::Error trait documentation to talk about `source` instead of `cause`

Resolves #57056
2019-01-12 10:54:57 +01:00
Mazdak Farrokhzad
bd8f464877
Rollup merge of #57175 - oli-obk:const_let_stabilization, r=nikomatsakis
Stabilize `let` bindings and destructuring in constants and const fn

r? @Centril

This PR stabilizes the following features in constants and `const` functions:

* irrefutable destructuring patterns (e.g. `const fn foo((x, y): (u8, u8)) { ... }`)
* `let` bindings (e.g. `let x = 1;`)
* mutable `let` bindings (e.g. `let mut x = 1;`)
* assignment (e.g. `x = y`) and assignment operator (e.g. `x += y`) expressions, even where the assignment target is a projection (e.g. a struct field or index operation like `x[3] = 42`)
* expression statements (e.g. `3;`)

This PR does explicitly *not* stabilize:

* mutable references (i.e. `&mut T`)
* dereferencing mutable references
* refutable patterns (e.g. `Some(x)`)
* operations on `UnsafeCell` types (as that would need raw pointers and mutable references and such, not because it is explicitly forbidden. We can't explicitly forbid it as such values are OK as long as they aren't mutated.)
* We are not stabilizing `let` bindings in constants that use `&&` and `||` short circuiting operations. These are treated as `&` and `|` inside `const` and `static` items right now. If we stopped treating them as `&` and `|` after stabilizing `let` bindings, we'd break code like `let mut x = false; false && { x = true; false };`. So to use `let` bindings in constants you need to change `&&` and `||` to `&` and `|` respectively.
2019-01-12 10:54:56 +01:00
Mazdak Farrokhzad
017f046c13
Rollup merge of #57042 - pnkfelix:issue-57038-sidestep-ice-in-fieldplacement-count, r=michaelwoerister
Don't call `FieldPlacement::count` when count is too large

Sidestep ICE in `FieldPlacement::count` by not calling it when count will not fit in host's usize.

(I briefly played with trying to fix this by changing `FieldPlacement::count` to return a `u64`. However, based on how `FieldPlacement` is used, it seems like this would be a largely pointless pursuit... I'm open to counter-arguments, however.)

Fix #57038
2019-01-12 10:54:54 +01:00
Mazdak Farrokhzad
53aa8a1ad0
Rollup merge of #56906 - blitzerr:master, r=nikomatsakis
Issue #56905

Adding a map to TypeckTables to get the list of all the Upvars
given a closureID. This is help us get rid of the recurring
pattern in the codebase of iterating over the free vars
using with_freevars.
2019-01-12 10:54:53 +01:00
Mazdak Farrokhzad
e69a5cb2d7
Rollup merge of #56425 - scottmcm:redo-vec-set_len-docs, r=Centril
Redo the docs for Vec::set_len

Inspired by the [recent conversation on IRLO](https://internals.rust-lang.org/t/make-vec-set-len-enforce-the-len-cap-invariant/8927/23?u=scottmcm).

This is just my first stab at this; suggestions welcome.
2019-01-12 10:54:51 +01:00
Mazdak Farrokhzad
6c623224dc const_let: --bless with --compare-mode=nll 2019-01-12 10:32:27 +01:00
Mazdak Farrokhzad
3dc08ed068 move const_let accepted gate to avoid future conflict. 2019-01-12 10:31:52 +01:00
bors
1190f7cdf7 Auto merge of #57532 - Centril:stabilize-2175, r=varkor
Stabilize #![feature(if_while_or_patterns)]

r? @varkor

Per https://github.com/rust-lang/rust/issues/56212#issue-384085857.
Leading `|` is also accepted per the comment in the stabilization proposal.
2019-01-12 08:40:17 +00:00
Mazdak Farrokhzad
0e1402dcda bless ui/while-let 2019-01-12 08:59:12 +01:00
Esteban Küber
1550787b13 Add label for invalid literal suffix 2019-01-11 23:37:49 -08:00
Esteban Küber
3ead6de40d Tweak incorrect discriminator value variant error 2019-01-11 23:12:29 -08:00
Esteban Küber
7feb802d89 Small tweaks to parser errors 2019-01-11 22:04:54 -08:00
Esteban Küber
de3c4be099 Tweak type argument after assoc type error 2019-01-11 21:45:24 -08:00
Esteban Küber
8119017746 Continue evaluating after finding incorrect .. in pattern 2019-01-11 21:33:57 -08:00
Esteban Küber
975f8b5e32 fix test 2019-01-11 21:21:30 -08:00
Esteban Küber
8bede50f23 Continue evaluating after incorrect float literal 2019-01-11 21:19:44 -08:00
Esteban Küber
65a8d7b1d8 fix tests 2019-01-11 21:07:46 -08:00
Esteban Küber
57f17e91d0 Continue evaluating after type argument in where clause 2019-01-11 21:05:48 -08:00
Esteban Küber
5d2f31cddc Continue evaluating after missing for in impl Trait for Foo 2019-01-11 20:58:51 -08:00
Esteban Küber
d8610b31ec Continue evaluating after parsing incorrect binary literal 2019-01-11 19:56:41 -08:00
Esteban Küber
fc4b54157f Continue parsing after lifetime in incorrect location 2019-01-11 19:41:43 -08:00
Esteban Küber
5c67ba615c Continue parser after trailing type argument attribute 2019-01-11 19:31:45 -08:00
varkor
afcb938116 Stabilise irrefutable if-let and while-let patterns
This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495).

Co-Authored-By: Sebastian Malton <sebastian@malton.name>
2019-01-12 03:10:59 +00:00
bors
0c91f3d97f Auto merge of #57234 - Centril:const-stabilizations-2, r=oli-obk
Const-stabilize `const_int_ops` + `const_ip`

r? @oli-obk

## Note for relnotes: This PR includes https://github.com/rust-lang/rust/pull/57105.

I've added T-lang since this affects intrinsics and the operational semantics of Rust's `const fn` fragment.

## Stable APIs proposed for constification

+ `const_int_ops`:
    + `count_ones`
    + `count_zeros`
    + `leading_zeros`
    + `trailing_zeros`
    + `swap_bytes`
    + `from_be`
    + `from_le`
    + `to_be`
    + `to_le`
+ `const_ip`
    + `Ipv4Addr::new`

## Unstable APIs constified

+ `const_int_conversion`:
    + `reverse_bits`
2019-01-12 02:00:18 +00:00
Mazdak Farrokhzad
561483e4e8 stabilize top level or-pats in if/while let. 2019-01-11 23:57:04 +01:00
David Sanders
49e8318b0c
Fixing a typographical error. 2019-01-11 13:58:13 -08:00
Alexander Ronald Altman
fdd2f0d823
Fix new hyperlinks in RELEASES.md 2019-01-11 13:59:04 -06:00
Andy Russell
020e1f5b60
don't unwrap unexpected tokens in format!
Fixes #57512.
2019-01-11 13:00:44 -05:00
Alexander Ronald Altman
434fe4e356
Correct RELEASES.md for 1.32.0
The `into_to_from_bytes` feature was stabilized for `i128` and `u128` just like for the other integer types, but they seem to have been missed.
2019-01-11 11:06:56 -06:00
Steve Klabnik
186d5d7fd4 re-do docs for core::cmp
Fixes #32934
2019-01-11 12:00:09 -05:00
Shotaro Yamada
0f34e0dabb Add fmt benchmarks 2019-01-12 01:54:57 +09:00
bors
b43986184b Auto merge of #57470 - RalfJung:miri, r=oli-obk
update miri

r? @oli-obk
2019-01-11 16:28:45 +00:00
bors
88f19a774f Auto merge of #57355 - arielb1:correct-subst, r=nikomatsakis
use the correct supertrait substitution in `object_ty_for_trait`

beta-nominating because regression.

Fixes #57156.
2019-01-11 12:04:24 +00:00
Oliver Scherer
16a4e477d8 Remove unneeded but benign change 2019-01-11 12:19:08 +01:00
Jethro Beekman
928efca151 Fix undefined behavior 2019-01-11 15:00:08 +05:30
Nick Cameron
4103e5b34b Add a profiles section to the manifest 2019-01-11 18:13:45 +13:00
John Kåre Alsaker
e69c2c75d6 Address comments 2019-01-11 04:58:46 +01:00
John Kåre Alsaker
468254b38f Update tests 2019-01-11 03:53:30 +01:00
John Kåre Alsaker
69d18a3986 Make more passes incremental 2019-01-11 03:53:29 +01:00
DebugSteven
ca47808479 add test for pub extern crate 2019-01-10 21:18:46 -05:00
DebugSteven
3f03297956 inline pub extern crate statements 2019-01-10 20:27:44 -05:00
Nick Cameron
27989ec30b
Remove submodule step from README
Since the bootstrap does it now
2019-01-11 14:27:12 +13:00
bors
729d3f07b4 Auto merge of #57471 - Aaronepower:master, r=Aaronepower
Updated RELEASES.md for 1.32.0

[Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

r? @Mark-Simulacrum
cc @rust-lang/release
2019-01-11 00:20:04 +00:00
Aaron Power
890a8a45c2
Update RELEASES.md 2019-01-10 23:28:18 +01:00
Mazdak Farrokhzad
e598ea83c8
Update src/libstd/path.rs
Co-Authored-By: steveklabnik <steve@steveklabnik.com>
2019-01-10 17:08:42 -05:00
Steve Klabnik
beb6495862 note that FromStr does not work for borrowed types
Fixes #47757
2019-01-10 17:08:27 -05:00
Aaron Power
359e6bf30b
Update RELEASES.md 2019-01-10 23:07:38 +01:00
Niko Matsakis
b411994b3b new trait alias tests
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2019-01-10 17:04:26 -05:00
Niko Matsakis
1336b8e8c7 integrate trait aliases into def-paths / metadata
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2019-01-10 17:04:19 -05:00