Auto merge of #74574 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
[stable] 1.45.1 release See RELEASES.md for details on what this contains.
This commit is contained in:
commit
14485ee125
17 changed files with 196 additions and 74 deletions
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
|
|
@ -26,7 +26,7 @@ name: CI
|
|||
- "**"
|
||||
defaults:
|
||||
run:
|
||||
shell: "python src/ci/exec-with-shell.py {0}"
|
||||
shell: bash
|
||||
jobs:
|
||||
pr:
|
||||
name: PR
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -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:
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ checksum = "716960a18f978640f25101b5cbf1c6f6b0d3192fab36a2d98ca96f0ecbe41010"
|
|||
|
||||
[[package]]
|
||||
name = "cargo"
|
||||
version = "0.46.0"
|
||||
version = "0.46.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"atty",
|
||||
|
|
@ -4467,7 +4467,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rustfmt-nightly"
|
||||
version = "1.4.15"
|
||||
version = "1.4.17"
|
||||
dependencies = [
|
||||
"annotate-snippets",
|
||||
"bytecount",
|
||||
|
|
|
|||
11
RELEASES.md
11
RELEASES.md
|
|
@ -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://github.com/rust-lang/rust/issues/73078
|
||||
[74509]: https://github.com/rust-lang/rust/pull/74509
|
||||
[74457]: https://github.com/rust-lang/rust/pull/74457
|
||||
|
||||
Version 1.45.0 (2020-07-16)
|
||||
==========================
|
||||
|
||||
|
|
|
|||
|
|
@ -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>,
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
@ -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(
|
||||
|
|
@ -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(
|
||||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# A simple wrapper that forwards the arguments to bash, unless the
|
||||
# CI_OVERRIDE_SHELL environment variable is present: in that case the content
|
||||
# of that environment variable is used as the shell path.
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
shell = os.environ["CI_OVERRIDE_SHELL"]
|
||||
except KeyError:
|
||||
shell = "bash"
|
||||
|
||||
res = subprocess.call([shell] + sys.argv[1:])
|
||||
sys.exit(res)
|
||||
|
|
@ -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
|
||||
|
|
@ -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:
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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>,
|
||||
}
|
||||
|
||||
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
);
|
||||
|
||||
|
|
|
|||
12
src/test/ui/issues/issue-74539.rs
Normal file
12
src/test/ui/issues/issue-74539.rs
Normal file
|
|
@ -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
src/test/ui/issues/issue-74539.stderr
Normal file
21
src/test/ui/issues/issue-74539.stderr
Normal file
|
|
@ -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`.
|
||||
|
|
@ -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() {}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
// Regression test for #74429, where we didn't think that a type parameter
|
||||
// outlived `ReEmpty`.
|
||||
|
||||
// check-pass
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
fn apply<T, F: FnOnce(T)>(_: T, _: F) {}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
struct Invariant<T> {
|
||||
t: T,
|
||||
p: PhantomData<fn(T) -> T>,
|
||||
}
|
||||
|
||||
fn verify_reempty<T>(x: T) {
|
||||
// r is inferred to have type `Invariant<&ReEmpty(U0) T>`
|
||||
let r = Invariant { t: &x, p: PhantomData };
|
||||
// Creates a new universe, all variables from now on are in `U1`, say.
|
||||
let _: fn(&()) = |_| {};
|
||||
// Closure parameter is of type `&ReEmpty(U1) T`, so the closure has an implied
|
||||
// bound of `T: ReEmpty(U1)`
|
||||
apply(&x, |_| {
|
||||
// Requires `typeof(r)` is well-formed, i.e. `T: ReEmpty(U0)`. If we
|
||||
// only have the implied bound from the closure parameter to use this
|
||||
// requires `ReEmpty(U1): ReEmpty(U0)`, which isn't true so we reported
|
||||
// an error.
|
||||
//
|
||||
// This doesn't happen any more because we ensure that `T: ReEmpty(U0)`
|
||||
// is an implicit bound for all type parameters.
|
||||
drop(r);
|
||||
});
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 744bd1fbb666f33b20b09d5bacc5047957c8ed42
|
||||
Subproject commit f242df6edb897f6f69d393a22bb257f5af0f52d0
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 530eadf4b42ddf35b209d4f4acd120f3fcc467ce
|
||||
Subproject commit 8a93416c2a6b389a7807dcdc6e6111d5f1e9213a
|
||||
Loading…
Add table
Add a link
Reference in a new issue