Commit graph

10040 commits

Author SHA1 Message Date
bors
bd1554c425 Auto merge of #11318 - Centri3:#11309, r=Manishearth
[`filter_map_bool_then`]: Don't ICE on late bound regions

Fixes #11309

Also lints `&NonCopy` now, since any `&` is `Copy`. That was accidental, but it seems that this is a consequence (or improvement!) of this fix.

r? `@Jarcho`

changelog: [`filter_map_bool_then`]: Don't ICE on late bound regions
2023-08-11 00:17:15 +00:00
Catherine Flores
1ec0501bca Revert "New lint [filter_map_bool_then]"
This reverts commits 978b1daf99 and 3235d9d612.
2023-08-10 17:28:01 -05:00
Catherine Flores
beb57f074e Don't ICE with late bound regions 2023-08-10 16:26:22 -05:00
Philipp Krones
17b9c42572
Merge remote-tracking branch 'upstream/master' into rustup 2023-08-10 21:15:24 +02:00
Guillaume Gomez
42186af21e Correctly handle async blocks for NEEDLESS_PASS_BY_REF_MUT 2023-08-10 16:23:27 +02:00
y21
dd25cc349b Remove unnecessary paragraph, move examples 2023-08-09 14:48:31 +02:00
Timo
d2acfb37b3
Reword paragraph
Co-authored-by: Dirkjan Ochtman <dirkjan@ochtman.nl>
2023-08-09 14:44:42 +02:00
y21
830bac5548 clarify why Vec::new() + resize is worse than vec![0; N] 2023-08-09 14:08:48 +02:00
Vadim Petrochenkov
36a50008d0 rustc: Move crate_types from Session to GlobalCtxt
Removes a piece of mutable state.
Follow up to #114578.
2023-08-09 14:17:54 +08:00
bors
7c595b4599 Auto merge of #11305 - y21:issue11304, r=Centri3
[`redundant_guards`]: don't lint on float literals

Fixes #11304

changelog: [`redundant_guards`]: don't lint on float literals

r? `@Centri3` i figured you are probably a good reviewer for this since you implemented the lint ^^
2023-08-08 16:18:06 +00:00
y21
b6156502af document the new behavior and add test for float in struct 2023-08-08 18:04:57 +02:00
y21
f959ccc09b [redundant_guards]: don't lint on floats 2023-08-08 17:19:53 +02:00
Matthias Krüger
5f8600939e Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, r=oli-obk
Store the laziness of type aliases in their `DefKind`

Previously, we would treat paths referring to type aliases as *lazy* type aliases if the current crate had lazy type aliases enabled independently of whether the crate which the alias was defined in had the feature enabled or not.

With this PR, the laziness of a type alias depends on the crate it is defined in. This generally makes more sense to me especially if / once lazy type aliases become the default in a new edition and we need to think about *edition interoperability*:

Consider the hypothetical case where the dependency crate has an older edition (and thus eager type aliases), it exports a type alias with bounds & a where-clause (which are void but technically valid), the dependent crate has the latest edition (and thus lazy type aliases) and it uses that type alias. Arguably, the bounds should *not* be checked since at any time, the dependency crate should be allowed to change the bounds at will with a *non*-major version bump & without negatively affecting downstream crates.

As for the reverse case (dependency: lazy type aliases, dependent: eager type aliases), I guess it rules out anything from slight confusion to mild annoyance from upstream crate authors that would be caused by the compiler ignoring the bounds of their type aliases in downstream crates with older editions.

---

This fixes #114468 since before, my assumption that the type alias associated with a given weak projection was lazy (and therefore had its variances computed) did not necessarily hold in cross-crate scenarios (which [I kinda had a hunch about](https://github.com/rust-lang/rust/pull/114253#discussion_r1278608099)) as outlined above. Now it does hold.

`@rustbot` label F-lazy_type_alias
r? `@oli-obk`
2023-08-08 03:30:56 +02:00
León Orell Valerian Liehr
3ff6fd2ac7 Store the laziness of type aliases in the DefKind 2023-08-07 15:54:31 +02:00
bors
84d2896747 Auto merge of #11295 - lengyijun:typo, r=Centri3
Small code style adjustments

changelog: none
2023-08-07 03:23:23 +00:00
bors
526d1156bd Auto merge of #11191 - Alexendoo:redundant-type-annotations-ice, r=llogiq
redundant_type_annotations: only pass certain def kinds to type_of

