Commit graph

152466 commits

Author SHA1 Message Date
Kornel
624df182ea Track caller of Vec::remove() 2021-07-26 18:39:59 +01:00
bors
fd2b43dfb7 Auto merge of #7495 - camsteffen:extern-conflict, r=Manishearth
Improve conflicting rlibs error again

changelog: none

Now you can do `rm <paste>` and 🐇💨

```text
thread 'compile_test' panicked at '
----------------------------------------------------------------------
ERROR: Found multiple rlibs for crates: `clippy_lints`, `clippy_utils`
Try running `cargo clean` or remove the following files:

target/debug/deps/libclippy_lints-9117c875159004e0.rlib \
target/debug/deps/libclippy_lints-fe45157be7ff9444.rlib \
target/debug/deps/libclippy_utils-5eba1e07a9846ed0.rlib \
target/debug/deps/libclippy_utils-ccbc08fcf64de262.rlib

For details on this error see https://github.com/rust-lang/rust-clippy/issues/7343
----------------------------------------------------------------------
```
2021-07-26 16:56:05 +00:00
Cameron Steffen
3c517b3b24 Improve conflicting rlibs error again 2021-07-26 11:38:53 -05:00
Oli Scherer
2953a2fb18 Mir borrowck does not generate lifetime variables for 'static lifetimes during opaque type resolution 2021-07-26 16:35:32 +00:00
Nadir Fejzic
0e5802ef5d Include more information in --help
`--no-deps` filled in with a little more information. Explain that
`--fix` implies `--no-deps`.
Explain that `--no-deps` is used with `cargo clippy --`, including
one example.
2021-07-26 16:14:29 +02:00
Guillaume Gomez
12c2092adb
Rollup merge of #87474 - GuillaumeGomez:missing-whitespace-after-attr, r=notriddle
Add missing whitespace after attribute in HTML template

Firefox (even though it worked) highlights it as red when you look at the source code because there is a missing whitespace.

r? `@notriddle`
2021-07-26 16:04:39 +02:00
Guillaume Gomez
d94f554953
Rollup merge of #87473 - rylev:zulip-notify-edition-bugs, r=jyn514
Notify the Rust 2021 edition working group in zulip of edition bugs

Notifying the group of these issues will make it easier for us to track them.

r? `@jyn514`
2021-07-26 16:04:38 +02:00
Guillaume Gomez
434223c632
Rollup merge of #87464 - camelid:rm-union-structhead, r=jyn514
Remove unnecessary `structhead` parameter from `render_union`

`structhead` is used for `render_struct` so that the logic for rendering
structs can be shared between struct variants and struct items. However,
`render_union` is not used anywhere except for rendering union items, so
its `structhead` parameter is unnecessary.
2021-07-26 16:04:37 +02:00
Guillaume Gomez
f9d00b4a78
Rollup merge of #87458 - ibraheemdev:help-msg-block-borrow, r=oli-obk
Fix help message for modification to &T created by &{t}

Previous:
```rust
error[E0594]: cannot assign to `*x` which is behind a `&` reference
 --> src/main.rs:3:5
  |
2 |     let x: &usize = &mut{0};
  |                     ------- help: consider changing this to be a mutable reference: `&mut mut{0}`
3 |     *x = 1;
  |     ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
```
2021-07-26 16:04:36 +02:00
Guillaume Gomez
e3c6cd23cf
Rollup merge of #87457 - devnexen:fbsd_remove_workaround, r=petrochenkov
freebsd remove compiler workaround.

related issue #43575
2021-07-26 16:04:35 +02:00
Guillaume Gomez
fc0b4848cb
Rollup merge of #87447 - RalfJung:not-null, r=oli-obk
Miri: santiy check that null pointer can never have an AllocId
2021-07-26 16:04:34 +02:00
Guillaume Gomez
b745a2881d
Rollup merge of #87444 - camelid:flatten-nested-format, r=jyn514
Flatten nested `format!` calls
2021-07-26 16:04:32 +02:00
Guillaume Gomez
4205077537
Rollup merge of #87436 - ebobrow:suggest-semicolon, r=oli-obk
Suggest `;` on parse error where applicable

fixes #87197
2021-07-26 16:04:26 +02:00
bors
3214de3fe6 Auto merge of #7493 - xFrednet:7220-fix-new-without-default-impl-type, r=camsteffen
Prefer a code snipped over formatting the self type (`new_without_default`)

