Skip to content

Commit a6cbf2d

Browse files
committed
Auto merge of #61945 - Centril:rollup-xdqo2mn, r=Centril
Rollup of 11 pull requests Successful merges: - #61505 (Only show methods that appear in `impl` blocks in the Implementors sections of trait doc pages) - #61701 (move stray run-pass const tests into const/ folder) - #61748 (Tweak transparent enums and unions diagnostic spans) - #61802 (Make MaybeUninit #[repr(transparent)]) - #61839 (ci: Add a script for generating CPU usage graphs) - #61842 (Remove unnecessary lift calls) - #61843 (Turn down the myriad-closures test) - #61896 (rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.) - #61898 (syntax: Factor out common fields from `SyntaxExtension` variants) - #61938 (create an issue for miri even in status test-fail) - #61941 (Preserve generator and yield source for error messages) Failed merges: r? @ghost
2 parents 605ea9d + fde341a commit a6cbf2d

File tree

109 files changed

+966
-923
lines changed

Some content is hidden

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

109 files changed

+966
-923
lines changed

src/ci/cpu-usage-over-time.py

+2-17
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,8 @@
3030
# the second column is always zero.
3131
#
3232
# Once you've downloaded a file there's various ways to plot it and visualize
33-
# it. For command line usage you can use a script like so:
34-
#
35-
# set timefmt '%Y-%m-%dT%H:%M:%S'
36-
# set xdata time
37-
# set ylabel "Idle CPU %"
38-
# set xlabel "Time"
39-
# set datafile sep ','
40-
# set term png
41-
# set output "printme.png"
42-
# set grid
43-
# builder = "i686-apple"
44-
# plot "cpu-".builder.".csv" using 1:2 with lines title builder
45-
#
46-
# Executed as `gnuplot < ./foo.plot` it will generate a graph called
47-
# `printme.png` which you can then open up. If you know how to improve this
48-
# script or the viewing process that would be much appreciated :) (or even if
49-
# you know how to automate it!)
33+
# it. For command line usage you use the `src/etc/cpu-usage-over-time-plot.sh`
34+
# script in this repository.
5035

5136
import datetime
5237
import sys

