Commit Graph

326 Commits

Author SHA1 Message Date
许杰友 Jieyou Xu (Joe)
72b3b58efc
Extend unused_must_use to cover block exprs 2023-06-15 17:59:13 +08:00
许杰友 Jieyou Xu (Joe)
edafbaffb2
Adjust UI tests for unit_bindings
- Either explicitly annotate `let x: () = expr;` where `x` has unit
  type, or remove the unit binding to leave only `expr;` instead.
- Fix disjoint-capture-in-same-closure test
2023-06-12 20:24:48 +08:00
Nicky Lim
211376927d Update ui test 2023-06-11 18:27:26 +08:00
Deadbeef
1e36f7e9ae suspicious_double_ref_op: don't lint on .borrow() 2023-06-11 06:08:44 +00:00
Urgau
3e91349c42 Uplift improved version of clippy::cmp_nan to rustc 2023-06-10 11:12:55 +02:00
bors
d7ad9d9797 Auto merge of #111530 - Urgau:uplift_undropped_manually_drops, r=compiler-errors
Uplift `clippy::undropped_manually_drops` lint

This PR aims at uplifting the `clippy::undropped_manually_drops` lint.

## `undropped_manually_drops`

(warn-by-default)

The `undropped_manually_drops` lint check for calls to `std::mem::drop` with a value of `std::mem::ManuallyDrop` which doesn't drop.

### Example

```rust
struct S;
drop(std::mem::ManuallyDrop::new(S));
```

### Explanation

`ManuallyDrop` does not drop it's inner value so calling `std::mem::drop` will not drop the inner value of the `ManuallyDrop` either.

-----

Mostly followed the instructions for uplifting an clippy lint described here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751

`@rustbot` label: +I-lang-nominated
r? compiler

-----

For Clippy:

changelog: Moves: Uplifted `clippy::undropped_manually_drops` into rustc
2023-06-09 12:44:23 +00:00
Urgau
52300bf8d8 Uplift clippy::undropped_manually_drops to rustc 2023-06-08 11:41:34 +02:00
Matthias Krüger
38ddff516c
Rollup merge of #112343 - GuillaumeGomez:extern-crate-missing-docs, r=notriddle
Prevent emitting `missing_docs` for `pub extern crate`

Fixes #112308.

r? `@notriddle`
2023-06-06 22:00:20 +02:00
Guillaume Gomez
550fe634bf Add regression test for #112308 2023-06-06 11:50:24 +02:00
clubby789
1fa769234e Ensure space is inserted after keyword in unused_delims 2023-06-05 14:25:00 +00:00
yukang
b002c9ff11 remove type ascription feature gate 2023-06-03 09:22:47 +08:00
Urgau
5da606779c Uplift clippy::cast_ref_to_mut to rustc 2023-05-31 12:28:38 +02:00
Nilstrieb
7a4006cc52
Rollup merge of #111543 - Urgau:uplift_invalid_utf8_in_unchecked, r=WaffleLapkin
Uplift `clippy::invalid_utf8_in_unchecked` lint

This PR aims at uplifting the `clippy::invalid_utf8_in_unchecked` lint into two lints.

## `invalid_from_utf8_unchecked`

(deny-by-default)

The `invalid_from_utf8_unchecked` lint checks for calls to `std::str::from_utf8_unchecked` and `std::str::from_utf8_unchecked_mut` with an invalid UTF-8 literal.

### Example

```rust
unsafe {
    std::str::from_utf8_unchecked(b"cl\x82ippy");
}
```

### Explanation

Creating such a `str` would result in undefined behavior as per documentation for `std::str::from_utf8_unchecked` and `std::str::from_utf8_unchecked_mut`.

## `invalid_from_utf8`

(warn-by-default)

The `invalid_from_utf8` lint checks for calls to `std::str::from_utf8` and `std::str::from_utf8_mut` with an invalid UTF-8 literal.

### Example

```rust
std::str::from_utf8(b"ru\x82st");
```

### Explanation