Fixes #11190
Fixes rust-lang/rust#113516

Also adds an `is_lint_allowed` check to skip the lint when it's not needed

changelog: none
2023-08-06 18:45:38 +00:00
Manish Goregaokar
d628046244
Update clippy_lints/src/operators/mod.rs
Co-authored-by: Catherine Flores <catherine.3.flores@gmail.com>
2023-08-06 17:19:43 +00:00
Matthias Krüger
261837c841 Rollup merge of #114505 - ouz-a:cleanup_mir, r=RalfJung
Add documentation to has_deref

Documentation of `has_deref` needed some polish to be more clear about where it should be used and what's it's purpose.

cc https://github.com/rust-lang/rust/issues/114401

r? `@RalfJung`
2023-08-06 17:26:29 +02:00
ouz-a
44cd3bcbba cleanup misinformation regarding has_deref 2023-08-06 17:29:09 +03:00
Morten Lohne
3157b96a5b Provide fallback code snippets, if the snippet is not available 2023-08-06 13:49:17 +02:00
Morten Lohne
0e064d5d04 Replace ConstEvalLateContext::new() with two calls to constant() to simplify the code, after PR suggestion 2023-08-06 13:48:28 +02:00
Morten Lohne
9646446923 Add lifetime parameter to 'Constant', after rebasing on upstream 2023-08-06 13:29:50 +02:00
Morten Lohne
1d61fc1b0a Rename 'impossible_double_const_comparisons' -> 'impossible_comparisons' and 'ineffective_double_const_comparisons' -> 'redundant_comparisons', after discussion on Zulip 2023-08-05 21:28:08 +02:00
Morten Lohne
b5ef66f442 Optimize by doing a cheap check for double binary expression first 2023-08-05 21:28:08 +02:00
Morten Lohne
08e1333fa6 Add missing variable decl to doc comment 2023-08-05 21:28:08 +02:00
Morten Lohne
e16a2ac0c6 Add descriptions for 'impossible_double_const_comparisons' and 'ineffective_double_const_comparisons' 2023-08-05 21:28:08 +02:00
Morten Lohne
046d3df35e New lints: impossible_double_const_comparisons and ineffective_double_const_comparisons 2023-08-05 21:28:08 +02:00
lengyijun
e5b0483c85 Small code style adjustments 2023-08-05 12:41:20 +08:00
bors
ec1d61e064 Auto merge of #114481 - matthiaskrgr:rollup-58pczpl, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #113945 (Fix wrong span for trait selection failure error reporting)
 - #114351 ([rustc_span][perf] Remove unnecessary string joins and allocs.)
 - #114418 (bump parking_lot to 0.12)
 - #114434 (Improve spans for indexing expressions)
 - #114450 (Fix ICE failed to get layout for ReferencesError)
 - #114461 (Fix unwrap on None)
 - #114462 (interpret: add mplace_to_ref helper method)
 - #114472 (Reword `confusable_idents` lint)
 - #114477 (Account for `Rc` and `Arc` when suggesting to clone)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-04 20:31:40 +00:00
Matthias Krüger
878a87d5b7 Rollup merge of #114434 - Nilstrieb:indexing-spans, r=est31
Improve spans for indexing expressions

fixes #114388

Indexing is similar to method calls in having an arbitrary left-hand-side and then something on the right, which is the main part of the expression. Method calls already have a span for that right part, but indexing does not. This means that long method chains that use indexing have really bad spans, especially when the indexing panics and that span in coverted into a panic location.

This does the same thing as method calls for the AST and HIR, storing an extra span which is then put into the `fn_span` field in THIR.

r? compiler-errors
2023-08-04 21:31:57 +02:00
bors
18522006a1 Auto merge of #114104 - oli-obk:syn2, r=compiler-errors
Lots of tiny incremental simplifications of `EmitterWriter` internals

ignore the first commit, it's https://github.com/rust-lang/rust/pull/114088 squashed and rebased, but it's needed to use to use `derive_setters`, as they need a newer `syn` version.

Then this PR starts out with removing many arguments that are almost always defaulted to `None` or `false` and replace them with builder methods that can set these fields in the few cases that want to set them.

