Commit Graph

125169 Commits

Author SHA1 Message Date
Matthias Krüger
6b0a6a70f8 default-trait-access: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger
3d592b5154 cmp_null: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger
8679dd375b unnecessary_unwrap, panicking_unwrap: make lints adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger
9b7ab1d38b checked-conversions: make lint adhere to lint message convention 2020-08-10 23:48:57 +02:00
bors
770bd3d1d0 Auto merge of #75349 - nnethercote:tweak-confusable-idents-checking, r=petrochenkov
Tweak confusable idents checking

The confusable idents checking does some sub-optimal things with symbols.

r? @petrochenkov
cc @crlf0710
2020-08-10 21:47:29 +00:00
Eduardo Broto
5d66bd7bb3 Avoid or_fun_call for const_fn with no args 2020-08-10 23:38:58 +02:00
Denis Vasilik
eea85814e1 Use intra-doc links 2020-08-10 23:16:01 +02:00
Denis Vasilik
f260462c32 Remove links that are in scope 2020-08-10 23:14:43 +02:00
Mark Rousskov
6bbf4558ac Feature gate is always present 2020-08-11 00:08:04 +03:00
Vadim Petrochenkov
20c5044465 Introduce rustc_lexer::is_ident and use it in couple of places 2020-08-11 00:08:04 +03:00
bors
d495ef527c Auto merge of #75127 - jyn514:impl-trait, r=pnkfelix
Fix async-std by special-casing rustdoc in typeck

https://github.com/rust-lang/rust/issues/75100
2020-08-10 19:33:25 +00:00
Alexis Bourget
a6e492b5db Move to doc links inside the prelude 2020-08-10 21:09:37 +02:00
Esteban Küber
54f1b43130 Add missing primary label 2020-08-10 12:04:10 -07:00
Esteban Küber
6c0755a7dc Point at item definition in foreign crates 2020-08-10 12:04:10 -07:00
Esteban Küber
089810a1cb Do not suggest similarly named enclosing item 2020-08-10 12:04:10 -07:00
Esteban Küber
eef284be59 Tweak ordering of suggestions
Modify logic to make it easier to follow and recover labels that would
otherwise be lost.
2020-08-10 12:04:10 -07:00
Alexis Bourget
26792a65cd Move to doc links inside std/time.rs 2020-08-10 21:01:58 +02:00
Matthias Krüger
40416c0fa8 naive_bytecount: make lint adhere to lint message convention 2020-08-10 20:55:23 +02:00
Matthias Krüger
fd379a889e builtin-type-shadow: make lint adhere to lint message convention 2020-08-10 20:55:23 +02:00
Matthias Krüger
0876f17d77 bool-comparison: make lint adhere to lint message convention 2020-08-10 20:55:23 +02:00
Matthias Krüger
e57aafe33f too-many-lines: make lint adhere to lint message convention 2020-08-10 20:55:23 +02:00
Denis Vasilik
d7e7271085 Remove AsRef link as it is in the prelude 2020-08-10 20:29:20 +02:00
bors
4113453202 Auto merge of #5887 - robojumper:patch-1, r=flip1995
Fix CHANGELOG's commit range links

Two most recent links linked to the wrong range

changelog: none
2020-08-10 17:51:37 +00:00
bors
1275cc15d6 Auto merge of #74936 - GuillaumeGomez:const-rustc_const_unstable, r=jyn514
Don't print "const" keyword on non-nightly build if rustc_const_unstable is used on the item

Fixes #74579.
2020-08-10 17:12:42 +00:00
Ivan Tham
a7f61bf3bb
Remove empty fn main from E0749 2020-08-11 01:06:30 +08:00
robojumper
82c816ee02
Fix CHANGELOG's commit range links
Two most recent links linked to the wrong range

changelog: none
2020-08-10 17:45:04 +02:00
bors
08324fe6f7 Auto merge of #74953 - JulianKnodt:master, r=lcnr
Remove restriction on type parameters preceding consts w/ feature const-generics

Removed the restriction on type parameters preceding const parameters when the feature const-generics is enabled.

Builds on #74676, which deals with unsorted generic parameters. This just lifts the check in lowering the AST to HIR that permits consts and types to be reordered with respect to each other. Lifetimes still must precede both

This change is not intended for min-const-generics, and is gated behind the `#![feature(const_generics)]`.

One thing is that it also permits type parameters without a default to come after consts, which I expected to not work, and was hoping to get more guidance on whether that should be permitted or how to prevent it otherwise.

I did not go through the RFC process for this pull request because there was prior work to get this feature added. In the previous PR that was cited, work was done to enable this change.

r? @lcnr
2020-08-10 15:19:46 +00:00
Guillaume Gomez
2a281e0a76 Add test for rustc_const_unstable on methods 2020-08-10 16:57:25 +02:00
Guillaume Gomez
a34bc7961a Add help button 2020-08-10 16:52:19 +02:00
Ivan Tham
8cb1a2f8a2
Use : rather than . in example description
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2020-08-10 22:46:15 +08:00
Ivan Tham
a2d7c33aa8
Split fix into another section for E0749 2020-08-10 22:33:17 +08:00
bors
c576bedc41 Auto merge of #5883 - flip1995:rollup-x9mftxe, r=flip1995
Rollup of 5 pull requests

Successful merges:

 - #5825 (Add the new lint `same_item_push`)
 - #5869 (New lint against `Self` as an arbitrary self type)
 - #5870 (enable #[allow(clippy::unsafe_derive_deserialize)])
 - #5871 (Lint .min(x).max(y) with x < y)
 - #5874 (Make the docs clearer for new contributors)

Failed merges:

r? @ghost

