]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #5710 - lcnr:patch-1, r=flip1995
Philipp Krones [Tue, 23 Jun 2020 12:39:44 +0000 (14:39 +0200)]
Rollup merge of #5710 - lcnr:patch-1, r=flip1995

typo

changelog: none

4 years agoRollup merge of #5709 - ebroto:5389_ice, r=Manishearth
Philipp Krones [Tue, 23 Jun 2020 12:39:43 +0000 (14:39 +0200)]
Rollup merge of #5709 - ebroto:5389_ice, r=Manishearth

Fix ICE in consts::binop

changelog: Fix ICE in `consts::binop`

Fixes #5389

4 years agoRollup merge of #5705 - dtolnay:orpat, r=flip1995
Philipp Krones [Tue, 23 Jun 2020 12:39:42 +0000 (14:39 +0200)]
Rollup merge of #5705 - dtolnay:orpat, r=flip1995

Downgrade unnested_or_patterns to pedantic

Even with #5704 fixed, I don't believe it is a safe bet that if someone is using or-patterns anywhere in a codebase then they want to use it as much as possible in the whole codebase. I think it would be reasonable to reevaluate after the feature is stable. I feel that a warn-by-default lint suggesting use of an unstable feature, even if already being used in one place, is questionable.

changelog: Remove unnested_or_patterns from default set of enabled lints

4 years agoRollup merge of #5178 - matthiaskrgr:rustc_arg_pass, r=flip1995
Philipp Krones [Tue, 23 Jun 2020 12:39:40 +0000 (14:39 +0200)]
Rollup merge of #5178 - matthiaskrgr:rustc_arg_pass, r=flip1995

clippy-driver: pass all args to rustc if --rustc is present

changelog: clippy-driver: pass all args to rustc if --rustc is present

4 years agoAuto merge of #5739 - flip1995:rustup, r=flip1995
bors [Tue, 23 Jun 2020 12:04:08 +0000 (12:04 +0000)]
Auto merge of #5739 - flip1995:rustup, r=flip1995

Rustup

changelog: none

r? @ghost

4 years agoAuto merge of #5695 - esamudera:lint_mem_uninitialized, r=phansch,oli-obk
bors [Tue, 23 Jun 2020 05:14:21 +0000 (05:14 +0000)]
Auto merge of #5695 - esamudera:lint_mem_uninitialized, r=phansch,oli-obk

New lint: suggest `ptr::read` instead of `mem::replace(..., uninitialized())`

resolves: #5575

changelog: improvements to `MEM_REPLACE_WITH_UNINIT`:
- add a new test case in `tests/ui/repl_uninit.rs` to cover the case of replacing with `mem::MaybeUninit::uninit().assume_init()`.
- modify the existing `MEM_REPLACE_WITH_UNINIT` when replacing with `mem::uninitialized` to suggest using `ptr::read` instead.
- lint with `MEM_REPLACE_WITH_UNINIT` when replacing with `mem::MaybeUninit::uninit().assume_init()`

4 years agoRollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievink
Dylan DPC [Tue, 23 Jun 2020 01:16:22 +0000 (03:16 +0200)]
Rollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievink

Make is_freeze and is_copy_modulo_regions take TyCtxtAt

Make is_freeze and is_copy_modulo_regions take TyCtxtAt instead of separately taking TyCtxt and Span. This is consistent with is_sized.

4 years agoAuto merge of #5711 - flip1995:rustup, r=flip1995
bors [Tue, 23 Jun 2020 00:27:02 +0000 (00:27 +0000)]
Auto merge of #5711 - flip1995:rustup, r=flip1995

Rustup

changelog: none

4 years agoFix sync fallout
flip1995 [Tue, 23 Jun 2020 00:18:38 +0000 (02:18 +0200)]
Fix sync fallout

