Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

tuple struct constructors and uninitialized fields - #96

Closed
oli-obk wants to merge 20 commits into
rust-lang:masterfrom
oli-obk:always_encode_mir
Closed

oli-obk wants to merge 20 commits into
rust-lang:masterfrom
oli-obk:always_encode_mir

Conversation

@oli-obk

@oli-obk oli-obk commented Dec 15, 2016

Copy link
Copy Markdown
Contributor

It might be easier to create a fourth variant to Value: Undefined, but that wouldn't allow for fat pointers where one part isn't defined yet. Having an undefined Primval might work.

@oli-obk

oli-obk commented Dec 15, 2016 •

Copy link
Copy Markdown
Contributor Author

#55 (run-pass) is now at

test result: FAILED. 2185 passed; 398 failed; 3 ignored; 0 measured

Associated constants are probably a big part of this, and 70 or more are threads

    106 error: attempted to read undefined bytes
     29 error: reached the configured maximum execution time
     20 error: can't call C ABI function: syscall
     16 error: panicked at src/libcore/slice.rs:566
     15 error: a raw memory access tried to access part of a pointer value as raw bytes
     12 error: index out of bounds: the len is 0 but the index is 0 at src/libcollections/vec.rs:1362:10: 1362:25
     10 error: panicked at src/libcore/option.rs:323
      9 error: tried to access memory through an invalid pointer
      9 error: cannot evaluate inline assembly
      6 error: linking with `cc` failed: exit code: 1
      6 collect2: error: ld returned 1 exit status
      5 error: panicked at src/libcore/str/mod.rs:1754
      5 error: no mir for `std::ops::Add::add`
      5 error: can't handle function with PlatformIntrinsic ABI
      5 error: can't call C ABI function: __rust_maybe_catch_panic
      5 error: can't call C ABI function: foo
      4 error: unimplemented intrinsic: atomic_xadd
      4 error: tried to access memory with alignment 1, but alignment 8 is required
      3 error: unimplemented intrinsic: atomic_store_relaxed
      3 error: tried to access memory with alignment 1, but alignment 4 is required
      3 error: internal compiler error: src/step.rs:247: static def id doesn't point to item
      2 error: no mir for `foolib::Foo::BAR`
      2 error: internal compiler error: src/librustc/ty/subst.rs:476: Type parameter `T/#0` (T/0) out of range when substituting (root type=Some(std::option::Option<T>)) substs=[]
      2 error: expected primitive type, got [u8; 8]
      2 error: dangling pointer was dereferenced
      2 error: can't call C ABI function: setenv
      2 error: can't call C ABI function: rust_interesting_average
      2 error: can't call C ABI function: rust_get_test_int
      2 error: can't call C ABI function: rust_dbg_call
      2 error: can't call C ABI function: readlink
      2 error: auxiliary build of "../rust/src/test/run-pass/auxiliary/foreign_lib.rs" failed to compile:
      2 error: auxiliary build of "../rust/src/test/run-pass/auxiliary/anon-extern-mod-cross-crate-1.rs" failed to compile:
      2 error: attempted to do math or a comparison on pointers into different allocations
      1 error: unimplemented intrinsic: atomic_store_rel
      1 error: unimplemented intrinsic: atomic_or
      1 error: unimplemented intrinsic: atomic_cxchg_relaxed
      1 error: tried to modify constant memory
      1 error: tried to access memory with alignment 2, but alignment 8 is required
      1 error: tried to access memory with alignment 1, but alignment 2 is required
      1 error: reached the configured maximum number of stack frames
      1 error: panicked at src/libcore/result.rs:837
      1 error: Overflow(Neg) at src/libcore/ops.rs:757:43: 757:45
      1 error: Overflow(Add) at src/libcore/ops.rs:263:45: 263:57
      1 error: no mir for `std::sys::imp::os::environ::::environ`
      1 error: no mir for `std::ops::Deref::deref`
      1 error: no mir for `std::iter::IntoIterator::into_iter`
      1 error: memory access of 85899344..85899346 outside bounds of allocation 301 which has size 200
      1 error: internal compiler error: src/vtable.rs:65: bad VtableFnPointer fn_ty: fn(u32) -> u32
      1 error: internal compiler error: src/value.rs:92: expected ptr and vtable, got ByVal(PrimVal { bits: 0, relocation: Some(AllocId(6)) })
      1 error: internal compiler error: src/terminator/mod.rs:947: find_method: translate_substs returned Slice(['_#0r, &(), u32]) which contains inference types/regions
      1 error: internal compiler error: src/terminator/mod.rs:789: UntaggedUnion { variants: Union { align: Align { raw: 51 }, min_size: Size { raw: 8 }, packed: false } } is not an adt layout
      1 error: internal compiler error: src/terminator/mod.rs:789: UntaggedUnion { variants: Union { align: Align { raw: 48 }, min_size: Size { raw: 1 }, packed: false } } is not an adt layout
      1 error: internal compiler error: src/terminator/mod.rs:789: UntaggedUnion { variants: Union { align: Align { raw: 48 }, min_size: Size { raw: 0 }, packed: false } } is not an adt layout
      1 error: internal compiler error: src/terminator/mod.rs:789: CEnum { discr: I8, signed: false, non_zero: false, min: 0, max: 1 } is not an adt layout
      1 error: internal compiler error: src/terminator/mod.rs:657: VtableFnPointer did not contain a concrete function: VtableFnPointer(fn_ty=fn(char) -> bool, nested=[])
      1 error: internal compiler error: src/terminator/mod.rs:278: bad layout for tuple struct constructor: General { discr: I32, variants: [Struct { align: Align { raw: 50 }, packed: false, sized: true, offsets: [Size { raw: 0 }, Size { raw: 4 }], min_size: Size { raw: 8 } }, Struct { align: Align { raw: 50 }, packed: false, sized: true, offsets: [Size { raw: 0 }, Size { raw: 4 }], min_size: Size { raw: 12 } }], size: Size { raw: 12 }, align: Align { raw: 50 } }
      1 error: internal compiler error: src/librustc/ty/mod.rs:1901: No def'n found for DefId { krate: CrateNum(0), node: DefIndex(5) => issue_23808/4089d7c8b778d88cec885baf7b69e6df-exe::Const[0]::C[0] } in tcx.mir_map
      1 error: internal compiler error: src/librustc/ty/mod.rs:1901: No def'n found for DefId { krate: CrateNum(0), node: DefIndex(5) => associated_const_use_impl_of_same_trait/4089d7c8b778d88cec885baf7b69e6df-exe::Foo[0]::BAR[0] } in tcx.mir_map
      1 error: internal compiler error: src/librustc/ty/mod.rs:1901: No def'n found for DefId { krate: CrateNum(0), node: DefIndex(5) => associated_const_ufcs_infer_trait/4089d7c8b778d88cec885baf7b69e6df-exe::Foo[0]::ID[0] } in tcx.mir_map
      1 error: internal compiler error: src/librustc/ty/mod.rs:1901: No def'n found for DefId { krate: CrateNum(0), node: DefIndex(5) => associated_const_type_parameters/4089d7c8b778d88cec885baf7b69e6df-exe::Foo[0]::X[0] } in tcx.mir_map
      1 error: internal compiler error: src/librustc/ty/mod.rs:1901: No def'n found for DefId { krate: CrateNum(0), node: DefIndex(5) => associated_const_self_type/4089d7c8b778d88cec885baf7b69e6df-exe::MyInt[0]::ONE[0] } in tcx.mir_map
      1 error: internal compiler error: src/librustc/ty/mod.rs:1901: No def'n found for DefId { krate: CrateNum(0), node: DefIndex(5) => associated_const_const_eval/4089d7c8b778d88cec885baf7b69e6df-exe::Foo[0]::NUM[0] } in tcx.mir_map
      1 error: internal compiler error: src/librustc/ty/mod.rs:1901: No def'n found for DefId { krate: CrateNum(0), node: DefIndex(5) => associated_const/4089d7c8b778d88cec885baf7b69e6df-exe::Foo[0]::ID[0] } in tcx.mir_map
      1 error: internal compiler error: src/librustc/ty/mod.rs:1901: No def'n found for DefId { krate: CrateNum(0), node: DefIndex(10) => associated_const_resolution_order/4089d7c8b778d88cec885baf7b69e6df-exe::MyTrait[0]::IMPL_IS_INHERENT[0] } in tcx.mir_map
      1 error: internal compiler error: src/librustc_trans/mir/constant.rs:375: assignment to (_0.0: u32) in constant
      1 error: internal compiler error: src/librustc_borrowck/borrowck/mir/gather_moves.rs:511: Broken MIR: moving out of lvalue (*_9): Box<isize> at bb4[10]
      1 error: internal compiler error: src/librustc_borrowck/borrowck/mir/gather_moves.rs:511: Broken MIR: moving out of lvalue (*_3): T at bb3[0]
      1 error: internal compiler error: src/librustc_borrowck/borrowck/mir/gather_moves.rs:511: Broken MIR: moving out of lvalue ((*_3).1: std::option::Option<Box<std::cell::RefCell<list<T>>>>): std::option::Option<Box<std::cell::RefCell<list<T>>>> at bb4[2]
      1 error: internal compiler error: src/librustc_borrowck/borrowck/mir/gather_moves.rs:511: Broken MIR: moving out of lvalue ((*_3).0: S): S at bb0[6]
      1 error: internal compiler error: src/librustc_borrowck/borrowck/mir/gather_moves.rs:511: Broken MIR: moving out of lvalue ((*_3).0: Box<Subscriber<Input=u64>>): Box<Subscriber<Input=u64>> at bb0[8]
      1 error: internal compiler error: src/librustc_borrowck/borrowck/mir/gather_moves.rs:511: Broken MIR: moving out of lvalue (*_2): std::option::Option<Box<Node<std::marker::Send>>> at bb5[7]
      1 error: internal compiler error: src/librustc_borrowck/borrowck/mir/gather_moves.rs:511: Broken MIR: moving out of lvalue (*_2): Box<u8> at bb0[6]
      1 error: internal compiler error: src/librustc_borrowck/borrowck/mir/gather_moves.rs:511: Broken MIR: moving out of lvalue (*_2): Box<isize> at bb0[6]
      1 error: internal compiler error: src/librustc_borrowck/borrowck/mir/gather_moves.rs:511: Broken MIR: moving out of lvalue (*_202): std::vec::Vec<i32> at bb48[1]
      1 error: could not find native static library `rust_test_helpers`, perhaps an -L flag is missing?
      1 error: can't handle type: [closure@../rust/src/test/run-pass/nullable-pointer-opt-closures.rs:32:18: 32:43 a:std::string::String], TyClosure(DefId { krate: CrateNum(0), node: DefIndex(14) => nullable_pointer_opt_closures/4089d7c8b778d88cec885baf7b69e6df-exe::main[0]::{{closure}}[2] }, ClosureSubsts { substs: Slice([std::string::String]) })
      1 error: can't handle function with Win64 ABI
      1 error: can't handle function with Vectorcall ABI
      1 error: can't handle function with SysV64 ABI
      1 error: can't handle function with Fastcall ABI
      1 error: can't call C ABI function: tuple2
      1 error: can't call C ABI function: transmute
      1 error: can't call C ABI function: the_foo
      1 error: can't call C ABI function: test
      1 error: can't call C ABI function: strlen
      1 error: can't call C ABI function: stat64
      1 error: can't call C ABI function: simple_extern
      1 error: can't call C ABI function: sigaction
      1 error: can't call C ABI function: sched_yield
      1 error: can't call C ABI function: rust_int8_to_int32
      1 error: can't call C ABI function: rust_dbg_extern_return_TwoU8s
      1 error: can't call C ABI function: rust_dbg_extern_return_TwoU64s
      1 error: can't call C ABI function: rust_dbg_extern_return_TwoU32s
      1 error: can't call C ABI function: rust_dbg_extern_return_TwoU16s
      1 error: can't call C ABI function: rust_dbg_extern_identity_u8
      1 error: can't call C ABI function: rust_dbg_extern_identity_u64
      1 error: can't call C ABI function: rust_dbg_extern_identity_u32
      1 error: can't call C ABI function: rust_dbg_extern_identity_TwoU8s
      1 error: can't call C ABI function: rust_dbg_extern_identity_TwoU64s
      1 error: can't call C ABI function: rust_dbg_extern_identity_TwoU32s
      1 error: can't call C ABI function: rust_dbg_extern_identity_TwoU16s
      1 error: can't call C ABI function: rust_dbg_extern_identity_double
      1 error: can't call C ABI function: rust_dbg_extern_empty_struct
      1 error: can't call C ABI function: rust_dbg_abi_1
      1 error: can't call C ABI function: puts
      1 error: can't call C ABI function: nanosleep
      1 error: can't call C ABI function: malloc
      1 error: can't call C ABI function: lgamma_r
      1 error: can't call C ABI function: issue_28983
      1 error: can't call C ABI function: increment_all_parts
      1 error: can't call C ABI function: good
      1 error: can't call C ABI function: get_x
      1 error: can't call C ABI function: getcwd
      1 error: can't call C ABI function: get_c_many_params
      1 error: can't call C ABI function: getaddrinfo
      1 error: can't call C ABI function: free
      1 error: can't call C ABI function: f
      1 error: can't call C ABI function: dup
      1 error: can't call C ABI function: dlsym
      1 error: can't call C ABI function: close
      1 error: can't call C ABI function: atol
      1 error: auxiliary build of "../rust/src/test/run-pass/auxiliary/issue-25185-1.rs" failed to compile:
      1 error: auxiliary build of "../rust/src/test/run-pass/auxiliary/extern-crosscrate-source.rs" failed to compile:
      1 error: `assume` argument was false

@oli-obk

oli-obk commented Dec 17, 2016

Copy link
Copy Markdown
Contributor Author

Nightly has the necessary changes now.

@solson
solson changed the base branch from always_encode_mir to master December 17, 2016 01:45
@solson

solson commented Dec 17, 2016

Copy link
Copy Markdown
Contributor

I changed the PR base to solson:master since it contains all the code from the solson:always_encode_mir branch now due to #97.

@oli-obk

oli-obk commented Dec 19, 2016

Copy link
Copy Markdown
Contributor Author

I rebased over your changes (which enabled me to simply remove an entire hacky commit 🎉 )

I also re-enabled auxiliary tests for the host only (we need to make sure we drop a ignore-cross-compile comment into every test utilizing auxiliary compilation units)

$someday, in the glorious future of lld or something else, we won't need such hacks

@oli-obk

oli-obk commented Dec 20, 2016

Copy link
Copy Markdown
Contributor Author

this is ready for review (and passing travis ^^)

@oli-obk

oli-obk commented Jan 9, 2017

Copy link
Copy Markdown
Contributor Author

so... I did the minimal work for the i128 rustup. But one question is open: should we immediately change code to support 128 bit pointers, or is it ok to leave those at 64 bit?

@eddyb

eddyb commented Jan 9, 2017

Copy link
Copy Markdown
Contributor

128 bit pointers are expected to never happen at this point.

@oli-obk

oli-obk commented Jan 9, 2017 •

Copy link
Copy Markdown
Contributor Author

Great. So Primvals are 128 bit, Value::ByValPair is 256bit + discriminant and Pointer stays at 128bit (offset + alloc_id). We should probably fix the ergonomics with as_u128 and friends (since we often want usize of the target, which we know will be 64 bits max).

@eddyb

eddyb commented Jan 9, 2017

Copy link
Copy Markdown
Contributor

I'd keep only 64-bit immediate and load/store i128 from memory as needed.

@oli-obk

oli-obk commented Jan 9, 2017

Copy link
Copy Markdown
Contributor Author

that's gonna make basic math really weird

@oli-obk

oli-obk commented Jan 9, 2017

Copy link
Copy Markdown
Contributor Author

Also, there's no gain. PrimVal's Pointer variant is already 128 bit, so there's no reason to make the Bytes variant smaller.

@eddyb

eddyb commented Jan 9, 2017

Copy link
Copy Markdown
Contributor

Oh, that makes more sense, nevermind me.
It only works because pointers are smaller.

@oli-obk
oli-obk force-pushed the always_encode_mir branch 8 times, most recently from dd18c7c to bf51059 Compare January 10, 2017 12:26
@oli-obk

oli-obk commented Jan 10, 2017

Copy link
Copy Markdown
Contributor Author

tests now run on x86_64_unknown_linux_gnu, i686_unknown_linux_gnu, x86_64_pc_windows_gnu, x86_64_pc_windows_msvc

@oli-obk oli-obk mentioned this pull request Jan 12, 2017
@oli-obk oli-obk closed this Jan 12, 2017
erickt pushed a commit to erickt/miri that referenced this pull request Feb 4, 2022
Also update the travis script and the README to indicate that MSRV is
1.18 for builds, and 1.30 for development builds.

Fixes rust-lang#96.
github-actions Bot pushed a commit that referenced this pull request Apr 18, 2025
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`.
  - These support files cannot use the canonical `auxiliary/` dir because they participate in module resolution or are included, or their relative paths can be important for test intention otherwise.

Follow-up to:
- #139705
- #139783
- #139740

See also discussions in:

- [#t-compiler > Directive name for non-test aux files?](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Directive.20name.20for.20non-test.20aux.20files.3F/with/512773817)
- [#t-compiler > Handling disabled &#96;//@ ignore-test&#96; tests](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Handling.20disabled.20.60.2F.2F.40.20ignore-test.60.20tests/with/512005974)
- [#t-compiler/meetings > &#91;steering&#93; 2025-04-11 Dealing with disabled tests](https://rust-lang.zulipchat.com/#narrow/channel/238009-t-compiler.2Fmeetings/topic/.5Bsteering.5D.202025-04-11.20Dealing.20with.20disabled.20tests/with/511717981)

### Remarks on remaining unconditionally disabled tests under `tests/`

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

<details>
<summary>Remaining `//@ ignore-test` files under `tests/`</summary>

```
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)
```
</details>

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

- Best reviewed commit-by-commit.
- The directive name diverged from the most voted `//@ auxiliary` because I think that's easy to confuse with `//@ aux-{crate,dir}`.

r? compiler
github-actions Bot pushed a commit that referenced this pull request Aug 9, 2025
…n, r=petrochenkov

Prevent name collisions with internal implementation details

The implementation of the linkage attribute inside extern blocks defines symbols starting with _rust_extern_with_linkage_. If someone tries to also define this symbol you will get a symbol conflict or even an ICE. By adding an unpredictable component to the symbol name, this becomes less of an issue.

Spawned from the discussion at [#t-compiler > About static variables &#96;_rust_extern_with_linkage_&#42;&#96;](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/About.20static.20variables.20.60_rust_extern_with_linkage_*.60) cc `@ywxt`

Fixes rust-lang/rust#144940
github-actions Bot pushed a commit that referenced this pull request Oct 3, 2025
Split Bound index into Canonical and Bound

See [#t-types/trait-system-refactor > perf &#96;async-closures/post-mono-higher-ranked-hang.rs&#96;](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context

Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run.

r? lcnr
github-actions Bot pushed a commit that referenced this pull request Dec 18, 2025
Update `wrapping_sh[lr]` docs and examples

Inspired by [#general > &#96;Source&#96; link for &#96;core&#96; items is often inscrutable @ 💬][zulip-thread] I wanted to add some more examples of the actual wrapping as well as update the documentation to emphasize that the behaviour is unusual.

In particular, now that `unbounded_sh[lr]` is stable, point people trying to avoid panics to that instead, since it behaves less weirdly.

[zulip-thread]: https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/.60Source.60.20link.20for.20.60core.60.20items.20is.20often.20inscrutable/near/562774474
github-actions Bot pushed a commit that referenced this pull request Mar 16, 2026
compiletest: show rustdoc logs when `--no-capture`

This should make rustdoc debug log output actually visible in `./x test tests/rustdoc-json/ --no-capture` invocations.

Reported in [#t-infra/bootstrap > Help with &#96;./x test --no-capture&#96; to get logs.](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Help.20with.20.60.2E.2Fx.20test.20--no-capture.60.20to.20get.20logs.2E/with/579547276).

### Example

<details>
<summary>Output</summary>

```bash
$ RUSTDOC_LOG=rustdoc::formats::cache=trace ./x test ./tests/rustdoc-json/span.rs --force-rerun --no-capture
[...]

running 1 tests
status: exit status: 0
command: cd "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span" && env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc" "-L" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span/auxiliary" "-o" "/home/joe/repos/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-json/span" "--deny" "warnings" "/home/joe/repos/rust/tests/rustdoc-json/span.rs" "-A" "internal_features" "--output-format" "json" "-Zunstable-options"
stdout: none
--- stderr -------------------------------
2:rustc DEBUG rustdoc::formats::cache cx.cache.crate_version=None
2:rustc DEBUG rustdoc::formats::cache folding mod (stripped: false) "Some("span")", id DefId(DefId(0:0 ~ span[c5a1]))
2:rustc DEBUG rustdoc::formats::cache folding mod (stripped: false) "Some("bar")", id DefId(DefId(0:3 ~ span[c5a1]::bar))
------------------------------------------

.

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 177 filtered out; finished in 345.34ms

Build completed successfully in 0:00:02
```
</details>
LorrensP-2158466 pushed a commit to LorrensP-2158466/miri that referenced this pull request Jun 23, 2026
…jorn3,kobzol

Enable Cargo's new build-dir layout

This PR enables the new Cargo `build-dir` layout in boostrap builds with `-Zbuild-dir-new-layout`.

See: [#t-infra/bootstrap > Has anyone tested &rust-lang#96;./x&rust-lang#96; with the new build-dir layout?](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Has.20anyone.20tested.20.60.2E.2Fx.60.20with.20the.20new.20build-dir.20layout.3F/with/581660716)

Tracked in: rust-lang/cargo#15010

r? @bjorn3

cc: @epage
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Aug 24, 2026
add a cache to the `WfPredicates` visitor





Part of speeding up compiling `ReShell` with `-Znext-solver`, see rust-lang/trait-system-refactor-initiative#272 and [#t-types/trait-system-refactor > more &rust-lang#96;reshell&rust-lang#96; slowness](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/more.20.60reshell.60.20slowness/with/616484452).

The PR changes the `WfPredicates` visitor to only collect new bounds for unique types. That is, if we have a type like:

```
type T0 = Map<Then<Whitespace, Whitespace>>
type T1 = Map<Then<T0, T0>>
type T2 = Map<Then<T1, T1>>
...
type T_N = Map<Then<T_N-1, T_N-1>>
```

etc., the visitor used to end up collecting one WF obligation for each path from `T_N` to its `Whitespace` leaves, even though WF of a type (I believe) doesn't depend on the path the visitor took to get there, which allows us to deduplicate by Ty. Not deduplicating caused us to go O(2^N) here.

next-solver is still about ~5x slower than the old solver on the third reproducer due to some other hidden quadratics, and fixing that seems to be more involved, but I think this PR will still be ✨ An Improvement.

r? lcnr
mojeanmac pushed a commit to cmu-cornell-for-rust/miri that referenced this pull request Aug 25, 2026
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Nov 4, 2026
…rochenkov

Add `let_underscore_drop_guard` lint.

This lint is similar to the existing [`let_underscore_lock`](https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#let-underscore-lock) lint, but applies to `DropGuard` instead of `MutexGuard` and similar types. It is deny-by-default, like `let_underscore_lock`. (Note that the related `let_underscore_drop` lint is allow-by-default.)

Relevant discussion: [#t-libs > Linting &rust-lang#96;let _ = DropGuard::new(....);&rust-lang#96;](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Linting.20.60let.20_.20.3D.20DropGuard.3A.3Anew.28.2E.2E.2E.2E.29.3B.60/with/631977543)

Note that `DropGuard` is a newly stabilized type, currently in 1.100 beta, and will be on the 1.100 stable release on November 12.

Tracking issue for `DropGuard`: rust-lang/rust#144426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants