Skip to content

Commit c22ce28

Browse files
committed
Auto merge of #61510 - Centril:rollup-bvi95y2, r=Centril
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
2 parents dc7c4aa + 5baa58e commit c22ce28

File tree

66 files changed

+607
-843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+607
-843
lines changed

.azure-pipelines/steps/run.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ steps:
118118
# bucket.
119119
- bash: |
120120
set -e
121+
source src/ci/shared.sh
121122
if [ "$AGENT_OS" = "Linux" ]; then
122123
rm -rf obj/build/dist/doc
123124
upload_dir=obj/build/dist
@@ -130,7 +131,7 @@ steps:
130131
if [ "$DEPLOY_ALT" == "1" ]; then
131132
deploy_dir=rustc-builds-alt
132133
fi
133-
aws s3 cp --no-progress --recursive --acl public-read ./$upload_dir s3://$DEPLOY_BUCKET/$deploy_dir/$BUILD_SOURCEVERSION
134+
retry aws s3 cp --no-progress --recursive --acl public-read ./$upload_dir s3://$DEPLOY_BUCKET/$deploy_dir/$BUILD_SOURCEVERSION
134135
env:
135136
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
136137
condition: and(succeeded(), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')))

src/bootstrap/config.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use std::process;
1111
use std::cmp;
1212

1313
use build_helper::t;
14-
use num_cpus;
1514
use toml;
1615
use serde::Deserialize;
1716
use crate::cache::{INTERNER, Interned};
@@ -401,7 +400,7 @@ impl Config {
401400
config.rustc_error_format = flags.rustc_error_format;
402401
config.on_fail = flags.on_fail;
403402
config.stage = flags.stage;
404-
config.jobs = flags.jobs;
403+
config.jobs = flags.jobs.map(threads_from_config);
405404
config.cmd = flags.cmd;
406405
config.incremental = flags.incremental;
407406
config.dry_run = flags.dry_run;
@@ -583,13 +582,8 @@ impl Config {
583582

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

586-
match rust.codegen_units {
587-
Some(0) => config.rust_codegen_units = Some(num_cpus::get() as u32),
588-
Some(n) => config.rust_codegen_units = Some(n),
589-
None => {}
590-
}
591-
592-
config.rust_codegen_units_std = rust.codegen_units_std;
585+
config.rust_codegen_units = rust.codegen_units.map(threads_from_config);
586+
config.rust_codegen_units_std = rust.codegen_units_std.map(threads_from_config);
593587
}
594588

595589
if let Some(ref t) = toml.target {
@@ -688,3 +682,10 @@ fn set<T>(field: &mut T, val: Option<T>) {
688682
*field = v;
689683
}
690684
}
685+
686+
fn threads_from_config(v: u32) -> u32 {
687+
match v {
688+
0 => num_cpus::get() as u32,
689+
n => n,
690+
}
691+
}

src/ci/shared.sh

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ function isOSX {
3535
function getCIBranch {
3636
if [ "$TRAVIS" = "true" ]; then
3737
echo "$TRAVIS_BRANCH"
38+
elif [ "$APPVEYOR" = "True" ]; then
39+
echo "$APPVEYOR_REPO_BRANCH"
3840
else
3941
echo "$BUILD_SOURCEBRANCHNAME"
4042
fi;

src/liballoc/rc.rs

+27-7
Original file line numberDiff line numberDiff line change
@@ -580,15 +580,18 @@ impl<T: ?Sized> Rc<T> {
580580
impl<T: Clone> Rc<T> {
581581
/// Makes a mutable reference into the given `Rc`.
582582
///
583-
/// If there are other `Rc` or [`Weak`][weak] pointers to the same value,
584-
/// then `make_mut` will invoke [`clone`][clone] on the inner value to
585-
/// ensure unique ownership. This is also referred to as clone-on-write.
583+
/// If there are other `Rc` pointers to the same value, then `make_mut` will
584+
/// [`clone`] the inner value to ensure unique ownership. This is also
585+
/// referred to as clone-on-write.
586586
///
587-
/// See also [`get_mut`][get_mut], which will fail rather than cloning.
587+
/// If there are no other `Rc` pointers to this value, then [`Weak`]
588+
/// pointers to this value will be dissassociated.
588589
///
589-
/// [weak]: struct.Weak.html
590-
/// [clone]: ../../std/clone/trait.Clone.html#tymethod.clone
591-
/// [get_mut]: struct.Rc.html#method.get_mut
590+
/// See also [`get_mut`], which will fail rather than cloning.
591+
///
592+
/// [`Weak`]: struct.Weak.html
593+
/// [`clone`]: ../../std/clone/trait.Clone.html#tymethod.clone
594+
/// [`get_mut`]: struct.Rc.html#method.get_mut
592595
///
593596
/// # Examples
594597
///
@@ -607,6 +610,23 @@ impl<T: Clone> Rc<T> {
607610
/// assert_eq!(*data, 8);
608611
/// assert_eq!(*other_data, 12);
609612
/// ```
613+
///
614+
/// [`Weak`] pointers will be dissassociated:
615+
///
616+
/// ```
617+
/// use std::rc::Rc;
618+
///
619+
/// let mut data = Rc::new(75);
620+
/// let weak = Rc::downgrade(&data);
621+
///
622+
/// assert!(75 == *data);
623+
/// assert!(75 == *weak.upgrade().unwrap());
624+
///
625+
/// *Rc::make_mut(&mut data) += 1;
626+
///
627+
/// assert!(76 == *data);
628+
/// assert!(weak.upgrade().is_none());
629+
/// ```
610630
#[inline]
611631
#[stable(feature = "rc_unique", since = "1.4.0")]
612632
pub fn make_mut(this: &mut Self) -> &mut T {

src/liballoc/str.rs

+7
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,13 @@ impl str {
431431
///
432432
/// assert_eq!(new_year, new_year.to_uppercase());
433433
/// ```
434+
///
435+
/// One character can become multiple:
436+
/// ```
437+
/// let s = "tschüß";
438+
///
439+
/// assert_eq!("TSCHÜSS", s.to_uppercase());
440+
/// ```
434441
#[stable(feature = "unicode_case_mapping", since = "1.2.0")]
435442
pub fn to_uppercase(&self) -> String {
436443
let mut s = String::with_capacity(self.len());

src/liballoc/vec.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -2018,16 +2018,14 @@ impl<T> Vec<T> {
20182018
/// with the given `replace_with` iterator and yields the removed items.
20192019
/// `replace_with` does not need to be the same length as `range`.
20202020
///
2021-
/// Note 1: The element range is removed even if the iterator is not
2022-
/// consumed until the end.
2021+
/// The element range is removed even if the iterator is not consumed until the end.
20232022
///
2024-
/// Note 2: It is unspecified how many elements are removed from the vector,
2023+
/// It is unspecified how many elements are removed from the vector
20252024
/// if the `Splice` value is leaked.
20262025
///
2027-
/// Note 3: The input iterator `replace_with` is only consumed
2028-
/// when the `Splice` value is dropped.
2026+
/// The input iterator `replace_with` is only consumed when the `Splice` value is dropped.
20292027
///
2030-
/// Note 4: This is optimal if:
2028+
/// This is optimal if:
20312029
///
20322030
/// * The tail (elements in the vector after `range`) is empty,
20332031
/// * or `replace_with` yields fewer elements than `range`’s length

src/librustc/hir/intravisit.rs

-10
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ pub trait Visitor<'v> : Sized {
262262
fn visit_pat(&mut self, p: &'v Pat) {
263263
walk_pat(self, p)
264264
}
265-
fn visit_argument_source(&mut self, s: &'v ArgSource) {
266-
walk_argument_source(self, s)
267-
}
268265
fn visit_anon_const(&mut self, c: &'v AnonConst) {
269266
walk_anon_const(self, c)
270267
}
@@ -402,17 +399,10 @@ pub fn walk_body<'v, V: Visitor<'v>>(visitor: &mut V, body: &'v Body) {
402399
for argument in &body.arguments {
403400
visitor.visit_id(argument.hir_id);
404401
visitor.visit_pat(&argument.pat);
405-
visitor.visit_argument_source(&argument.source);
406402
}
407403
visitor.visit_expr(&body.value);
408404
}
409405

410-
pub fn walk_argument_source<'v, V: Visitor<'v>>(visitor: &mut V, source: &'v ArgSource) {
411-
if let ArgSource::AsyncFn(pat) = source {
412-
visitor.visit_pat(pat);
413-
}
414-
}
415-
416406
pub fn walk_local<'v, V: Visitor<'v>>(visitor: &mut V, local: &'v Local) {
417407
// Intentionally visiting the expr first - the initialization expr
418408
// dominates the local's definition.

0 commit comments

Comments
 (0)