4 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Tue, 23 Jun 2020 00:18:17 +0000 (02:18 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

4 years agoStop using old version of `syn` in `rustc-workspace-hack`
Aaron Hill [Mon, 22 Jun 2020 17:29:04 +0000 (13:29 -0400)]
Stop using old version of `syn` in `rustc-workspace-hack`

None of the tools seem to need syn 0.15.35, so we can just build syn
1.0.

This was causing an issue with clippy's `compile-test` program: since
multiple versions of `syn` would exist in the build directory, we would
non-deterministically pick one based on filesystem iteration order. If
the pre-1.0 version of `syn` was picked, a strange build error would
occur (see
https://github.com/rust-lang/rust/pull/73594#issuecomment-647671463)

To prevent this kind of issue from happening again, we now panic if we
find multiple versions of a crate in the build directly, instead of
silently picking the first version we find.

4 years agoMake is_freeze and is_copy_modulo_regions take TyCtxtAt
Ralf Jung [Sun, 21 Jun 2020 09:20:48 +0000 (11:20 +0200)]
Make is_freeze and is_copy_modulo_regions take TyCtxtAt

4 years agoRefactor hir::Place
Aman Arora [Wed, 17 Jun 2020 22:13:05 +0000 (18:13 -0400)]
Refactor hir::Place

For the following code
```rust
let c = || bar(foo.x, foo.x)
```

We generate two different `hir::Place`s for both `foo.x`.
Handling this adds overhead for analysis we need to do for RFC 2229.

We also want to store type information at each Projection to support
analysis as part of the RFC. This resembles what we have for
`mir::Place`

This commit modifies the Place as follows:
- Rename to `PlaceWithHirId`, where there `hir_id` is that of the
expressioin.
- Move any other information that describes the access out to another
struct now called `Place`.
- Removed `Span`, it can be accessed using the [hir
API](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.span)
- Modify `Projection` to be a strucutre of its own, that currently only
contains the `ProjectionKind`.

Adding type information to projections wil be completed as part of https://github.com/rust-lang/project-rfc-2229/issues/5

Closes https://github.com/rust-lang/project-rfc-2229/issues/3

Co-authored-by: Aman Arora <me@aman-arora.com>
Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
4 years agomem_replace_with_uninit: suggest std::ptr::read
Ericko Samudera [Sun, 7 Jun 2020 17:44:14 +0000 (00:44 +0700)]
mem_replace_with_uninit: suggest std::ptr::read

4 years agoRollup merge of #72938 - lzutao:stabilize_option_zip, r=dtolnay
Ralf Jung [Mon, 15 Jun 2020 10:01:03 +0000 (12:01 +0200)]
Rollup merge of #72938 - lzutao:stabilize_option_zip, r=dtolnay

Stabilize Option::zip

This PR stabilizes the following API:

```rust
impl<T> Option<T> {
    pub fn zip<U>(self, other: Option<U>) -> Option<(T, U)>;
}
```

This API has real world usage as seen in <https://grep.app/search?q=-%3E%20Option%3C%5C%28T%2C%5Cs%3FU%5C%29%3E&regexp=true&filter[lang][0]=Rust>.

The `zip_with` method is left unstably as this API is kinda niche
and it hasn't received much usage in Rust repositories on GitHub.

cc #70086

4 years agoAuto merge of #72080 - matthewjasper:uniform-impl-trait, r=nikomatsakis
bors [Mon, 15 Jun 2020 04:10:24 +0000 (04:10 +0000)]
Auto merge of #72080 - matthewjasper:uniform-impl-trait, r=nikomatsakis

Clean up type alias impl trait implementation

- Removes special case for top-level impl trait
- Removes associated opaque types
- Forbid lifetime elision in let position impl trait. This is consistent with the behavior for inferred types.
- Handle lifetimes in type alias impl trait more uniformly with other parameters

cc #69323
cc #63063
Closes #57188
Closes #62988
Closes #69136
Closes #73061

4 years agotypo
Bastian Kauschke [Sat, 13 Jun 2020 10:42:58 +0000 (12:42 +0200)]
typo

4 years agoStabilize Option::zip
Lzu Tao [Sat, 13 Jun 2020 01:27:14 +0000 (01:27 +0000)]
Stabilize Option::zip

4 years agoFix ICE in consts::binop
Eduardo Broto [Fri, 12 Jun 2020 22:52:32 +0000 (00:52 +0200)]
Fix ICE in consts::binop

4 years agoRollup merge of #72906 - lzutao:migrate-numeric-assoc-consts, r=dtolnay
Dylan DPC [Fri, 12 Jun 2020 10:28:23 +0000 (12:28 +0200)]
Rollup merge of #72906 - lzutao:migrate-numeric-assoc-consts, r=dtolnay

Migrate to numeric associated consts

The deprecation PR is #72885

cc #68490
cc rust-lang/rfcs#2700

4 years agoRemove ImplItemKind::OpaqueTy from clippy
Matthew Jasper [Sun, 10 May 2020 14:05:06 +0000 (15:05 +0100)]
Remove ImplItemKind::OpaqueTy from clippy

4 years agoRemove associated opaque types
Matthew Jasper [Sun, 10 May 2020 11:15:51 +0000 (12:15 +0100)]
Remove associated opaque types

They're unused now.

4 years agoclippy-driver: fix test and add --rustc to --help output
Matthias Krüger [Tue, 9 Jun 2020 11:18:00 +0000 (13:18 +0200)]
clippy-driver: fix test and add --rustc to --help output

4 years agoadd test for compiler output when compiling with rustc/clippy-driver
Matthias Krüger [Sun, 7 Jun 2020 14:27:41 +0000 (16:27 +0200)]
add test for compiler output when compiling with rustc/clippy-driver

4 years agoadd test and remove debug print
Matthias Krüger [Tue, 2 Jun 2020 12:50:44 +0000 (14:50 +0200)]
add test and remove debug print

4 years agoclippy-driver: pass all args after "--rustc" to rustc.
Matthias Krüger [Sun, 31 May 2020 22:22:29 +0000 (00:22 +0200)]
clippy-driver: pass all args after "--rustc" to rustc.

4 years agoDowngrade unnested_or_patterns to pedantic
David Tolnay [Thu, 11 Jun 2020 02:29:11 +0000 (19:29 -0700)]
Downgrade unnested_or_patterns to pedantic

4 years agoClippy fixes
Aaron Hill [Wed, 10 Jun 2020 03:45:32 +0000 (23:45 -0400)]
Clippy fixes

4 years agoUpdate Clippy for MethodCall changes
Aaron Hill [Tue, 9 Jun 2020 21:44:04 +0000 (17:44 -0400)]
Update Clippy for MethodCall changes

4 years agoMigrate to numeric associated consts
Lzu Tao [Tue, 2 Jun 2020 07:59:11 +0000 (07:59 +0000)]
Migrate to numeric associated consts

4 years agoAuto merge of #5702 - ebroto:5698_mul_not_comm, r=matthiaskrgr
bors [Tue, 9 Jun 2020 22:19:24 +0000 (22:19 +0000)]
Auto merge of #5702 - ebroto:5698_mul_not_comm, r=matthiaskrgr

if_same_then_else: don't assume multiplication is always commutative

changelog: Don't assume multiplication is always commutative in [`if_same_then_else`]

Fixes #5698

4 years agoAdd a comment linking to the issue
Eduardo Broto [Tue, 9 Jun 2020 22:14:02 +0000 (00:14 +0200)]
Add a comment linking to the issue

4 years agoif_same_then_else: don't assume multiplication is always commutative
Eduardo Broto [Tue, 9 Jun 2020 21:49:21 +0000 (23:49 +0200)]
if_same_then_else: don't assume multiplication is always commutative

4 years agoAuto merge of #5279 - DevinR528:macro-use-sugg, r=flip1995
bors [Tue, 9 Jun 2020 20:49:27 +0000 (20:49 +0000)]
Auto merge of #5279 - DevinR528:macro-use-sugg, r=flip1995

Macro use sugg

changelog: Add auto applicable suggstion to macro_use_imports

fixes #5275

<s>Where exactly is the `wildcard_imports_helper` I haven't been able to import anything ex.
`use lazy_static;` or something like for that I get version/compiler conflicts?</s>
Found it.

Should we also check for `#[macro_use] extern crate`, although this is still depended on for stuff like `rustc_private`?

4 years agoAdd enough attrs to the test file so the fix compiles with no errors, fmt/`clippy`
Devin R [Sun, 7 Jun 2020 20:25:21 +0000 (16:25 -0400)]
Add enough attrs to the test file so the fix compiles with no errors, fmt/`clippy`

4 years agoMerge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippy
Lzu Tao [Tue, 9 Jun 2020 14:36:01 +0000 (14:36 +0000)]
Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippy

4 years agoFix suggestion output, add run-rustfix to test file, stop sorting import segments duh
Devin R [Sun, 7 Jun 2020 20:12:35 +0000 (16:12 -0400)]
Fix suggestion output, add run-rustfix to test file, stop sorting import segments duh

4 years agocleaned up import suggestion formatter, look into code reuse with wildcard impotrs
Devin R [Tue, 26 May 2020 23:57:36 +0000 (19:57 -0400)]
cleaned up import suggestion formatter, look into code reuse with wildcard impotrs

4 years agowip: of handling nested import paths for multi-macro paths
Devin R [Fri, 15 May 2020 12:36:56 +0000 (08:36 -0400)]
wip: of handling nested import paths for multi-macro paths

4 years agostill working on displaying nested imports
Devin R [Thu, 14 May 2020 22:20:07 +0000 (18:20 -0400)]
still working on displaying nested imports

4 years agofix some of the review, rename, fmt, refactor
Devin R [Sun, 10 May 2020 13:06:33 +0000 (09:06 -0400)]
fix some of the review, rename, fmt, refactor

4 years agoremove session
Devin R [Tue, 24 Mar 2020 02:13:35 +0000 (22:13 -0400)]
remove session

4 years agouse hashset not map for keeping track of seen macro refs
Devin R [Fri, 13 Mar 2020 22:54:32 +0000 (18:54 -0400)]
use hashset not map for keeping track of seen macro refs

remove stdout, fix clippy warnings, fmtcar

4 years agocollected all the imports and names
Devin R [Wed, 4 Mar 2020 12:59:10 +0000 (07:59 -0500)]
collected all the imports and names

how to compare macro to import path

add more imports to test

4 years agowarn on macro_use attr
Devin R [Wed, 26 Feb 2020 12:40:31 +0000 (07:40 -0500)]
warn on macro_use attr

cargo dev update lints

use if_chain

clean up alot, span_lint_and_sugg

find imported macros for sugg

4 years agoAuto merge of #5692 - ebroto:5689_N_dotdot_N, r=yaahc
bors [Mon, 8 Jun 2020 17:15:45 +0000 (17:15 +0000)]
Auto merge of #5692 - ebroto:5689_N_dotdot_N, r=yaahc

reversed_empty_ranges: avoid linting N..N except in for loop arguments

changelog: [`reversed_empty_ranges`]: avoid linting N..N except in for loop arguments

r? @yaahc
Fixes #5689

4 years agoAuto merge of #5680 - ebroto:3792_let_return, r=Manishearth
bors [Mon, 8 Jun 2020 16:47:22 +0000 (16:47 +0000)]
Auto merge of #5680 - ebroto:3792_let_return, r=Manishearth

let_and_return: avoid "does not live long enough" errors

EDIT: Add #3324 to the list of fixes

<details>
<summary>Description of old impl</summary>
<br>
Avoid suggesting turning the RHS expression of the last statement into the block tail expression if a temporary borrows from a local that would be destroyed before.

This is my first incursion into MIR so there's probably room for improvement!
</details>

Avoid linting if the return type of some method or function called in the last statement has a lifetime parameter.

changelog: Fix false positive in [`let_and_return`]

Fixes #3792
Fixes #3324

4 years agoAuto merge of #5378 - Centril:unnested-or-pats, r=flip1995,phansch
bors [Mon, 8 Jun 2020 13:49:29 +0000 (13:49 +0000)]
Auto merge of #5378 - Centril:unnested-or-pats, r=flip1995,phansch

New lint: `unnested_or_patterns`

changelog: Adds a lint `unnested_or_patterns`, suggesting `Some(0 | 2)` as opposed to `Some(0) | Some(2)`. The lint only fires on compilers capable of using `#![feature(or_patterns)]`.

- The lint is primarily encoded as a pure algorithm which to unnest or-patterns in an `ast::Pat` (`fn unnest_or_patterns`) through a `MutVisitor`. After that is done, and assuming that any change was detected, then `pprust::pat_to_string` is used to simply convert the transformed pattern into a suggestion.

- The PR introduces a module `utils::ast_utils` with a bunch of functions for spanless & nodeless equality comparisons of ASTs.

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

4 years agoFix rebase fallout
flip1995 [Sun, 7 Jun 2020 19:33:03 +0000 (21:33 +0200)]
Fix rebase fallout

4 years agoApply self-review by Centril
flip1995 [Sun, 7 Jun 2020 14:43:17 +0000 (16:43 +0200)]
Apply self-review by Centril

4 years agosplit unnested_or_patterns test
Mazdak Farrokhzad [Sat, 28 Mar 2020 12:08:57 +0000 (13:08 +0100)]
split unnested_or_patterns test

4 years agodogfood unnested_or_patterns
Mazdak Farrokhzad [Sat, 28 Mar 2020 10:45:13 +0000 (11:45 +0100)]
dogfood unnested_or_patterns

4 years agoRemove unnecessary lifetime parameter
Eduardo Broto [Sun, 7 Jun 2020 19:13:13 +0000 (21:13 +0200)]
Remove unnecessary lifetime parameter

4 years agoadd `unnested_or_patterns` lint
Mazdak Farrokhzad [Thu, 19 Mar 2020 13:14:52 +0000 (14:14 +0100)]
add `unnested_or_patterns` lint

4 years agoreversed_empty_ranges: don't lint N..N except in for loop arg
Eduardo Broto [Sun, 7 Jun 2020 18:38:28 +0000 (20:38 +0200)]
reversed_empty_ranges: don't lint N..N except in for loop arg

4 years agolet_and_return: do not lint if last statement borrows
Eduardo Broto [Sat, 6 Jun 2020 22:30:39 +0000 (00:30 +0200)]
let_and_return: do not lint if last statement borrows

4 years agoRename let_and_return test for consistency with the lint name
Eduardo Broto [Sat, 6 Jun 2020 19:51:41 +0000 (21:51 +0200)]
Rename let_and_return test for consistency with the lint name

4 years agoMake let_and_return a late lint pass
Eduardo Broto [Tue, 2 Jun 2020 23:13:57 +0000 (01:13 +0200)]
Make let_and_return a late lint pass

4 years agoAuto merge of #5691 - flip1995:rustup, r=matthiaskrgr
bors [Sun, 7 Jun 2020 12:55:08 +0000 (12:55 +0000)]
Auto merge of #5691 - flip1995:rustup, r=matthiaskrgr

Rustup

changelog: none

4 years agoTemporarily disable RLS integration test
flip1995 [Sun, 7 Jun 2020 12:54:21 +0000 (14:54 +0200)]
Temporarily disable RLS integration test

4 years agoRustup to rust-lang/rust#71796
flip1995 [Sun, 7 Jun 2020 01:07:48 +0000 (03:07 +0200)]
Rustup to rust-lang/rust#71796

4 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Sun, 7 Jun 2020 00:17:49 +0000 (02:17 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

4 years agoRollup merge of #72508 - ecstatic-morse:poly-self-ty, r=nikomatsakis
Ralf Jung [Sat, 6 Jun 2020 19:57:38 +0000 (21:57 +0200)]
Rollup merge of #72508 - ecstatic-morse:poly-self-ty, r=nikomatsakis

Make `PolyTraitRef::self_ty` return `Binder<Ty>`

This came up during review of #71618. The current implementation is the same as a call to `skip_binder` but harder to audit. Make it preserve binding levels and add a call to `skip_binder` at all use sites so they can be audited as part of #72507.

4 years agoAuto merge of #5674 - ThibsG:DocTypeDefinesMethod, r=yaahc,phansch,flip1995
bors [Sat, 6 Jun 2020 10:32:02 +0000 (10:32 +0000)]
Auto merge of #5674 - ThibsG:DocTypeDefinesMethod, r=yaahc,phansch,flip1995

Add doc for checking if type defines specific method

This PR adds documentation on how:
- check if a type defines a specific method
- check an expr is calling a specific method

closes: #3843

changelog: none

4 years agoAuto merge of #5528 - phansch:same-tys, r=flip1995
bors [Sat, 6 Jun 2020 10:04:21 +0000 (10:04 +0000)]
Auto merge of #5528 - phansch:same-tys, r=flip1995

Cleanup: Use rustc's `same_type` for our `same_tys`

This delegates our `same_tys` to [ty::TyS::same_type][same_type] to
remove some duplication.

Our `same_tys` was introduced 4 years ago in #730. Before, it was
building an inference context to be able to call
`can_eq` to compare the types. The `rustc-dev-guide` has some more details
about `can_eq` in [Type Inference -> Trying equality][try_eq].

Now, using the rustc function, we are essentially comparing the `DefId`s
of the given types, which also makes more sense, IMO.

I also confirmed that the FIXME is resolved via a bit of `dbg!`, however
no UI tests seem to have been affected.

[same_type]: https://github.com/rust-lang/rust/blob/659951c4a0d7450e43f61c61c0e87d0ceae17087/src/librustc_middle/ty/util.rs#L777
[try_eq]: https://rustc-dev-guide.rust-lang.org/type-inference.html#trying-equality

---

changelog: none

4 years agoCleanup: Use rustc's `same_types` instead of our `same_tys`
Philipp Hansch [Sat, 6 Jun 2020 09:50:59 +0000 (11:50 +0200)]
Cleanup: Use rustc's `same_types` instead of our `same_tys`

4 years agoAuto merge of #72927 - petrochenkov:rustc, r=Mark-Simulacrum
bors [Sat, 6 Jun 2020 09:00:51 +0000 (09:00 +0000)]
Auto merge of #72927 - petrochenkov:rustc, r=Mark-Simulacrum

Rename all remaining compiler crates to use the `rustc_foo` pattern

libarena -> librustc_arena
libfmt_macros -> librustc_parse_format
libgraphviz -> librustc_graphviz
libserialize -> librustc_serialize

Closes https://github.com/rust-lang/rust/issues/71177 in particular.

4 years agoAuto merge of #5688 - ebroto:fix_cargo_tests_in_rustc, r=flip1995
bors [Fri, 5 Jun 2020 21:59:37 +0000 (21:59 +0000)]
Auto merge of #5688 - ebroto:fix_cargo_tests_in_rustc, r=flip1995

Fix cargo tests when running inside the rustlang/rust repo

It seems we hit https://github.com/rust-lang/cargo/issues/5418, so I've applied the suggested solution. Also added some more info when cargo-metadata fails to execute.

(there was no open issue for this)

changelog: none

4 years agoFix cargo ui tests when running inside rust repo
Eduardo Broto [Fri, 5 Jun 2020 20:30:14 +0000 (22:30 +0200)]
Fix cargo ui tests when running inside rust repo

4 years agoAdd error info when cargo metadata fails to run
Eduardo Broto [Fri, 5 Jun 2020 20:28:58 +0000 (22:28 +0200)]
Add error info when cargo metadata fails to run

4 years agoAuto merge of #5687 - flip1995:release_doc, r=phansch
bors [Fri, 5 Jun 2020 13:34:19 +0000 (13:34 +0000)]
Auto merge of #5687 - flip1995:release_doc, r=phansch

Replace all remaining occurrences of submodule with subtree

r? @phansch

I should have included this in #5686, but forgot about it, so here we go again.

changelog: none

4 years agoReplace all remaining occurrences of submodule with subtree
flip1995 [Fri, 5 Jun 2020 12:47:12 +0000 (14:47 +0200)]
Replace all remaining occurrences of submodule with subtree

4 years agoAuto merge of #5671 - ebroto:changelog_144_145, r=flip1995
bors [Fri, 5 Jun 2020 12:52:23 +0000 (12:52 +0000)]
Auto merge of #5671 - ebroto:changelog_144_145, r=flip1995

Update changelog for stable:1.44 beta:1.45

[Rendered](https://github.com/ebroto/rust-clippy/blob/changelog_144_145/CHANGELOG.md)

changelog: none

4 years agoAuto merge of #5686 - flip1995:release_doc, r=phansch
bors [Fri, 5 Jun 2020 12:23:13 +0000 (12:23 +0000)]
Auto merge of #5686 - flip1995:release_doc, r=phansch

Reorder sections of release documentation

r? @phansch

[Rendered](https://github.com/flip1995/rust-clippy/blob/release_doc/doc/release.md)

changelog: none

4 years agoReorder sections of release documentation
flip1995 [Fri, 5 Jun 2020 11:56:07 +0000 (13:56 +0200)]
Reorder sections of release documentation

Before tagging a commit the beta branch has to be remerged

4 years agoAuto merge of #5685 - flip1995:backport_remerge, r=flip1995
bors [Fri, 5 Jun 2020 11:52:27 +0000 (11:52 +0000)]
Auto merge of #5685 - flip1995:backport_remerge, r=flip1995

Backport remerge

Part of the release process. Nothing to see here (literally).

d4092ac matches the current HEAD of the beta branch

changelog: none

4 years agoMerge remote-tracking branch 'upstream/beta' into backport_remerge
flip1995 [Fri, 5 Jun 2020 11:50:53 +0000 (13:50 +0200)]
Merge remote-tracking branch 'upstream/beta' into backport_remerge

4 years agoAuto merge of #5681 - matthiaskrgr:empty_line, r=phansch
bors [Thu, 4 Jun 2020 09:23:44 +0000 (09:23 +0000)]
Auto merge of #5681 - matthiaskrgr:empty_line, r=phansch

match_wildcard_for_single_variants: remove empty line at start of lint example.

See https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

changelog: none

4 years agomatch_wildcard_for_single_variants: remove empty line at start of lint example.
Matthias Krüger [Thu, 4 Jun 2020 01:34:22 +0000 (03:34 +0200)]
match_wildcard_for_single_variants: remove empty line at start of lint example.

See https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

changelog: none

4 years agoBump to 1.46
Mark Rousskov [Wed, 3 Jun 2020 19:15:53 +0000 (15:15 -0400)]
Bump to 1.46

4 years agoAuto merge of #5677 - lzutao:checked_conv, r=matthiaskrgr
bors [Wed, 3 Jun 2020 16:06:39 +0000 (16:06 +0000)]
Auto merge of #5677 - lzutao:checked_conv, r=matthiaskrgr

 Fix false negative of `checked_conversion` lint

Closes  #5675
changelog: none

4 years agoFix false negative of checked_conversion lint
Lzu Tao [Wed, 3 Jun 2020 02:04:24 +0000 (09:04 +0700)]
Fix false negative of checked_conversion lint

4 years agoUpdate fulldeps tests and clippy
Vadim Petrochenkov [Tue, 2 Jun 2020 19:46:42 +0000 (22:46 +0300)]
Update fulldeps tests and clippy

4 years agoApply suggestions from PR review
Eduardo Broto [Tue, 2 Jun 2020 18:45:57 +0000 (20:45 +0200)]
Apply suggestions from PR review

4 years agoRename the crates in source code
Vadim Petrochenkov [Tue, 2 Jun 2020 17:19:49 +0000 (20:19 +0300)]
Rename the crates in source code

4 years agoAuto merge of #5678 - lzutao:slice, r=flip1995
bors [Tue, 2 Jun 2020 16:42:51 +0000 (16:42 +0000)]
Auto merge of #5678 - lzutao:slice, r=flip1995

Make use of slice pattern

changelog: none

4 years agoMake use of slice pattern
Lzu Tao [Tue, 2 Jun 2020 14:42:33 +0000 (21:42 +0700)]
Make use of slice pattern

4 years agoAuto merge of #5672 - phansch:regression-test-env, r=yaahc
bors [Tue, 2 Jun 2020 12:40:20 +0000 (12:40 +0000)]
Auto merge of #5672 - phansch:regression-test-env, r=yaahc

Add regression test for `string_lit_as_bytes` issue

Closes #5619

Before the fix in https://github.com/rust-lang/rust/pull/72637, `string_lit_as_bytes` was incorrectly triggering on the `env!` macro. With the fix merged, this test makes sure that the lint is not triggering anymore.

changelog: none

4 years agoAuto merge of #5664 - ThibsG:GiveCorrectedCode, r=flip1995
bors [Tue, 2 Jun 2020 12:11:28 +0000 (12:11 +0000)]
Auto merge of #5664 - ThibsG:GiveCorrectedCode, r=flip1995

Give corrected code

This PR adds corrected code for doc examples.

I did this in several commits to facilitate review.
Don't hesitate to tell me if I forgot some.
Also, sometimes I felt it was not necessary to give corrected code, but I maybe wrong.

fixes: #4829

changelog: Improve documentation examples across multiple lints.

4 years agoAuto merge of #5597 - esamudera:slice_iter_next, r=flip1995
bors [Tue, 2 Jun 2020 11:42:22 +0000 (11:42 +0000)]
Auto merge of #5597 - esamudera:slice_iter_next, r=flip1995

New lint: iter_next_slice

Hello, this is a work-in-progress PR for issue: https://github.com/rust-lang/rust-clippy/issues/5572

I have implemented lint to replace `iter().next()` for `slice[index..]` and `array` with `get(index)` and `get(0)` respectively. However since I made a lot of changes, I would like to request some feedback before continuing so that I could fix mistakes.

Thank you!

---

changelog: implement `iter_next_slice` lint and test, and modify `needless_continues`, `for_loop_over_options_result` UI tests since they have `iter().next()`

4 years agoCall `skip_binder` or `no_bound_vars` before `self_ty`
Dylan MacKenzie [Sat, 23 May 2020 18:12:06 +0000 (11:12 -0700)]
Call `skip_binder` or `no_bound_vars` before `self_ty`

4 years agoUpdate documentation on changelog updates
Eduardo Broto [Mon, 1 Jun 2020 07:26:40 +0000 (09:26 +0200)]
Update documentation on changelog updates

4 years agoAuto merge of #5673 - phansch:endless-loop, r=Manishearth
bors [Mon, 1 Jun 2020 17:16:06 +0000 (17:16 +0000)]
Auto merge of #5673 - phansch:endless-loop, r=Manishearth

Add regression test for endless loop / update `pulldown_cmark`

Closes #4917

This was fixed in pulldown_cmark 0.7.1, specifically raphlinus/pulldown-cmark#438

changelog: none

4 years agoAdd doc for checking if type defines certain method
ThibsG [Sun, 31 May 2020 13:09:58 +0000 (15:09 +0200)]
Add doc for checking if type defines certain method

4 years agoCorrected doc PR fixes
ThibsG [Mon, 1 Jun 2020 08:16:01 +0000 (10:16 +0200)]
Corrected doc PR fixes

4 years agoAdd more corrected code for doc
ThibsG [Sun, 31 May 2020 10:08:41 +0000 (12:08 +0200)]
Add more corrected code for doc

4 years agoGive more corrected code examples in doc
ThibsG [Sun, 31 May 2020 09:38:48 +0000 (11:38 +0200)]
Give more corrected code examples in doc

4 years agoFix more code examples
ThibsG [Fri, 29 May 2020 16:15:42 +0000 (18:15 +0200)]
Fix more code examples

4 years agoFix some code examples in doc
ThibsG [Wed, 27 May 2020 14:24:53 +0000 (16:24 +0200)]
Fix some code examples in doc

4 years agoAdd regression test for endless loop
Philipp Hansch [Mon, 1 Jun 2020 08:20:17 +0000 (10:20 +0200)]
Add regression test for endless loop

This was fixed in pulldown_cmark 0.7.1, specifically
https://github.com/raphlinus/pulldown-cmark/pull/438