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 6 pull requests #71037

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4c8bf50
Remove some dead code.
nnethercote Apr 1, 2020
72a28e8
Improve `ModuleConfig` initialization.
nnethercote Apr 1, 2020
5131c69
Rename `modules_config` as `regular_config`.
nnethercote Apr 1, 2020
b0ec96c
Use inner/outer generator naming instead of first/last
tmandry Mar 25, 2020
0c97636
Add test for #68112 (existing output)
tmandry Mar 25, 2020
ce8331f
Improve span label
tmandry Mar 25, 2020
b731478
Don't annotate type when type is opaque
tmandry Mar 25, 2020
455537e
Use "generator" instead of "future" when appropriate
tmandry Mar 25, 2020
9862bbe
Use clearer message when obligation is caused by await expr
tmandry Apr 2, 2020
cd501a6
Don't double-annotate the same Span
tmandry Apr 2, 2020
4687b8d
rustfmt
tmandry Apr 2, 2020
9aeaaa2
Include type info when available for awaited expr
tmandry Apr 2, 2020
9dba024
Fix style nits
tmandry Apr 8, 2020
889cfe1
Incorporate feedback into diagnostics
tmandry Apr 8, 2020
5aac1f3
Update stdarch submodule to use llvm_asm! instead of asm!
Amanieu Apr 10, 2020
921579c
Add or_insert_with_key to Entry of HashMap/BTreeMap
ChaiTRex Apr 10, 2020
7810237
Fixed doc tests for added methods
ChaiTRex Apr 10, 2020
34d608d
Update parking_lot dependency to avoid use of deprecated asm!
Amanieu Apr 10, 2020
43ee31f
Deprecate the asm! macro
Amanieu Apr 10, 2020
7f4048c
Store UNICODE_VERSION as a tuple
pyfisch Apr 11, 2020
b78ff99
Use write!-style syntax for MIR assert terminator
robojumper Apr 11, 2020
db0c39f
Change issue number to point to tracking issue
ChaiTRex Apr 11, 2020
8f98e5d
Rollup merge of #70644 - nnethercote:clean-up-ModuleConfig-init, r=Ma…
Centril Apr 11, 2020
6bad3ee
Rollup merge of #70679 - tmandry:issue-68112, r=nikomatsakis
Centril Apr 11, 2020
b90d0b3
Rollup merge of #70996 - ChaiTRex:master, r=Amanieu
Centril Apr 11, 2020
c8523b7
Rollup merge of #71007 - Amanieu:deprecate_asm, r=Mark-Simulacrum
Centril Apr 11, 2020
6fe2171
Rollup merge of #71020 - pyfisch:unicode-version, r=sfackler
Centril Apr 11, 2020
c6a6be0
Rollup merge of #71021 - robojumper:71000-mir-assert-syntax, r=jonas-…
Centril Apr 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ checksum = "5b31c9b90731276fdd24d896f31bb10aecf2e5151733364ae81123186643d939"
dependencies = [
"jsonrpc-core",
"log",
"parking_lot 0.10.0",
"parking_lot 0.10.2",
"serde",
]

Expand Down Expand Up @@ -1866,9 +1866,9 @@ checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83"