Fixes: rust-lang/rust-clippy#7220

changelog: [`new_without_default`]: The `Default` impl block type doesn't use the full type path qualification

Have a nice day to everyone reading this 🙃
2021-07-26 12:20:54 +00:00
bors
7d6946df34 Auto merge of #7485 - camsteffen:add-test-externs, r=flip1995
Add to test third party crates list

changelog: none
2021-07-26 12:06:07 +00:00
bors
02d70f3604 Auto merge of #7477 - F3real:needless_continue, r=flip1995
Enhance needless continue to detect loop {continue;}

Fixes #7417

changelog: Report [`needless_continue`] in `loop { continue; }` case
2021-07-26 11:52:55 +00:00
bors
6d9036bc5f Auto merge of #7484 - camsteffen:author, r=flip1995
Some `clippy::author` improvements

changelog: none

* Use `Debug` instead of re-implementing it for some things
* Fix block trailing expression handing
* Don't double print on stmt/expr with `#[clippy::author]` attribute
2021-07-26 11:41:46 +00:00
bors
fc24bcead1 Auto merge of #86696 - rust-lang:relnotes-1.54.0, r=pietroalbini
Update RELEASES.md for 1.54.0

### [Rendered](https://github.com/rust-lang/rust/blob/relnotes-1.54.0/RELEASES.md)

r? `@Mark-Simulacrum`
cc `@rust-lang/release`
2021-07-26 11:41:37 +00:00
Ryan Levick
79da09b14a Use correct syntax 2021-07-26 11:38:46 +02:00
Guillaume Gomez
b0e67d5e3a Add missing whitespace after attribute in HTML template 2021-07-26 11:37:34 +02:00
Guillaume Gomez
fbf78e1f9c Add test for enum item tuple fields documentation 2021-07-26 11:15:20 +02:00
Guillaume Gomez
2b790944a0 Add support for tuple struct fields documentation in enums as well 2021-07-26 11:15:20 +02:00
XAMPPRocky
9fc2bfafb1
Update RELEASES.md 2021-07-26 10:58:37 +02:00
bors
cfc856acf3 Auto merge of #87442 - mystor:patch-2, r=m-ou-se
Fix my email in .mailmap
2021-07-26 08:42:15 +00:00
Ryan Levick
d1b032f525 Notify the Rust 2021 edition working group in zulip of edition bugs 2021-07-26 10:31:28 +02:00
xFrednet
89c8c3f4cd Prefer a code snipped over formatting the self type (new_without_default) 2021-07-26 09:35:38 +02:00
Aman Arora
75edcd9e07 2229: Don't capture preicese paths on top of a union
- Accessing fields of a union require unsafe block
- As part of 2229 we don't allow precision where we need an unsafe block
to capture.

Fixes: #87378

r? @nikomatsakis
2021-07-26 02:01:52 -04:00
bors
9cf1944217 Auto merge of #87439 - ThibsG:FixDocTypo, r=jonas-schievink
Fix doc typo

