about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-12-04use `assume(idx < self.len())` in `[T]::get_unchecked`bendn-0/+13
2023-12-03Auto merge of #118579 - matthiaskrgr:rollup-22kn8sa, r=matthiaskrgrbors-29/+146
Rollup of 3 pull requests Successful merges: - #117869 ([rustdoc] Add highlighting for comments in items declaration) - #118525 (coverage: Skip spans that can't be un-expanded back to the function body) - #118574 (rustc_session: Address all `rustc::potential_query_instability` lints) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-03Rollup merge of #118525 - Zalathar:skip-spans, r=cjgillotMatthias Krüger-23/+23
coverage: Skip spans that can't be un-expanded back to the function body When we extract coverage spans from MIR, we try to "un-expand" them back to spans that are inside the function's body span. In cases where that doesn't succeed, the current code just swaps in the entire body span instead. But that tends to result in coverage spans that are completely unrelated to the control flow of the affected code, so it's better to just discard those spans. --- Extracted from #118305, since this is a general improvement that isn't specific to branch coverage. --- `@rustbot` label +A-code-coverage
2023-12-03Rollup merge of #117869 - GuillaumeGomez:comment-highlighting-item-decl, ↵Matthias Krüger-6/+123
r=notriddle [rustdoc] Add highlighting for comments in items declaration Fixes #117555. So after the discussion in https://github.com/rust-lang/rust/pull/117643, the outcome was that having the comments in the item declaration at the same level (in term of color) as the rest of the code was actually a bit distracting and could be improved. The current highlighting color for comments is "lighter" than the rest and I think it fits perfectly to improve the current situation. With this, we now have different "levels" which makes it easier to read and filter out what we want when reading the items declaration. Here's a screenshot: ![image](https://github.com/rust-lang/rust/assets/3050060/dbd98029-e98b-4997-9a89-6b823eaac9a4) r? `@notriddle`
2023-12-03Auto merge of #118072 - estebank:issue-98982, r=cjgillotbors-17/+48
Provide structured suggestion for type mismatch in loop We currently provide only a `help` message, this PR introduces the last two structured suggestions instead: ``` error[E0308]: mismatched types --> $DIR/issue-98982.rs:2:5 | LL | fn foo() -> i32 { | --- expected `i32` because of return type LL | / for i in 0..0 { LL | | return i; LL | | } | |_____^ expected `i32`, found `()` | note: the function expects a value to always be returned, but loops might run zero times --> $DIR/issue-98982.rs:2:5 | LL | for i in 0..0 { | ^^^^^^^^^^^^^ this might have zero elements to iterate on LL | return i; | -------- if the loop doesn't execute, this value would never get returned help: return a value for the case when the loop has zero elements to iterate on | LL ~ } LL ~ /* `i32` value */ | help: otherwise consider changing the return type to account for that possibility | LL ~ fn foo() -> Option<i32> { LL | for i in 0..0 { LL ~ return Some(i); LL ~ } LL ~ None | ``` Fix #98982.
2023-12-03Auto merge of #113730 - belovdv:jobserver-init-check, r=petrochenkovbors-3/+19
Report errors in jobserver inherited through environment variables This pr attempts to catch situations, when jobserver exists, but is not being inherited. r? `@petrochenkov`
2023-12-03Auto merge of #118526 - sjwang05:issue-118510, r=petrochenkovbors-0/+36
Fix ICE: `fn_arg_names: unexpected item DefId(..)` Fixes #118510
2023-12-03Satisfy tidyNadrieril-0/+0
2023-12-03Disallow arm bodies on never patternsNadrieril-18/+48
2023-12-03Disallow guards on never patternsNadrieril-41/+30
2023-12-03Disallow an arm without a body (except for never patterns)Nadrieril-7/+86
Parsing now accepts a match arm without a body, so we must make sure to only accept that if the pattern is a never pattern.
2023-12-03Detect attempts to expand a macro to a match arm againNadrieril-0/+2
Because a macro invocation can expand to a never pattern, we can't rule out a `arm!(),` arm at parse time. Instead we detect that case at expansion time, if the macro tries to output a pattern followed by `=>`.
2023-12-03Parse a pattern with no armNadrieril-115/+177
2023-12-03codegen, miri: fix computing the offset of an unsized field in a packed structRalf Jung-0/+75
2023-12-03Auto merge of #118542 - chenyukang:yukang-fix-parser-ice-118531, r=cjgillotbors-0/+106
Fix parser ICE from attrs Fixes #118531, Fixes #118530.
2023-12-03coverage: Skip spans that can't be un-expanded back to the function bodyZalathar-23/+23
When we extract coverage spans from MIR, we try to "un-expand" them back to spans that are inside the function's body span. In cases where that doesn't succeed, the current code just swaps in the entire body span instead. But that tends to result in coverage spans that are completely unrelated to the control flow of the affected code, so it's better to just discard those spans.
2023-12-02Fix ICE when suggesting closures for non-fn-like defssjwang05-0/+36
2023-12-02FileCheck while_let_loops.Camille GILLOT-1/+2
2023-12-02FileCheck tuple_literal_propagation.Camille GILLOT-2/+3
2023-12-02FileCheck return_place.Camille GILLOT-1/+2
2023-12-02FileCheck switch_int.Camille GILLOT-1/+8
2023-12-02FileCheck slice_len.Camille GILLOT-7/+22
2023-12-02FileCheck scalar_literal_propagation.Camille GILLOT-1/+3
2023-12-02FileCheck repeat.Camille GILLOT-1/+3
2023-12-02FileCheck reify_fn_ptr.Camille GILLOT-1/+4
2023-12-02FileCheck ref_deref.Camille GILLOT-8/+19
2023-12-02FileCheck read_immutable_static.Camille GILLOT-1/+3
2023-12-02FileCheck mutable_variable_unprop_assign.Camille GILLOT-2/+12
2023-12-02FileCheck mutable_variable_aggregate_partial_read.Camille GILLOT-1/+7
2023-12-02FileCheck mutable_variable_no_prop.Camille GILLOT-1/+8
2023-12-02FileCheck mutable_variable_aggregate_mut_ref.Camille GILLOT-1/+8
2023-12-02FileCheck mutable_variable_aggregate.Camille GILLOT-1/+6
2023-12-02FileCheck mutable_variable.Camille GILLOT-1/+6
2023-12-02FileCheck mult_by_zero.Camille GILLOT-3/+4
2023-12-02FileCheck issue_67019.Camille GILLOT-2/+8
2023-12-02FileCheck issue_66971.Camille GILLOT-6/+20
2023-12-02FileCheck inherit_overflow.Camille GILLOT-3/+6
2023-12-02FileCheck indirect.Camille GILLOT-1/+3
2023-12-02FileCheck discriminant.Camille GILLOT-2/+13
2023-12-02FileCheck and rename const_prop_fails_gracefully.Camille GILLOT-12/+18
2023-12-02FileCheck checked_add.Camille GILLOT-1/+4
2023-12-02FileCheck cast.Camille GILLOT-2/+5
2023-12-02FileCheck boxes.Camille GILLOT-1/+5
2023-12-02FileCheck boolean_identities.Camille GILLOT-8/+36
2023-12-02FileCheck bad_op_unsafe_oob_for_slices.Camille GILLOT-1/+4
2023-12-02FileCheck bad_op_mod_by_zero.Camille GILLOT-1/+8
2023-12-02FileCheck bad_op_div_by_zero.Camille GILLOT-2/+8
2023-12-02FileCheck array_index.Camille GILLOT-2/+4
2023-12-02FileCheck aggregate.Camille GILLOT-174/+14
2023-12-02FileCheck address_of_pair.Camille GILLOT-1/+14