[[package]]
name = "lock_api"
version = "0.3.1"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc"
checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75"
dependencies = [
"scopeguard",
]
Expand Down Expand Up @@ -2406,12 +2406,12 @@ dependencies = [

[[package]]
name = "parking_lot"
version = "0.10.0"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc"
checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e"
dependencies = [
"lock_api",
"parking_lot_core 0.7.0",
"parking_lot_core 0.7.1",
]

[[package]]
Expand All @@ -2431,9 +2431,9 @@ dependencies = [

[[package]]
name = "parking_lot_core"
version = "0.7.0"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1"
checksum = "0e136c1904604defe99ce5fd71a28d473fa60a12255d511aa78a9ddf11237aeb"
dependencies = [
"cfg-if",
"cloudabi",
Expand Down Expand Up @@ -3251,7 +3251,7 @@ dependencies = [
"lazy_static 1.4.0",
"log",
"measureme",
"parking_lot 0.10.0",
"parking_lot 0.10.2",
"rustc-ap-graphviz",
"rustc-ap-rustc_index",
"rustc-ap-serialize",
Expand Down Expand Up @@ -3696,7 +3696,7 @@ dependencies = [
"lazy_static 1.4.0",
"log",
"measureme",
"parking_lot 0.10.0",
"parking_lot 0.10.2",
"rustc-hash",
"rustc-rayon",
"rustc-rayon-core",
Expand Down Expand Up @@ -3991,7 +3991,7 @@ dependencies = [
"jobserver",
"log",
"measureme",
"parking_lot 0.10.0",
"parking_lot 0.10.2",
"polonius-engine",
"rustc-rayon",
"rustc-rayon-core",
Expand Down Expand Up @@ -4140,7 +4140,7 @@ name = "rustc_query_system"
version = "0.0.0"
dependencies = [
"log",
"parking_lot 0.9.0",
"parking_lot 0.10.2",
"rustc-rayon-core",
"rustc_data_structures",
"rustc_errors",
Expand Down
28 changes: 28 additions & 0 deletions src/liballoc/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2361,6 +2361,34 @@ impl<'a, K: Ord, V> Entry<'a, K, V> {
}
}

#[unstable(feature = "or_insert_with_key", issue = "71024")]
/// Ensures a value is in the entry by inserting, if empty, the result of the default function,
/// which takes the key as its argument, and returns a mutable reference to the value in the
/// entry.
///
/// # Examples
///
/// ```
/// #![feature(or_insert_with_key)]
/// use std::collections::BTreeMap;
///
/// let mut map: BTreeMap<&str, usize> = BTreeMap::new();
///
/// map.entry("poneyland").or_insert_with_key(|key| key.chars().count());
///
/// assert_eq!(map["poneyland"], 9);
/// ```
#[inline]
pub fn or_insert_with_key<F: FnOnce(&K) -> V>(self, default: F) -> &'a mut V {
match self {
Occupied(entry) => entry.into_mut(),
Vacant(entry) => {
let value = default(entry.key());
entry.insert(value)
}
}
}

/// Returns a reference to this entry's key.
///
/// # Examples
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/char/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ pub use self::decode::{decode_utf16, DecodeUtf16, DecodeUtf16Error};

// unstable re-exports
#[unstable(feature = "unicode_version", issue = "49726")]
pub use crate::unicode::version::UnicodeVersion;
#[unstable(feature = "unicode_version", issue = "49726")]
pub use crate::unicode::UNICODE_VERSION;

use crate::fmt::{self, Write};
Expand Down
8 changes: 8 additions & 0 deletions src/libcore/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,14 @@ pub(crate) mod builtin {
issue = "70173",
reason = "inline assembly is not stable enough for use and is subject to change"
)]
#[cfg_attr(
not(bootstrap),
rustc_deprecated(
since = "1.44.0",
reason = "the syntax of asm! will change soon, use llvm_asm! to avoid breakage",
suggestion = "llvm_asm",
)
)]
#[rustc_builtin_macro]
#[macro_export]
macro_rules! asm {
Expand Down
1 change: 1 addition & 0 deletions src/libcore/prelude/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub use crate::fmt::macros::Debug;
pub use crate::hash::macros::Hash;

#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[allow(deprecated)]
#[doc(no_inline)]
pub use crate::{
asm, assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
Expand Down
13 changes: 4 additions & 9 deletions src/libcore/unicode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@

pub(crate) mod printable;
mod unicode_data;
pub(crate) mod version;

use version::UnicodeVersion;

/// The version of [Unicode](http://www.unicode.org/) that the Unicode parts of
/// `char` and `str` methods are based on.
///
/// The version numbering scheme is explained in
/// [Unicode 11.0 or later, Section 3.1 Versions of the Unicode Standard](https://www.unicode.org/versions/Unicode11.0.0/ch03.pdf#page=4).
#[unstable(feature = "unicode_version", issue = "49726")]
pub const UNICODE_VERSION: UnicodeVersion = UnicodeVersion {
major: unicode_data::UNICODE_VERSION.0,
minor: unicode_data::UNICODE_VERSION.1,
micro: unicode_data::UNICODE_VERSION.2,
_priv: (),
};
pub const UNICODE_VERSION: (u8, u8, u8) = unicode_data::UNICODE_VERSION;

// For use in liballoc, not re-exported in libstd.
pub mod derived_property {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/unicode/unicode_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn skip_search<const SOR: usize, const OFFSETS: usize>(
offset_idx % 2 == 1
}

pub const UNICODE_VERSION: (u32, u32, u32) = (13, 0, 0);
pub const UNICODE_VERSION: (u8, u8, u8) = (13, 0, 0);

#[rustfmt::skip]
pub mod alphabetic {
Expand Down
18 changes: 0 additions & 18 deletions src/libcore/unicode/version.rs

This file was deleted.

4 changes: 2 additions & 2 deletions src/librustc_ast_lowering/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
await_span,
self.allow_gen_future.clone(),
);
let expr = self.lower_expr(expr);

let pinned_ident = Ident::with_dummy_span(sym::pinned);
let (pinned_pat, pinned_pat_hid) =
Expand Down Expand Up @@ -671,7 +672,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
let unit = self.expr_unit(span);
let yield_expr = self.expr(
span,
hir::ExprKind::Yield(unit, hir::YieldSource::Await),
hir::ExprKind::Yield(unit, hir::YieldSource::Await { expr: Some(expr.hir_id) }),
ThinVec::new(),
);
let yield_expr = self.arena.alloc(yield_expr);
Expand Down Expand Up @@ -704,7 +705,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
// match <expr> {
// mut pinned => loop { .. }
// }
let expr = self.lower_expr(expr);
hir::ExprKind::Match(expr, arena_vec![self; pinned_arm], hir::MatchSource::AwaitDesugar)
}

Expand Down
Loading