about summary refs log tree commit diff
path: root/src/test/ui/unused
AgeCommit message (Collapse)AuthorLines
2021-07-31Move the `unused` dir to `lint`s subdirYuki Okushi-1045/+0
2021-07-31Add a hint that the expressions produce a valueYuki Okushi-0/+28
2021-07-03Add a help message to `unused_doc_comments` lintYuki Okushi-0/+106
2021-05-15Fix unused attributes on macro_rules.Eric Huss-0/+66
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-04Move a `unused_doc_comments ` test to the `unused` dirYuki Okushi-0/+139
2021-04-04Trigger `unused_doc_comments` on macros at onceYuki Okushi-0/+48
2021-03-09Visit attributes in one go.Camille GILLOT-25/+25
2021-01-30Remove const_in_array_rep_exprkadmin-24/+9
2020-12-07Move some tests to subdirectoriesVadim Petrochenkov-0/+115
2020-09-02pretty: trim paths of unique symbolsDan Aloni-2/+2
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-2/+117
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-07-02Audit uses of `span_suggestion_short`Yuki Okushi-2/+13
2020-02-27Revert "Mark attributes consumed by `check_mod_attrs` as normal"Tomasz Miąsko-57/+0
This reverts commit d78b22f35ec367368643fe7d6f7e87d01762692b. Those changes were incompatible with incremental compilation since the effect `check_mod_attrs` has with respect to marking the attributes as used is neither persisted nor recomputed.
2020-02-23Mark attributes consumed by `check_mod_attrs` as normalTomasz Miąsko-0/+57
Take advantage of the fact that `check_mod_attrs` marks attributes as used and change their type to normal, so that any remaining uses will be warned about by the unused attribute lint.
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-10/+10
2019-06-08Introduce `#[rustc_dummy]` attribute and use it in testsVadim Petrochenkov-62/+61
Unlike other built-in attributes, this attribute accepts any input
2019-03-11Update testsVadim Petrochenkov-28/+28
2018-12-25Remove licensesMark Rousskov-107/+37
2018-10-25List allowed tokens after macro fragmentsEsteban Küber-1/+3
2018-10-15Rollup merge of #55025 - ehuss:missing-lifetime-err-msg, r=petrochenkovManish Goregaokar-1/+1
Add missing lifetime fragment specifier to error message. A very minor issue, `lifetime` was missing from the error list. I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-14Unused result warning: "X which must" ↦ "X that must"varkor-12/+12
2018-10-12Add missing lifetime fragment specifier to error message.Eric Huss-1/+1
A very minor issue, `lifetime` was missing from the error list. I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+499