rustup and small fixes by oli-obk · Pull Request #91 · rust-lang/miri (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@oli-obk

solson

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

// current stack.
let first = self.value_to_ptr_dont_use(args[0].0, args[0].1)?;
args[0].0 = Value::ByVal(PrimVal::from_ptr(first));
let ptr = match args[0].0 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code makes every element of temporaries a Value::ByRef. Can we just make temporaries into a Vec<Pointer>?

The way I see it, no accesses go through temporaries and they're only used for cleanup so it makes sense to be a list of Pointers. (Heck, even just a list of allocation ids should do it.)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (stayed with Pointers, since allocate returns a Pointer and deallocate takes one)

@ashleysommer

I'm getting

Compiling miri v0.1.0 (https://github.com/solson/miri.git#b96202b3)
error[E0107]: wrong number of lifetime parameters: expected 0, found 1
    --> /home/xxx/.cargo/git/checkouts/miri-f9dcdd0c0ec69fb1/b96202b/src/interpreter/mod.rs:1801:76
     |
1801 | pub fn monomorphize_field_ty<'a, 'tcx:'a >(tcx: TyCtxt<'a, 'tcx, 'tcx>, f: ty::FieldDef<'tcx>, substs: &'tcx Substs<'tcx>) -> Ty<'tcx> {
     |                                                                            ^^^^^^^^^^^^^^^^^^ unexpected lifetime parameter

error[E0107]: wrong number of lifetime parameters: expected 0, found 1
   --> /home/xxx/.cargo/git/checkouts/miri-f9dcdd0c0ec69fb1/b96202b/src/interpreter/terminator/intrinsics.rs:492:12
    |
492 |         f: ty::FieldDef<'tcx>,
    |            ^^^^^^^^^^^^^^^^^^ unexpected lifetime parameter

error: aborting due to 2 previous errors

error: Could not compile `miri`.

I believe this PR fixes that. Can it be merged ASAP?

@solson

@ashleysommer I cherry-picked the commit that fixes that into master. It should build for you now.

@oli-obk

solson

/// Temporaries introduced to save stackframes
/// This is pure interpreter magic and has nothing to do with how rustc does it
/// An example is calling an FnMut closure that has been converted to a FnOnce closure
/// If they are Value::ByRef, their memory will be freed when the stackframe finishes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is outdated now.

@oli-obk

github-actions bot pushed a commit that referenced this pull request

Apr 18, 2025

@matthiaskrgr

Introduce and use specialized //@ ignore-auxiliary for test support files instead of using //@ ignore-test

Summary

Add a semantically meaningful directive for ignoring test auxiliary files. This is for auxiliary files that participate in actual tests but should not be built by compiletest (i.e. these files are involved through mod xxx; or include!() or #[path = "xxx"], etc.).

Motivation

A specialized directive like //@ ignore-auxiliary makes it way easier to audit disabled tests via //@ ignore-test.

Follow-up to:

See also discussions in:

Remarks on remaining unconditionally disabled tests under tests/

After this PR, against commit 79a272c6402, only 14 remaining test files are disabled through //@ ignore-test:

Remaining `//@ ignore-test` files under `tests/`
tests/debuginfo/drop-locations.rs
4://@ ignore-test (broken, see #128971)

tests/rustdoc/macro-document-private-duplicate.rs
1://@ ignore-test (fails spuriously, see issue #89228)

tests/rustdoc/inline_cross/assoc-const-equality.rs
3://@ ignore-test (FIXME: #125092)

tests/ui/match/issue-27021.rs
7://@ ignore-test (#54987)

tests/ui/match/issue-26996.rs
7://@ ignore-test (#54987)

tests/ui/issues/issue-49298.rs
9://@ ignore-test (#54987)

tests/ui/issues/issue-59756.rs
2://@ ignore-test (rustfix needs multiple suggestions)

tests/ui/precondition-checks/write.rs
5://@ ignore-test (unimplemented)

tests/ui/precondition-checks/read.rs
5://@ ignore-test (unimplemented)

tests/ui/precondition-checks/write_bytes.rs
5://@ ignore-test (unimplemented)

tests/ui/explicit-tail-calls/drop-order.rs
2://@ ignore-test: tail calls are not implemented in rustc_codegen_ssa yet, so this causes 🧊

tests/ui/panics/panic-short-backtrace-windows-x86_64.rs
3://@ ignore-test (#92000)

tests/ui/json/json-bom-plus-crlf-multifile-aux.rs
3://@ ignore-test Not a test. Used by other tests

tests/ui/traits/next-solver/object-soundness-requires-generalization.rs
2://@ ignore-test (see #114196)

Of these, most are either unimplemented, or spurious, or known-broken. The outstanding one is tests/ui/json/json-bom-plus-crlf-multifile-aux.rs which I did not want to touch in this PR -- that aux file has load-bearing BOM and carriage returns and byte offset matters. I think those test files that require special encoding / BOM probably are better off as run-make tests. See #139968 for that aux file.

Review advice

r? compiler

github-actions bot pushed a commit that referenced this pull request

Nov 4, 2025

@matthiaskrgr

…, r=scottmcm

Make explicit that TypeId's layout and size are unstable

Or worded differently, explicitly remark non-stable-guarantee of TypeId layout and size.

This PR makes no additional guarantees or non-guarantees, it only emphasizes that TypeId's size and layout are unstable like any other #[repr(Rust)] types.

This was discussed during #t-compiler/meetings > &#91;weekly&#93; 2025-10-30 @ 💬, where the compiler team discussed a request rust-lang/rust#148265 to have the standard library (and language) commit to TypeId guaranteeing a size upper bound of 16 bytes. In the meeting, the consensus was:

Given that we have previously broken people who asserted the size of TypeId is 8 bytes, it was also discussed in the meeting that we should explicitly note that the size and layout of TypeId is not a stable guarantee, and is subject to changes between Rust releases, and thus cannot be relied upon -- if breakage in people's code is due to that assumption, it will be considered a won't-fix.

r? @scottmcm (or libs/libs-api/lang)