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

[stable] 1.45.1 release #74574

Merged
merged 11 commits into from
Jul 24, 2020
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ name: CI
- "**"
defaults:
run:
shell: "python src/ci/exec-with-shell.py {0}"
shell: bash
jobs:
pr:
name: PR
Expand Down Expand Up @@ -54,7 +54,6 @@ jobs:
steps:
- name: disable git crlf conversion
run: git config --global core.autocrlf false
shell: bash
- name: checkout the source code
uses: actions/checkout@v1
with:
Expand Down Expand Up @@ -164,7 +163,6 @@ jobs:
steps:
- name: disable git crlf conversion
run: git config --global core.autocrlf false
shell: bash
- name: checkout the source code
uses: actions/checkout@v1
with:
Expand Down Expand Up @@ -516,7 +514,6 @@ jobs:
steps:
- name: disable git crlf conversion
run: git config --global core.autocrlf false
shell: bash
- name: checkout the source code
uses: actions/checkout@v1
with:
Expand Down Expand Up @@ -618,6 +615,7 @@ jobs:
fetch-depth: 2
- name: publish toolstate
run: src/ci/publish_toolstate.sh
shell: bash
env:
TOOLSTATE_REPO_ACCESS_TOKEN: "${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}"
if: success() && !env.SKIP_JOB
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ checksum = "716960a18f978640f25101b5cbf1c6f6b0d3192fab36a2d98ca96f0ecbe41010"

