Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #53620

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
83d5a60
Feature gate where clauses on associated type impls
varkor Aug 9, 2018
f2445fb
Rename `Catch` variants to `TryBlock`
scottmcm Jul 22, 2018
1c90609
Add `try` to syntax_pos as an edition-2018-only keyword
scottmcm Jul 22, 2018
9e64ce1
Parse try blocks with the try keyword instead of do catch placeholder
scottmcm Jul 22, 2018
ef19886
Fix the unstable book
scottmcm Jul 22, 2018
91967a8
Put `try` in the reserved list, not the in-use list
scottmcm Jul 23, 2018
817efc2
Suggest `try` if someone uses `do catch`
scottmcm Jul 25, 2018
9f683be
Rename `catch_expr` feature to `try_blocks`
scottmcm Jul 25, 2018
5cf387c
Update try-block tests to work under NLL
scottmcm Jul 28, 2018
e428085
Make a try-blocks folder for all the try{} UI tests
scottmcm Aug 13, 2018
0095471
Switch out another use of `do catch`
scottmcm Aug 20, 2018
04b50e2
Convert `AllSets::on_entry_sets` to a `Vec<IdxSetBuf<E>>`.
nnethercote Aug 17, 2018
ab8dfbc
Merge `IdxSet` and `IdxSetBuf`.
nnethercote Aug 17, 2018
e7e9f2e
Remove IdxSet typedef and Rename {,Hybrid}IdxSetBuf as {,Hybrid}IdxSet.
nnethercote Aug 17, 2018
11f3918
docs: std::string::String.repeat(): slightly rephrase to be more in-l…
matthiaskrgr Aug 22, 2018
f07245c
Update RELEASES.md
Aaronepower Aug 22, 2018
c9c4f5e
Fix a grammatical mistake in "expected generic arguments" errors
varkor Aug 22, 2018
200c6d9
Update RELEASES.md
Aaronepower Aug 22, 2018
b34503e
Stabilize a few secondary macro features
petrochenkov Aug 17, 2018
a15b617
tidy: Stop requiring a license header
joshtriplett Aug 22, 2018
b188c2a
Lament the invincibility of the Turbofish
varkor Aug 21, 2018
9146d03
Rollup merge of #52602 - scottmcm:tryblock-expr, r=nikomatsakis
Mark-Simulacrum Aug 22, 2018
e3668a3
Rollup merge of #53235 - varkor:gat_impl_where, r=estebank
Mark-Simulacrum Aug 22, 2018
197d4d1
Rollup merge of #53459 - petrochenkov:stabmore, r=nrc
Mark-Simulacrum Aug 22, 2018
2c0ff41
Rollup merge of #53520 - nnethercote:merge-IdxSet-IdxSetBuf, r=nikoma…
Mark-Simulacrum Aug 22, 2018
3da92a0
Rollup merge of #53562 - varkor:bastion-of-the-turbofish, r=nagisa
Mark-Simulacrum Aug 22, 2018
b71140a
Rollup merge of #53592 - matthiaskrgr:str_doc, r=alexcrichton
Mark-Simulacrum Aug 22, 2018
8625fa5
Rollup merge of #53594 - rust-lang:Aaronepower-patch-1, r=Mark-Simula…
Mark-Simulacrum Aug 22, 2018
96e9507
Rollup merge of #53600 - varkor:expected-generic-arg-s, r=eddyb
Mark-Simulacrum Aug 22, 2018
df0a576
Rollup merge of #53617 - joshtriplett:tidy-no-license-header, r=Mark-…
Mark-Simulacrum Aug 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions RELEASES.md
Expand Up @@ -39,6 +39,8 @@ Misc
will demote `deny` and `forbid` lints to `warn`.
- [`rustc` and `rustdoc` will now have the exit code of `1` if compilation
fails, and `101` if there is a panic.][52197]
- [A preview of clippy has been made available through rustup.][51122]
You can install the preview with `rustup component add clippy-preview`

Compatibility Notes
-------------------
Expand All @@ -64,6 +66,7 @@ Compatibility Notes
[51619]: https://github.com/rust-lang/rust/pull/51619/
[51656]: https://github.com/rust-lang/rust/pull/51656/
[51178]: https://github.com/rust-lang/rust/pull/51178/
[51122]: https://github.com/rust-lang/rust/pull/51122
[50494]: https://github.com/rust-lang/rust/pull/50494/
[cargo/5614]: https://github.com/rust-lang/cargo/pull/5614/
[cargo/5723]: https://github.com/rust-lang/cargo/pull/5723/
Expand Down
26 changes: 0 additions & 26 deletions src/doc/unstable-book/src/language-features/tool-attributes.md

