Skip to content

Commit 74ee5ed

Browse files
committed
Auto merge of #150661 - jhpratt:rollup-xm7nf5h, r=jhpratt
Rollup of 4 pull requests Successful merges: - #150201 (compiletest: Support revisions in debuginfo (read: debugger) tests) - #150225 (Weekly `cargo update`) - #150642 (mutex.rs: remove needless-maybe-unsized bounds) - #150658 (Clarify panic conditions in `Iterator::last`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f280e76 + ffc77c2 commit 74ee5ed

File tree

11 files changed

+360
-434
lines changed

11 files changed

+360
-434
lines changed

Cargo.lock

Lines changed: 234 additions & 173 deletions
Large diffs are not rendered by default.

library/Cargo.lock

Lines changed: 6 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ dependencies = [
7878

7979
[[package]]
8080
name = "dlmalloc"
81-
version = "0.2.11"
81+
version = "0.2.12"
8282
source = "registry+https://github.com/rust-lang/crates.io-index"
83-
checksum = "06cdfe340b16dd990c54cce79743613fa09fbb16774f33a77c9fd196f8f3fa30"
83+
checksum = "6738d2e996274e499bc7b0d693c858b7720b9cd2543a0643a3087e6cb0a4fa16"
8484
dependencies = [
8585
"cfg-if",
8686
"libc",
@@ -347,7 +347,7 @@ dependencies = [
347347
"vex-sdk",
348348
"wasi 0.11.1+wasi-snapshot-preview1",
349349
"wasi 0.14.4+wasi-0.2.4",
350-
"windows-targets 0.0.0",
350+
"windows-targets",
351351
]
352352

353353
[[package]]
@@ -436,82 +436,17 @@ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
436436

437437
[[package]]
438438
name = "windows-sys"
439-
version = "0.60.2"
439+
version = "0.61.2"
440440
source = "registry+https://github.com/rust-lang/crates.io-index"
441-
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
441+
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
442442
dependencies = [
443-
"windows-targets 0.53.5",
443+
"windows-link",
444444
]
445445

446446
[[package]]
447447
name = "windows-targets"
448448
version = "0.0.0"
449449

450-
[[package]]
451-
name = "windows-targets"
452-
version = "0.53.5"
453-
source = "registry+https://github.com/rust-lang/crates.io-index"
454-
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
455-
dependencies = [
456-
"windows-link",
457-
"windows_aarch64_gnullvm",
458-
"windows_aarch64_msvc",
459-
"windows_i686_gnu",
460-
"windows_i686_gnullvm",
461-
"windows_i686_msvc",
462-
"windows_x86_64_gnu",
463-
"windows_x86_64_gnullvm",
464-
"windows_x86_64_msvc",
465-
]
466-
467-
[[package]]
468-
name = "windows_aarch64_gnullvm"
469-
version = "0.53.1"
470-
source = "registry+https://github.com/rust-lang/crates.io-index"
471-
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
472-
473-
[[package]]
474-
name = "windows_aarch64_msvc"
475-
version = "0.53.1"
476-
source = "registry+https://github.com/rust-lang/crates.io-index"
477-
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
478-
479-
[[package]]
480-
name = "windows_i686_gnu"
481-
version = "0.53.1"
482-
source = "registry+https://github.com/rust-lang/crates.io-index"
483-
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
484-
485-
[[package]]
486-
name = "windows_i686_gnullvm"
487-
version = "0.53.1"
488-
source = "registry+https://github.com/rust-lang/crates.io-index"
489-
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
490-
491-
[[package]]
492-
name = "windows_i686_msvc"
493-
version = "0.53.1"
494-
source = "registry+https://github.com/rust-lang/crates.io-index"
495-
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
496-
497-
[[package]]
498-
name = "windows_x86_64_gnu"
499-
version = "0.53.1"
500-
source = "registry+https://github.com/rust-lang/crates.io-index"
501-
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
502-
503-
[[package]]
504-
name = "windows_x86_64_gnullvm"
505-
version = "0.53.1"
506-
source = "registry+https://github.com/rust-lang/crates.io-index"
507-
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
508-
509-
[[package]]
510-
name = "windows_x86_64_msvc"
511-
version = "0.53.1"
512-
source = "registry+https://github.com/rust-lang/crates.io-index"
513-
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
514-
515450
[[package]]
516451
name = "wit-bindgen"
517452
version = "0.45.1"

library/core/src/iter/traits/iterator.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,7 @@ pub trait Iterator {
238238
///
239239
/// # Panics
240240
///
241-
/// This function might panic if the iterator has more than [`usize::MAX`]
242-
/// elements.
241+
/// This function might panic if the iterator is infinite.
243242
///
244243
/// # Examples
245244
///

library/std/src/sync/nonpoison/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl<T> From<T> for Mutex<T> {
422422
}
423423

424424
#[unstable(feature = "nonpoison_mutex", issue = "134645")]
425-
impl<T: ?Sized + Default> Default for Mutex<T> {
425+
impl<T: Default> Default for Mutex<T> {
426426
/// Creates a `Mutex<T>`, with the `Default` value for T.
427427
fn default() -> Mutex<T> {
428428
Mutex::new(Default::default())

library/std/src/sync/poison/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ impl<T> From<T> for Mutex<T> {
688688
}
689689

690690
#[stable(feature = "mutex_default", since = "1.10.0")]
691-
impl<T: ?Sized + Default> Default for Mutex<T> {
691+
impl<T: Default> Default for Mutex<T> {
692692
/// Creates a `Mutex<T>`, with the `Default` value for T.
693693
fn default() -> Mutex<T> {
694694
Mutex::new(Default::default())

src/tools/compiletest/src/directives.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::directives::directive_names::{
1515
};
1616
pub(crate) use crate::directives::file::FileDirectives;
1717
use crate::directives::handlers::DIRECTIVE_HANDLERS_MAP;
18-
use crate::directives::line::{DirectiveLine, line_directive};
18+
use crate::directives::line::DirectiveLine;
1919
use crate::directives::needs::CachedNeedsConditions;
2020
use crate::edition::{Edition, parse_edition};
2121
use crate::errors::ErrorKind;
@@ -29,6 +29,7 @@ mod directive_names;
2929
mod file;
3030
mod handlers;
3131
mod line;
32+
pub(crate) use line::line_directive;
3233
mod line_number;
3334
pub(crate) use line_number::LineNumber;
3435
mod needs;

src/tools/compiletest/src/runtest/debugger.rs

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::io::{BufRead, BufReader};
44

55
use camino::{Utf8Path, Utf8PathBuf};
66

7-
use crate::directives::LineNumber;
7+
use crate::directives::{LineNumber, line_directive};
88
use crate::runtest::ProcRes;
99

1010
/// Representation of information to invoke a debugger and check its output
@@ -17,10 +17,16 @@ pub(super) struct DebuggerCommands {
1717
check_lines: Vec<(LineNumber, String)>,
1818
/// Source file name
1919
file: Utf8PathBuf,
20+
/// The revision being tested, if any
21+
revision: Option<String>,
2022
}
2123

2224
impl DebuggerCommands {
23-
pub fn parse_from(file: &Utf8Path, debugger_prefix: &str) -> Result<Self, String> {
25+
pub fn parse_from(
26+
file: &Utf8Path,
27+
debugger_prefix: &str,
28+
test_revision: Option<&str>,
29+
) -> Result<Self, String> {
2430
let command_directive = format!("{debugger_prefix}-command");
2531
let check_directive = format!("{debugger_prefix}-check");
2632

@@ -37,19 +43,33 @@ impl DebuggerCommands {
3743
continue;
3844
}
3945

40-
let Some(line) = line.trim_start().strip_prefix("//@").map(str::trim_start) else {
46+
let Some(directive) = line_directive(file, line_number, &line) else {
4147
continue;
4248
};
4349

44-
if let Some(command) = parse_name_value(&line, &command_directive) {
45-
commands.push(command);
50+
if !directive.applies_to_test_revision(test_revision) {
51+
continue;
4652
}
47-
if let Some(pattern) = parse_name_value(&line, &check_directive) {
48-
check_lines.push((line_number, pattern));
53+
54+
if directive.name == command_directive
55+
&& let Some(command) = directive.value_after_colon()
56+
{
57+
commands.push(command.to_string());
58+
}
59+
if directive.name == check_directive
60+
&& let Some(pattern) = directive.value_after_colon()
61+
{
62+
check_lines.push((line_number, pattern.to_string()));
4963
}
5064
}
5165

52-
Ok(Self { commands, breakpoint_lines, check_lines, file: file.to_path_buf() })
66+
Ok(Self {
67+
commands,
68+
breakpoint_lines,
69+
check_lines,
70+
file: file.to_path_buf(),
71+
revision: test_revision.map(str::to_owned),
72+
})
5373
}
5474

5575
/// Given debugger output and lines to check, ensure that every line is
@@ -81,9 +101,11 @@ impl DebuggerCommands {
81101
Ok(())
82102
} else {
83103
let fname = self.file.file_name().unwrap();
104+
let revision_suffix =
105+
self.revision.as_ref().map_or(String::new(), |r| format!("#{}", r));
84106
let mut msg = format!(
85-
"check directive(s) from `{}` not found in debugger output. errors:",
86-
self.file
107+
"check directive(s) from `{}{}` not found in debugger output. errors:",
108+
self.file, revision_suffix
87109
);
88110

89111
for (src_lineno, err_line) in missing {
@@ -103,18 +125,6 @@ impl DebuggerCommands {
103125
}
104126
}
105127

106-
/// Split off from the main `parse_name_value_directive`, so that improvements
107-
/// to directive handling aren't held back by debuginfo test commands.
108-
fn parse_name_value(line: &str, name: &str) -> Option<String> {
109-
if let Some(after_name) = line.strip_prefix(name)
110-
&& let Some(value) = after_name.strip_prefix(':')
111-
{
112-
Some(value.to_owned())
113-
} else {
114-
None
115-
}
116-
}
117-
118128
/// Check that the pattern in `check_line` applies to `line`. Returns `true` if they do match.
119129
fn check_single_line(line: &str, check_line: &str) -> bool {
120130
// Allow check lines to leave parts unspecified (e.g., uninitialized

src/tools/compiletest/src/runtest/debuginfo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl TestCx<'_> {
4646
}
4747

4848
// Parse debugger commands etc from test files
49-
let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "cdb")
49+
let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "cdb", self.revision)
5050
.unwrap_or_else(|e| self.fatal(&e));
5151

5252
// https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-commands
@@ -105,7 +105,7 @@ impl TestCx<'_> {
105105
}
106106

107107
fn run_debuginfo_gdb_test(&self) {
108-
let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "gdb")
108+
let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "gdb", self.revision)
109109
.unwrap_or_else(|e| self.fatal(&e));
110110
let mut cmds = dbg_cmds.commands.join("\n");
111111

@@ -366,7 +366,7 @@ impl TestCx<'_> {
366366
}
367367

368368
// Parse debugger commands etc from test files
369-
let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "lldb")
369+
let dbg_cmds = DebuggerCommands::parse_from(&self.testpaths.file, "lldb", self.revision)
370370
.unwrap_or_else(|e| self.fatal(&e));
371371

372372
// Write debugger script:

0 commit comments

Comments
 (0)