Trying to create such a `str` would always return an error as per documentation for `std::str::from_utf8` and `std::str::from_utf8_mut`.

-----

Mostly followed the instructions for uplifting a clippy lint described here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751

````@rustbot```` label: +I-lang-nominated
r? compiler

-----

For Clippy:

changelog: Moves: Uplifted `clippy::invalid_utf8_in_unchecked` into rustc
2023-05-30 12:57:38 +02:00
Matthias Krüger
51cf1b62bc
Rollup merge of #111714 - cjgillot:lint-expect-confusion, r=wesleywiser
Stop confusing specification levels when computing expectations.

Fixes https://github.com/rust-lang/rust/issues/111682
2023-05-27 00:23:57 +02:00
Urgau
7f99c7d3e6 Add invalid_from_utf8 analogous to invalid_from_utf8_unchecked 2023-05-27 00:18:28 +02:00
Urgau
7f8846a9ef Uplift clippy::invalid_utf8_in_unchecked as invalid_from_utf8_unchecked 2023-05-27 00:16:47 +02:00
Michael Goulet
9d4527bc80
Rollup merge of #111757 - lowr:fix/lint-attr-on-match-arm, r=eholk
Consider lint check attributes on match arms

Currently, lint check attributes on match arms have no effect for some lints. This PR makes some lint passes to take those attributes into account.

- `LateContextAndPass` for late lint doesn't update `last_node_with_lint_attrs` when it visits match arms. This leads to lint check attributes on match arms taking no effects on late lints that operate on the arms' pattern:

  ```rust
  match value {
      #[deny(non_snake_case)]
      PAT => {} // `non_snake_case` only warned due to default lint level
  }
  ```

  To be honest, I'm not sure whether this is intentional or just an oversight. I've dug the implementation history and searched up issues/PRs but couldn't find any discussion on this.

- `MatchVisitor` doesn't update its lint level when it visits match arms. This leads to check lint attributes on match arms taking no effect on some lints handled by this visitor, namely: `bindings_with_variant_name` and `irrefutable_let_patterns`.

  This seems to be a fallout from #108504. Before 05082f57af, when the visitor operated on HIR rather than THIR, check lint attributes for the said lints were effective. [This playground][play] compiles successfully on current stable (1.69) but fails on current beta and nightly.

  I wasn't sure where best to place the test for this. Let me know if there's a better place.

[play]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=38432b79e535cb175f8f7d6d236d29c3
[play-match]: https://play.rust-lang.org/?version=beta&mode=debug&edition=2021&gist=629aa71b7c84b269beadeba664e2221d
2023-05-25 13:58:00 -07:00
Urgau
6b08a745a4 Rename forget_ref lint to forgetting_references 2023-05-21 14:28:09 +02:00
Urgau
c93d9c1794 Rename drop_ref lint to dropping_references 2023-05-21 14:16:41 +02:00
Urgau
85a1828943 Rename forget_copy lint to forgetting_copy_types 2023-05-21 14:09:03 +02:00
Urgau
1c7ab18c08 Rename drop_copy lint to dropping_copy_types 2023-05-21 13:37:32 +02:00
Dylan DPC
2294d81fb3
Rollup merge of #111491 - compiler-errors:nested-fut-must-use, r=wesleywiser
Dont check `must_use` on nested `impl Future` from fn

Fixes (but does not close, per beta policy) #111484

Also fixes a `FIXME` left in the code about (presumably) false-positives on non-async `#[must_use] fn() -> impl Future` cases, though if that's not desirable to include in the beta backport then I can certainly revert it.

Beta nominating as it fixes a beta ICE.
2023-05-20 12:20:58 +05:30
Ryo Yoshida
3a03587836
Consider lint check attributes on match arms in match checks 2023-05-19 19:04:15 +09:00
Ryo Yoshida
ddafe23401
Consider lint check attributes on match arms in late lints
Additionally add analogous test for early lints.
2023-05-19 19:04:10 +09:00
Camille GILLOT
f52db3ecaa Stop confusing specification levels when computing expectations. 2023-05-18 08:52:54 +00:00
bors
ad6ab11234 Auto merge of #111425 - Bryanskiy:privacy_ef, r=petrochenkov
Populate effective visibilities in `rustc_privacy` (take 2)