After that it's one commit after the other that removes or merges things until everything becomes some very simple trait objects
2023-08-04 18:46:19 +00:00
Nilstrieb
ed0dfed24f Improve spans for indexing expressions
Indexing is similar to method calls in having an arbitrary
left-hand-side and then something on the right, which is the main part
of the expression. Method calls already have a span for that right part,
but indexing does not. This means that long method chains that use
indexing have really bad spans, especially when the indexing panics and
that span in coverted into a panic location.

This does the same thing as method calls for the AST and HIR, storing an
extra span which is then put into the `fn_span` field in THIR.
2023-08-04 13:17:39 +02:00
bors
5818225a89 Auto merge of #11255 - blyxyas:fix-perf-sus_xor_used_as_pow, r=xFrednet
Fix `suspicious_xor_used_as_pow.rs` performance

The original `suspicious_xor_used_as_pow` lint had poor performance, so I fixed that + a little refactor so that module is readable.

**107 millis. -> 106 millis.** Using `SPEEDTEST` on Rust's VMs

fix #11060
changelog: [`suspicious_xor_used_as_pow`]: Improve performance by 0.934%
2023-08-03 20:07:54 +00:00
blyxyas
3fb84415cd
Fix suspicious_xor_used_as_pow.rs performance 2023-08-03 21:58:59 +02:00
Matthias Krüger
8f4f476a54 Rollup merge of #113657 - Urgau:expand-incorrect_fn_null_check-lint, r=cjgillot
Expand, rename and improve `incorrect_fn_null_checks` lint

This PR,

 - firstly, expand the lint by now linting on references
 - secondly, it renames the lint `incorrect_fn_null_checks` -> `useless_ptr_null_checks`
 - and thirdly it improves the lint by catching `ptr::from_mut`, `ptr::from_ref`, as well as `<*mut _>::cast` and `<*const _>::cast_mut`

Fixes https://github.com/rust-lang/rust/issues/113601
cc ```@est31```
2023-08-03 17:29:06 +02:00
bors
1eb254ef83 Auto merge of #11242 - samueltardieu:issue-11238, r=Centri3,giraffate
New lint `ignored_unit_patterns`

This idea comes from #11238. I've put the lint in `pedantic` as it might trigger numerous positives (three in Clippy itself).

changelog: [`ignored_unit_patterns`]: new lint
2023-08-03 01:04:39 +00:00
bors
ff27f9095f Auto merge of #107254 - chenyukang:yukang/fix-107113-wrong-sugg-in-macro, r=estebank
Avoid wrong code suggesting for attribute macro

Fixes #107113
r? `@estebank`
2023-08-02 23:04:27 +00:00
bors
237dd599db Auto merge of #11288 - Centri3:#11278, r=Alexendoo
[`ptr_as_ptr`]: Take snippet instead of pretty printing type

Fixes #11278

changelog: [`ptr_as_ptr`]: Include leading `super`s in suggestion
2023-08-02 22:32:35 +00:00
Catherine Flores
fef85c9083 Take snippet instead of pretty printing type 2023-08-02 17:26:25 -05:00
bors
97d1cfa2b4 Auto merge of #11286 - Centri3:#11283, r=Alexendoo
Suppress `question_mark` warning if `question_mark_used` is not allowed

Closes #11283

changelog: [`question_mark`]: Don't lint if `question_mark_used` is not allowed
2023-08-02 22:20:30 +00:00
Catherine Flores
4d49065a6c Suppress question_mark if question_mark_used is not allowed 2023-08-02 14:13:16 -05:00
Catherine Flores
71c54137ea Extract never-like into clippy_utils 2023-08-02 14:00:26 -05:00
Catherine Flores
779e0f4021 Do not lint unwrapping on ! or never-like enums 2023-08-02 14:00:12 -05:00
Deadbeef
b07de24a58 Remove constness from TraitPredicate 2023-08-02 15:38:00 +00:00
Your Name
72074a0f00 Alphabetically order arms in methods/mod.rs match 2023-08-02 16:44:26 +08:00
yukang
0ff6579eac fix RedundantLocals clippy caused by async and await 2023-08-02 16:32:49 +08:00
Urgau
7ef1a54ffe Rename incorrect_fn_null_checks to useless_ptr_null_checks (clippy side) 2023-08-01 20:04:01 +02:00
bors
588c1abb76 Auto merge of #11269 - y21:issue11268, r=Centri3
[`unnecessary_mut_passed`]: don't lint in macro expansions

