Skip to content

Commit 130b2ab

Browse files
committed
Auto merge of #82611 - Dylan-DPC:rollup-l7xlpks, r=Dylan-DPC
Rollup of 11 pull requests Successful merges: - #81856 (Suggest character encoding is incorrect when encountering random null bytes) - #82395 (Add missing "see its documentation for more" stdio) - #82401 (Remove a redundant macro) - #82498 (Use log level to control partitioning debug output) - #82534 (Link crtbegin/crtend on musl to terminate .eh_frame) - #82537 (Update measureme dependency to the latest version) - #82561 (doc: cube root, not cubic root) - #82563 (Fix intra-doc handling of `Self` in enum) - #82584 (Add ARIA role to sidebar toggle in Rustdoc) - #82596 (clarify RW lock's priority gotcha) - #82607 (Add a getter for Frame.loc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 94736c4 + 7847f69 commit 130b2ab

File tree

25 files changed

+102
-33
lines changed

25 files changed

+102
-33
lines changed

Cargo.lock

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,11 +2149,14 @@ dependencies = [
21492149

21502150
[[package]]
21512151
name = "measureme"
2152-
version = "9.0.0"
2152+
version = "9.1.0"
21532153
source = "registry+https://github.com/rust-lang/crates.io-index"
2154-
checksum = "22bf8d885d073610aee20e7fa205c4341ed32a761dbde96da5fd96301a8d3e82"
2154+
checksum = "4a98e07fe802486895addb2b5467f33f205e82c426bfaf350f5d8109b137767c"
21552155
dependencies = [
2156+
"log",
2157+
"memmap",
21562158
"parking_lot",
2159+
"perf-event-open-sys",
21572160
"rustc-hash",
21582161
"smallvec 1.6.1",
21592162
]
@@ -2550,6 +2553,15 @@ version = "2.1.0"
25502553
source = "registry+https://github.com/rust-lang/crates.io-index"
25512554
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
25522555

2556+
[[package]]
2557+
name = "perf-event-open-sys"
2558+
version = "1.0.1"
2559+
source = "registry+https://github.com/rust-lang/crates.io-index"
2560+
checksum = "ce9bedf5da2c234fdf2391ede2b90fabf585355f33100689bc364a3ea558561a"
2561+
dependencies = [
2562+
"libc",
2563+
]
2564+
25532565
[[package]]
25542566
name = "pest"
25552567
version = "2.1.3"

compiler/rustc_codegen_llvm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212
bitflags = "1.0"
1313
cstr = "0.2"
1414
libc = "0.2"
15-
measureme = "9.0.0"
15+
measureme = "9.1.0"
1616
snap = "1"
1717
tracing = "0.1"
1818
rustc_middle = { path = "../rustc_middle" }

compiler/rustc_data_structures/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ rustc-hash = "1.1.0"
2525
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
2626
rustc_index = { path = "../rustc_index", package = "rustc_index" }
2727
bitflags = "1.2.1"
28-
measureme = "9.0.0"
28+
measureme = "9.1.0"
2929
libc = "0.2"
3030
stacker = "0.1.12"
3131
tempfile = "3.0.5"

compiler/rustc_middle/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ rustc_ast = { path = "../rustc_ast" }
2828
rustc_span = { path = "../rustc_span" }
2929
chalk-ir = "0.55.0"
3030
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
31-
measureme = "9.0.0"
31+
measureme = "9.1.0"
3232
rustc_session = { path = "../rustc_session" }
3333
rustc_type_ir = { path = "../rustc_type_ir" }

compiler/rustc_mir/src/interpret/eval_context.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@ impl<'mir, 'tcx, Tag> Frame<'mir, 'tcx, Tag> {
226226
}
227227

228228
impl<'mir, 'tcx, Tag, Extra> Frame<'mir, 'tcx, Tag, Extra> {
229+
/// Get the current location within the Frame.
230+
///
231+
/// If this is `Err`, we are not currently executing any particular statement in
232+
/// this frame (can happen e.g. during frame initialization, and during unwinding on
233+
/// frames without cleanup code).
234+
/// We basically abuse `Result` as `Either`.
235+
pub fn current_loc(&self) -> Result<mir::Location, Span> {
236+
self.loc
237+
}
238+
229239
/// Return the `SourceInfo` of the current instruction.
230240
pub fn current_source_info(&self) -> Option<&mir::SourceInfo> {
231241
self.loc.ok().map(|loc| self.body.source_info(loc))

compiler/rustc_mir/src/monomorphize/partitioning/mod.rs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,17 +239,22 @@ where
239239
I: Iterator<Item = &'a CodegenUnit<'tcx>>,
240240
'tcx: 'a,
241241
{
242-
if cfg!(debug_assertions) {
243-
debug!("{}", label);
242+
let dump = move || {
243+
use std::fmt::Write;
244+
245+
let s = &mut String::new();
246+
let _ = writeln!(s, "{}", label);
244247
for cgu in cgus {
245-
debug!("CodegenUnit {} estimated size {} :", cgu.name(), cgu.size_estimate());
248+
let _ =
249+
writeln!(s, "CodegenUnit {} estimated size {} :", cgu.name(), cgu.size_estimate());
246250

247251
for (mono_item, linkage) in cgu.items() {
248252
let symbol_name = mono_item.symbol_name(tcx).name;
249253
let symbol_hash_start = symbol_name.rfind('h');
250254
let symbol_hash = symbol_hash_start.map_or("<no hash>", |i| &symbol_name[i..]);
251255

252-
debug!(
256+
let _ = writeln!(
257+
s,
253258
" - {} [{:?}] [{}] estimated size {}",
254259
mono_item,
255260
linkage,
@@ -258,9 +263,13 @@ where
258263
);
259264
}
260265

261-
debug!("");
266+
let _ = writeln!(s, "");
262267
}
263-
}
268+
269+
std::mem::take(s)
270+
};
271+
272+
debug!("{}", dump());
264273
}
265274

266275
#[inline(never)] // give this a place in the profiler

compiler/rustc_parse/src/lexer/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ impl<'a> StringReader<'a> {
268268
// tokens like `<<` from `rustc_lexer`, and then add fancier error recovery to it,
269269
// as there will be less overall work to do this way.
270270
let token = unicode_chars::check_for_substitution(self, start, c, &mut err);
271+
if c == '\x00' {
272+
err.help("source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used");
273+
}
271274
err.emit();
272275
token?
273276
}

compiler/rustc_target/src/spec/crt_objects.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,24 @@ pub(super) fn all(obj: &str) -> CrtObjects {
6464

6565
pub(super) fn pre_musl_fallback() -> CrtObjects {
6666
new(&[
67-
(LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o"]),
68-
(LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o"]),
69-
(LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o"]),
70-
(LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o"]),
71-
(LinkOutputKind::DynamicDylib, &["crti.o"]),
72-
(LinkOutputKind::StaticDylib, &["crti.o"]),
67+
(LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
68+
(LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o", "crtbeginS.o"]),
69+
(LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
70+
(LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o", "crtbeginS.o"]),
71+
(LinkOutputKind::DynamicDylib, &["crti.o", "crtbeginS.o"]),
72+
(LinkOutputKind::StaticDylib, &["crti.o", "crtbeginS.o"]),
7373
])
7474
}
7575

7676
pub(super) fn post_musl_fallback() -> CrtObjects {
77-
all("crtn.o")
77+
new(&[
78+
(LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]),
79+
(LinkOutputKind::DynamicPicExe, &["crtendS.o", "crtn.o"]),
80+
(LinkOutputKind::StaticNoPicExe, &["crtend.o", "crtn.o"]),
81+
(LinkOutputKind::StaticPicExe, &["crtendS.o", "crtn.o"]),
82+
(LinkOutputKind::DynamicDylib, &["crtendS.o", "crtn.o"]),
83+
(LinkOutputKind::StaticDylib, &["crtendS.o", "crtn.o"]),
84+
])
7885
}
7986

8087
pub(super) fn pre_mingw_fallback() -> CrtObjects {

compiler/rustc_typeck/src/check/method/suggest.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -517,21 +517,21 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
517517
}
518518

519519
if self.is_fn_ty(&rcvr_ty, span) {
520-
macro_rules! report_function {
521-
($span:expr, $name:expr) => {
522-
err.note(&format!(
523-
"`{}` is a function, perhaps you wish to call it",
524-
$name
525-
));
526-
};
520+
fn report_function<T: std::fmt::Display>(
521+
err: &mut DiagnosticBuilder<'_>,
522+
name: T,
523+
) {
524+
err.note(
525+
&format!("`{}` is a function, perhaps you wish to call it", name,),
526+
);
527527
}
528528

529529
if let SelfSource::MethodCall(expr) = source {
530530
if let Ok(expr_string) = tcx.sess.source_map().span_to_snippet(expr.span) {
531-
report_function!(expr.span, expr_string);
531+
report_function(&mut err, expr_string);
532532
} else if let ExprKind::Path(QPath::Resolved(_, ref path)) = expr.kind {
533533
if let Some(segment) = path.segments.last() {
534-
report_function!(expr.span, segment.ident);
534+
report_function(&mut err, segment.ident);
535535
}
536536
}
537537
}

library/std/src/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ impl f32 {
503503
unsafe { cmath::fdimf(self, other) }
504504
}
505505

506-
/// Returns the cubic root of a number.
506+
/// Returns the cube root of a number.
507507
///
508508
/// # Examples
509509
///

0 commit comments

Comments
 (0)