Same as https://github.com/rust-lang/rust/pull/110907 + regressions fixes.
Fixes https://github.com/rust-lang/rust/issues/111359.

r? `@petrochenkov`
2023-05-14 02:53:52 +00:00
Michael Goulet
926e874fd1 Dont check must_use on nested impl Future from fn 2023-05-12 02:08:43 +00:00
Bryanskiy
670f5b134e Populate effective visibilities in rustc_privacy 2023-05-11 14:51:01 +03:00
Urgau
e280df556d Add note to suggest using let _ = x to ignore the value 2023-05-10 19:36:02 +02:00
Urgau
d23f8957ae Improve warning message by saying that it "does nothing" 2023-05-10 19:36:02 +02:00
Urgau
457fa953a2 Use label instead of note to be more consistent with other lints 2023-05-10 19:36:02 +02:00
Urgau
971b9b23b5 Uplift clippy::forget_copy to rustc 2023-05-10 19:36:01 +02:00
Urgau
1ef9c163aa Uplift clippy::forget_ref to rustc 2023-05-10 19:36:01 +02:00
Urgau
156f5563c7 Uplift clippy::drop_copy to rustc 2023-05-10 19:36:01 +02:00
Urgau
28cdbc2a64 Uplift clippy::drop_ref to rustc 2023-05-10 19:36:01 +02:00
bors
04c53444df Auto merge of #111309 - saethlin:InstSimplify, r=scottmcm
Rename InstCombine to InstSimplify

```
╭ ➜ ben@archlinux:~/rust
╰ ➤ rg -i instcombine
src/doc/rustc-dev-guide/src/mir/optimizations.md
134:may have been misapplied. Examples of this are `InstCombine` and `ConstantPropagation`.

src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/llvm-config.sh
38:                    instcombine instrumentation interpreter ipo irreader lanai \

tests/codegen/slice_as_from_ptr_range.rs
4:// min-llvm-version: 15.0 (because this is a relatively new instcombine)
```

r? `@scottmcm`
2023-05-08 01:28:50 +00:00
Yuki Okushi
61115cd753
Rollup merge of #111150 - mj10021:issue-111025-fix, r=petrochenkov
added TraitAlias to check_item() for missing_docs

As in issue #111025 the `missing_docs` was not being triggered for trait aliases.  I added `TraitAlias` to the pattern match for check_item(), and the lint seems to be behaving appropriately
2023-05-07 14:12:15 +09:00
Ben Kimock
ff855547f4 Rename InstCombine to InstSimplify 2023-05-06 23:22:32 -04:00
James Dietz
fd005b06bb delete whitelist and add checks to check_item() for missing_docs
add test and bless
2023-05-06 18:31:50 -04:00
clubby789
9027d208f2 Check arguments length in trivial diagnostic lint 2023-05-06 14:42:35 +01:00
Dylan DPC
40c4ed4994
Rollup merge of #110955 - fee1-dead-contrib:sus-operation, r=compiler-errors
uplift `clippy::clone_double_ref` as `suspicious_double_ref_op`

Split from #109842.

r? ``@compiler-errors``
2023-05-02 11:44:52 +05:30
Matthias Krüger
1b262b8b56
Rollup merge of #110823 - compiler-errors:tweak-await-span, r=b-naber
Tweak await span to not contain dot

Fixes a discrepancy between method calls and await expressions where the latter are desugared to have a span that *contains* the dot (i.e. `.await`) but method call identifiers don't contain the dot. This leads to weird suggestions suggestions in borrowck -- see linked issue.

Fixes #110761