changelog: rollup
2020-08-10 13:02:53 +00:00
bors
4c336d4626 Auto merge of #75357 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/75274
Cc @rust-lang/miri r? @ghost
2020-08-10 13:01:44 +00:00
Philipp Krones
7f6897c7a3
Rollup merge of #5874 - camelid:patch-1, r=flip1995
Make the docs clearer for new contributors

It confused me before, so I made it extra obvious that you need to run
a script to set up your toolchain before you can build Clippy.

I also added a note so that new contributors aren't confused when
Clippy doesn't build as a result of a change in rustc's internals.

changelog: make `CONTRIBUTING.md` clearer for new contributors
2020-08-10 14:56:30 +02:00
Philipp Krones
ee8db50e13
Rollup merge of #5871 - wiomoc:feature/methodcall-minmax, r=flip1995
Lint .min(x).max(y) with x < y

Fixes  #5854

changelog: Also lint `ord.min(a).max(b)`, where `a < b` in [`min_max`] lint
2020-08-10 14:56:29 +02:00
Philipp Krones
08ab29bed1
Rollup merge of #5870 - ebroto:5789_allow_unsafe_derive_deserialize, r=flip1995
enable #[allow(clippy::unsafe_derive_deserialize)]

Before this change this lint could not be allowed as the code we are checking is automatically generated.

changelog: Enable using the `allow` attribute on top of an ADT linted by [`unsafe_derive_deserialize`].

Fixes: #5789
2020-08-10 14:56:27 +02:00
Philipp Krones
8ee57eed79
Rollup merge of #5869 - wiomoc:feature/implicit-self, r=ebroto,flip1995
New lint against `Self` as an arbitrary self type

Fixes #5861

changelog: * [`needless_arbitrary_self_type`] [#5869](https://github.com/rust-lang/rust-clippy/pull/5869)
2020-08-10 14:56:26 +02:00
Philipp Krones
9da5b6d1d0
Rollup merge of #5825 - giraffate:same_item_push, r=Manishearth
Add the new lint `same_item_push`

changelog: Add the new lint `same_item_push`

Fixed #4078. As I said in https://github.com/rust-lang/rust-clippy/issues/4078#issuecomment-658184195, I referrerd to https://github.com/rust-lang/rust-clippy/pull/4647.
2020-08-10 14:56:25 +02:00
David Wood
20f4e16824
polymorphize: constrain unevaluated const handling
This commit constrains the support added for handling unevaluated consts
in polymorphization (introduced in #75260) by:

- Skipping associated constants as this causes cycle errors.
- Skipping promoted constants when they contain `Self` as this ensures
  `T` is used in constants of the form `<Self as Foo<T>>`.

Signed-off-by: David Wood <david@davidtw.co>
2020-08-10 13:23:19 +01:00
Aaron Hill
4ed0c6a464
Use existing infcx when emitting trait impl diagnostic
Fixes #75361
Fixes #74918

Previously, we were creating a new `InferCtxt`, which caused an ICE when
used with type variables from the existing `InferCtxt`
2020-08-10 08:08:15 -04:00
Ivan Tham
ec23f4ed3f
Add sample fix for E0749
Even though the description is clear but the solution may not be as straightforward.
Adding a suggested fix.
2020-08-10 18:51:14 +08:00
Bastian Kauschke
66db8e52d7 unused_delims: trim expr 2020-08-10 12:04:51 +02:00
Erin Power
bf4be5de52 Update RELEASES.md for 1.46.0
Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com>
Co-authored-by: Lonami <totufals@hotmail.com>
2020-08-10 11:48:59 +02:00
Ralf Jung
fd3851aadb add test for unused erroneous const in CTFE 2020-08-10 10:58:53 +02:00
Ralf Jung
26ec7e9dd9 update Miri 2020-08-10 10:06:23 +02:00
kadmin
64f6437822 Convert Eq impl to check Ord::Equal 2020-08-10 05:54:55 +00:00
bors
13290e83a6 Auto merge of #75204 - cuviper:freebsd11, r=Mark-Simulacrum
Upgrade the FreeBSD toolchain to version 11.4

FreeBSD 10 reached its end-of-life in October 2018, and that toolchain
caused issues in the LLVM 11 upgrade (#73526) that are resolved with the
toolchain from FreeBSD 11.

Closes #72390.
2020-08-10 05:34:53 +00:00
bors
568f6195bb Auto merge of #74410 - mati865:mingw-no-self-contained-when-cross-compiling, r=petrochenkov
MinGW: disable self-contained mode when cross compiling

When cross compiling users have to provide own linker and libraries anyway.
Using rust provided MinGW crt objects is harmful here and has no benefits.

cc https://github.com/rust-lang/rust/issues/68887
2020-08-10 02:08:35 +00:00
Lzu Tao
0210fd3d73 Transmute between big endian s6_addr and [u16; 8].
The old code already made the assumption to reinterpret
`Ipv6Addr` as `[u16; 8]`.

Glibc, Linux, FreeBSD, Win32 all makes this assumption.
The main motivation of using union it to better optimize code.

ref:
* https://docs.microsoft.com/en-us/windows/win32/api/in6addr/ns-in6addr-in6_addr
* 1d6e424741/contrib/ntp/lib/isc/include/isc/ipv6.h (L63)
* 8b531aa996/include/net/net_ip.h (L137)
* https://sourceware.org/git/?p=glibc.git;a=blob;f=inet/netinet/in.h;h=f6355c7efe5192b88337b136ef687fe9a5ed648c;hb=HEAD#l216

Co-authored-by: Josh Stone <cuviper@gmail.com>
Co-authored-by: Peter Atashian <retep998@gmail.com>
2020-08-10 00:50:26 +00:00
Esteban Küber
7e0180906b Small cleanup
Remove unnecessary `unwrap`.
2020-08-09 17:48:32 -07:00