Fixes #11268

changelog: [`unnecessary_mut_passed`]: don't lint in macro expansions
2023-08-01 05:15:09 +00:00
Philipp Krones
b0e64a9c09 Merge commit '5436dba826191964ac1d0dab534b7eb6d4c878f6' into clippyup 2023-07-31 23:53:53 +02:00
Samuel "Sam" Tardieu
f9a6dfa60d New lint ignored_unit_patterns 2023-07-31 22:00:53 +02:00
y21
dc1e8b0dd9 [unnecessary_mut_passed]: don't lint in macro expansions 2023-07-31 21:09:52 +02:00
Oli Scherer
084c90a305 Remove a bool for color in favor of the WriteColor trait wrapping colored and uncolored printing 2023-07-31 09:34:36 +00:00
Oli Scherer
9a0af82781 Use builder pattern instead of lots of arguments for EmitterWriter::new 2023-07-31 09:34:30 +00:00
bors
5436dba826 Auto merge of #11263 - c410-f3r:let-chain, r=Centri3
[`arithmetic_side_effects`] Fix #11262

Fix #11262

Rustc already handles paths that refer literals -> https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d795058a2e1634c867288c20ff9432c8

```
changelog: [`arithmetic_side_effects`]: Ignore paths that refer literals
```
2023-07-30 20:16:57 +00:00
bors
2ab124126d Auto merge of #11261 - y21:issue11260, r=blyxyas
[`unnecessary_find_map`]: look for then_some

Closes #11260

changelog: [`unnecessary_find_map`]: lint `.then_some()` in closure
2023-07-30 18:26:45 +00:00
Caio
35d434d08e [arithmetic_side_effects] Fix #11262 2023-07-30 14:33:38 -03:00
Matthias Krüger
f54263af58 Rollup merge of #112655 - WaffleLapkin:must_use_map_or, r=workingjubilee
Mark `map_or` as `#[must_use]`

I don't know what else to say.

r? libs
2023-07-30 14:25:08 +02:00
y21
008746cae4 [unnecessary_find_map]: look for then_some 2023-07-30 13:51:35 +02:00
Maybe Waffle
0c93e30956 Mark map_or as #[must_use] 2023-07-30 10:22:23 +00:00
Jason Newcomb
7423c2760b Don't lint redundant closure for any function call inserted by the compiler. 2023-07-30 01:19:36 -04:00
Jason Newcomb
4d80a2ed2e Rework redundant_closure
* Better track when a early-bound region appears when a late-bound region is required
* Don't lint when the closure gives explicit types.
2023-07-30 01:19:29 -04:00
Jason Newcomb
71cc39e1f2 Add debug assertions to implements_trait
Improve debug assertions for `make_projection`
2023-07-30 00:38:04 -04:00
bors
436060f637 Auto merge of #113422 - Urgau:cast_ref_to_mut-pre-beta, r=Nilstrieb
Rename and allow `cast_ref_to_mut` lint

This PR is a small subset of https://github.com/rust-lang/rust/pull/112431, that is the renaming of the lint (`cast_ref_to_mut` -> `invalid_reference_casting`).

BUT also temporarily change the default level of the lint from deny-by-default to allow-by-default until https://github.com/rust-lang/rust/pull/112431 is merged.

r? `@Nilstrieb`
2023-07-29 07:48:44 +00:00
Philipp Krones
3d60241841
Merge remote-tracking branch 'upstream/master' into rustup 2023-07-28 23:44:28 +02:00
León Orell Valerian Liehr
4c9d68e9b8 Make Clippy understand generic const items 2023-07-28 22:21:41 +02:00
bors
d3c5b488db Auto merge of #11210 - y21:readonly_write_lock, r=giraffate
new lint: [`readonly_write_lock`]

Closes #8555

A new lint that catches `RwLock::write` calls to acquire a write lock only to read from it and not actually do any writes (mutations).

changelog: new lint: [`readonly_write_lock`]
2023-07-28 13:08:02 +00:00
y21
5e88003dda pattern match on local usage slice to avoid ICE 2023-07-28 12:52:06 +02:00
bors
295bdc028f Auto merge of #10759 - blyxyas:unset_opt_env_unwrap, r=flip1995
Now `option_env_unwrap` warns even if a variable isn't set at compiletime