This mostly touches a bunch of tests to tighten their `await` span.
2023-05-01 01:09:47 +02:00
Matthias Krüger
791d33c5eb
Rollup merge of #110973 - bindsdev:packed-struct-ref-diagnostic-note, r=compiler-errors
improve error notes for packed struct reference diagnostic

Addresses #110199
2023-04-30 01:14:58 +02:00
bindsdev
107d480892 improve error notes for packed struct reference diagnostic 2023-04-28 20:28:56 -05:00
Lukas Markeffsky
69c71dacda fix false negative for unused_mut 2023-04-28 19:35:40 +02:00
Deadbeef
5c99175a9e uplift clippy::clone_double_ref as suspicious_double_ref_op 2023-04-28 17:24:48 +00:00
Michael Goulet
f0fc4f9acf Tweak await span 2023-04-27 17:18:11 +00:00
Michael Goulet
12a2f24b15 Remove a bunch of orphaned test files 2023-04-27 17:17:38 +00:00
bors
3462f79e94 Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillot
Run various queries from other queries instead of explicitly in phases

These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps.

This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
2023-04-23 13:34:31 +00:00
Oli Scherer
334423263a Run check_match and check_liveness when MIR is built instead of having an explicit phase for them 2023-04-21 22:32:38 +00:00
DrMeepster
a642563d49 major test improvements 2023-04-21 02:45:48 -07:00
DrMeepster
f92294f76b bless 2023-04-21 02:14:03 -07:00
DrMeepster
2bcb018253 fmt 2023-04-21 02:14:03 -07:00
DrMeepster
b92c2f792c fix incorrect param env in dead code lint 2023-04-21 02:14:03 -07:00
bors
8d09b8e206 Auto merge of #110370 - c410-f3r:dqewdas, r=petrochenkov
Move test files

r? `@petrochenkov`
2023-04-21 01:26:57 +00:00
Caio
4adc5f9281 Move test files 2023-04-20 15:06:17 -03:00
Ezra Shaw
8cad917e68
reimpl make non_upper_case_globals lint not report trait impls 2023-04-20 16:28:49 +12:00
Ezra Shaw
625619551d
make non_upper_case_globals lint not report trait impls 2023-04-19 12:47:35 +12:00
Matthias Krüger
06d12f668e
Rollup merge of #110257 - lukas-code:why-would-anyone-write-code-like-that-anyway, r=oli-obk
fix false positives for `unused_parens` around unary and binary operations

fix https://github.com/rust-lang/rust/issues/110251
2023-04-17 18:13:33 +02:00
Eric Huss
d7ed5a52ff Unignore closure-bang.
This test was ignored long ago in
https://github.com/rust-lang/rust/pull/20578/ when the syntax for
closures was changed.