Just a typo in doc that has a bad rendering here: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/expr_use_visitor/struct.ExprUseVisitor.html#method.walk_captures
2021-07-26 05:51:40 +00:00
Caleb Cartwright
102a06b36b Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-rustfmt 2021-07-25 22:57:19 -05:00
Caleb Cartwright
4236289b75 chore: bump toolchain 2021-07-25 22:53:32 -05:00
Elliot Bobrow
0832137b9e fix link in Contributing.md 2021-07-25 22:53:32 -05:00
Caleb Cartwright
d42be80bf7 chore: disable clippy::matches_like_macro lint 2021-07-25 22:53:32 -05:00
Matthias Krüger
4c2959fb12 fix a bunch of clippy warnings
clippy::bind_instead_of_map
clippy::branches_sharing_code
clippy::collapsible_match
clippy::inconsistent_struct_constructor
clippy::int_plus_one
clippy::iter_count
clippy::iter_nth_zero
clippy::manual_range_contains
clippy::match_like_matches_macro
clippy::needless::collect
clippy::needless_question_mark
clippy::needless_return
clippy::op_ref
clippy::option_as_ref_deref
clippy::ptr_arg
clippy::redundant_clone
clippy::redundant_closure
clippy::redundant_static_lifetimes
clippy::search_is_some
clippy::#single_char_add_str
clippy::single_char_pattern
clippy::single_component_path_imports
clippy::single_match
clippy::skip_while_next
clippy::unnecessary_lazy_evaluations
clippy::unnecessary_unwrap
clippy::useless_conversion
clippy::useless_format
2021-07-25 22:53:32 -05:00
Caleb Cartwright
2cf280ed1b docs: clarify match_arm_blocks config documentation 2021-07-25 22:53:32 -05:00
Jethro Beekman
19733f19f1 Change line endings from CRLF to LF 2021-07-25 22:53:32 -05:00
Caleb Cartwright
b305d62e5b fix: correct arm leading pipe check (#4880)
In the event a pattern starts with a leading pipe
the pattern span will contain, and begin with, the pipe.

This updates the process to see if a match arm contains
a leading pipe by leveraging this recent(ish) change to
the patterns in the AST, and avoids an indexing bug that
occurs when a pattern starts with a non-ascii char in the
old implementation.
2021-07-25 22:53:32 -05:00
Michael Murphy
e634a6f9a8 Updating outdated links (#4869)
* Updating outdated links

Updating the links to the docs and source code for `ast.rs`. Seems like it was moved to a new crate at some point.

* Updating more outdated links

This time, the links to the `fmt-rfcs` repository, which is now owned by
`rust-dev-tools` (although GitHub was redirecting anyway).

* Update Contributing.md

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2021-07-25 22:53:32 -05:00
Michael Murphy
486e774fbf Adjusting help message (#4865)
On stable, running with `--help|-h` shows information about `file-lines`
which is a nightly-only option. This commit removes all mention of
`file-lines` from the help message on stable.

There is room for improvement here; perhaps a new struct called, e.g.,
`StableOptions` could be added to complement the existing
`GetOptsOptions` struct. `StableOptions` could have a field for each
field in `GetOptsOptions`, with each field's value being a `bool` that
specifies whether or not the option exists on stable. Or is this adding
too much complexity?
2021-07-25 22:53:32 -05:00
Casey Rodarmor
1ca3798d2c Improve pasta copyability of merge_imports deprecation message
Add double quotes around `Crate` so that it can be copied directly into a `Cargo.toml` file
2021-07-25 22:53:32 -05:00
Ruby Lazuli
75765f656e Allow --edition 2021 to be passed to rustfmt
This was added to Configurations.md in #4618, but the option wasn't
actually made available. This should let people who are using Rust 2021
on nightly rustc run `cargo fmt` again.
2021-07-25 22:53:32 -05:00
bors
3bcce82d14 Auto merge of #87424 - RalfJung:const-check, r=oli-obk
rename const checking visitor module to check_consts::check

This avoids naming ambiguities with "const validation" which is in `interpret/validity.rs` and checks *values*.

r? `@oli-obk`
2021-07-26 03:10:42 +00:00
Aaron Hill
87740bac64
Restrict field visibility 2021-07-25 20:43:27 -05:00
Aaron Hill
e6a5231238
Create QuerySideEffects and use it for diagnostics 2021-07-25 20:27:58 -05:00
Caleb Cartwright
bfd479d5af
Merge pull request #4920 from calebcartwright/subtree-sync
subtree sync
2021-07-25 19:50:31 -05:00
bors
0ded6adf66 Auto merge of #87430 - devnexen:netbsd_ucred_enabled, r=joshtriplett
netbsd enabled ucred
2021-07-26 00:22:45 +00:00
Noah Lev
dbb978a3c6 Remove unnecessary structhead parameter from render_union
`structhead` is used for `render_struct` so that the logic for rendering
structs can be shared between struct variants and struct items. However,
`render_union` is not used anywhere except for rendering union items, so
its `structhead` parameter is unnecessary.
2021-07-25 16:28:52 -07:00
Cameron Steffen
d3492a0894 author: check block.expr: None 2021-07-25 18:10:59 -05:00
bors
5782f01a51 Auto merge of #87390 - notriddle:notriddle/rustdoc-headers-patch, r=GuillaumeGomez
Rustdoc accessibility: use real headers for doc items

Part of #87059

Partially reverts #84703

Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
2021-07-25 21:41:57 +00:00
bors
76a3b609d0 Rustdoc accessibility: use real headers for doc items
Part of #87059

Partially reverts #84703

Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
2021-07-25 21:41:57 +00:00
Guillaume Gomez
19f30b72b3 Add test for tuple struct documentation fields 2021-07-25 21:19:21 +02:00