- 17 8月, 2023 16 次提交
-
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
- 16 8月, 2023 24 次提交
-
-
由 bors 提交于
Fix argument removal suggestion around macros Fixes #112437. Fixes #113866. Helps with #114255. The issue was that `span.find_ancestor_inside(outer)` could previously return a span with a different expansion context from `outer`. This happens for example for the built-in macro `panic!`, which expands to another macro call of `panic_2021!` or `panic_2015!`. Because the call site of `panic_20xx!` has not associated source code, its span currently points to the call site of `panic!` instead. Something similar also happens items that get desugared in AST->HIR lowering. For example, `for` loops get two spans: One "inner" span that has the `.desugaring_kind()` kind set to `DesugaringKind::ForLoop` and one "outer" span that does not. Similar to the macro situation, both of these spans point to the same source code, but have different expansion contexts. This causes problems, because joining two spans with different expansion contexts will usually[^1] not actually join them together to avoid creating "spaghetti" spans that go from the macro definition to the macro call. For example, in the following snippet `full_span` might not actually contain the `adjusted_start` and `adjusted_end`. This caused the broken suggestion / debug ICE in the linked issues. ```rust let adjusted_start = start.find_ancestor_inside(shared_ancestor); let adjusted_end = end.find_ancestor_inside(shared_ancestor); let full_span = adjusted_start.to(adjusted_end) ``` To fix the issue, this PR introduces a new method, `find_ancestor_inside_same_ctxt`, which combines the functionality of `find_ancestor_inside` and `find_ancestor_in_same_ctxt`: It finds an ancestor span that is contained within the parent *and* has the same syntax context, and is therefore safe to extend. This new method should probably be used everywhere, where the returned span is extended, but for now it is just used for the argument removal suggestion. Additionally, this PR fixes a second issue where the function call itself is inside a macro but the arguments come from outside the macro. The test is added in the first commit to include stderr diff, so this is best reviewed commit by commit. [^1]: If one expansion context is the root context and the other is not.
-
由 bors 提交于
add codegen test for `trailing_zeros` comparison This PR add codegen test for https://github.com/rust-lang/rust/issues/107554#issuecomment-1677369236 Fixes #107554.
-
由 bors 提交于
Update LLVM submodule Merge the current release/17.x branch. Fixes #114691. Fixes #114312. The test for the latter is taken from #114726.
-
由 bors 提交于
Rollup of 7 pull requests Successful merges: - #114721 (Optimizing the rest of bool's Ord implementation) - #114746 (Don't add associated type bound for non-types) - #114779 (Add check before suggest removing parens) - #114859 (Add trait related queries to SMIR's rustc_internal) - #114861 (fix typo: affect -> effect) - #114867 ([nit] Fix a comment typo.) - #114871 (Update the link in the docs of `std::intrinsics`) r? `@ghost` `@rustbot` modify labels: rollup
-
由 Matthias Krüger 提交于
Update the link in the docs of `std::intrinsics` The previous link in that place, https://github.com/rust-lang/miri/blob/master/src/shims/intrinsics.rs, no longer points to an existing file.
-
由 Matthias Krüger 提交于
[nit] Fix a comment typo.
-
由 Matthias Krüger 提交于
fix typo: affect -> effect I just realized I made a silly typo when writing that comment...
-
由 Matthias Krüger 提交于
Add trait related queries to SMIR's rustc_internal r? `@oli-obk`
-
由 Matthias Krüger 提交于
Add check before suggest removing parens Fixes #114701
-
由 Matthias Krüger 提交于
Don't add associated type bound for non-types We had this fix for equality constraints (#99890), but for some reason not trait constraints
😅 Fixes #114744 -
由 Matthias Krüger 提交于
Optimizing the rest of bool's Ord implementation After coming across issue #66780, I realized that the other functions provided by Ord (`min`, `max`, and `clamp`) were similarly inefficient for bool. This change provides implementations for them in terms of boolean operators, resulting in much simpler assembly and faster code. Fixes issue #114653 [Comparison on Godbolt](https://rust.godbolt.org/z/5nb5P8e8j) `max` assembly before: ```assembly example::max: mov eax, edi mov ecx, eax neg cl mov edx, esi not dl cmp dl, cl cmove eax, esi ret ``` `max` assembly after: ```assembly example::max: mov eax, edi or eax, esi ret ``` `clamp` assembly before: ```assembly example::clamp: mov eax, esi sub al, dl inc al cmp al, 2 jae .LBB1_1 mov eax, edi sub al, sil movzx ecx, dil sub dil, dl cmp dil, 1 movzx edx, dl cmovne edx, ecx cmp al, -1 movzx eax, sil cmovne eax, edx ret .LBB1_1: ; identical assert! code ``` `clamp` assembly after: ```assembly example::clamp: test edx, edx jne .LBB1_2 test sil, sil jne .LBB1_3 .LBB1_2: or dil, sil and dil, dl mov eax, edi ret .LBB1_3: ; identical assert! code ```
-
由 khei4 提交于
specify llvm-version and bit width for int arg add missing percent simbol
-
由 bors 提交于
Do not mark shallow_lint_levels_on as eval_always. It does not need it. Removing it allows to skip recomputation.
-
由 bors 提交于
Stabilize thread local cell methods. Closes #92122.
-
由 bors 提交于
Cleaner assert_eq! & assert_ne! panic messages This PR finishes refactoring of the assert messages per #94005. The panic message format change #112849 used to be part of this PR, but has been factored out and just merged. It might be better to keep both changes in the same release once FCP vote completes. Modify panic message for `assert_eq!`, `assert_ne!`, the currently unstable `assert_matches!`, as well as the corresponding `debug_assert_*` macros. ```rust assert_eq!(1 + 1, 3); assert_eq!(1 + 1, 3, "my custom message value={}!", 42); ``` #### Old messages ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion failed: `(left == right)` left: `2`, right: `3` ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion failed: `(left == right)` left: `2`, right: `3`: my custom message value=42! ``` #### New messages ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion `left == right` failed left: 2 right: 3 ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion `left == right` failed: my custom message value=42! left: 2 right: 3 ``` History of fixing #94005 * #94016 was a lengthy PR that was abandoned * #111030 was similar, but it stringified left and right arguments, and thus caused compile time performance issues, thus closed * #112849 factored out the two-line formatting of all panic messages Fixes #94005 r? `@m-ou-se`
-
由 Tim Kurdov 提交于
The previous link in that place, https://github.com/rust-lang/miri/blob/master/src/shims/intrinsics.rs, no longer points to an existing file.
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #114588 (Improve docs for impl Default for ExitStatus) - #114619 (Fix pthread_attr_union layout on Wasi) - #114644 (Point out expectation even if we have `TypeError::RegionsInsufficientlyPolymorphic`) - #114668 (Deny `FnDef` in patterns) - #114819 (Point at return type when it influences non-first `match` arm) - #114826 (Fix typos) - #114837 (add missing feature(error_in_core)) - #114853 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup
-
由 Yuri Astrakhan 提交于
Modify panic message for `assert_eq!`, `assert_ne!`, the currently unstable `assert_matches!`, as well as the corresponding `debug_assert_*` macros. ```rust assert_eq!(1 + 1, 3); assert_eq!(1 + 1, 3, "my custom message value={}!", 42); ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion failed: `(left == right)` left: `2`, right: `3` ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion failed: `(left == right)` left: `2`, right: `3`: my custom message value=42! ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion `left == right` failed left: 2 right: 3 ``` ```plain thread 'main' panicked at $DIR/main.rs:6:5: assertion `left == right` failed: my custom message value=42! left: 2 right: 3 ``` This PR is a simpler subset of the #111030, but it does NOT stringify the original left and right source code assert expressions, thus should be faster to compile.
-
由 Taras Tsugrii 提交于
-
由 Matthias Krüger 提交于
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? ``@notriddle``
-
由 Matthias Krüger 提交于
add missing feature(error_in_core) Needed to fix feature gate errors in https://github.com/rust-lang/miri-test-libstd/actions/runs/5862810459/job/15895203359. I don't know how doctests are passing in-tree without this feature gate...
-
由 Matthias Krüger 提交于
Fix typos
-
由 Matthias Krüger 提交于
Point at return type when it influences non-first `match` arm When encountering code like ```rust fn foo() -> i32 { match 0 { 1 => return 0, 2 => "", _ => 1, } } ``` Point at the return type and not at the prior arm, as that arm has type `!` which isn't influencing the arm corresponding to arm `2`. Fix #78124.
-
由 Matthias Krüger 提交于
Deny `FnDef` in patterns We can only see these via `const { .. }` patterns, which are unstable. cc #76001 (tracking issue for inline const pats) Fixes #114658 Fixes #114659
-