Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
407 changes: 234 additions & 173 deletions Cargo.lock

Large diffs are not rendered by default.

77 changes: 6 additions & 71 deletions library/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ dependencies = [

[[package]]
name = "dlmalloc"
version = "0.2.11"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06cdfe340b16dd990c54cce79743613fa09fbb16774f33a77c9fd196f8f3fa30"
checksum = "6738d2e996274e499bc7b0d693c858b7720b9cd2543a0643a3087e6cb0a4fa16"
dependencies = [
"cfg-if",
"libc",
Expand Down Expand Up @@ -347,7 +347,7 @@ dependencies = [
"vex-sdk",
"wasi 0.11.1+wasi-snapshot-preview1",
"wasi 0.14.4+wasi-0.2.4",
"windows-targets 0.0.0",
"windows-targets",
]

[[package]]
Expand Down Expand Up @@ -436,82 +436,17 @@ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"

[[package]]
name = "windows-sys"
version = "0.60.2"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
"windows-targets 0.53.5",
"windows-link",
]

[[package]]
name = "windows-targets"
version = "0.0.0"

[[package]]
name = "windows-targets"
version = "0.53.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
dependencies = [
"windows-link",
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
"windows_i686_gnu",
"windows_i686_gnullvm",
"windows_i686_msvc",
"windows_x86_64_gnu",
"windows_x86_64_gnullvm",
"windows_x86_64_msvc",
]

[[package]]
name = "windows_aarch64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"

[[package]]
name = "windows_aarch64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"

[[package]]
name = "windows_i686_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"

[[package]]
name = "windows_i686_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"

[[package]]
name = "windows_i686_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"

[[package]]
name = "windows_x86_64_gnu"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"

[[package]]
name = "windows_x86_64_gnullvm"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"

[[package]]
name = "windows_x86_64_msvc"
version = "0.53.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"

[[package]]
name = "wit-bindgen"
version = "0.45.1"
Expand Down
3 changes: 1 addition & 2 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@ pub trait Iterator {
///
/// # Panics
///
/// This function might panic if the iterator has more than [`usize::MAX`]
/// elements.
/// This function might panic if the iterator is infinite.
///
/// # Examples
///
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/nonpoison/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ impl<T> From<T> for Mutex<T> {
}

#[unstable(feature = "nonpoison_mutex", issue = "134645")]
impl<T: ?Sized + Default> Default for Mutex<T> {
impl<T: Default> Default for Mutex<T> {
/// Creates a `Mutex<T>`, with the `Default` value for T.
fn default() -> Mutex<T> {
Mutex::new(Default::default())
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sync/poison/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ impl<T> From<T> for Mutex<T> {
}

#[stable(feature = "mutex_default", since = "1.10.0")]
impl<T: ?Sized + Default> Default for Mutex<T> {
impl<T: Default> Default for Mutex<T> {
/// Creates a `Mutex<T>`, with the `Default` value for T.
fn default() -> Mutex<T> {
Mutex::new(Default::default())
Expand Down
3 changes: 2 additions & 1 deletion src/tools/compiletest/src/directives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::directives::directive_names::{
};
pub(crate) use crate::directives::file::FileDirectives;
use crate::directives::handlers::DIRECTIVE_HANDLERS_MAP;
use crate::directives::line::{DirectiveLine, line_directive};
use crate::directives::line::DirectiveLine;
use crate::directives::needs::CachedNeedsConditions;
use crate::edition::{Edition, parse_edition};
use crate::errors::ErrorKind;
Expand All @@ -29,6 +29,7 @@ mod directive_names;
mod file;
mod handlers;
mod line;
pub(crate) use line::line_directive;
mod line_number;
pub(crate) use line_number::LineNumber;
mod needs;
Expand Down
54 changes: 32 additions & 22 deletions src/tools/compiletest/src/runtest/debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::io::{BufRead, BufReader};

use camino::{Utf8Path, Utf8PathBuf};

use crate::directives::LineNumber;
use crate::directives::{LineNumber, line_directive};
use crate::runtest::ProcRes;

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

impl DebuggerCommands {
pub fn parse_from(file: &Utf8Path, debugger_prefix: &str) -> Result<Self, String> {
pub fn parse_from(
file: &Utf8Path,
debugger_prefix: &str,
test_revision: Option<&str>,
) -> Result<Self, String> {
let command_directive = format!("{debugger_prefix}-command");
let check_directive = format!("{debugger_prefix}-check");

Expand All @@ -37,19 +43,33 @@ impl DebuggerCommands {
continue;
}

let Some(line) = line.trim_start().strip_prefix("//@").map(str::trim_start) else {
let Some(directive) = line_directive(file, line_number, &line) else {
continue;
};

if let Some(command) = parse_name_value(&line, &command_directive) {
commands.push(command);
if !directive.applies_to_test_revision(test_revision) {
continue;
}
if let Some(pattern) = parse_name_value(&line, &check_directive) {
check_lines.push((line_number, pattern));

if directive.name == command_directive
&& let Some(command) = directive.value_after_colon()
{
commands.push(command.to_string());
}
if directive.name == check_directive
&& let Some(pattern) = directive.value_after_colon()
{
check_lines.push((line_number, pattern.to_string()));
}
}

Ok(Self { commands, breakpoint_lines, check_lines, file: file.to_path_buf() })
Ok(Self {
commands,
breakpoint_lines,
check_lines,
file: file.to_path_buf(),
revision: test_revision.map(str::to_owned),
})
}

/// Given debugger output and lines to check, ensure that every line is
Expand Down Expand Up @@ -81,9 +101,11 @@ impl DebuggerCommands {
Ok(())
} else {
let fname = self.file.file_name().unwrap();
let revision_suffix =
self.revision.as_ref().map_or(String::new(), |r| format!("#{}", r));
let mut msg = format!(
"check directive(s) from `{}` not found in debugger output. errors:",
self.file
"check directive(s) from `{}{}` not found in debugger output. errors:",
self.file, revision_suffix
);

for (src_lineno, err_line) in missing {
Expand All @@ -103,18 +125,6 @@ impl DebuggerCommands {
}
}

/// Split off from the main `parse_name_value_directive`, so that improvements
/// to directive handling aren't held back by debuginfo test commands.
fn parse_name_value(line: &str, name: &str) -> Option<String> {
if let Some(after_name) = line.strip_prefix(name)
&& let Some(value) = after_name.strip_prefix(':')
{
Some(value.to_owned())
} else {
None
}
}

/// Check that the pattern in `check_line` applies to `line`. Returns `true` if they do match.
fn check_single_line(line: &str, check_line: &str) -> bool {
// Allow check lines to leave parts unspecified (e.g., uninitialized
Expand Down
6 changes: 3 additions & 3 deletions src/tools/compiletest/src/runtest/debuginfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl TestCx<'_> {
}

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

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

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

Expand Down Expand Up @@ -366,7 +366,7 @@ impl TestCx<'_> {
}

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

// Write debugger script:
Expand Down
Loading
Loading