about summary refs log tree commit diff
path: root/src/test/ui/liveness
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-1378/+0
2022-11-23review comments: inline bindings and fix typoEsteban Küber-2/+2
2022-11-23Fix wordingEsteban Küber-2/+2
2022-11-23Remove logic duplicationEsteban Küber-2/+2
2022-11-23Suggest `.clone()` or `ref binding` on E0382Esteban Küber-2/+53
2022-10-04slightly improve no return for returning function errorRageking8-6/+5
2022-10-01bless ui testsMaybe Waffle-7/+7
2022-08-23Use par_body_owners for livenessSeo Sanghyeon-6/+6
2022-07-20Rollup merge of #98784 - compiler-errors:forgot-to-return-binding, r=estebankDylan DPC-0/+5
Suggest returning local on "expected `ty`, found `()`" due to expr-less block Putting this up for _initial_ review. Notably, this doesn't consider if the value has possibly been moved, or whether the type is `Copy`. It also provides a structured suggestion if there's one "preferred" binding that matches the type (i.e. one binding in the block or its parent), otherwise it just points them out if there's fewer than 4 of them. Fixes #98177 r? `@estebank`
2022-07-20Suggest returning binding from block or enclosing scope on ↵Michael Goulet-0/+5
coerce_forced_unit error
2022-07-19Mention first and last macro in backtraceMichael Goulet-3/+3
2022-06-16 fix one more case of trailing spaceklensy-1/+1
2022-04-10only suggest removing semicolon when expr implements traitMichael Goulet-1/+1
2022-03-20Filter OnceNote in diagnostic infra.Camille GILLOT-10/+0
2021-12-12Stabilize asm! and global_asm!Amanieu d'Antras-4/+5
They are also removed from the prelude as per the decision in https://github.com/rust-lang/rust/issues/87228. stdarch and compiler-builtins are updated to work with the new, stable asm! and global_asm! macros.
2021-11-28Rollup merge of #90131 - camsteffen:fmt-args-span-fix, r=cjgillotMatthias Krüger-0/+6
Fix a format_args span to be expansion I found this while exploring solutions for rust-lang/rust-clippy#7843. r? `@m-ou-se`
2021-11-18Move some tests to more reasonable directoriesCaio-0/+16
2021-10-29Fix a format_args span to be expansionCameron Steffen-0/+6
2021-10-15Bless testsCameron Steffen-4/+3
2021-09-26Remove box syntax from most places in src/test outside of the issues direst31-17/+18
2021-09-01Stop sorting bodies by span.Camille GILLOT-14/+14
The definition order is already close to the span order, and only differs in corner cases.
2021-08-24Improve liveness analysis for generatorsTomasz Miąsko-20/+96
Liveness analysis for generators assumes that execution always continues normally after a yield point, not accounting for the fact that generator could be dropped before completion. If generators captures any variables by reference, those variables could be used within a generator, or when the generator completes, but also after each yield point in the case the generator is dropped. Account for the case when generator is dropped after yielding, but before running to the completion. This effectively considers all variables captured by reference to be used after a yield point.
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-1/+1
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-04-12Compiler error messages: reduce assertiveness of message E0384James Addison-8/+8
This message is emitted as guidance by the compiler when a developer attempts to reassign a value to an immutable variable. Following the message will always currently work, but it may not always be the best course of action; following the 'consider ...' messaging pattern provides a hint to the developer that it could be wise to explore other alternatives.
2021-02-28Bless some testsGiacomo Stevanato-10/+10
2020-10-21Bless liveness-asm outputOlivia Crain-3/+3
2020-10-21Limit liveness-asm tests to x86_64Olivia Crain-0/+1
2020-10-18Refactor liveness-issue-77915 to liveness-asm and improve testsOlivia Crain-36/+66
2020-10-17Mark inout asm! operands as used in liveness passOlivia Crain-0/+36
2020-09-29Liveness analysis for everybodyTomasz Miąsko-6/+143
Perform liveness analysis for every body instead of limiting it to fns.
2020-09-27liveness: Test interaction with automatically_derived attributeTomasz Miąsko-0/+53
2020-09-02pretty: trim paths of unique symbolsDan Aloni-5/+5
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-07-28Make closures and generators a must use typesTomasz Miąsko-9/+9
Warn about unused expressions with closure or generator type. This follows existing precedence of must use annotations present on `FnOnce`, `FnMut`, `Fn` traits, which already indirectly apply to closures in some cases, e.g.,: ```rust fn f() -> impl FnOnce() { || {} } fn main() { // an existing warning: unused implementer of `std::ops::FnOnce` that must be used: f(); // a new warning: unused closure that must be used: || {}; } ```
2020-05-29liveness: Warn about unused captured variablesTomasz Miąsko-0/+258
2020-04-12Rollup merge of #67766 - sapir:fix-unused-in-or-pattern-warning, r=matthewjasperDylan DPC-8/+8
Fix warning for unused variables in or pattern (issue #67691) Is this a good way to fix it? Also, the tests fail, the "fixed" code output says `{ i, j }` instead of `{ i, j: _ }`, how can I fix that?
2020-04-11rustc: Add a warning count upon completionRoccoDev-2/+2
2020-04-10Try to fix warning for unused variables in or patterns, issue #67691sapir-8/+8
2020-03-23Reword unused variable warningAlex Tokarev-8/+8
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-0/+2
2020-01-24Normalise notes with the/isvarkor-4/+4
2019-11-18Surround types with backticks in type errorsEsteban Küber-8/+8
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-24/+0
2019-11-18review comments: tweak prefix stringsEsteban Küber-16/+16
2019-09-21Do not trigger unreachable lint in async body and Use span labelsEsteban Küber-6/+3
2019-09-18Point at original span when emitting unreachable lintAaron Hill-0/+5
Fixes #64590 When we emit an 'unreachable' lint, we now add a note pointing at the expression that actually causes the code to be unreachable (e.g. `return`, `break`, `panic`). This is especially useful when macros are involved, since a diverging expression might be hidden inside of a macro invocation.
2019-08-09review comments: typo and rewordingEsteban Küber-6/+6
2019-08-09review comment: review wording or missing return errorEsteban Küber-6/+6
2019-08-09Tweak wording of fn without explicit returnEsteban Küber-6/+6
2019-08-09Change wording for function without return valueEsteban Küber-6/+6
Fix #62677
2019-07-17normalize use of backticks in compiler messages for librustc/lintSamy Kacimi-2/+2
https://github.com/rust-lang/rust/issues/60532