Skip to content

Rollup of 8 pull requests #63057

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

Merged
merged 36 commits into from
Jul 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b95bde4
squash of all commits for nth_back on ChunksMut
May 31, 2019
4242206
Re-enable assertions in PPC dist builder
mati865 Jul 19, 2019
3334802
Refactoring use commun code between option, result and accum
Stargateur Jul 22, 2019
e2eb957
Allow lifetime elision in `Pin<&(mut) Self>`
taiki-e May 26, 2019
a1fd4fa
Remove query for `.pin_type()`
taiki-e May 27, 2019
7b9a65e
Make is_self_ty a method on SelfVisitor
taiki-e May 29, 2019
2f64404
Use Set1<Region> instead of Option<Region>
taiki-e May 29, 2019
3096568
add a bevy of new test cases
nikomatsakis Jun 28, 2019
258498a
Update src/test/ui/self/elision/README.md
taiki-e Jul 15, 2019
c1f22c0
Add main functions and check-pass annotations
taiki-e Jul 15, 2019
aab9edc
Minor clean up
taiki-e Jul 15, 2019
8507b8e
Add test for multiple ref-self
taiki-e Jul 15, 2019
1e29052
Add tests for `self: (&)AssocType`
taiki-e Jul 26, 2019
34f59eb
Fix typo
taiki-e Jul 26, 2019
05f67a2
arbitrary_self_types lifetime elision: --bless --compare-mode=nll
taiki-e Jul 27, 2019
8b3f28c
Make more informative error on outer attr after inner
eupn Jul 27, 2019
3eeec1c
Break dependencies between `syntax_ext` and some other crates
petrochenkov Jul 17, 2019
4ad0daa
Move proc macro server into libsyntax
petrochenkov Jul 18, 2019
f6eda99
Move test harness generation into libsyntax_ext
petrochenkov Jul 18, 2019
4d535bd
Move standard library injection into libsyntax_ext
petrochenkov Jul 18, 2019
b5a0e6e
syntax_ext: `proc_macro_decls` -> `proc_macro_harness`
petrochenkov Jul 18, 2019
fc9bfd6
Treat doc comments separately
eupn Jul 27, 2019
2787cb2
Fix failing UI tests
eupn Jul 27, 2019
693be44
Fix ui/parser/attr test
eupn Jul 27, 2019
c0df742
tidy: libcoretest.rs -> unit_tests.rs
petrochenkov Jul 25, 2019
6a4def0
tidy: Fix a regression in `#[test]` detection in libcore
petrochenkov Jul 25, 2019
aecaa03
tidy: Add a check for inline unit tests and benchmarks
petrochenkov Jul 26, 2019
75dfdcb
ci: download awscli from our mirror
pietroalbini Jul 27, 2019
ece18b7
Rollup merge of #61207 - taiki-e:arbitrary_self_types-lifetime-elisio…
Centril Jul 28, 2019
cb8b491
Rollup merge of #62074 - wizAmit:feature/mut_chunks_nth_back, r=scottmcm
Centril Jul 28, 2019
ca0cd73
Rollup merge of #62771 - petrochenkov:depext, r=eddyb
Centril Jul 28, 2019
8f9b8c1
Rollup merge of #62883 - Stargateur:refactoring-adapters, r=scottmcm
Centril Jul 28, 2019
fb6fdd4
Rollup merge of #62949 - mati865:patch-1, r=alexcrichton
Centril Jul 28, 2019
c3c0309
Rollup merge of #62996 - petrochenkov:outest, r=Mark-Simulacrum
Centril Jul 28, 2019
5c70085
Rollup merge of #63038 - eupn:outer-attribute-diag, r=estebank
Centril Jul 28, 2019
34c0f46
Rollup merge of #63050 - pietroalbini:vendor-awscli, r=Mark-Simulacrum
Centril Jul 28, 2019
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
42 changes: 5 additions & 37 deletions .azure-pipelines/steps/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,43 +138,11 @@ steps:

