about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-11-29review comments and rebase fixesEsteban Küber-2/+2
2023-11-29On Fn arg mismatch for a fn path, suggest a closureEsteban Küber-43/+80
When encountering a fn call that has a path to another fn being passed in, where an `Fn` impl is expected, and the arguments differ, suggest wrapping the argument with a closure with the appropriate arguments.
2023-11-29Avoid unnecessary pattern parse errors on `ref box`Esteban Küber-24/+2
2023-11-29fix rebaseEsteban Küber-2/+24
2023-11-29Always emit help when failing to parse enum variantEsteban Küber-0/+4
2023-11-29Fix tidyEsteban Küber-2/+15
2023-11-29Fix test and move to more appropriate directoryEsteban Küber-37/+63
2023-11-29Change how `for (x in foo) {}` is handledEsteban Küber-24/+79
Use the same approach used for match arm patterns.
2023-11-29Account for `(pat if expr) => {}`Esteban Küber-8/+25
When encountering match arm (pat if expr) => {}, recover and suggest removing parentheses. Fix #100825.
2023-11-29Change enum parse recoveryEsteban Küber-13/+9
2023-11-29Bubble parse error when expecting `)`Esteban Küber-51/+22
2023-11-29More accurate span for unnecessary parens suggestionEsteban Küber-1/+1
2023-11-29When parsing patterns, bubble all errors except reserved idents that aren't ↵Esteban Küber-6/+208
likely to appear in for head or match arm
2023-11-29Make `parse_pat_ident` not recover bad nameEsteban Küber-273/+14
2023-11-29Tweak message on ADT with private fields buildingEsteban Küber-6/+6
When trying to create an inaccessible ADT due to private fields, handle the case when no fields were passed. ``` error: cannot construct `Foo` with struct literal syntax due to private fields --> $DIR/issue-76077.rs:8:5 | LL | foo::Foo {}; | ^^^^^^^^ | = note: private field `you_cant_use_this_field` that was not provided ```
2023-11-29rustdoc-search: replace TAB/NL/LF with SP firstMichael Howell-13/+22
This way, most of the parsing code doesn't need to be designed to handle it, since they should always be treated exactly the same anyhow.
2023-11-29rustdoc-search: removed dead parser codeMichael Howell-0/+9
This is already covered by the normal unexpected char path.
2023-11-29rustdoc-search: allow `:: ` and ` ::`Michael Howell-18/+57
This restriction made sense back when spaces separated function parameters, but now that they separate path components, there's no real ambiguity any more. Additionally, the Rust language allows it.
2023-11-29jobserver: check file descriptorsbelovdv-3/+19
2023-11-29Rollup merge of #118426 - aDotInTheVoid:const-wat, r=compiler-errors,cjgillotMatthias Krüger-0/+67
ConstProp: Correctly remove const if unknown value assigned to it. Closes #118328 The problematic sequence of MIR is: ```rust _1 = const 0_usize; _1 = const _; // This is an associated constant we can't know before monomorphization. _0 = _1; ``` 1. When `ConstProp::visit_assign` happens on `_1 = const 0_usize;`, it records that `0x0usize` is the value for `_1`. 2. Next `visit_assign` happens on `_1 = const _;`. Because the rvalue `.has_param()`, it can't be const evaled. 3. Finaly, `visit_assign` happens on `_0 = _1;`. Here it would think the value of `_1` was `0x0usize` from step 1. The solution is to remove consts when checking the RValue fails, as they may have contained values that should now be invalidated, as that local was overwritten. This should probably be back-ported to beta. Stable is more iffy, as it's gone unidentified since 1.70, so I only think it's worthwhile if there's another reason for a 1.74.1 release anyway.
2023-11-29Rollup merge of #118333 - eduardosm:print-missing-target-features, r=est31Matthias Krüger-47/+129
Print list of missing target features when calling a function with target features outside an unsafe block Fixes https://github.com/rust-lang/rust/issues/108680 Supersedes https://github.com/rust-lang/rust/pull/109710. I used the same wording for the messages, but the implementation is different. r? `@est31`
2023-11-29Rollup merge of #118191 - estebank:let-chain-typo, r=compiler-errorsMatthias Krüger-10/+23
Suggest `let` or `==` on typo'd let-chain When encountering a bare assignment in a let-chain, suggest turning the assignment into a `let` expression or an equality check. ``` error: expected expression, found `let` statement --> $DIR/bad-if-let-suggestion.rs:5:8 | LL | if let x = 1 && i = 2 {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions help: you might have meant to continue the let-chain | LL | if let x = 1 && let i = 2 {} | +++ help: you might have meant to compare for equality | LL | if let x = 1 && i == 2 {} | + ```
2023-11-29Rollup merge of #118157 - Nadrieril:never_pat-feature-gate, r=compiler-errorsMatthias Krüger-0/+221
Add `never_patterns` feature gate This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (https://github.com/rust-lang/rust/issues/118155) for details on the experiment. `@scottmcm` has agreed to be my lang-team liaison for this experiment.
2023-11-29Auto merge of #118433 - matthiaskrgr:rollup-fi9lrwg, r=matthiaskrgrbors-51/+32
Rollup of 7 pull requests Successful merges: - #116839 (Implement thread parking for xous) - #118265 (remove the memcpy-on-equal-ptrs assumption) - #118269 (Unify `TraitRefs` and `PolyTraitRefs` in `ValuePairs`) - #118394 (Remove HIR opkinds) - #118398 (Add proper cfgs in std) - #118419 (Eagerly return `ExprKind::Err` on `yield`/`await` in wrong coroutine context) - #118422 (Fix coroutine validation for mixed panic strategy) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-29Rollup merge of #118429 - cuviper:its-arguments, r=compiler-errorsMatthias Krüger-2/+2
Fix a typo in a `format_args!` note
2023-11-29Rollup merge of #118413 - chenyukang:yukang-fix-118145-unwrap-for-shorthand, ↵Matthias Krüger-0/+303
r=compiler-errors Fix the issue of suggesting unwrap/expect for shorthand field Fixes #118145
2023-11-29Rollup merge of #118342 - compiler-errors:macro-generic-bang, r=estebankMatthias Krüger-0/+13
Dont suggest `!` for path in function call if it has generic args Fixes #118335
2023-11-29Rollup merge of #118422 - tmiasko:mix, r=compiler-errorsMatthias Krüger-0/+24
Fix coroutine validation for mixed panic strategy Validation introduced in #113124 allows `UnwindAction::Continue` and `TerminatorKind::Resume` to occur only in functions with ABI that can unwind. The function ABI depends on the panic strategy, which can vary across crates. Usually MIR is built and validated in the same crate. The coroutine drop glue thus far was an exception. As a result validation could fail when mixing different panic strategies. Avoid the problem by executing `AbortUnwindingCalls` along with the validation. Fixes #116953.
2023-11-29Rollup merge of #118419 - compiler-errors:await-span2, r=cjgillotMatthias Krüger-51/+8
Eagerly return `ExprKind::Err` on `yield`/`await` in wrong coroutine context This PR does 2 things: 1. Refuses to lower `.await` or `yield` when we are outside of the right coroutine context for the operator. Instead, we lower to `hir::ExprKind::Err`, to silence subsequent redundant errors. 2. Reworks a bit of the span tracking in `LoweringContext` to fix a bad span when we have something like `let x = [0; async_fn().await]` where the `await` is inside of an anon const. The span for the "item" still kinda sucks, since it overlaps with the `await` span, but at least it's accurate.
2023-11-29Add `never_patterns` feature gateNadrieril-0/+221
2023-11-28Fix a typo in a `format_args!` noteJosh Stone-2/+2
2023-11-29Auto merge of #114841 - bvanjoi:fix-114814, r=cuviperbors-4/+81
add track_caller for arith ops Fixes #114814 `#[track_caller]` is works, r? `@scottmcm`
2023-11-29More fix on mismatched type suggestion for shorthand fieldsyukang-0/+234
2023-11-28Rename and add another testAlona Enraght-Moony-3/+30
2023-11-28Auto merge of #118412 - matthiaskrgr:rollup-ghzhti2, r=matthiaskrgrbors-1/+1
Rollup of 6 pull requests Successful merges: - #118193 (Add missing period in `std::process::Command` docs) - #118222 (unify read_to_end and io::copy impls for reading into a Vec) - #118323 (give dev-friendly error message for incorrect config profiles) - #118378 (Perform LTO optimisations with wasm-ld + -Clinker-plugin-lto) - #118399 (Clean dead codes in miri) - #118410 (update test for new LLVM 18 codegen) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-28ConstProp: Remove const when rvalue check fails.Alona Enraght-Moony-2/+1
2023-11-28Add with_opt_const_effect_param helper, simplifyMichael Goulet-2/+2
2023-11-28Add PartialEq<&B> for &AMichael Goulet-44/+12
2023-11-28Fix PartialEq args when #[const_trait] is enabledMichael Goulet-1/+1
2023-11-28Fix coroutine validation for mixed panic strategyTomasz Miąsko-0/+24
Validation introduced in #113124 allows UnwindAction::Continue and TerminatorKind::Resume to occur only in functions with ABI that can unwind. The function ABI depends on the panic strategy, which can vary across crates. Usually MIR is built and validated in the same crate. The coroutine drop glue thus far was an exception. As a result validation could fail when mixing different panic strategies. Avoid the problem by executing AbortUnwindingCalls along with the validation.
2023-11-28thir-unsafeck: print list of missing target features when calling a function ↵Eduardo Sánchez Muñoz-13/+65
with target features outside an unsafe block
2023-11-28Fix spans for bad await in inline constMichael Goulet-47/+8
2023-11-28Eagerly return ExprKind::Err on yield/await in wrong coroutine contextMichael Goulet-4/+0
2023-11-28Suggest `let` or `==` on typo'd let-chainEsteban Küber-10/+23
When encountering a bare assignment in a let-chain, suggest turning the assignment into a `let` expression or an equality check. ``` error: expected expression, found `let` statement --> $DIR/bad-if-let-suggestion.rs:5:8 | LL | if let x = 1 && i = 2 {} | ^^^^^^^^^ | = note: only supported directly in conditions of `if` and `while` expressions help: you might have meant to continue the let-chain | LL | if let x = 1 && let i = 2 {} | +++ help: you might have meant to compare for equality | LL | if let x = 1 && i == 2 {} | + ```
2023-11-28fix the issue of suggest unwrap/expect for shorthand fieldyukang-0/+69
2023-11-28Precommit test for https://github.com/rust-lang/rust/issues/118328.Alona Enraght-Moony-0/+41
2023-11-28Rollup merge of #118410 - krasimirgg:llvm-18-test, r=nikicMatthias Krüger-1/+1
update test for new LLVM 18 codegen LLVM at HEAD now emits `or disjoint`: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/24076#018c1596-8153-488e-b622-951266a02f6c/741-774
2023-11-28def collector: Set correct namespace in `DefPathData` for foreign typesVadim Petrochenkov-1/+1
2023-11-28resolve: Feed the `def_kind` query immediately on `DefId` creationVadim Petrochenkov-2/+2
2023-11-28update test for new LLVM 18 codegenKrasimir Georgiev-1/+1
LLVM at HEAD now emits `or disjoint`: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/24076#018c1596-8153-488e-b622-951266a02f6c/741-774