The current status is that a closure with an explicit `!` return type
will trigger the `unreachable_code` lint which appears to be the
original intent of the test
(https://github.com/rust-lang/rust/pull/16836). A closure without a
return type won't trigger the lint since the `!` type isn't inferred
(AFAIK). This restores the test to its original form.
2023-04-15 14:43:20 -07:00
Lukas Markeffsky
0d0949d87f emit unused_parens for break if it is not immediately followed by a block 2023-04-13 18:09:47 +02:00
Lukas Markeffsky
8df1f41b9c fix false positives for unused_parens around unary and binary operations 2023-04-13 18:08:52 +02:00
Ezra Shaw
39e23ef532
impl reviewer feedback
- remove unused (pun intentional) `continue`
- improve wording with assoc items in general
2023-04-13 23:39:14 +12:00
Ezra Shaw
c41dcac8e8
dead-code-lint: de-dup multiple unused assoc fns 2023-04-13 22:42:47 +12:00
Ezra Shaw
03cf0e949f
refactor: emit "unused assoc fn" in lexical order
with repect to other dead code lints
2023-04-13 20:53:32 +12:00
bors
4087deaccd Auto merge of #110249 - matthiaskrgr:rollup-7iig04q, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #110153 (Fix typos in compiler)
 - #110165 (rustdoc: use CSS `overscroll-behavior` instead of JavaScript)
 - #110175 (Symbol cleanups)
 - #110203 (Remove `..` from return type notation)
 - #110205 (rustdoc: make settings radio and checks thicker, less contrast)
 - #110222 (Improve the error message when forwarding a matched fragment to another macro)
 - #110237 (Split out a separate feature gate for impl trait in associated types)
 - #110241 (tidy: Issue an error when UI test limits are too high)

Failed merges:

 - #110218 (Remove `ToRegionVid`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-12 20:01:36 +00:00
Oli Scherer
f263f88bea Split out a separate feature gate for impl trait in associated types 2023-04-12 16:17:31 +00:00
Matthias Krüger
49769260a3
Rollup merge of #110209 - JohnTitor:issue-59003, r=compiler-errors
Add regression test for #59003

Closes #59003
r? compiler-errors
2023-04-12 17:04:33 +02:00
Yuki Okushi
06ec5faccb
Add regression test for #59003
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-04-12 06:24:49 +09:00
Michael Goulet
4560b61cd1 Broken tests 2023-04-11 17:45:42 +00:00
Camille GILLOT
8528ac6e35 Do not suppress temporary_cstring_as_ptr in macros. 2023-04-04 18:55:02 +00:00
bors
35d06f9c74 Auto merge of #109599 - notriddle:notriddle/use-redundant-glob, r=petrochenkov
diagnostics: account for glob shadowing when linting redundant imports

Fixes #92904
2023-04-04 06:41:27 +00:00
Michael Howell
000e94e67d diagnostics: account for glob shadowing when linting redundant imports
Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2023-04-01 11:11:21 -07:00
Mu42
dde26b31b6 add run-rustfix 2023-03-29 09:56:28 +08:00
Michael Howell
2005e300c0 tests: make directory for use redundant lint 2023-03-25 09:23:05 -07:00
Mu001999
910a5ad2df Emits suggestions for expressions with parentheses or not separately 2023-03-25 01:00:49 +08:00
Mu42
6034b2fcb8 Use independent suggestions 2023-03-24 20:09:02 +08:00
Mu42
8e56c2c5f1 Suggest ..= when someone tries to create an overflowing range 2023-03-24 14:24:25 +08:00
Guillaume Gomez
e03b13ccb7 Update anonymous-reexport UI test 2023-03-22 16:05:20 +01:00
DaniPopes
8ca0f61fe3
fix ClashingExternDeclarations lint ICE 2023-03-20 00:50:03 +01:00
Dylan DPC
462e7e7a10
Rollup merge of #109003 - GuillaumeGomez:useless-anonymous-reexport-lint, r=cjgillot
Add `useless_anonymous_reexport` lint

This is a follow-up of https://github.com/rust-lang/rust/pull/108936. We once again show all anonymous re-exports in rustdoc, however we also wanted to add a lint to let users know that it very likely doesn't have the effect they think it has.
2023-03-19 15:33:57 +05:30
Matthias Krüger
36b82373e0
Rollup merge of #109158 - Ezrashaw:expand-sugg-for-unused-lint, r=Nilstrieb
error-msg: expand suggestion for `unused_def` lint

Fixes #108885

Expands `let _ = ..` suggestion into more positions.
2023-03-16 08:57:07 +01:00
Ezra Shaw
35103fe8ab
error-msg: expand suggestion for unused lint 2023-03-15 23:30:12 +13:00
yukang
b3af5e2f8b Fix #109152, fix the scenario that we may can not get span of func 2023-03-15 14:07:39 +08:00
Guillaume Gomez
7b0fa085b0 Update failing ui tests 2023-03-12 16:38:54 +01:00
Guillaume Gomez
ac4ea52980 Add test for useless_anonymous_reexport lint 2023-03-12 16:33:37 +01:00
Matthias Krüger
fbc121fdfd
Rollup merge of #104363 - WaffleLapkin:bonk_box_new, r=Nilstrieb
Make `unused_allocation` lint against `Box::new` too

Previously it only linted against `box` syntax, which likely won't ever be stabilized, which is pretty useless. Even now I'm not sure if it's a meaningful lint, but it's at least something 🤷

This means that code like the following will be linted against:
```rust
Box::new([1, 2, 3]).len();
f(&Box::new(1)); // where f : &i32 -> ()
```
The lint works by checking if a `Box::new` (or `box`) expression has an a borrow adjustment, meaning that the code that first stores the box in a variable won't be linted against:
```rust
let boxed = Box::new([1, 2, 3]); // no lint
boxed.len();
```
2023-03-11 15:43:11 +01:00
Albert Larsan
33d7fad7e5
Add regression test for 98444 2023-03-06 13:41:07 +00:00
Maybe Waffle
a90abd64fb Remove feature(box_syntax) from unused allocation list test 2023-03-03 19:02:35 +00:00
Maybe Waffle
ff5f784140 Add a test for unused_allocation lint
(how come we didn't have one already??)
2023-03-03 17:47:40 +00:00
Matthias Krüger
371904bba6
Rollup merge of #108297 - chenyukang:yukang/delim-error-exit, r=petrochenkov
Exit when there are unmatched delims to avoid noisy diagnostics

From https://github.com/rust-lang/rust/pull/104012#issuecomment-1311764832
r? ``@petrochenkov``
2023-03-01 01:20:22 +01:00
yukang
65ad5f8de7 remove duplicated diagnostic for unclosed delimiter 2023-02-28 07:57:17 +00:00
yukang
f01d0c02e7 Exit when there are unmatched delims to avoid noisy diagnostics 2023-02-28 07:55:19 +00:00
Obei Sideg
99344a8b32 Add ui test for E0271 error 2023-02-23 13:57:13 +03:00
Obei Sideg
b93d54556f Add ui test for map_unit_fn lint in closure case 2023-02-23 13:57:13 +03:00
Obei Sideg
ddd7d10879 Add ui test for map_unit_fn lint 2023-02-23 13:57:13 +03:00
bors
0978711950 Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, r=compiler-errors,davidtwco,estebank,oli-obk
diagnostics: if AssocFn has self argument, describe as method

Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515

This commit also changes the tooltips on rustdoc intra-doc links targeting methods.

For anyone not sure why this is being done, see the Reference definitions of these terms in <https://doc.rust-lang.org/1.67.1/reference/items/associated-items.html#methods>

> Associated functions whose first parameter is named `self` are called methods and may be invoked using the [method call operator](https://doc.rust-lang.org/1.67.1/reference/expressions/method-call-expr.html), for example, `x.foo()`, as well as the usual function call notation.

In particular, while this means it's technically correct for rustc to refer to a method as an associated function (and there are a few cases where it'll still do so), rustc *must never* use the term "method" to refer to an associated function that does not have a `self` parameter.
2023-02-23 00:19:12 +00:00
Michael Howell
3f374128ee diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
clubby789
c7a4f387fd Lint dead code in closures 2023-02-22 15:27:19 +00:00
Dylan DPC
4dea3a295f
Rollup merge of #108000 - y21:no-zero-init-for-uninhabited, r=jackh726
lint: don't suggest MaybeUninit::assume_init for uninhabited types

Creating a zeroed uninhabited type such as `!` or an empty enum with `mem::zeroed()` (or transmuting `()` to `!`) currently triggers this lint:
```rs
warning: the type `!` does not permit zero-initialization
 --> test.rs:5:23
  |
5 |         let _val: ! = mem::zeroed();
  |                       ^^^^^^^^^^^^^
  |                       |
  |                       this code causes undefined behavior when executed
  |                       help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
  |
  = note: the `!` type has no valid value
```
The `MaybeUninit` suggestion in the help message seems confusing/useless for uninhabited types, as such a type cannot be fully initialized in the first place (as the note implies).
This PR limits this help message to inhabited types which can be initialized
2023-02-21 14:19:58 +05:30
bors
21e5b941e0 Auto merge of #108128 - clubby789:builtin-derived-attr, r=jackh726
Properly check for builtin derived code

Fixes #108122
2023-02-19 21:18:07 +00:00
y21
0610df9314 lint: don't suggest assume_init for uninhabited types 2023-02-18 19:05:44 +01:00
clubby789
eebd31c187 Don't eagerly convert principal to string 2023-02-17 14:44:58 +00:00
clubby789
90f642bb3d Properly check for builtin derives 2023-02-16 19:44:03 +00:00
Michael Goulet
087a0136d0 Don't ICE in might_permit_raw_init if reference is polymorphic 2023-02-14 01:03:06 +00:00
Matthias Krüger
8fc9ed51f0
Rollup merge of #107043 - Nilstrieb:true-and-false-is-false, r=wesleywiser
Support `true` and `false` as boolean flag params

Implements [MCP 577](https://github.com/rust-lang/compiler-team/issues/577).
2023-02-10 06:09:56 +01:00
bors
044a28a409 Auto merge of #103761 - chenyukang:yukang/fix-103320-must-use, r=compiler-errors
Add explanatory message for [#must_use] in ops

Fixes #103320
2023-02-06 12:57:37 +00:00
Dylan DPC
d9db35785d
Rollup merge of #107539 - PossiblyAShrub:unused-parens-in-index, r=lcnr
Emit warnings on unused parens in index expressions

Fixes: #96606.

I am not sure what the best term for "index expression" is. Is there a better term we could use?
2023-02-03 23:04:51 +05:30
yukang
cb55d10eb2 Fix #103320, add explanatory message for [#must_use] 2023-02-04 00:27:03 +08:00
Aidan Olsen
c3a71ede7c Emit warnings on unused parens/braces in index expressions 2023-02-02 12:46:31 -07:00
Ralf Jung
dfc4a7b2d0 make unaligned_reference a hard error 2023-01-31 20:28:11 +01:00
Esteban Küber
62ba3e70a1 Modify primary span label for E0308
The previous output was unintuitive to users.
2023-01-30 20:12:19 +00:00
Camille GILLOT
0e52a671d4 Bless tests. 2023-01-27 20:10:17 +00:00
Camille GILLOT
9259da51ed Test the 3 generator handling versions for generator/async tests. 2023-01-27 18:58:13 +00:00
Aaron Hill
dc8876196b
Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS to future-incompat report 2023-01-21 14:38:25 -06:00
--global
734f375019 Change bindings_with_variant_name to deny-by-default 2023-01-20 02:26:12 -05:00
Nilstrieb
a6fda3ee7f Support true and false as boolean flag params
Implements MCP 577.
2023-01-18 20:46:36 +01:00
Dylan DPC
f91f369949
Rollup merge of #106148 - chenyukang:yukang/fix-105061-unused, r=lcnr
Fix unused_parens issue for higher ranked function pointers

fixes #105061

r? `@lcnr`
2023-01-17 20:33:03 +05:30
yukang
9d74bb832f comments feedback 2023-01-16 20:44:14 +08:00
clubby789
295f5483fe Fix regression in unused_braces with macros 2023-01-15 05:08:30 +00:00
yukang
644ee8d250 add test case for issue 105601 2023-01-14 17:11:05 +08:00
yukang
7d99866bfc fix #105061, Fix unused_parens issue for higher ranked function pointers 2023-01-14 17:11:04 +08:00
Matthias Krüger
c6e3a47843
Rollup merge of #106585 - estebank:issue-46585, r=compiler-errors
When suggesting writing a fully qualified path probe for appropriate types

Address the more common part of #46585.
2023-01-13 19:16:42 +01:00
Arthur Carcano
797f247997 Mark ZST as FFI-safe if all its fields are PhantomData
Modify the linting behavior and add the corresponding
regression test
2023-01-12 12:21:35 +01:00
Esteban Küber
12ddf77811 When suggesting writing a fully qualified path probe for appropriate types
Fix #46585.
2023-01-11 21:30:10 +00:00
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00