# Ensure the `aws` CLI is installed so we can deploy later on, cache docker
# images, etc.
- bash: |
set -e
# Temporary code to debug #62967.
debug_failed_connections() {
echo "trying to ping pypi.org"
ping pypi.org -c10 || true
echo "trying to ping google.com"
ping google.com -c10 || true
echo "trying to ping 8.8.8.8"
ping 8.8.8.8 -c10 || true
echo "trying to download pypi.org"
curl https://pypi.org || true
echo "trying to download from our S3 bucket"
curl https://rust-lang-ci2.s3.amazonaws.com || true
echo "trying to dig pypi.org"
dig pypi.org || true
echo "trying to dig files.pythonhosted.org"
dig files.pythonhosted.org || true
echo "trying to connect to pypi.org with openssl"
echo | openssl s_client -connect pypi.org:443 || true
echo "trying to connect to files.pythonhosted.org with openssl"
echo | openssl s_client -connect files.pythonhosted.org:443 || true
}
debug_failed_connections_and_fail() {
debug_failed_connections
return 1
}
source src/ci/shared.sh
sudo apt-get install -y python3-setuptools
debug_failed_connections
retry pip3 install -r src/ci/awscli-requirements.txt --upgrade --user || debug_failed_connections_and_fail
echo "##vso[task.prependpath]$HOME/.local/bin"
displayName: Install awscli (Linux)
condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Linux'))
- script: pip install -r src/ci/awscli-requirements.txt
displayName: Install awscli (non-Linux)
condition: and(succeeded(), not(variables.SKIP_JOB), ne(variables['Agent.OS'], 'Linux'))
- bash: src/ci/install-awscli.sh
env:
AGENT_OS: $(Agent.OS)
condition: and(succeeded(), not(variables.SKIP_JOB))
displayName: Install awscli

