Skip to content

Commit aa73111

Browse files
kayagokalpblyxyas
andauthored
doc: apply doc related suggestions from code review
Co-authored-by: Alejandra González <[email protected]>
1 parent 1ab9ae6 commit aa73111

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

book/src/lint_configuration.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -843,20 +843,8 @@ that the test calls contains a call to any one of these, lint will mark the test
843843

844844

845845
## `test-without-fail-case-include-indexing-as-fallible`
846-
Whether to consider indexing as a fallible operation while assesing if a test can fail.
847-
Indexing is fallible, and thus the a test that is doing that can fail but it is likely
848-
that tests that fail this way were not intended.
849-
850-
If set true, the lint will consider indexing into a slice a failable case
851-
and won't lint tests that has some sort of indexing. This analysis still done
852-
in a interprocedural manner. Meaning that any indexing opeartion done inside of
853-
a function that the test calls will still result the test getting marked fallible.
854-
855-
By default this is set to `false`. That is because from a usability perspective,
856-
indexing an array is not the intended way to fail a test. So setting this `true`
857-
reduces false positives but makes the analysis more focused on possible byproducts
858-
of a test. That is the set of operations to get the point we assert something rather
859-
than the existance of asserting that thing.
846+
Whether to consider indexing (`a[b]`) as a fallible operation while checking if a test can fail.
847+
Indexing is fallible, and thus it can panic, but this panic is likely not intended to be tested.
860848

861849
**Default Value:** `false`
862850

@@ -866,9 +854,9 @@ than the existance of asserting that thing.
866854

867855

868856
## `test-without-fail-case-non-fallible-paths`
869-
List of full paths of macros and functions, that we want to mark as "not going to fail".
870-
This allows us to make the lint more focused on actual short comings of our test suite
871-
by marking common routines non-fallible, even though they are fallible.
857+
List of full paths of macros and functions, that will not count as fallible.
858+
This allows the user to make the lint more focused on actual short comings of the test suite
859+
by marking common routines non-fallible, even though they are.
872860

873861
**Default Value:** `["std::print", "std::println", "std::dbg", "std::eprint", "std::eprintln"]`
874862

clippy_lints/src/test_without_fail_case.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ declare_clippy_lint! {
4747
#[clippy::version = "1.82.0"]
4848
pub TEST_WITHOUT_FAIL_CASE,
4949
restriction,
50-
"test function cannot fail because it does not anyway to panic or assert"
50+
"test function cannot fail because it does not call anywhere to panic or assert"
5151
}
5252

5353
pub struct TestWithoutFailCase {
@@ -231,9 +231,7 @@ impl<'tcx> Visitor<'tcx> for SearchFailIntraFunction<'_, 'tcx> {
231231
// unlikely that this is intended as the tests assertion. In the name of
232232
// reducing false negatives we are giving out soundness.
233233
//
234-
// This decision can be justified as it is highly unlikely that this lint is sound
235-
// without this additional check, and with this we are reducing the number of false
236-
// negatives.
234+
// This reduces the number of false positives
237235
if self.search_config.non_fallible_paths.contains(&macro_with_path) {
238236
return;
239237
}

0 commit comments

Comments
 (0)