Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c45fc2b
Add support for xray in aarch64 unknown none target
odlot Dec 4, 2025
689279e
Add support for xray in aarch64 unknown none softfloat target
odlot May 11, 2026
743c6a6
docs: Add remark to bring your own runtime if none available
odlot May 11, 2026
2e70d68
Prepare for merging from rust-lang/rust
May 13, 2026
87bc203
Merge ref 'c8c4c83d57d3' from rust-lang/rust
May 13, 2026
0fbd5a7
fmt
May 13, 2026
c07430c
feat: finish TTL socket option, add nodelay socket option
WhySoBad May 12, 2026
748e457
Merge pull request #5035 from rust-lang/rustup-2026-05-13
oli-obk May 13, 2026
716b62d
turns out we can do 'connect; accept' in a single thread
RalfJung May 13, 2026
7fdccf5
Merge pull request #5031 from WhySoBad/network-socket-more-socket-opt…
RalfJung May 13, 2026
a0095ae
Fix last remnants of TB's Active -> Unique renaming
JoJoDeveloping May 13, 2026
0a97587
Adjust tests
JoJoDeveloping May 13, 2026
5ce1703
Merge pull request #5037 from JoJoDeveloping/fix-tb-unq-act
RalfJung May 13, 2026
cbcae88
update test_flock comments
RalfJung May 13, 2026
50113f8
Merge pull request #5039 from RalfJung/test-flock-comments
RalfJung May 13, 2026
b502d55
move closures related ui tests into its folder
danieljofficial May 13, 2026
3429bdf
add issue links and bless
danieljofficial May 13, 2026
61e801d
Add FileCheck for build_correct_coerce
eval-exec May 14, 2026
4becc81
refactor thread block timeout handling
RalfJung May 15, 2026
d08ba50
Merge pull request #5044 from RalfJung/timeouts
RalfJung May 15, 2026
170e6eb
add --native flag to './miri run' to run tests on the host
RalfJung May 16, 2026
710572c
Merge pull request #5045 from RalfJung/native
RalfJung May 16, 2026
a2400e2
fix eventfd writes with too big buffers
RalfJung May 16, 2026
68f4a90
libc-epoll-blocking data race test: fix what we are blocking for
RalfJung May 16, 2026
05731b4
libc tests: remove unused features
RalfJung May 16, 2026
51af80a
libc-time: expand comment
RalfJung May 16, 2026
faa411e
fs: statx always returns MODE; make test pass outside Miri as well
RalfJung May 16, 2026
79697e5
fix mkstemp behavior: we should not add the /tmp path
RalfJung May 16, 2026
c128457
Merge pull request #5046 from RalfJung/libc-test-fixes
RalfJung May 16, 2026
af7f76d
Add shims for vectored reads and vectored writes
WhySoBad May 9, 2026
425ec49
fix: don't remove readable readiness after short `peek`
WhySoBad May 15, 2026
804108e
Merge pull request #5019 from WhySoBad/file-description-readv-writev
RalfJung May 16, 2026
a54a4a8
Merge pull request #5043 from WhySoBad/network-socket-fix-short-peek
RalfJung May 16, 2026
5f8a3f7
Prepare for merging from rust-lang/rust
May 17, 2026
2b9856f
Merge ref '281c97c3240a' from rust-lang/rust
May 17, 2026
57e65b3
Merge pull request #5048 from rust-lang/rustup-2026-05-17
RalfJung May 17, 2026
52b5f55
ci: Add dist-aarch64-freebsd
mrkajetanp Jan 22, 2026
79cfca5
Various TCP socket `connect` fixes
WhySoBad May 13, 2026
6c88e90
Move `span_map` file to the right folder
GuillaumeGomez May 18, 2026
6e9e47d
Merge pull request #5036 from WhySoBad/network-socket-fix-blocking-co…
RalfJung May 19, 2026
18311c6
fix running miri test when the working directory is not writable
RalfJung May 19, 2026
d14790a
Rollup merge of #154265 - mrkajetanp:freebsd-aarch64-ci, r=marcoieni
JonathanBrouwer May 19, 2026
c8cb78d
Rollup merge of #156739 - RalfJung:miri, r=RalfJung
JonathanBrouwer May 19, 2026
93e516b
Rollup merge of #148666 - odlot:master, r=wesleywiser
JonathanBrouwer May 19, 2026
9283c8e
Rollup merge of #156547 - danieljofficial:move-tests-closures, r=adwi…
JonathanBrouwer May 19, 2026
3a0c6e9
Rollup merge of #156578 - eval-exec:mir-opt-build-correct-coerce-file…
JonathanBrouwer May 19, 2026
f3d44a0
Rollup merge of #156734 - GuillaumeGomez:move-span_map, r=yotamofek
JonathanBrouwer May 19, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub(crate) fn target() -> Target {
stack_probes: StackProbeType::Inline,
panic_strategy: PanicStrategy::Abort,
default_uwtable: true,
supports_xray: true,
..Default::default()
};
Target {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(crate) fn target() -> Target {
stack_probes: StackProbeType::Inline,
panic_strategy: PanicStrategy::Abort,
default_uwtable: true,
supports_xray: true,
..Default::default()
};
Target {
Expand Down
44 changes: 44 additions & 0 deletions src/ci/docker/host-aarch64/dist-aarch64-freebsd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM ubuntu:26.04

RUN apt-get update && apt-get install -y --no-install-recommends \
clang \
make \
ninja-build \
file \
curl \
ca-certificates \
python3 \
git \
cmake \
sudo \
bzip2 \
xz-utils \
texinfo \
wget \
libssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

COPY scripts/freebsd-toolchain.sh /tmp/
RUN /tmp/freebsd-toolchain.sh aarch64

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh

ENV \
AR_aarch64_unknown_freebsd=aarch64-unknown-freebsd14-ar \
CC_aarch64_unknown_freebsd=aarch64-unknown-freebsd14-clang \
CXX_aarch64_unknown_freebsd=aarch64-unknown-freebsd14-clang++

ENV HOSTS=aarch64-unknown-freebsd

ENV RUST_CONFIGURE_ARGS="--enable-full-tools \
--enable-extended \
--enable-profiler \
--enable-sanitizers \
--disable-docs"

ENV SCRIPT="python3 ../x.py dist --host $HOSTS --target $HOSTS"
1 change: 1 addition & 0 deletions src/ci/docker/scripts/freebsd-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ mkdir -p "$sysroot"
case $arch in
(x86_64) freebsd_arch=amd64 ;;
(i686) freebsd_arch=i386 ;;
(aarch64) freebsd_arch=arm64 ;;
esac

files_to_extract=(
Expand Down
3 changes: 3 additions & 0 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ auto:
- name: dist-x86_64-freebsd
<<: *job-linux-4c

- name: dist-aarch64-freebsd
<<: *job-aarch64-linux

- name: dist-x86_64-illumos
<<: *job-linux-4c

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ which on their own don't do anything useful.
In order to actually trace the functions,
you will need to link a separate runtime library of your choice,
such as Clang's [XRay Runtime Library](https://www.llvm.org/docs/XRay.html#xray-runtime-library).
On targets where such a runtime is not available but instrumentation is supported, you must supply and link your own runtime library.
4 changes: 2 additions & 2 deletions src/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use crate::display::Joined as _;
use crate::html::escape::EscapeBodyText;
use crate::html::format::HrefInfo;
use crate::html::macro_expansion::ExpandedCode;
use crate::html::render::span_map::{DUMMY_SP, Span};
use crate::html::render::{Context, LinkFromSrc};
use crate::html::render::Context;
use crate::html::span_map::{DUMMY_SP, LinkFromSrc, Span};

/// This type is needed in case we want to render links on items to allow to go to their definition.
pub(crate) struct HrefContext<'a, 'tcx> {
Expand Down
1 change: 1 addition & 0 deletions src/librustdoc/html/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub(crate) mod macro_expansion;
pub mod markdown;
pub(crate) mod render;
pub(crate) mod sources;
pub(crate) mod span_map;
pub(crate) mod static_files;
pub(crate) mod toc;
mod url_parts_builder;
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/render/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use tracing::info;

use super::print_item::{full_path, print_item, print_item_path, print_ty_path};
use super::sidebar::{ModuleLike, Sidebar, print_sidebar, sidebar_module_like};
use super::{AllTypes, LinkFromSrc, StylePath, collect_spans_and_sources, scrape_examples_help};
use super::{AllTypes, StylePath, scrape_examples_help};
use crate::clean::types::ExternalLocation;
use crate::clean::utils::has_doc_flag;
use crate::clean::{self, ExternalCrate};
Expand All @@ -33,8 +33,8 @@ use crate::formats::item_type::ItemType;
use crate::html::escape::Escape;
use crate::html::macro_expansion::ExpandedCode;
use crate::html::markdown::{self, ErrorCodes, IdMap, plain_text_summary};
use crate::html::render::span_map::Span;
use crate::html::render::write_shared::write_shared;
use crate::html::span_map::{LinkFromSrc, Span, collect_spans_and_sources};
use crate::html::url_parts_builder::UrlPartsBuilder;
use crate::html::{layout, sources, static_files};
use crate::scrape_examples::AllCallLocations;
Expand Down
2 changes: 0 additions & 2 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ mod ordered_json;
mod print_item;
pub(crate) mod sidebar;
mod sorted_template;
pub(crate) mod span_map;
mod type_layout;
mod write_shared;

Expand Down Expand Up @@ -64,7 +63,6 @@ use rustc_span::symbol::{Symbol, sym};
use tracing::{debug, info};

pub(crate) use self::context::*;
pub(crate) use self::span_map::{LinkFromSrc, collect_spans_and_sources};
pub(crate) use self::write_shared::*;
use crate::clean::{self, Defaultness, Item, ItemId, RenderedLink};
use crate::display::{Joined as _, MaybeDisplay as _};
Expand Down
File renamed without changes.
40 changes: 22 additions & 18 deletions src/tools/miri/miri-script/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ impl Command {
Command::Check { features, flags } => Self::check(features, flags),
Command::Test { bless, target, coverage, features, flags } =>
Self::test(bless, target, coverage, features, flags),
Command::Run { dep, quiet, target, edition, features, flags } =>
Self::run(dep, quiet, target, edition, features, flags),
Command::Run { dep, native, quiet, target, edition, features, flags } =>
Self::run(dep, native, quiet, target, edition, features, flags),
Command::Doc { features, flags } => Self::doc(features, flags),
Command::Fmt { flags } => Self::fmt(flags),
Command::Clippy { features, flags } => Self::clippy(features, flags),
Expand Down Expand Up @@ -465,15 +465,18 @@ impl Command {

fn run(
dep: bool,
native: bool,
quiet: bool,
target: Option<String>,
edition: Option<String>,
features: Vec<String>,
flags: Vec<String>,
) -> Result<()> {
let mut e = MiriEnv::new()?;
let run_via_ui_test = dep || native;

// Preparation: get a sysroot, and get the miri binary.
// We do this even for native run as it also builds Miri itself.
let miri_sysroot =
e.build_miri_sysroot(/* quiet */ quiet, target.as_deref(), &features)?;
let miri_bin = e
Expand All @@ -484,44 +487,45 @@ impl Command {
// (because `flags` may contain `--`).
let mut early_flags = Vec::<OsString>::new();

// In `dep` mode, the target is already passed via `MIRI_TEST_TARGET`
if !dep {
// In ui_test mode, the target is already passed via `MIRI_TEST_TARGET`
if !run_via_ui_test {
if let Some(target) = &target {
early_flags.push("--target".into());
early_flags.push(target.into());
}
}
early_flags.push("--edition".into());
early_flags.push(edition.as_deref().unwrap_or("2021").into());
early_flags.push("--sysroot".into());
early_flags.push(miri_sysroot.into());
if !native {
early_flags.push("--sysroot".into());
early_flags.push(miri_sysroot.into());
}

// Compute flags.
let miri_flags = e.sh.var("MIRIFLAGS").unwrap_or_default();
let miri_flags = flagsplit(&miri_flags);
let quiet_flag = if quiet { Some("--quiet") } else { None };

// Run Miri.
// The basic command that executes the Miri driver.
let mut cmd = if dep {
let mut cmd = if run_via_ui_test {
// We invoke the test suite as that has all the logic for running with dependencies.
e.cargo_cmd(".", "test", &features)
let mut cmd = e
.cargo_cmd(".", "test", &features)
.args(&["--test", "ui"])
.args(quiet_flag)
// This does not show anything useful so we always hide it.
.arg("--quiet")
.arg("--")
.args(&["--miri-run-dep-mode"])
.env("MIRI_RUN_MODE", if native { "native" } else { "1" });
if let Some(target) = &target {
cmd = cmd.env("MIRI_TEST_TARGET", target);
}
cmd
} else {
cmd!(e.sh, "{miri_bin}")
};
cmd.set_quiet(quiet);
// Add Miri flags
let mut cmd = cmd.args(&miri_flags).args(&early_flags).args(&flags);
// For `--dep` we also need to set the target in the env var.
if dep {
if let Some(target) = &target {
cmd = cmd.env("MIRI_TEST_TARGET", target);
}
}
let cmd = cmd.args(&miri_flags).args(&early_flags).args(&flags);
// Finally, run the thing.
Ok(cmd.run()?)
}
Expand Down
4 changes: 4 additions & 0 deletions src/tools/miri/miri-script/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ pub enum Command {
/// Build the program with the dependencies declared in `tests/deps/Cargo.toml`.
#[arg(long)]
dep: bool,
/// Compile and run the program natively instead of via Miri. Implies `--dep`.
/// All flags are passed to rustc; there is currently no way to pass flags to the program.
#[arg(long)]
native: bool,
/// Hide build progress.
#[arg(long, short)]
quiet: bool,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
63b1dfc0e00fd6f8ad7cd8817fc712e7d9b7be59
281c97c3240a9abd984ca0c6a2cd7389115e80d5
12 changes: 6 additions & 6 deletions src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ struct DisplayFmtWrapper {
/// will show each permission line as
/// ```text
/// 0.. 1.. 2.. 3.. 4.. 5
/// [Act|Res|Frz|Dis|___]
/// [Unq|Res|Frz|Dis|___]
/// ```
struct DisplayFmtPermission {
/// Text that starts the permission block.
Expand All @@ -467,7 +467,7 @@ struct DisplayFmtPermission {
close: S,
/// Text to show when a permission is not initialized.
/// Should have the same width as a `Permission`'s `.short_name()`, i.e.
/// 3 if using the `Res/Act/Frz/Dis` notation.
/// 3 if using the `Res/Unq/Frz/Dis` notation.
uninit: S,
/// Text to separate the `start` and `end` values of a range.
range_sep: S,
Expand Down Expand Up @@ -525,7 +525,7 @@ struct DisplayFmtPadding {
/// ```
/// will show states as
/// ```text
/// Act
/// Unq
/// ?Res
/// ____
/// ```
Expand All @@ -549,8 +549,8 @@ struct DisplayFmt {
}
impl DisplayFmt {
/// Print the permission with the format
/// ` Res`/` Re*`/` Act`/` Frz`/` Dis` for accessed locations
/// and `?Res`/`?Re*`/`?Act`/`?Frz`/`?Dis` for unaccessed locations.
/// ` Res`/` Re*`/` Unq`/` Frz`/` Dis` for accessed locations
/// and `?Res`/`?Re*`/`?Unq`/`?Frz`/`?Dis` for unaccessed locations.
fn print_perm(&self, perm: Option<LocationState>) -> String {
if let Some(perm) = perm {
format!(
Expand Down Expand Up @@ -801,7 +801,7 @@ impl DisplayRepr {
) {
let mut line = String::new();
// Format the permissions on each range.
// Looks like `| Act| Res| Res| Act|`.
// Looks like `| Unq| Res| Res| Unq|`.
line.push_str(fmt.perm.open);
for (i, (perm, &pad)) in tree.rperm.iter().zip(padding.iter()).enumerate() {
if i > 0 {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/miri/src/borrow_tracker/tree_borrows/perms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ pub mod diagnostics {
ReservedFrz { conflicted: false } => "Res ",
ReservedFrz { conflicted: true } => "ResC",
ReservedIM => "ReIM",
Unique => "Act ",
Unique => "Unq ",
Frozen => "Frz ",
Disabled => "Dis ",
}
Expand Down
81 changes: 80 additions & 1 deletion src/tools/miri/src/clock.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::cell::Cell;
use std::time::{Duration, Instant as StdInstant};
use std::time::{Duration, Instant as StdInstant, SystemTime};

use crate::MiriMachine;

/// When using a virtual clock, this defines how many nanoseconds we pretend are passing for each
/// basic block.
Expand All @@ -8,6 +10,7 @@ use std::time::{Duration, Instant as StdInstant};
/// (See `tests/pass/shims/time-with-isolation*.rs`.)
const NANOSECONDS_PER_BASIC_BLOCK: u128 = 5000;

/// An instant (a fixed moment in time) in Miri's monotone clock.
#[derive(Debug)]
pub struct Instant {
kind: InstantKind,
Expand Down Expand Up @@ -129,3 +132,79 @@ impl MonotonicClock {
}
}
}

/// A deadline for some event to occur.
#[derive(Debug)]
pub enum Deadline {
Monotonic(Instant),
RealTime(SystemTime),
}

impl From<Instant> for Deadline {
fn from(value: Instant) -> Self {
Deadline::Monotonic(value)
}
}

impl Deadline {
/// Will try to add `duration`, but if that overflows it may add less.
fn add_lossy(&self, duration: Duration) -> Self {
match self {
Deadline::Monotonic(i) => Deadline::Monotonic(i.add_lossy(duration)),
Deadline::RealTime(s) => {
// If this overflows, try adding just 1h and assume that will not overflow.
Deadline::RealTime(
s.checked_add(duration)
.unwrap_or_else(|| s.checked_add(Duration::from_secs(3600)).unwrap()),
)
}
}
}
}

/// The clock to use for the timeout you are asking for.
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum TimeoutClock {
/// The timeout is measured using the monotone clock.
Monotonic,
/// The timeout is measured using the host's system clock.
RealTime,
}

/// Whether the timeout is relative or absolute.
#[derive(Debug, Copy, Clone)]
pub enum TimeoutStyle {
/// The given duration is interpreted relative to "now" for the selected clock.
Relative,
/// The given duration is interpreted as an "absolute" time, i.e., relative to the epoch of the
/// selected clock.
Absolute,
}

impl MiriMachine<'_> {
/// Computes the deadline for a given timeout configuration and duration.
pub fn timeout(
&self,
clock: TimeoutClock,
style: TimeoutStyle,
duration: Duration,
) -> Deadline {
// First let's figure out what "zero" means for the given clock and style.
let zero = match clock {
TimeoutClock::RealTime => {
assert!(self.communicate(), "cannot have `RealTime` timeout with isolation");
Deadline::RealTime(match style {
TimeoutStyle::Absolute => SystemTime::UNIX_EPOCH,
TimeoutStyle::Relative => SystemTime::now(),
})
}
TimeoutClock::Monotonic =>
Deadline::Monotonic(match style {
TimeoutStyle::Absolute => self.monotonic_clock.epoch(),
TimeoutStyle::Relative => self.monotonic_clock.now(),
}),
};
// Then add the given duration relative to that "zero".
zero.add_lossy(duration)
}
}
Loading
Loading