This file was deleted.

@@ -1,27 +1,29 @@
# `catch_expr`
# `try_blocks`

The tracking issue for this feature is: [#31436]

[#31436]: https://github.com/rust-lang/rust/issues/31436

------------------------

The `catch_expr` feature adds support for a `catch` expression. The `catch`
expression creates a new scope one can use the `?` operator in.
The `try_blocks` feature adds support for `try` blocks. A `try`
block creates a new scope one can use the `?` operator in.

```rust
#![feature(catch_expr)]
```rust,ignore
// This code needs the 2018 edition

#![feature(try_blocks)]

use std::num::ParseIntError;

let result: Result<i32, ParseIntError> = do catch {
let result: Result<i32, ParseIntError> = try {
"1".parse::<i32>()?
+ "2".parse::<i32>()?
+ "3".parse::<i32>()?
};
assert_eq!(result, Ok(6));

let result: Result<i32, ParseIntError> = do catch {
let result: Result<i32, ParseIntError> = try {
"1".parse::<i32>()?
+ "foo".parse::<i32>()?
+ "3".parse::<i32>()?
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/str.rs
Expand Up @@ -513,7 +513,7 @@ impl str {
unsafe { String::from_utf8_unchecked(slice.into_vec()) }
}

/// Create a [`String`] by repeating a string `n` times.
/// Creates a new [`String`] by repeating a string `n` times.
///
/// [`String`]: string/struct.String.html
///
Expand Down
6 changes: 3 additions & 3 deletions src/liballoc/string.rs
Expand Up @@ -752,7 +752,7 @@ impl String {
self.vec
}

/// Extracts a string slice containing the entire string.
/// Extracts a string slice containing the entire `String`.
///
/// # Examples
///
Expand Down Expand Up @@ -1454,8 +1454,8 @@ impl String {
self.vec.clear()
}

/// Creates a draining iterator that removes the specified range in the string
/// and yields the removed chars.
/// Creates a draining iterator that removes the specified range in the `String`
/// and yields the removed `chars`.
///
/// Note: The element range is removed even if the iterator is not
/// consumed until the end.
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/hir/lowering.rs
Expand Up @@ -3613,10 +3613,10 @@ impl<'a> LoweringContext<'a> {
hir::LoopSource::Loop,
)
}),
ExprKind::Catch(ref body) => {
ExprKind::TryBlock(ref body) => {
self.with_catch_scope(body.id, |this| {
let unstable_span =
this.allow_internal_unstable(CompilerDesugaringKind::Catch, body.span);
this.allow_internal_unstable(CompilerDesugaringKind::TryBlock, body.span);
let mut block = this.lower_block(body, true).into_inner();
let tail = block.expr.take().map_or_else(
|| {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ich/impls_syntax.rs
Expand Up @@ -412,7 +412,7 @@ impl_stable_hash_for!(enum ::syntax_pos::hygiene::CompilerDesugaringKind {
QuestionMark,
ExistentialReturnType,
ForLoop,
Catch
TryBlock
});

impl_stable_hash_for!(enum ::syntax_pos::FileName {
Expand Down
1 change: 0 additions & 1 deletion src/librustc/lib.rs
Expand Up @@ -65,7 +65,6 @@
#![feature(trace_macros)]
#![feature(trusted_len)]
#![feature(vec_remove_item)]
#![feature(catch_expr)]
#![feature(step_trait)]
#![feature(integer_atomics)]
#![feature(test)]
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/ty/query/mod.rs
Expand Up @@ -49,7 +49,7 @@ use util::nodemap::{DefIdSet, DefIdMap, ItemLocalSet};
use util::common::{ErrorReported};
use util::profiling::ProfileCategory::*;

use rustc_data_structures::indexed_set::IdxSetBuf;
use rustc_data_structures::indexed_set::IdxSet;
use rustc_target::spec::PanicStrategy;
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
Expand Down Expand Up @@ -208,7 +208,7 @@ define_queries! { <'tcx>
/// Maps DefId's that have an associated Mir to the result
/// of the MIR qualify_consts pass. The actual meaning of
/// the value isn't known except to the pass itself.
[] fn mir_const_qualif: MirConstQualif(DefId) -> (u8, Lrc<IdxSetBuf<mir::Local>>),
[] fn mir_const_qualif: MirConstQualif(DefId) -> (u8, Lrc<IdxSet<mir::Local>>),

/// Fetch the MIR for a given def-id right after it's built - this includes
/// unreachable code.
Expand Down