Fixes #10742
changelog: Fix false negative where `option_env_unwrap` wouldn't warn if the env variable isn't set at compile-time.
2023-07-27 19:52:46 +00:00
Timo
205a3741c1 make lint description more consistent (writer/reader -> write/read)
Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
2023-07-27 21:19:35 +02:00
y21
136339f2d3 new lint: [readonly_write_lock] 2023-07-27 21:19:35 +02:00
Deadbeef
39fb315396 bless clippy 2023-07-27 17:56:25 +00:00
Deadbeef
be0b4d5a9b Remove constness from ParamEnv 2023-07-27 15:50:42 +00:00
blyxyas
3bfccacca9
Add comments + Very minor Refactor 2023-07-26 23:16:24 +02:00
Matthias Krüger
8615595021 Rollup merge of #114070 - blyxyas:iter_mut_symbol, r=oli-obk
Add `sym::iter_mut` + `sym::as_mut_ptr` for Clippy

We currently have `sym::iter` and `sym::iter_repeat`, this PR adds `sym::iter_mut` as it's useful for https://github.com/rust-lang/rust-clippy/pull/11038 and another Clippy lint, it also adds `sym::as_mut_ptr` as it's useful for https://github.com/rust-lang/rust-clippy/pull/10962.
2023-07-26 20:49:13 +02:00
blyxyas
4e1db44404
Now option_env_unwrap warns even if a variable isn't set at compile time. 2023-07-26 18:57:57 +02:00
bors
ed2ec819e9 Auto merge of #114054 - oli-obk:cleanups, r=estebank
Split some functions with many arguments into builder pattern functions

r? `@estebank`

This doesn't resolve all of the ones in rustc, mostly because I need to do other cleanups in order to be able to use some builder derives from crates.io

Works around https://github.com/rust-lang/rust/issues/90672 by making `x test rustfmt --bless` format itself instead of testing that it is formatted
2023-07-26 11:17:35 +00:00
bors
0d0dbae550 Auto merge of #11233 - Centri3:#11232, r=Jarcho
[`arc_with_non_send_sync`]: No longer lints macro-generated code

Fixes #11232

changelog: [`arc_with_non_send_sync`]: No longer lints macro-generated code
2023-07-26 03:26:10 +00:00
blyxyas
0404b6b6c2 Add sym::iter_mut + sym::as_mut_ptr 2023-07-25 23:33:08 +00:00
Catherine Flores
90947e95ad [arc_with_non_send_sync]: Check if it's macro-generated 2023-07-25 18:09:59 -05:00
Catherine
3235d9d612 Only lint Copy types 2023-07-25 17:51:05 -05:00
Catherine
978b1daf99 New lint [filter_map_bool_then] 2023-07-25 17:42:36 -05:00
bors
2153c0fcc8 Auto merge of #11226 - GuillaumeGomez:needless-ref-mut-cfg, r=llogiq
Needless ref mut cfg

Fixes https://github.com/rust-lang/rust-clippy/issues/11185.

cc `@Centri3`

changelog: Emit note if function is behind a cfg for `NEEDLESS_PASS_BY_REF_MUT` lint.
2023-07-25 19:00:59 +00:00
bors
70c5798993 Auto merge of #11198 - y21:issue10938, r=Centri3
[`slow_vector_initialization`]: catch `Vec::new()` followed by `.resize(len, 0)`

Closes #10938

changelog: [`slow_vector_initialization`]: catch `Vec::new()` followed by `.resize(len, 0)`
2023-07-25 17:23:01 +00:00
y21
c0484b74f7 simplify looking for Vec::with_capacity exprs 2023-07-25 18:56:57 +02:00
Guillaume Gomez
1c9772c773 Move inherits_cfg function into clippy_utils 2023-07-25 18:43:58 +02:00
y21
1fe2762900 use a dedicated enum for vec initializer 2023-07-25 18:21:00 +02:00
Guillaume Gomez
15de3dd2af Add a note if the function is behind a cfg 2023-07-25 18:08:16 +02:00
Oli Scherer
3fb714d828 Use a builder instead of boolean/option arguments 2023-07-25 13:51:15 +00:00
David Wood
a1473721b0 clippy: env! invocations can't be b"" literals
Signed-off-by: David Wood <david@davidtw.co>
2023-07-25 11:56:54 +01:00
bors
d09c8a9387 Auto merge of #11221 - Alexendoo:ui-test-text, r=flip1995
Remove Gha status emitter in compile-test