# Configure our CI_JOB_NAME variable which log analyzers can use for the main
# step to see what's going on.
Expand Down
14 changes: 0 additions & 14 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2863,31 +2863,20 @@ dependencies = [
name = "rustc_driver"
version = "0.0.0"
dependencies = [
"arena 0.0.0",
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
"graphviz 0.0.0",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc-rayon 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_ast_borrowck 0.0.0",
"rustc_codegen_utils 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
"rustc_incremental 0.0.0",
"rustc_interface 0.0.0",
"rustc_lint 0.0.0",
"rustc_metadata 0.0.0",
"rustc_mir 0.0.0",
"rustc_passes 0.0.0",
"rustc_plugin 0.0.0",
"rustc_privacy 0.0.0",
"rustc_resolve 0.0.0",
"rustc_save_analysis 0.0.0",
"rustc_target 0.0.0",
"rustc_traits 0.0.0",
"rustc_typeck 0.0.0",
"serialize 0.0.0",
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"syntax 0.0.0",
"syntax_pos 0.0.0",
]
Expand Down Expand Up @@ -3019,7 +3008,6 @@ dependencies = [
"smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
"stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntax 0.0.0",
"syntax_ext 0.0.0",
"syntax_pos 0.0.0",
]

Expand Down Expand Up @@ -3064,9 +3052,7 @@ dependencies = [
"rustc 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
"rustc_mir 0.0.0",
"syntax 0.0.0",
"syntax_ext 0.0.0",
"syntax_pos 0.0.0",
]

Expand Down
13 changes: 0 additions & 13 deletions src/ci/awscli-requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions src/ci/docker/dist-powerpc-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,3 @@ ENV HOSTS=powerpc-unknown-linux-gnu

ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS

# FIXME(#36150) this will fail the bootstrap. Probably means something bad is
# happening!
ENV NO_LLVM_ASSERTIONS 1
35 changes: 35 additions & 0 deletions src/ci/install-awscli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# This script downloads and installs awscli from the packages mirrored in our
# own S3 bucket. This follows the recommendations at:
#
# https://packaging.python.org/guides/index-mirrors-and-caches/#caching-with-pip
#
# To create a new mirrored copy you can run the command:
#
# pip wheel awscli
#
# Before compressing please make sure all the wheels end with `-none-any.whl`.
# If that's not the case you'll need to remove the non-cross-platform ones and
# replace them with the .tar.gz downloaded from https://pypi.org. Also make
# sure it's possible to call this script with both Python 2 and Python 3.

set -euo pipefail
IFS=$'\n\t'

MIRROR="https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2019-07-27-awscli.tar"
DEPS_DIR="/tmp/awscli-deps"

pip="pip"
pipflags=""
if [[ "${AGENT_OS}" == "Linux" ]]; then
pip="pip3"
pipflags="--user"

sudo apt-get install -y python3-setuptools
echo "##vso[task.prependpath]$HOME/.local/bin"
fi

mkdir -p "${DEPS_DIR}"
curl "${MIRROR}" | tar xf - -C "${DEPS_DIR}"
"${pip}" install ${pipflags} --no-index "--find-links=${DEPS_DIR}" awscli
rm -rf "${DEPS_DIR}"
135 changes: 135 additions & 0 deletions src/libcore/iter/adapters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2062,3 +2062,138 @@ impl<I: ExactSizeIterator, F> ExactSizeIterator for Inspect<I, F>
#[stable(feature = "fused", since = "1.26.0")]
impl<I: FusedIterator, F> FusedIterator for Inspect<I, F>
where F: FnMut(&I::Item) {}

/// An iterator adapter that produces output as long as the underlying
/// iterator produces `Option::Some` values.
pub(crate) struct OptionShunt<I> {
iter: I,
exited_early: bool,
}

impl<I, T> OptionShunt<I>
where
I: Iterator<Item = Option<T>>,
{
/// Process the given iterator as if it yielded a `T` instead of a
/// `Option<T>`. Any `None` value will stop the inner iterator and
/// the overall result will be a `None`.
pub fn process<F, U>(iter: I, mut f: F) -> Option<U>
where
F: FnMut(&mut Self) -> U,
{
let mut shunt = OptionShunt::new(iter);
let value = f(shunt.by_ref());
shunt.reconstruct(value)
}

fn new(iter: I) -> Self {
OptionShunt {
iter,
exited_early: false,
}
}

/// Consume the adapter and rebuild a `Option` value.
fn reconstruct<U>(self, val: U) -> Option<U> {
if self.exited_early {
None
} else {
Some(val)
}
}
}

impl<I, T> Iterator for OptionShunt<I>
where
I: Iterator<Item = Option<T>>,
{
type Item = T;

fn next(&mut self) -> Option<Self::Item> {
match self.iter.next() {
Some(Some(v)) => Some(v),
Some(None) => {
self.exited_early = true;
None
}
None => None,
}
}

fn size_hint(&self) -> (usize, Option<usize>) {
if self.exited_early {
(0, Some(0))
} else {
let (_, upper) = self.iter.size_hint();
(0, upper)
}
}
}

/// An iterator adapter that produces output as long as the underlying
/// iterator produces `Result::Ok` values.
///
/// If an error is encountered, the iterator stops and the error is
/// stored. The error may be recovered later via `reconstruct`.
pub(crate) struct ResultShunt<I, E> {
iter: I,
error: Option<E>,
}

impl<I, T, E> ResultShunt<I, E>
where I: Iterator<Item = Result<T, E>>
{
/// Process the given iterator as if it yielded a `T` instead of a
/// `Result<T, _>`. Any errors will stop the inner iterator and
/// the overall result will be an error.
pub fn process<F, U>(iter: I, mut f: F) -> Result<U, E>
where F: FnMut(&mut Self) -> U
{
let mut shunt = ResultShunt::new(iter);
let value = f(shunt.by_ref());
shunt.reconstruct(value)
}

fn new(iter: I) -> Self {
ResultShunt {
iter,
error: None,
}
}

/// Consume the adapter and rebuild a `Result` value. This should
/// *always* be called, otherwise any potential error would be
/// lost.
fn reconstruct<U>(self, val: U) -> Result<U, E> {
match self.error {
None => Ok(val),
Some(e) => Err(e),
}
}
}

impl<I, T, E> Iterator for ResultShunt<I, E>
where I: Iterator<Item = Result<T, E>>
{
type Item = T;

fn next(&mut self) -> Option<Self::Item> {
match self.iter.next() {
Some(Ok(v)) => Some(v),
Some(Err(e)) => {
self.error = Some(e);
None
}
None => None,
}
}

fn size_hint(&self) -> (usize, Option<usize>) {
if self.error.is_some() {
(0, Some(0))
} else {
let (_, upper) = self.iter.size_hint();
(0, upper)
}
}
}
2 changes: 1 addition & 1 deletion src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ pub use self::adapters::Flatten;
#[stable(feature = "iter_copied", since = "1.36.0")]
pub use self::adapters::Copied;

pub(crate) use self::adapters::TrustedRandomAccess;
pub(crate) use self::adapters::{TrustedRandomAccess, OptionShunt, ResultShunt};

mod range;
mod sources;
Expand Down
Loading