[[package]]
name = "cargo"
version = "0.46.0"
version = "0.46.1"
dependencies = [
"anyhow",
"atty",
Expand Down Expand Up @@ -4467,7 +4467,7 @@ dependencies = [

[[package]]
name = "rustfmt-nightly"
version = "1.4.15"
version = "1.4.17"
dependencies = [
"annotate-snippets",
"bytecount",
Expand Down
11 changes: 11 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Version 1.45.1 (2020-07-30)
==========================

* [rustfmt accepts rustfmt_skip in cfg_attr again.][73078]
* [Avoid spurious implicit region bound.][74509]
* [Install clippy on x.py install][74457]

[73078]: https:/rust-lang/rust/issues/73078
[74509]: https:/rust-lang/rust/pull/74509
[74457]: https:/rust-lang/rust/pull/74457

Version 1.45.0 (2020-07-16)
==========================

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use build_helper::output;
use crate::Build;

// The version number
pub const CFG_RELEASE_NUM: &str = "1.45.0";
pub const CFG_RELEASE_NUM: &str = "1.45.1";

pub struct GitInfo {
inner: Option<Info>,
Expand Down
21 changes: 4 additions & 17 deletions src/bootstrap/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ macro_rules! install {
config.extended && config.tools.as_ref()
.map_or(true, |t| t.contains($path))
}

#[allow(dead_code)]
fn should_install(builder: &Builder<'_>) -> bool {
builder.config.tools.as_ref().map_or(false, |t| t.contains($path))
}
}

impl Step for $name {
Expand Down Expand Up @@ -204,8 +199,7 @@ install!((self, builder, _config),
install_cargo(builder, self.compiler.stage, self.target);
};
Rls, "rls", Self::should_build(_config), only_hosts: true, {
if builder.ensure(dist::Rls { compiler: self.compiler, target: self.target }).is_some() ||
Self::should_install(builder) {
if builder.ensure(dist::Rls { compiler: self.compiler, target: self.target }).is_some() {
install_rls(builder, self.compiler.stage, self.target);
} else {
builder.info(
Expand All @@ -215,17 +209,10 @@ install!((self, builder, _config),
};
Clippy, "clippy", Self::should_build(_config), only_hosts: true, {
builder.ensure(dist::Clippy { compiler: self.compiler, target: self.target });
if Self::should_install(builder) {
install_clippy(builder, self.compiler.stage, self.target);
} else {
builder.info(
&format!("skipping Install clippy stage{} ({})", self.compiler.stage, self.target),
);
}
install_clippy(builder, self.compiler.stage, self.target);
};
Miri, "miri", Self::should_build(_config), only_hosts: true, {
if builder.ensure(dist::Miri { compiler: self.compiler, target: self.target }).is_some() ||
Self::should_install(builder) {
if builder.ensure(dist::Miri { compiler: self.compiler, target: self.target }).is_some() {
install_miri(builder, self.compiler.stage, self.target);
} else {
builder.info(
Expand All @@ -237,7 +224,7 @@ install!((self, builder, _config),
if builder.ensure(dist::Rustfmt {
compiler: self.compiler,
target: self.target
}).is_some() || Self::should_install(builder) {
}).is_some() {
install_rustfmt(builder, self.compiler.stage, self.target);
} else {
builder.info(
Expand Down
16 changes: 0 additions & 16 deletions src/ci/exec-with-shell.py

This file was deleted.

18 changes: 5 additions & 13 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ x--expand-yaml-anchors--remove:
steps:
- name: disable git crlf conversion
run: git config --global core.autocrlf false
shell: bash

- name: checkout the source code
uses: actions/checkout@v1
Expand Down Expand Up @@ -239,18 +238,10 @@ on:

defaults:
run:
# While on Linux and macOS builders it just forwards the arguments to the
# system bash, this wrapper allows switching from the host's bash.exe to
# the one we install along with MSYS2 mid-build on Windows.
#
# Once the step to install MSYS2 is executed, the CI_OVERRIDE_SHELL
# environment variable is set pointing to our MSYS2's bash.exe. From that
# moment the host's bash.exe will not be called anymore.
#
# This is needed because we can't launch our own bash.exe from the host
# bash.exe, as that would load two different cygwin1.dll in memory, causing
# "cygwin heap mismatch" errors.
shell: python src/ci/exec-with-shell.py {0}
# On Linux, macOS, and Windows, use the system-provided bash as the default
# shell. (This should only make a difference on Windows, where the default
# shell is PowerShell.)
shell: bash

jobs:
pr:
Expand Down Expand Up @@ -624,6 +615,7 @@ jobs:

- name: publish toolstate
run: src/ci/publish_toolstate.sh
shell: bash
env:
TOOLSTATE_REPO_ACCESS_TOKEN: ${{ secrets.TOOLSTATE_REPO_ACCESS_TOKEN }}
<<: *step
Expand Down
17 changes: 15 additions & 2 deletions src/ci/scripts/install-msys2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ if isWindows; then
mkdir -p "$(ciCheckoutPath)/msys2/home/${USERNAME}"
ciCommandAddPath "$(ciCheckoutPath)/msys2/usr/bin"

echo "switching shell to use our own bash"
ciCommandSetEnv CI_OVERRIDE_SHELL "$(ciCheckoutPath)/msys2/usr/bin/bash.exe"
# Detect the native Python version installed on the agent. On GitHub
# Actions, the C:\hostedtoolcache\windows\Python directory contains a
# subdirectory for each installed Python version.
#
# The -V flag of the sort command sorts the input by version number.
native_python_version="$(ls /c/hostedtoolcache/windows/Python | sort -Vr | head -n 1)"

# Make sure we use the native python interpreter instead of some msys equivalent
# one way or another. The msys interpreters seem to have weird path conversions
# baked in which break LLVM's build system one way or another, so let's use the
# native version which keeps everything as native as possible.
python_home="/c/hostedtoolcache/windows/Python/${native_python_version}/x64"
cp "${python_home}/python.exe" "${python_home}/python3.exe"
ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64"
ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64\\Scripts"
fi
26 changes: 19 additions & 7 deletions src/librustc_resolve/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1407,18 +1407,30 @@ impl<'a, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
pat_src: PatternSource,
bindings: &mut SmallVec<[(PatBoundCtx, FxHashSet<Ident>); 1]>,
) {
let is_tuple_struct_pat = matches!(pat.kind, PatKind::TupleStruct(_, _));

// Visit all direct subpatterns of this pattern.
pat.walk(&mut |pat| {
debug!("resolve_pattern pat={:?} node={:?}", pat, pat.kind);
match pat.kind {
// In tuple struct patterns ignore the invalid `ident @ ...`.
// It will be handled as an error by the AST lowering.
PatKind::Ident(bmode, ident, ref sub) => {
// First try to resolve the identifier as some existing entity,
// then fall back to a fresh binding.
let has_sub = sub.is_some();
let res = self
.try_resolve_as_non_binding(pat_src, pat, bmode, ident, has_sub)
.unwrap_or_else(|| self.fresh_binding(ident, pat.id, pat_src, bindings));
self.r.record_partial_res(pat.id, PartialRes::new(res));
if is_tuple_struct_pat && sub.as_ref().filter(|p| p.is_rest()).is_some() {
self.r
.session
.delay_span_bug(ident.span, "ident in tuple pattern is invalid");
} else {
// First try to resolve the identifier as some existing entity,
// then fall back to a fresh binding.
let has_sub = sub.is_some();
let res = self
.try_resolve_as_non_binding(pat_src, pat, bmode, ident, has_sub)
.unwrap_or_else(|| {
self.fresh_binding(ident, pat.id, pat_src, bindings)
});
self.r.record_partial_res(pat.id, PartialRes::new(res));
}
}
PatKind::TupleStruct(ref path, ..) => {
self.smart_resolve_path(pat.id, None, path, PathSource::TupleStruct);
Expand Down
9 changes: 0 additions & 9 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,6 @@ pub struct Inherited<'a, 'tcx> {
/// opaque type.
opaque_types_vars: RefCell<FxHashMap<Ty<'tcx>, Ty<'tcx>>>,

/// Each type parameter has an implicit region bound that
/// indicates it must outlive at least the function body (the user
/// may specify stronger requirements). This field indicates the
/// region of the callee. If it is `None`, then the parameter
/// environment is for an item or something where the "callee" is
/// not clear.
implicit_region_bound: Option<ty::Region<'tcx>>,

body_id: Option<hir::BodyId>,
}

Expand Down Expand Up @@ -681,7 +673,6 @@ impl Inherited<'a, 'tcx> {
deferred_generator_interiors: RefCell::new(Vec::new()),
opaque_types: RefCell::new(Default::default()),
opaque_types_vars: RefCell::new(Default::default()),
implicit_region_bound: None,
body_id,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/regionck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
fn resolve_regions_and_report_errors(&self, mode: RegionckMode) {
self.infcx.process_registered_region_obligations(
self.outlives_environment.region_bound_pairs_map(),
self.implicit_region_bound,
Some(self.tcx.lifetimes.re_root_empty),
self.param_env,
);

Expand Down
12 changes: 12 additions & 0 deletions src/test/ui/issues/issue-74539.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
enum E {
A(u8, u8),
}

fn main() {
let e = E::A(2, 3);
match e {
E::A(x @ ..) => { //~ ERROR `x @` is not allowed in a tuple
x //~ ERROR cannot find value `x` in this scope
}
};
}
21 changes: 21 additions & 0 deletions src/test/ui/issues/issue-74539.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
error[E0425]: cannot find value `x` in this scope
--> $DIR/issue-74539.rs:9:13
|
LL | x
| ^ help: a local variable with a similar name exists: `e`

error: `x @` is not allowed in a tuple struct
--> $DIR/issue-74539.rs:8:14
|
LL | E::A(x @ ..) => {
| ^^^^^^ this is only allowed in slice patterns
|
= help: remove this and bind each tuple field independently
help: if you don't need to use the contents of x, discard the tuple's remaining fields
|
LL | E::A(..) => {
| ^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0425`.
66 changes: 66 additions & 0 deletions src/test/ui/regions/type-param-outlives-reempty-issue-74429-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Regression test for #74429, where we didn't think that a type parameter
// outlived `ReEmpty`.

// check-pass

use std::marker::PhantomData;
use std::ptr::NonNull;

pub unsafe trait RawData {
type Elem;
}

unsafe impl<A> RawData for OwnedRepr<A> {
type Elem = A;
}

unsafe impl<'a, A> RawData for ViewRepr<&'a A> {
type Elem = A;
}

pub struct OwnedRepr<A> {
ptr: PhantomData<A>,
}

// these Copy impls are not necessary for the repro, but allow the code to compile without error
// on 1.44.1
#[derive(Copy, Clone)]
pub struct ViewRepr<A> {
life: PhantomData<A>,
}

#[derive(Copy, Clone)]
pub struct ArrayBase<S>
where
S: RawData,
{
ptr: NonNull<S::Elem>,
}

pub type Array<A> = ArrayBase<OwnedRepr<A>>;

pub type ArrayView<'a, A> = ArrayBase<ViewRepr<&'a A>>;

impl<A, S> ArrayBase<S>
where
S: RawData<Elem = A>,
{
pub fn index_axis(&self) -> ArrayView<'_, A> {
unimplemented!()
}

pub fn axis_iter<'a>(&'a self) -> std::iter::Empty<&'a A> {
unimplemented!()
}
}

pub fn x<T: Copy>(a: Array<T>) {
// drop just avoids a must_use warning
drop((0..1).filter(|_| true));
let y = a.index_axis();
a.axis_iter().for_each(|_| {
drop(y);
});
}

fn main() {}
Loading