Skip to content

Commit 1c65325

Browse files
committed
Auto merge of #64661 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] rollup of last set of backports * ci: split aws credentials in two separate users with scoped perms #64576 * Updated RELEASES.md for 1.38.0 #64283 * Add Compatibility Notes to RELEASES.md for 1.38.0 #64621
2 parents fdd4856 + e8d2957 commit 1c65325

File tree

8 files changed

+302
-8
lines changed

8 files changed

+302
-8
lines changed

RELEASES.md

+114
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,117 @@
1+
Version 1.38.0 (2019-09-26)
2+
==========================
3+
4+
Language
5+
--------
6+
- [The `#[global_allocator]` attribute can now be used in submodules.][62735]
7+
- [The `#[deprecated]` attribute can now be used on macros.][62042]
8+
9+
Compiler
10+
--------
11+
- [Added pipelined compilation support to `rustc`.][62766] This will
12+
improve compilation times in some cases. For further information please refer
13+
to the [_"Evaluating pipelined rustc compilation"_][pipeline-internals] thread.
14+
- [Added tier 3\* support for the `aarch64-uwp-windows-msvc`, `i686-uwp-windows-gnu`,
15+
`i686-uwp-windows-msvc`, `x86_64-uwp-windows-gnu`, and
16+
`x86_64-uwp-windows-msvc` targets.][60260]
17+
- [Added tier 3 support for the `armv7-unknown-linux-gnueabi` and
18+
`armv7-unknown-linux-musleabi` targets.][63107]
19+
- [Added tier 3 support for the `hexagon-unknown-linux-musl` target.][62814]
20+
- [Added tier 3 support for the `riscv32i-unknown-none-elf` target.][62784]
21+
22+
\* Refer to Rust's [platform support page][forge-platform-support] for more
23+
information on Rust's tiered platform support.
24+
25+
Libraries
26+
---------
27+
- [`ascii::EscapeDefault` now implements `Clone` and `Display`.][63421]
28+
- [Derive macros for prelude traits (e.g. `Clone`, `Debug`, `Hash`) are now
29+
available at the same path as the trait.][63056] (e.g. The `Clone` derive macro
30+
is available at `std::clone::Clone`). This also makes all built-in macros
31+
available in `std`/`core` root. e.g. `std::include_bytes!`.
32+
- [`str::Chars` now implements `Debug`.][63000]
33+
- [`slice::{concat, connect, join}` now accepts `&[T]` in addition to `&T`.][62528]
34+
- [`*const T` and `*mut T` now implement `marker::Unpin`.][62583]
35+
- [`Arc<[T]>` and `Rc<[T]>` now implement `FromIterator<T>`.][61953]
36+
- [Added euclidean remainder and division operations (`div_euclid`,
37+
`rem_euclid`) to all numeric primitives.][61884] Additionally `checked`,
38+
`overflowing`, and `wrapping` versions are available for all
39+
integer primitives.
40+
- [`thread::AccessError` now implements `Clone`, `Copy`, `Eq`, `Error`, and
41+
`PartialEq`.][61491]
42+
- [`iter::{StepBy, Peekable, Take}` now implement `DoubleEndedIterator`.][61457]
43+
44+
Stabilized APIs
45+
---------------
46+
- [`<*const T>::cast`]
47+
- [`<*mut T>::cast`]
48+
- [`Duration::as_secs_f32`]
49+
- [`Duration::as_secs_f64`]
50+
- [`Duration::div_duration_f32`]
51+
- [`Duration::div_duration_f64`]
52+
- [`Duration::div_f32`]
53+
- [`Duration::div_f64`]
54+
- [`Duration::from_secs_f32`]
55+
- [`Duration::from_secs_f64`]
56+
- [`Duration::mul_f32`]
57+
- [`Duration::mul_f64`]
58+
- [`any::type_name`]
59+
60+
Cargo
61+
-----
62+
- [Added pipelined compilation support to `cargo`.][cargo/7143]
63+
- [You can now pass the `--features` option multiple times to enable
64+
multiple features.][cargo/7084]
65+
66+
Misc
67+
----
68+
- [`rustc` will now warn about some incorrect uses of
69+
`mem::{uninitialized, zeroed}` that are known to cause undefined behaviour.][63346]
70+
71+
Compatibility Notes
72+
-------------------
73+
- Unfortunately the [`x86_64-unknown-uefi` platform can not be built][62785]
74+
with rustc 1.39.0.
75+
- The [`armv7-unknown-linux-gnueabihf` platform is also known to have
76+
issues][62896] for certain crates such as libc.
77+
78+
[60260]: https://github.com/rust-lang/rust/pull/60260/
79+
[61457]: https://github.com/rust-lang/rust/pull/61457/
80+
[61491]: https://github.com/rust-lang/rust/pull/61491/
81+
[61884]: https://github.com/rust-lang/rust/pull/61884/
82+
[61953]: https://github.com/rust-lang/rust/pull/61953/
83+
[62042]: https://github.com/rust-lang/rust/pull/62042/
84+
[62528]: https://github.com/rust-lang/rust/pull/62528/
85+
[62583]: https://github.com/rust-lang/rust/pull/62583/
86+
[62735]: https://github.com/rust-lang/rust/pull/62735/
87+
[62766]: https://github.com/rust-lang/rust/pull/62766/
88+
[62784]: https://github.com/rust-lang/rust/pull/62784/
89+
[62785]: https://github.com/rust-lang/rust/issues/62785/
90+
[62814]: https://github.com/rust-lang/rust/pull/62814/
91+
[62896]: https://github.com/rust-lang/rust/issues/62896/
92+
[63000]: https://github.com/rust-lang/rust/pull/63000/
93+
[63056]: https://github.com/rust-lang/rust/pull/63056/
94+
[63107]: https://github.com/rust-lang/rust/pull/63107/
95+
[63346]: https://github.com/rust-lang/rust/pull/63346/
96+
[63421]: https://github.com/rust-lang/rust/pull/63421/
97+
[cargo/7084]: https://github.com/rust-lang/cargo/pull/7084/
98+
[cargo/7143]: https://github.com/rust-lang/cargo/pull/7143/
99+
[`<*const T>::cast`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast
100+
[`<*mut T>::cast`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast
101+
[`Duration::as_secs_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_secs_f32
102+
[`Duration::as_secs_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.as_secs_f64
103+
[`Duration::div_duration_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_duration_f32
104+
[`Duration::div_duration_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_duration_f64
105+
[`Duration::div_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_f32
106+
[`Duration::div_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.div_f64
107+
[`Duration::from_secs_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_secs_f32
108+
[`Duration::from_secs_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_secs_f64
109+
[`Duration::mul_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f32
110+
[`Duration::mul_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f64
111+
[`any::type_name`]: https://doc.rust-lang.org/std/any/fn.type_name.html
112+
[forge-platform-support]: https://forge.rust-lang.org/platform-support.html
113+
[pipeline-internals]: https://internals.rust-lang.org/t/evaluating-pipelined-rustc-compilation/10199
114+
1115
Version 1.37.0 (2019-08-15)
2116
==========================
3117

src/ci/azure-pipelines/auto.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trigger:
77
- auto
88

99
variables:
10-
- group: real-prod-credentials
10+
- group: prod-credentials
1111

1212
jobs:
1313
- job: Linux

src/ci/azure-pipelines/master.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trigger:
77
- master
88

99
variables:
10-
- group: real-prod-credentials
10+
- group: prod-credentials
1111

1212
pool:
1313
vmImage: ubuntu-16.04

src/ci/azure-pipelines/steps/run.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ steps:
168168
env:
169169
CI: true
170170
SRC: .
171-
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
171+
AWS_ACCESS_KEY_ID: $(SCCACHE_AWS_ACCESS_KEY_ID)
172+
AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
172173
TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)
173174
condition: and(succeeded(), not(variables.SKIP_JOB))
174175
displayName: Run build
@@ -192,7 +193,8 @@ steps:
192193
fi
193194
retry aws s3 cp --no-progress --recursive --acl public-read ./$upload_dir s3://$DEPLOY_BUCKET/$deploy_dir/$BUILD_SOURCEVERSION
194195
env:
195-
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
196+
AWS_ACCESS_KEY_ID: $(UPLOAD_AWS_ACCESS_KEY_ID)
197+
AWS_SECRET_ACCESS_KEY: $(UPLOAD_AWS_SECRET_ACCESS_KEY)
196198
condition: and(succeeded(), not(variables.SKIP_JOB), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')))
197199
displayName: Upload artifacts
198200

@@ -201,7 +203,8 @@ steps:
201203
# errors here ever fail the build since this is just informational.
202204
- bash: aws s3 cp --acl public-read cpu-usage.csv s3://$DEPLOY_BUCKET/rustc-builds/$BUILD_SOURCEVERSION/cpu-$SYSTEM_JOBNAME.csv
203205
env:
204-
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY)
205-
condition: variables['AWS_SECRET_ACCESS_KEY']
206+
AWS_ACCESS_KEY_ID: $(UPLOAD_AWS_ACCESS_KEY_ID)
207+
AWS_SECRET_ACCESS_KEY: $(UPLOAD_AWS_SECRET_ACCESS_KEY)
208+
condition: variables['UPLOAD_AWS_SECRET_ACCESS_KEY']
206209
continueOnError: true
207210
displayName: Upload CPU usage statistics

src/ci/azure-pipelines/try.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ trigger:
33
- try
44

55
variables:
6-
- group: real-prod-credentials
6+
- group: prod-credentials
77

88
jobs:
99
- job: Linux

src/librustc_mir/hair/pattern/mod.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,13 @@ fn search_for_adt_without_structural_match<'tcx>(tcx: TyCtxt<'tcx>,
12031203
ty::RawPtr(..) => {
12041204
// `#[structural_match]` ignores substructure of
12051205
// `*const _`/`*mut _`, so skip super_visit_with
1206-
1206+
//
1207+
// (But still tell caller to continue search.)
1208+
return false;
1209+
}
1210+
ty::FnDef(..) | ty::FnPtr(..) => {
1211+
// types of formals and return in `fn(_) -> _` are also irrelevant
1212+
//
12071213
// (But still tell caller to continue search.)
12081214
return false;
12091215
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
// run-pass
2+
3+
// This file checks that fn ptrs are considered structurally matchable.
4+
// See also rust-lang/rust#63479.
5+
6+
fn main() {
7+
let mut count = 0;
8+
9+
// A type which is not structurally matchable:
10+
struct NotSM;
11+
12+
// And one that is:
13+
#[derive(PartialEq, Eq)]
14+
struct SM;
15+
16+
fn trivial() {}
17+
18+
fn sm_to(_: SM) {}
19+
fn not_sm_to(_: NotSM) {}
20+
fn to_sm() -> SM { SM }
21+
fn to_not_sm() -> NotSM { NotSM }
22+
23+
// To recreate the scenario of interest in #63479, we need to add
24+
// a ref-level-of-indirection so that we descend into the type.
25+
26+
fn r_sm_to(_: &SM) {}
27+
fn r_not_sm_to(_: &NotSM) {}
28+
fn r_to_r_sm(_: &()) -> &SM { &SM }
29+
fn r_to_r_not_sm(_: &()) -> &NotSM { &NotSM }
30+
31+
#[derive(PartialEq, Eq)]
32+
struct Wrap<T>(T);
33+
34+
// In the code below, we put the match input into a local so that
35+
// we can assign it an explicit type that is an fn ptr instead of
36+
// a singleton type of the fn itself that the type inference would
37+
// otherwise assign.
38+
39+
// Check that fn() is #[structural_match]
40+
const CFN1: Wrap<fn()> = Wrap(trivial);
41+
let input: Wrap<fn()> = Wrap(trivial);
42+
match Wrap(input) {
43+
Wrap(CFN1) => count += 1,
44+
Wrap(_) => {}
45+
};
46+
47+
// Check that fn(T) is #[structural_match] when T is too.
48+
const CFN2: Wrap<fn(SM)> = Wrap(sm_to);
49+
let input: Wrap<fn(SM)> = Wrap(sm_to);
50+
match Wrap(input) {
51+
Wrap(CFN2) => count += 1,
52+
Wrap(_) => {}
53+
};
54+
55+
// Check that fn() -> T is #[structural_match] when T is too.
56+
const CFN3: Wrap<fn() -> SM> = Wrap(to_sm);
57+
let input: Wrap<fn() -> SM> = Wrap(to_sm);
58+
match Wrap(input) {
59+
Wrap(CFN3) => count += 1,
60+
Wrap(_) => {}
61+
};
62+
63+
// Check that fn(T) is #[structural_match] even if T is not.
64+
const CFN4: Wrap<fn(NotSM)> = Wrap(not_sm_to);
65+
let input: Wrap<fn(NotSM)> = Wrap(not_sm_to);
66+
match Wrap(input) {
67+
Wrap(CFN4) => count += 1,
68+
Wrap(_) => {}
69+
};
70+
71+
// Check that fn() -> T is #[structural_match] even if T is not.
72+
const CFN5: Wrap<fn() -> NotSM> = Wrap(to_not_sm);
73+
let input: Wrap<fn() -> NotSM> = Wrap(to_not_sm);
74+
match Wrap(input) {
75+
Wrap(CFN5) => count += 1,
76+
Wrap(_) => {}
77+
};
78+
79+
// Check that fn(&T) is #[structural_match] when T is too.
80+
const CFN6: Wrap<fn(&SM)> = Wrap(r_sm_to);
81+
let input: Wrap<fn(&SM)> = Wrap(r_sm_to);
82+
match Wrap(input) {
83+
Wrap(CFN6) => count += 1,
84+
Wrap(_) => {}
85+
};
86+
87+
// Check that fn() -> &T is #[structural_match] when T is too.
88+
const CFN7: Wrap<fn(&()) -> &SM> = Wrap(r_to_r_sm);
89+
let input: Wrap<fn(&()) -> &SM> = Wrap(r_to_r_sm);
90+
match Wrap(input) {
91+
Wrap(CFN7) => count += 1,
92+
Wrap(_) => {}
93+
};
94+
95+
// Check that fn(T) is #[structural_match] even if T is not.
96+
const CFN8: Wrap<fn(&NotSM)> = Wrap(r_not_sm_to);
97+
let input: Wrap<fn(&NotSM)> = Wrap(r_not_sm_to);
98+
match Wrap(input) {
99+
Wrap(CFN8) => count += 1,
100+
Wrap(_) => {}
101+
};
102+
103+
// Check that fn() -> T is #[structural_match] even if T is not.
104+
const CFN9: Wrap<fn(&()) -> &NotSM> = Wrap(r_to_r_not_sm);
105+
let input: Wrap<fn(&()) -> &NotSM> = Wrap(r_to_r_not_sm);
106+
match Wrap(input) {
107+
Wrap(CFN9) => count += 1,
108+
Wrap(_) => {}
109+
};
110+
111+
// Check that a type which has fn ptrs is `#[structural_match]`.
112+
#[derive(PartialEq, Eq)]
113+
struct Foo {
114+
alpha: fn(NotSM),
115+
beta: fn() -> NotSM,
116+
gamma: fn(SM),
117+
delta: fn() -> SM,
118+
}
119+
120+
const CFOO: Foo = Foo {
121+
alpha: not_sm_to,
122+
beta: to_not_sm,
123+
gamma: sm_to,
124+
delta: to_sm,
125+
};
126+
127+
let input = Foo { alpha: not_sm_to, beta: to_not_sm, gamma: sm_to, delta: to_sm };
128+
match input {
129+
CFOO => count += 1,
130+
Foo { .. } => {}
131+
};
132+
133+
// Final count must be 10 now if all
134+
assert_eq!(count, 10);
135+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// run-pass
2+
3+
// The actual regression test from #63479. (Including this because my
4+
// first draft at fn-ptr-is-structurally-matchable.rs failed to actually
5+
// cover the case this hit; I've since expanded it accordingly, but the
6+
// experience left me wary of leaving this regression test out.)
7+
8+
#[derive(Eq)]
9+
struct A {
10+
a: i64
11+
}
12+
13+
impl PartialEq for A {
14+
#[inline]
15+
fn eq(&self, other: &Self) -> bool {
16+
self.a.eq(&other.a)
17+
}
18+
}
19+
20+
type Fn = fn(&[A]);
21+
22+
fn my_fn(_args: &[A]) {
23+
println!("hello world");
24+
}
25+
26+
const TEST: Fn = my_fn;
27+
28+
struct B(Fn);
29+
30+
fn main() {
31+
let s = B(my_fn);
32+
match s {
33+
B(TEST) => println!("matched"),
34+
_ => panic!("didn't match")
35+
};
36+
}

0 commit comments

Comments
 (0)