Disables the github specific output for now since it can be a bit confusing - https://github.com/oli-obk/ui_test/issues/109, in particular the truncation/repetition

r? `@flip1995`

changelog: none
2023-07-25 08:29:27 +00:00
Catherine Flores
ef482d17f2 Do not lint if used as a fn-like argument 2023-07-24 19:29:23 -05:00
bors
867e0ec024 Auto merge of #11218 - MrNossiom:master, r=Manishearth
changelog: [`min_ident_chars`]: don't lint const generics

Fixes: #11163

changelog: [`min_ident_chars`]: don't lint const generics
2023-07-24 21:26:56 +00:00
Alex Macleod
5c26e82d80 Remove Gha status emitter in compile-test 2023-07-24 18:29:11 +00:00
bors
31f37693e9 Auto merge of #11031 - Centri3:needless_return, r=giraffate
New lint [`needless_return_with_try`]

Closes #10902

Rather than having a config option, this will just suggest removing the "return"; if `try_err` is used as well, then it'll be added again but without the `?`.

changelog: New lint [`needless_return_with_try`]
2023-07-24 13:17:50 +00:00
Milo Moisson
82982133a9
changelog: [min_ident_chars]: don't lint const generics 2023-07-24 14:59:27 +02:00
bors
a447725394 Auto merge of #11215 - MrNossiom:master, r=Jarcho
ptr_arg should ignore extern functions

Fixes: #11181

changelog: [`ptr_arg`]: ignore extern functions that are not

I am not sure whether we should ignore other Rust calling conventions like `rust-intrinsic`, `rust-call` or `rust-cold`.
2023-07-24 00:01:48 +00:00
Milo Moisson
7b8598d6c0
ptr lint: check_mut_from_ref is checked independently of the function's ABI 2023-07-24 01:23:35 +02:00
bors
e4923c21c8 Auto merge of #10120 - smoelius:or_insert_with, r=blyxyas
`unwrap_or_else_default` -> `unwrap_or_default` and improve resulting lint

Resolves #10080 (though it doesn't implement exactly what's described there)

This PR does the following:
1. Merges `unwrap_or_else_default.rs`'s code into `or_fun_call.rs`
2. Extracts the code to handle `unwrap_or(/* default value */)` and similar, and moves it into `unwrap_or_else_default`
3. Implements the missing functionality from #9342, e.g.,, to handle `or_insert_with(Default::default)`
4. Renames `unwrap_or_else_default` to `unwrap_or_default` (since the "new" lint handles both `unwrap_or` and `unwrap_or_else`, it seemed sensible to use the shortened name)

This PR is currently two commits. The first implements 1-3, the second implements 4.

A word about 2: the `or_fun_call` lint currently produces warnings like the following:
```
error: use of `unwrap_or` followed by a call to `new`
  --> $DIR/or_fun_call.rs:56:14
   |
LL |     with_new.unwrap_or(Vec::new());
   |              ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
```
To me, such warnings look like they should come from `unwrap_or_else_default`, not `or_fun_call`, especially since `or_fun_call` is [in the nursery](https://github.com/rust-lang/rust-clippy/pull/9829).

---

changelog: Move: Renamed `unwrap_or_else_default` to [`unwrap_or_default`]
[#10120](https://github.com/rust-lang/rust-clippy/pull/10120)
changelog: Enhancement: [`unwrap_or_default`]: Now handles more functions, like `or_insert_with`
[#10120](https://github.com/rust-lang/rust-clippy/pull/10120)
<!-- changelog_checked-->
2023-07-23 20:28:07 +00:00
bors
a4e64ff375 Auto merge of #11166 - Jarcho:expr_use, r=Centri3
Refactor some of  `dereference.rs` to util functions

I've seen a few lints that need to be able to tell if changing the type of an expression would be a vaild suggestion. This extracts part of how that's done from `explicit_auto_deref`.

changelog: None
2023-07-23 18:27:48 +00:00
Milo Moisson
30d06a810c
ptr_arg should ignore extern functions 2023-07-23 17:10:13 +02:00