Skip to content

Commit

Permalink
Auto merge of #61510 - Centril:rollup-bvi95y2, r=Centril
Browse files Browse the repository at this point in the history
Rollup of 13 pull requests

Successful merges:

 - #61135 (Fix documentation of `Rc::make_mut` regarding `rc::Weak`.)
 - #61404 (miri unsizing: fix projecting into a field of an operand)
 - #61409 (Fix an ICE with a const argument in a trait)
 - #61413 (Re-implement async fn drop order lowering )
 - #61419 (Add an unusual-conversion example to to_uppercase)
 - #61420 (Succinctify splice docs)
 - #61444 (Suggest using `as_ref` on `*const T`)
 - #61446 (On TerminatorKind::DropAndReplace still handle unused_mut correctly)
 - #61485 (azure: retry s3 upload if it fails)
 - #61489 (ci: Reenable step timings on AppVeyor)
 - #61496 (Do not panic in tidy on unbalanced parentheses in cfg's)
 - #61497 (Treat 0 as special value for codegen-units-std)
 - #61499 (Add regression test for existential type ICE #53457)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Jun 4, 2019
2 parents dc7c4aa + 5baa58e commit c22ce28
Show file tree
Hide file tree
Showing 66 changed files with 607 additions and 843 deletions.
3 changes: 2 additions & 1 deletion .azure-pipelines/steps/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ steps:
# bucket.
- bash: |
set -e
source src/ci/shared.sh
if [ "$AGENT_OS" = "Linux" ]; then
rm -rf obj/build/dist/doc
upload_dir=obj/build/dist
Expand All @@ -130,7 +131,7 @@ steps:
if [ "$DEPLOY_ALT" == "1" ]; then
deploy_dir=rustc-builds-alt
fi
aws s3 cp --no-progress --recursive --acl public-read ./$upload_dir s3://$DEPLOY_BUCKET/$deploy_dir/$BUILD_SOURCEVERSION
retry aws s3 cp --no-progress --recursive --acl public-read ./$upload_dir s3://$DEPLOY_BUCKET/$deploy_dir/$BUILD_SOURCEVERSION
env:
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
condition: and(succeeded(), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')))
Expand Down
19 changes: 10 additions & 9 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use std::process;
use std::cmp;

use build_helper::t;
use num_cpus;
use toml;
use serde::Deserialize;
use crate::cache::{INTERNER, Interned};
Expand Down Expand Up @@ -401,7 +400,7 @@ impl Config {
config.rustc_error_format = flags.rustc_error_format;
config.on_fail = flags.on_fail;
config.stage = flags.stage;
config.jobs = flags.jobs;
config.jobs = flags.jobs.map(threads_from_config);
config.cmd = flags.cmd;
config.incremental = flags.incremental;
config.dry_run = flags.dry_run;
Expand Down Expand Up @@ -583,13 +582,8 @@ impl Config {

set(&mut config.rust_codegen_backends_dir, rust.codegen_backends_dir.clone());

match rust.codegen_units {
Some(0) => config.rust_codegen_units = Some(num_cpus::get() as u32),
Some(n) => config.rust_codegen_units = Some(n),
None => {}
}

config.rust_codegen_units_std = rust.codegen_units_std;
config.rust_codegen_units = rust.codegen_units.map(threads_from_config);
config.rust_codegen_units_std = rust.codegen_units_std.map(threads_from_config);
}

if let Some(ref t) = toml.target {
Expand Down Expand Up @@ -688,3 +682,10 @@ fn set<T>(field: &mut T, val: Option<T>) {
*field = v;
}
}

fn threads_from_config(v: u32) -> u32 {
match v {
0 => num_cpus::get() as u32,
n => n,
}
}
2 changes: 2 additions & 0 deletions src/ci/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ function isOSX {
function getCIBranch {
if [ "$TRAVIS" = "true" ]; then
echo "$TRAVIS_BRANCH"
elif [ "$APPVEYOR" = "True" ]; then
echo "$APPVEYOR_REPO_BRANCH"
else
echo "$BUILD_SOURCEBRANCHNAME"
fi;
Expand Down
34 changes: 27 additions & 7 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,15 +580,18 @@ impl<T: ?Sized> Rc<T> {
impl<T: Clone> Rc<T> {
/// Makes a mutable reference into the given `Rc`.
///
/// If there are other `Rc` or [`Weak`][weak] pointers to the same value,
/// then `make_mut` will invoke [`clone`][clone] on the inner value to
/// ensure unique ownership. This is also referred to as clone-on-write.
/// If there are other `Rc` pointers to the same value, then `make_mut` will
/// [`clone`] the inner value to ensure unique ownership. This is also
/// referred to as clone-on-write.
///
/// See also [`get_mut`][get_mut], which will fail rather than cloning.
/// If there are no other `Rc` pointers to this value, then [`Weak`]
/// pointers to this value will be dissassociated.
///
/// [weak]: struct.Weak.html
/// [clone]: ../../std/clone/trait.Clone.html#tymethod.clone
/// [get_mut]: struct.Rc.html#method.get_mut
/// See also [`get_mut`], which will fail rather than cloning.
///
/// [`Weak`]: struct.Weak.html
/// [`clone`]: ../../std/clone/trait.Clone.html#tymethod.clone
/// [`get_mut`]: struct.Rc.html#method.get_mut
///
/// # Examples
///
Expand All @@ -607,6 +610,23 @@ impl<T: Clone> Rc<T> {
/// assert_eq!(*data, 8);
/// assert_eq!(*other_data, 12);
/// ```
///
/// [`Weak`] pointers will be dissassociated:
///
/// ```
/// use std::rc::Rc;
///
/// let mut data = Rc::new(75);
/// let weak = Rc::downgrade(&data);
///
/// assert!(75 == *data);
/// assert!(75 == *weak.upgrade().unwrap());
///
/// *Rc::make_mut(&mut data) += 1;
///
/// assert!(76 == *data);
/// assert!(weak.upgrade().is_none());
/// ```
#[inline]
#[stable(feature = "rc_unique", since = "1.4.0")]
pub fn make_mut(this: &mut Self) -> &mut T {
Expand Down
7 changes: 7 additions & 0 deletions src/liballoc/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,13 @@ impl str {
///
/// assert_eq!(new_year, new_year.to_uppercase());
/// ```
///
/// One character can become multiple:
/// ```
/// let s = "tschüß";
///
/// assert_eq!("TSCHÜSS", s.to_uppercase());
/// ```
#[stable(feature = "unicode_case_mapping", since = "1.2.0")]
pub fn to_uppercase(&self) -> String {
let mut s = String::with_capacity(self.len());
Expand Down
10 changes: 4 additions & 6 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2018,16 +2018,14 @@ impl<T> Vec<T> {
/// with the given `replace_with` iterator and yields the removed items.
/// `replace_with` does not need to be the same length as `range`.
///
/// Note 1: The element range is removed even if the iterator is not
/// consumed until the end.
/// The element range is removed even if the iterator is not consumed until the end.
///
/// Note 2: It is unspecified how many elements are removed from the vector,
/// It is unspecified how many elements are removed from the vector
/// if the `Splice` value is leaked.
///
/// Note 3: The input iterator `replace_with` is only consumed
/// when the `Splice` value is dropped.
/// The input iterator `replace_with` is only consumed when the `Splice` value is dropped.
///
/// Note 4: This is optimal if:
/// This is optimal if:
///
/// * The tail (elements in the vector after `range`) is empty,
/// * or `replace_with` yields fewer elements than `range`’s length
Expand Down
10 changes: 0 additions & 10 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,6 @@ pub trait Visitor<'v> : Sized {
fn visit_pat(&mut self, p: &'v Pat) {
walk_pat(self, p)
}
fn visit_argument_source(&mut self, s: &'v ArgSource) {
walk_argument_source(self, s)
}
fn visit_anon_const(&mut self, c: &'v AnonConst) {
walk_anon_const(self, c)
}
Expand Down Expand Up @@ -402,17 +399,10 @@ pub fn walk_body<'v, V: Visitor<'v>>(visitor: &mut V, body: &'v Body) {
for argument in &body.arguments {
visitor.visit_id(argument.hir_id);
visitor.visit_pat(&argument.pat);
visitor.visit_argument_source(&argument.source);
}
visitor.visit_expr(&body.value);
}

pub fn walk_argument_source<'v, V: Visitor<'v>>(visitor: &mut V, source: &'v ArgSource) {
if let ArgSource::AsyncFn(pat) = source {
visitor.visit_pat(pat);
}
}

pub fn walk_local<'v, V: Visitor<'v>>(visitor: &mut V, local: &'v Local) {
// Intentionally visiting the expr first - the initialization expr
// dominates the local's definition.
Expand Down

0 comments on commit c22ce28

Please sign in to comment.