about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2025-02-01Rollup merge of #130514 - compiler-errors:unsafe-binders, r=oli-obkMatthias Krüger-56/+154
Implement MIR lowering for unsafe binders This is the final bit of the unsafe binders puzzle. It implements MIR, CTFE, and codegen for unsafe binders, and enforces that (for now) they are `Copy`. Later on, I'll introduce a new trait that relaxes this requirement to being "is `Copy` or `ManuallyDrop<T>`" which more closely models how we treat union fields. Namely, wrapping unsafe binders is now `Rvalue::WrapUnsafeBinder`, which acts much like an `Rvalue::Aggregate`. Unwrapping unsafe binders are implemented as a MIR projection `ProjectionElem::UnwrapUnsafeBinder`, which acts much like `ProjectionElem::Field`. Tracking: - https://github.com/rust-lang/rust/issues/130516
2025-02-01Auto merge of #136371 - matthiaskrgr:rollup-0b880v3, r=matthiaskrgrbors-60/+113
Rollup of 7 pull requests Successful merges: - #135840 (omit unused args warnings for intrinsics without body) - #135900 (Manually walk into WF obligations in `BestObligation` proof tree visitor) - #136163 (Fix off-by-one error causing slice::sort to abort the program) - #136266 (fix broken release notes id) - #136314 (Use proper type when applying deref adjustment in const) - #136348 (miri: make float min/max non-deterministic) - #136351 (Add documentation for derive(CoercePointee)) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-01Auto merge of #135768 - jieyouxu:migrate-symbol-mangling-hashed, r=Noratriebbors-68/+128
tests: Port `symbol-mangling-hashed` to rmake.rs Part of #121876. This PR supersedes #128567 and is co-authored with `@lolbinarycat.` ### Summary This PR ports `tests/run-make/symbol-mangling-hashed` to rmake.rs. Notable differences when compared to the Makefile version includes: - It's no longer limited to linux + x86_64 only. In particular, this now is exercised on darwin and windows (esp. msvc) too. - The test uses `object` crate to be more precise in the filtering, and avoids relying on parsing the human-readable `nm` output for *some* `nm` in the given environment (which isn't really a thing on msvc anyway, and `llvm-nm` doesn't handle msvc dylibs AFAICT). - Dump the symbols satisfying various criteria on test failure to make it hopefully less of a pain to debug if it ever fails in CI. ### Review advice - Best reviewed commit-by-commit. - I'm not *super* sure about the msvc logic, would benefit from a MSVC (PE/COFF) expert taking a look. --- try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: i686-mingw try-job: x86_64-mingw-1 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: test-various
2025-02-01Rollup merge of #136314 - compiler-errors:const-deref-adj, r=fee1-deadMatthias Krüger-8/+28
Use proper type when applying deref adjustment in const When applying a deref adjustment to some type `Wrap<T>` which derefs to `T`, we were checking that `T: ~const Deref`, not `Wrap<T>: ~const Deref` like we should have been. r? project-const-traits Fixes #136273 Fixes #135210 -- I just deleted the test since the regression test is uninteresting
2025-02-01Rollup merge of #136163 - uellenberg:driftsort-off-by-one, r=Mark-SimulacrumMatthias Krüger-0/+10
Fix off-by-one error causing slice::sort to abort the program Fixes #136103. Based on the analysis by ``@jonathan-gruber-jg`` and ``@orlp.``
2025-02-01Rollup merge of #135900 - compiler-errors:derive-wf, r=lcnrMatthias Krüger-38/+55
Manually walk into WF obligations in `BestObligation` proof tree visitor When we encounter a `WellFormed` obligation in the `BestObligation` proof tree visitor, ignore the proof tree and call `wf::unnormalized_obligations` to derive well-formed obligations with the correct cause codes. This is to avoid having to replicate the somewhat delicate logic that `wf.rs` does to set up its obligation causes... Don't see a better way to do this. vibes?? r? lcnr
2025-02-01Rollup merge of #135840 - vayunbiyani:omit_intrinsic_unused_param_warning, ↵Matthias Krüger-14/+20
r=oli-obk omit unused args warnings for intrinsics without body potential fix for https://github.com/rust-lang/rust/issues/135598
2025-01-31Auto merge of #136350 - matthiaskrgr:rollup-6eqfyvh, r=matthiaskrgrbors-186/+278
Rollup of 9 pull requests Successful merges: - #134531 ([rustdoc] Add `--extract-doctests` command-line flag) - #135860 (Compiler: Finalize dyn compatibility renaming) - #135992 (Improve documentation when adding a new target) - #136194 (Support clobber_abi in BPF inline assembly) - #136325 (Delay a bug when indexing unsized slices) - #136326 (Replace our `LLVMRustDIBuilderRef` with LLVM-C's `LLVMDIBuilderRef`) - #136330 (Remove unnecessary hooks) - #136336 (Overhaul `rustc_middle::util`) - #136341 (Remove myself from vacation) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Manually walk into WF obligations in BestObligation proof tree visitorMichael Goulet-38/+55
2025-01-31Enforce unsafe binders must be Copy (for now)Michael Goulet-39/+74
2025-01-31Implement MIR, CTFE, and codegen for unsafe bindersMichael Goulet-56/+119
2025-01-31Auto merge of #134424 - 1c3t3a:null-checks, r=saethlinbors-0/+104
Insert null checks for pointer dereferences when debug assertions are enabled Similar to how the alignment is already checked, this adds a check for null pointer dereferences in debug mode. It is implemented similarly to the alignment check as a `MirPass`. This inserts checks in the same places as the `CheckAlignment` pass and additionally also inserts checks for `Borrows`, so code like ```rust let ptr: *const u32 = std::ptr::null(); let val: &u32 = unsafe { &*ptr }; ``` will have a check inserted on dereference. This is done because null references are UB. The alignment check doesn't cover these places, because in `&(*ptr).field`, the exact requirement is that the final reference must be aligned. This is something to consider further enhancements of the alignment check. For now this is implemented as a separate `MirPass`, to make it easy to disable this check if necessary. This is related to a 2025H1 project goal for better UB checks in debug mode: https://github.com/rust-lang/rust-project-goals/pull/177. r? `@saethlin`
2025-01-31Rollup merge of #136325 - compiler-errors:indirectly, r=RalfJungMatthias Krüger-0/+42
Delay a bug when indexing unsized slices Fixes #136298 r? RalfJung or reassign
2025-01-31Rollup merge of #136194 - taiki-e:bpf-clobber-abi, r=amanieuMatthias Krüger-0/+31
Support clobber_abi in BPF inline assembly This supports [`clobber_abi`](https://doc.rust-lang.org/nightly/reference/inline-assembly.html#abi-clobbers) which is one of the requirements of stabilization mentioned in the tracking Issue for `asm_experimental_arch` (#93335). Refs: [Section 1.1 "Registers and calling convention" in BPF ABI Recommended Conventions and Guidelines v1.0](https://github.com/torvalds/linux/blob/v6.13/Documentation/bpf/standardization/abi.rst#11registers-and-calling-convention) > R0 - R5 are scratch registers and BPF programs needs to spill/fill them if necessary across calls. cc `@alessandrod` `@dave-tucker` `@tamird` `@vadorovsky` (target maintainers mentioned in platform support document which will be added by https://github.com/rust-lang/rust/pull/135107) r? `@Amanieu` `@rustbot` label +O-eBPF +A-inline-assembly
2025-01-31Rollup merge of #135860 - fmease:compiler-mv-obj-save-dyn-compat-ii, r=jieyouxuMatthias Krüger-185/+185
Compiler: Finalize dyn compatibility renaming Update the Reference link to use the new URL fragment from https://github.com/rust-lang/reference/pull/1666 (this change has finally hit stable). Fixes a FIXME. Follow-up to #130826. Part of #130852. ~~Blocking it on #133372.~~ (merged) r? ghost
2025-01-31Rollup merge of #134531 - GuillaumeGomez:extract-doctests, ↵Matthias Krüger-1/+20
r=notriddle,aDotInTheVoid [rustdoc] Add `--extract-doctests` command-line flag Part of https://github.com/rust-lang/rust/issues/134529. It was discussed with the Rust-for-Linux project recently that they needed a way to extract doctests so they can modify them and then run them more easily (look for "a way to extract doctests" [here](https://github.com/Rust-for-Linux/linux/issues/2)). For now, I output most of `ScrapedDoctest` fields in JSON format with `serde_json`. So it outputs the following information: * filename * line * langstr * text cc `@ojeda` r? `@notriddle`
2025-01-31Insert null checks for pointer dereferences when debug assertions are enabledBastian Kersting-0/+104
Similar to how the alignment is already checked, this adds a check for null pointer dereferences in debug mode. It is implemented similarly to the alignment check as a MirPass. This is related to a 2025H1 project goal for better UB checks in debug mode: https://github.com/rust-lang/rust-project-goals/pull/177.
2025-01-31Auto merge of #136332 - jhpratt:rollup-aa69d0e, r=jhprattbors-98/+199
Rollup of 9 pull requests Successful merges: - #132156 (When encountering unexpected closure return type, point at return type/expression) - #133429 (Autodiff Upstreaming - rustc_codegen_ssa, rustc_middle) - #136281 (`rustc_hir_analysis` cleanups) - #136297 (Fix a typo in profile-guided-optimization.md) - #136300 (atomic: extend compare_and_swap migration docs) - #136310 (normalize `*.long-type.txt` paths for compare-mode tests) - #136312 (Disable `overflow_delimited_expr` in edition 2024) - #136313 (Filter out RPITITs when suggesting unconstrained assoc type on too many generics) - #136323 (Fix a typo in conventions.md) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Auto merge of #136331 - jhpratt:rollup-curo1f4, r=jhprattbors-94/+114
Rollup of 8 pull requests Successful merges: - #135414 (Stabilize `const_black_box`) - #136150 (ci: use windows 2025 for i686-mingw) - #136258 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 11)) - #136270 (Remove `NamedVarMap`.) - #136278 (add constraint graph to polonius MIR dump) - #136287 (LLVM changed the nocapture attribute to captures(none)) - #136291 (some test suite cleanups) - #136296 (float::min/max: mention the non-determinism around signed 0) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Rollup merge of #136313 - compiler-errors:too-many-args, r=lqdJacob Pratt-0/+31
Filter out RPITITs when suggesting unconstrained assoc type on too many generics Fixes #136233
2025-01-31Rollup merge of #136310 - lqd:long-types, r=compiler-errorsJacob Pratt-55/+73
normalize `*.long-type.txt` paths for compare-mode tests When using a compare mode, the name of the test + compare-mode is embedded in some of rustc's output, like the location where a long type `bla.long-type(-some-hash)?.txt` is written to. That generally makes these tests fail under all compare-modes. This PR fixes this by normalizing the compare-mode suffix away in the stderr output. We can also see some remnants of the long-removed `nll` compare mode being normalized away ^^. I did this to fix some failures with `--compare-mode next-solver` (but it also fixes them with e.g. `--compare-mode polonius` of course): - it makes 9 new tests pass with the new solver - however, 3 tests I changed here still don't pass with the new solver (IIRC there were 2 ICEs, and some duplicate errors for the 3rd one) (There was also one that triggered slowness in the new solver while triggering the long type failure, I'll mention this on zulip. )
2025-01-31Rollup merge of #132156 - estebank:closure-return, r=Nadrieril,compiler-errorsJacob Pratt-43/+95
When encountering unexpected closure return type, point at return type/expression ``` error[E0271]: expected `{closure@fallback-closure-wrap.rs:18:40}` to be a closure that returns `()`, but it returns `!` --> $DIR/fallback-closure-wrap.rs:19:9 | LL | let error = Closure::wrap(Box::new(move || { | ------- LL | panic!("Can't connect to server."); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `!` | = note: expected unit type `()` found type `!` = note: required for the cast from `Box<{closure@$DIR/fallback-closure-wrap.rs:18:40: 18:47}>` to `Box<dyn FnMut()>` ``` ``` error[E0271]: expected `{closure@dont-ice-for-type-mismatch-in-closure-in-async.rs:6:10}` to be a closure that returns `bool`, but it returns `Option<()>` --> $DIR/dont-ice-for-type-mismatch-in-closure-in-async.rs:6:16 | LL | call(|| -> Option<()> { | ---- ------^^^^^^^^^^ | | | | | expected `bool`, found `Option<()>` | required by a bound introduced by this call | = note: expected type `bool` found enum `Option<()>` note: required by a bound in `call` --> $DIR/dont-ice-for-type-mismatch-in-closure-in-async.rs:3:25 | LL | fn call(_: impl Fn() -> bool) {} | ^^^^ required by this bound in `call` ``` ``` error[E0271]: expected `{closure@f670.rs:28:13}` to be a closure that returns `Result<(), _>`, but it returns `!` --> f670.rs:28:20 | 28 | let c = |e| -> ! { | -------^ | | | expected `Result<(), _>`, found `!` ... 32 | f().or_else(c); | ------- required by a bound introduced by this call -Ztrack-diagnostics: created at compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs:1433:28 | = note: expected enum `Result<(), _>` found type `!` note: required by a bound in `Result::<T, E>::or_else` --> /home/gh-estebank/rust/library/core/src/result.rs:1406:39 | 1406 | pub fn or_else<F, O: FnOnce(E) -> Result<T, F>>(self, op: O) -> Result<T, F> { | ^^^^^^^^^^^^ required by this bound in `Result::<T, E>::or_else` ``` CC #111539.
2025-01-31Rollup merge of #136291 - lcnr:compare-mode, r=oli-obkJacob Pratt-44/+10
some test suite cleanups found while checking `compare-mode next-solver` r? `@oli-obk` <sub> [lcnr](https://github.com/rust-lang/rust/commits?author=lcnr) authored and JJ_EMPTY_STRING committed </sub>
2025-01-31Rollup merge of #136287 - zmodem:nocapture, r=nikicJacob Pratt-18/+25
LLVM changed the nocapture attribute to captures(none) This updates RustWrapper.cpp and tests after https://github.com/llvm/llvm-project/pull/123181
2025-01-31Rollup merge of #136258 - notriddle:notriddle/issue-d, r=fmeaseJacob Pratt-32/+79
rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 11) Follow up * https://github.com/rust-lang/rust/pull/134053 * https://github.com/rust-lang/rust/pull/130287 et al As always, it's easier to review the commits one at a time. Don't use the Files Changed tab. It's confusing.
2025-01-31tests: port `symbol-mangling-hashed` to rmake.rs许杰友 Jieyou Xu (Joe)-68/+128
- Use `object` based test logic instead of processing `nm` human-readable textual output. - Try to expand test coverage to not be limited to only linux + x86_64. Co-authored-by: binarycat <binarycat@envs.net>
2025-01-31Auto merge of #135318 - compiler-errors:vtable-fixes, r=lcnrbors-325/+508
Fix deduplication mismatches in vtables leading to upcasting unsoundness We currently have two cases where subtleties in supertraits can trigger disagreements in the vtable layout, e.g. leading to a different vtable layout being accessed at a callsite compared to what was prepared during unsizing. Namely: ### #135315 In this example, we were not normalizing supertraits when preparing vtables. In the example, ``` trait Supertrait<T> { fn _print_numbers(&self, mem: &[usize; 100]) { println!("{mem:?}"); } } impl<T> Supertrait<T> for () {} trait Identity { type Selff; } impl<Selff> Identity for Selff { type Selff = Selff; } trait Middle<T>: Supertrait<()> + Supertrait<T> { fn say_hello(&self, _: &usize) { println!("Hello!"); } } impl<T> Middle<T> for () {} trait Trait: Middle<<() as Identity>::Selff> {} impl Trait for () {} fn main() { (&() as &dyn Trait as &dyn Middle<()>).say_hello(&0); } ``` When we prepare `dyn Trait`, we see a supertrait of `Middle<<() as Identity>::Selff>`, which itself has two supertraits `Supertrait<()>` and `Supertrait<<() as Identity>::Selff>`. These two supertraits are identical, but they are not duplicated because we were using structural equality and *not* considering normalization. This leads to a vtable layout with two trait pointers. When we upcast to `dyn Middle<()>`, those two supertraits are now the same, leading to a vtable layout with only one trait pointer. This leads to an offset error, and we call the wrong method. ### #135316 This one is a bit more interesting, and is the bulk of the changes in this PR. It's a bit similar, except it uses binder equality instead of normalization to make the compiler get confused about two vtable layouts. In the example, ``` trait Supertrait<T> { fn _print_numbers(&self, mem: &[usize; 100]) { println!("{mem:?}"); } } impl<T> Supertrait<T> for () {} trait Trait<T, U>: Supertrait<T> + Supertrait<U> { fn say_hello(&self, _: &usize) { println!("Hello!"); } } impl<T, U> Trait<T, U> for () {} fn main() { (&() as &'static dyn for<'a> Trait<&'static (), &'a ()> as &'static dyn Trait<&'static (), &'static ()>) .say_hello(&0); } ``` When we prepare the vtable for `dyn for<'a> Trait<&'static (), &'a ()>`, we currently consider the PolyTraitRef of the vtable as the key for a supertrait. This leads two two supertraits -- `Supertrait<&'static ()>` and `for<'a> Supertrait<&'a ()>`. However, we can upcast[^up] without offsetting the vtable from `dyn for<'a> Trait<&'static (), &'a ()>` to `dyn Trait<&'static (), &'static ()>`. This is just instantiating the principal trait ref for a specific `'a = 'static`. However, when considering those supertraits, we now have only one distinct supertrait -- `Supertrait<&'static ()>` (which is deduplicated since there are two supertraits with the same substitutions). This leads to similar offsetting issues, leading to the wrong method being called. [^up]: I say upcast but this is a cast that is allowed on stable, since it's not changing the vtable at all, just instantiating the binder of the principal trait ref for some lifetime. The solution here is to recognize that a vtable isn't really meaningfully higher ranked, and to just treat a vtable as corresponding to a `TraitRef` so we can do this deduplication more faithfully. That is to say, the vtable for `dyn for<'a> Tr<'a>` and `dyn Tr<'x>` are always identical, since they both would correspond to a set of free regions on an impl... Do note that `Tr<for<'a> fn(&'a ())>` and `Tr<fn(&'static ())>` are still distinct. ---- There's a bit more that can be cleaned up. In codegen, we can stop using `PolyExistentialTraitRef` basically everywhere. We can also fix SMIR to stop storing `PolyExistentialTraitRef` in its vtable allocations. As for testing, it's difficult to actually turn this into something that can be tested with `rustc_dump_vtable`, since having multiple supertraits that are identical is a recipe for ambiguity errors. Maybe someone else is more creative with getting that attr to work, since the tests I added being run-pass tests is a bit unsatisfying. Miri also doesn't help here, since it doesn't really generate vtables that are offset by an index in the same way as codegen. r? `@lcnr` for the vibe check? Or reassign, idk. Maybe let's talk about whether this makes sense. <sup>(I guess an alternative would also be to not do any deduplication of vtable supertraits (or only a really conservative subset) rather than trying to normalize and deduplicate more faithfully here. Not sure if that works and is sufficient tho.)</sup> cc `@steffahn` -- ty for the minimizations cc `@WaffleLapkin` -- since you're overseeing the feature stabilization :3 Fixes #135315 Fixes #135316
2025-01-31Delay a bug when indexing unsized slicesMichael Goulet-0/+42
2025-01-30Auto merge of #136318 - matthiaskrgr:rollup-a159mzo, r=matthiaskrgrbors-9/+59
Rollup of 9 pull requests Successful merges: - #135026 (Cast global variables to default address space) - #135475 (uefi: Implement path) - #135852 (Add `AsyncFn*` to `core` prelude) - #136004 (tests: Skip const OOM tests on aarch64-unknown-linux-gnu) - #136157 (override build profile for bootstrap tests) - #136180 (Introduce a wrapper for "typed valtrees" and properly check the type before extracting the value) - #136256 (Add release notes for 1.84.1) - #136271 (Remove minor future footgun in `impl Debug for MaybeUninit`) - #136288 (Improve documentation for file locking) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-30Auto merge of #135030 - Flakebi:require-cpu, r=workingjubileebors-0/+24
Target option to require explicit cpu Some targets have many different CPUs and no generic CPU that can be used as a default. For these targets, the user needs to explicitly specify a CPU through `-C target-cpu=`. Add an option for targets and an error message if no CPU is set. This affects the proposed amdgpu and avr targets. amdgpu tracking issue: #135024 AVR MCP: https://github.com/rust-lang/compiler-team/issues/800
2025-01-30Rollup merge of #136180 - lukas-code:typed-valtree, r=oli-obkMatthias Krüger-6/+52
Introduce a wrapper for "typed valtrees" and properly check the type before extracting the value This PR adds a new wrapper type `ty::Value` to replace the tuple `(Ty, ty::ValTree)` and become the new canonical representation of type-level constant values. The value extraction methods `try_to_bits`/`try_to_bool`/`try_to_target_usize` are moved to this new type. For `try_to_bits` in particular, this avoids some redundant matches on `ty::ConstKind::Value`. Furthermore, these methods and will now properly check the type before extracting the value, which fixes some ICEs. The name `ty::Value` was chosen to be consistent with `ty::Expr`. Commit 1 should be non-functional and commit 2 adds the type check. --- fixes https://github.com/rust-lang/rust/issues/131102 supercedes https://github.com/rust-lang/rust/pull/136130 r? `@oli-obk` cc `@FedericoBruzzone` `@BoxyUwU`
2025-01-30Rollup merge of #136004 - mrkajetanp:aarch64-skip-large-const-alloc-tests, ↵Matthias Krüger-3/+7
r=Kobzol tests: Skip const OOM tests on aarch64-unknown-linux-gnu Skip const OOM tests on AArch64 Linux through explicit annotations instead of inside opt-dist. Intended to avoid confusion in cases like #135952. Prerequisite for https://github.com/rust-lang/rust/pull/135960. r? `@Kobzol` cc `@workingjubilee` try-job: dist-aarch64-linux
2025-01-30Direct link 108459 to issues -> pull redirectMichael Howell-1/+1
2025-01-30Give 104145, 103463, and 31948 more descriptive namesMichael Howell-0/+0
2025-01-30Filter out RPITITs when suggesting unconstrained assoc type on too many genericsMichael Goulet-0/+31
2025-01-30Use proper type when applying deref adjustment in constMichael Goulet-8/+28
2025-01-30Add closure labelsEsteban Küber-9/+12
2025-01-30On E0271 for a closure behind a binding, point at binding in call tooEsteban Küber-0/+60
``` error[E0271]: expected `{closure@return-type-doesnt-match-bound.rs:18:13}` to be a closure that returns `Result<(), _>`, but it returns `!` --> tests/ui/closures/return-type-doesnt-match-bound.rs:18:20 | 18 | let c = |e| -> ! { //~ ERROR to be a closure that returns | -------^ | | | expected `Result<(), _>`, found `!` ... 22 | f().or_else(c); | ------- - | | | required by a bound introduced by this call | = note: expected enum `Result<(), _>` found type `!` note: required by a bound in `Result::<T, E>::or_else` --> /home/gh-estebank/rust/library/core/src/result.rs:1406:39 | 1406 | pub fn or_else<F, O: FnOnce(E) -> Result<T, F>>(self, op: O) -> Result<T, F> { | ^^^^^^^^^^^^ required by this bound in `Result::<T, E>::or_else` ```
2025-01-30When encountering unexpected closure return type, point at return ↵Esteban Küber-43/+32
type/expression ``` error[E0271]: expected `{closure@fallback-closure-wrap.rs:18:40}` to be a closure that returns `()`, but it returns `!` --> $DIR/fallback-closure-wrap.rs:19:9 | LL | let error = Closure::wrap(Box::new(move || { | ------- LL | panic!("Can't connect to server."); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `!` | = note: expected unit type `()` found type `!` = note: required for the cast from `Box<{closure@$DIR/fallback-closure-wrap.rs:18:40: 18:47}>` to `Box<dyn FnMut()>` ``` ``` error[E0271]: expected `{closure@dont-ice-for-type-mismatch-in-closure-in-async.rs:6:10}` to be a closure that returns `bool`, but it returns `Option<()>` --> $DIR/dont-ice-for-type-mismatch-in-closure-in-async.rs:6:16 | LL | call(|| -> Option<()> { | ---- ------^^^^^^^^^^ | | | | | expected `bool`, found `Option<()>` | required by a bound introduced by this call | = note: expected type `bool` found enum `Option<()>` note: required by a bound in `call` --> $DIR/dont-ice-for-type-mismatch-in-closure-in-async.rs:3:25 | LL | fn call(_: impl Fn() -> bool) {} | ^^^^ required by this bound in `call` ``` ``` error[E0271]: expected `{closure@f670.rs:28:13}` to be a closure that returns `Result<(), _>`, but it returns `!` --> f670.rs:28:20 | 28 | let c = |e| -> ! { | -------^ | | | expected `Result<(), _>`, found `!` ... 32 | f().or_else(c); | ------- required by a bound introduced by this call -Ztrack-diagnostics: created at compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs:1433:28 | = note: expected enum `Result<(), _>` found type `!` note: required by a bound in `Result::<T, E>::or_else` --> /home/gh-estebank/rust/library/core/src/result.rs:1406:39 | 1406 | pub fn or_else<F, O: FnOnce(E) -> Result<T, F>>(self, op: O) -> Result<T, F> { | ^^^^^^^^^^^^ required by this bound in `Result::<T, E>::or_else` ```
2025-01-30More assertions, tests, and miri coverageMichael Goulet-5/+42
2025-01-30Auto merge of #136292 - matthiaskrgr:rollup-fw1tlca, r=matthiaskrgrbors-317/+1960
Rollup of 7 pull requests Successful merges: - #133636 ([rustdoc] Add sans-serif font setting) - #135434 (Match Ergonomics 2024: update edition 2024 behavior of feature gates) - #135739 (Clean up uses of the unstable `dwarf_version` option) - #135882 (simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]`) - #136179 (Allow transmuting generic pattern types to and from their base) - #136199 (Fix a couple Emscripten tests) - #136251 (use impl Into<String> instead of explicit type args with bounds) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-30check the types in `ty::Value` to value conversionLukas Markeffsky-6/+52
and remove `ty::Const::try_to_scalar` because it becomes redundant
2025-01-30normalize long-type.txt in testsRémy Rakic-55/+73
this allows compare-mode to share the same subdirectory and removes differences due to that
2025-01-30Normalize vtable entries before walking and deduplicating themMichael Goulet-2/+33
2025-01-30Do not treat vtable supertraits as distinct when bound with different bound varsMichael Goulet-2/+25
2025-01-30Remove print_vtable_sizesMichael Goulet-73/+0
2025-01-30Rework rustc_dump_vtableMichael Goulet-252/+417
2025-01-30Auto merge of #134824 - niklasf:int_from_ascii, r=ibraheemdevbors-4/+8
Implement `int_from_ascii` (#134821) Provides unstable `T::from_ascii()` and `T::from_ascii_radix()` for integer types `T`, as drafted in tracking issue #134821. To deduplicate documentation without additional macros, implementations of `isize` and `usize` no longer delegate to equivalent integer types. After #132870 they are inlined anyway.
2025-01-30Rollup merge of #136199 - purplesyringa:emscripten-tests, r=jieyouxuMatthias Krüger-10/+40
Fix a couple Emscripten tests This fixes a couple Emscripten tests where the correct fix is more or less obvious. A couple UI tests are still broken with this PR: - `tests/ui/abi/numbers-arithmetic/return-float.rs` (#136197) - `tests/ui/no_std/no-std-unwind-binary.rs` (haven't debugged yet) - `tests/ui/test-attrs/test-passed.rs` (haven't debugged this either) `````@rustbot````` label +T-compiler +O-emscripten
2025-01-30Rollup merge of #136179 - oli-obk:push-vxvyttorquxw, r=BoxyUwUMatthias Krüger-0/+53
Allow transmuting generic pattern types to and from their base Pattern types always have the same size as their base type, so we can just ignore the pattern and look at the base type for figuring out whether transmuting is possible.