src/doc/unstable-book/src/language-features/plugin.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ The advantages over a simple `fn(&str) -> u32` are:
132132
In addition to procedural macros, you can define new
133133
[`derive`](../../reference/attributes/derive.md)-like attributes and other kinds
134134
of extensions. See `Registry::register_syntax_extension` and the
135-
`SyntaxExtension` enum. For a more involved macro example, see
135+
`SyntaxExtension` struct. For a more involved macro example, see
136136
[`regex_macros`](https://github.com/rust-lang/regex/blob/master/regex_macros/src/lib.rs).
137137

138138

src/etc/cpu-usage-over-time-plot.sh

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
# A small script to help visualizing CPU usage over time data collected on CI
4+
# using `gnuplot`.
5+
#
6+
# This script is expected to be called with two arguments. The first is the full
7+
# commit SHA of the build you're interested in, and the second is the name of
8+
# the builder. For example:
9+
#
10+
# ./src/etc/cpu-usage-over-time-plot.sh e699ea096fcc2fc9ce8e8bcf884e11496a31cc9f i686-mingw-1
11+
#
12+
# That will generate `$builder.png` in the current directory which you can open
13+
# up to see a hopefully pretty graph.
14+
#
15+
# Improvements to this script are greatly appreciated!
16+
17+
set -ex
18+
19+
bucket=rust-lang-ci-evalazure
20+
commit=$1
21+
builder=$2
22+
23+
curl -O https://$bucket.s3.amazonaws.com/rustc-builds/$commit/cpu-$builder.csv
24+
25+
gnuplot <<-EOF
26+
reset
27+
set timefmt '%Y-%m-%dT%H:%M:%S'
28+
set xdata time
29+
set ylabel "CPU Usage %"
30+
set xlabel "Time"
31+
set datafile sep ','
32+
set term png size 3000,1000
33+
set output "$builder.png"
34+
set grid
35+
36+
f(x) = mean_y
37+
fit f(x) 'cpu-$builder.csv' using 1:(100-\$2) via mean_y
38+
39+
set label 1 gprintf("Average = %g%%", mean_y) center font ",18"
40+
set label 1 at graph 0.50, 0.25
41+
set xtics rotate by 45 offset -2,-2.4 300
42+
set ytics 10
43+
set boxwidth 0.5
44+
45+
plot \\
46+
mean_y with lines linetype 1 linecolor rgb "#ff0000" title "average", \\
47+
"cpu-$builder.csv" using 1:(100-\$2) with points pointtype 7 pointsize 0.4 title "$builder", \\
48+
"" using 1:(100-\$2) smooth bezier linewidth 3 title "bezier"
49+
EOF

src/libcore/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
#![feature(staged_api)]
101101
#![feature(std_internals)]
102102
#![feature(stmt_expr_attributes)]
103+
#![cfg_attr(not(bootstrap), feature(transparent_unions))]
103104
#![feature(unboxed_closures)]
104105
#![feature(unsized_locals)]
105106
#![feature(untagged_unions)]

src/libcore/mem/maybe_uninit.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ use crate::mem::ManuallyDrop;
172172
///
173173
/// # Layout
174174
///
175-
/// `MaybeUninit<T>` is guaranteed to have the same size and alignment as `T`:
175+
/// `MaybeUninit<T>` is guaranteed to have the same size, alignment, and ABI as `T`:
176176
///
177177
/// ```rust
178178
/// use std::mem::{MaybeUninit, size_of, align_of};
@@ -191,9 +191,23 @@ use crate::mem::ManuallyDrop;
191191
/// assert_eq!(size_of::<Option<bool>>(), 1);
192192
/// assert_eq!(size_of::<Option<MaybeUninit<bool>>>(), 2);
193193
/// ```
194+
///
195+
/// If `T` is FFI-safe, then so is `MaybeUninit<T>`.
196+
///
197+
/// While `MaybeUninit` is `#[repr(transparent)]` (indicating it guarantees the same size,
198+
/// alignment, and ABI as `T`), this does *not* change any of the previous caveats. `Option<T>` and
199+
/// `Option<MaybeUninit<T>>` may still have different sizes, and types containing a field of type
200+
/// `T` may be laid out (and sized) differently than if that field were `MaybeUninit<T>`.
201+
/// `MaybeUninit` is a union type, and `#[repr(transparent)]` on unions is unstable (see [the
202+
/// tracking issue](https://github.com/rust-lang/rust/issues/60405)). Over time, the exact
203+
/// guarantees of `#[repr(transparent)]` on unions may evolve, and `MaybeUninit` may or may not
204+
/// remain `#[repr(transparent)]`. That said, `MaybeUninit<T>` will *always* guarantee that it has
205+
/// the same size, alignment, and ABI as `T`; it's just that the way `MaybeUninit` implements that
206+
/// guarantee may evolve.
194207
#[allow(missing_debug_implementations)]
195208
#[stable(feature = "maybe_uninit", since = "1.36.0")]
196209
#[derive(Copy)]
210+
#[cfg_attr(not(bootstrap), repr(transparent))]
197211
pub union MaybeUninit<T> {
198212
uninit: (),
199213
value: ManuallyDrop<T>,

src/librustc/cfg/construct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
330330
hir::ExprKind::DropTemps(ref e) |
331331
hir::ExprKind::Unary(_, ref e) |
332332
hir::ExprKind::Field(ref e, _) |
333-
hir::ExprKind::Yield(ref e) |
333+
hir::ExprKind::Yield(ref e, _) |
334334
hir::ExprKind::Repeat(ref e, _) => {
335335
self.straightline(expr, pred, Some(&**e).into_iter())
336336
}

src/librustc/hir/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
10891089
visitor.visit_expr(expr)
10901090
}
10911091
}
1092-
ExprKind::Yield(ref subexpression) => {
1092+
ExprKind::Yield(ref subexpression, _) => {
10931093
visitor.visit_expr(subexpression);
10941094
}
10951095
ExprKind::Lit(_) | ExprKind::Err => {}

0 commit comments

Comments
 (0)