Commit graph

129481 commits

Author SHA1 Message Date
Guillaume Gomez
7c0d576c59 Add test for reexported items lints 2020-10-09 20:24:59 +02:00
Guillaume Gomez
130fd1a970 Don't remove export items so that we can run lints on them 2020-10-09 20:24:59 +02:00
Josh Stone
1d06b07765
simplify the cfg in ReadDir construction
Co-authored-by: David Tolnay <dtolnay@gmail.com>
2020-10-09 10:54:50 -07:00
bjorn3
46f2f023b0 Move supported_target_features query provider to cg_ssa 2020-10-09 19:35:17 +02:00
bors
7b06cb1052 Auto merge of #77747 - flip1995:clippyup, r=Manishearth
Update Clippy

Biweekly Clippy update.

This includes a `Cargo.lock` update: 7ea42be

r? `@Manishearth`
2020-10-09 17:14:39 +00:00
Josh Stone
365e00aeee remove ReadDir.end_of_stream on targets that don't use it 2020-10-09 10:00:11 -07:00
Josh Stone
c1297eca3e unix/vxworks: make DirEntry slightly smaller
`DirEntry` contains a `ReadDir` handle, which used to just be a wrapper
on `Arc<InnerReadDir>`. Commit af75314ecd added `end_of_stream: bool`
which is not needed by `DirEntry`, but adds 8 bytes after padding. We
can let `DirEntry` have an `Arc<InnerReadDir>` directly to avoid that.
2020-10-09 10:00:11 -07:00
Tom Eccles
e0b033e965 doc: fix broken link for crate::os::linux::raw::stat
Fixing:

 Documenting std v0.0.0 (/checkout/library/std)
error: `self::os::linux::raw::stat` is both a struct and a function
  --> library/std/src/os/linux/fs.rs:23:19
   |
23 |     /// [`stat`]: crate::os::linux::raw::stat
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous link
   |
   = note: `-D broken-intra-doc-links` implied by `-D warnings`
help: to link to the struct, prefix with `struct@`
   |
23 |     /// [`stat`]: struct@self::os::linux::raw::stat
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: to link to the function, add parentheses
   |
23 |     /// [`stat`]: self::os::linux::raw::stat()
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: could not document `std`

Signed-off-by: Tom Eccles <tom.eccles@codethink.co.uk>
2020-10-09 17:36:35 +01:00
Dániel Buga
217d6f9741 Revert calculate_dtor signature change 2020-10-09 17:18:57 +02:00
bors
be719d11e5 Auto merge of #77609 - ortem:fix-lldb-commands, r=Mark-Simulacrum
Remove redundant backslashes from `lldb_commands`
2020-10-09 15:18:41 +00:00
Tom Eccles
a4a0342cf5 ci: disabled: riscv: work around QEMU regression
This bumps the version of the bbl bootloader not to perform 64-bit
accesses to the PLIC. Doing so resulted in the QEMU test machine to fail
to boot:

bbl loader
../machine/mtrap.c:21: machine mode: unhandlable trap 7 @ 0x0000000080001f6e
Power off

Signed-off-by: Tom Eccles <tom.eccles@codethink.co.uk>
2020-10-09 16:11:18 +01:00
Dániel Buga
18318a9d84 Reimplement for_each_relevant_impl on top of find_map... 2020-10-09 16:56:09 +02:00
Dániel Buga
7993ddd89d Add find_map_relevant_impl 2020-10-09 16:22:49 +02:00
Pietro Albini
8d2b15943b
bootstrap: always use the Rust version in package names
The format of the tarballs produced by CI is roughly the following:

    {component}-{release}-{target}.{ext}

While on the beta and nightly channels `{release}` is just the channel
name, on the stable channel is either the Rust version or the version of
the component we're shipping:

    cargo-0.47.0-x86_64-unknown-linux-gnu.tar.xz
    clippy-0.0.212-x86_64-unknown-linux-gnu.tar.xz
    llvm-tools-1.46.0-x86_64-unknown-linux-gnu.tar.xz
    miri-0.1.0-x86_64-unknown-linux-gnu.tar.xz
    rls-1.41.0-x86_64-unknown-linux-gnu.tar.xz
    rust-1.46.0-x86_64-unknown-linux-gnu.tar.xz
    ...

This makes it really hard to get the package URL without having access
to the manifest (and there is no manifest on ci-artifacts.rlo), as there
is no consistent version number to use.

This commit addresses the problem by always using the Rust version
number as `{release}` for the stable channel, regardless of the version
number of the component we're shipping. I chose that instead of "stable"
to avoid breaking the URL scheme *that* much.

Rustup should not be affected by this change, as it fetches the URLs
from the manifest. Unfortunately we don't have a way to test other
clients before making a stable release, as this change only affects the
stable channel.
2020-10-09 15:21:45 +02:00
bors
53a4c3b0ba Auto merge of #77690 - est31:llvm_8_required, r=matthewjasper
Simplify some code in rustc_llvm/build.rs now that LLVM 8 is required

LLVM 8 is required since 8506bb0060
so this is safe to do.
2020-10-09 12:23:49 +00:00
Mateusz Mikuła
8818fda7f0 Remove useless all in cfg 2020-10-09 13:24:05 +02:00
Mateusz Mikuła
0c97c24a6c Remove some dead code in windows-gnu std 2020-10-09 13:23:50 +02:00
flip1995
7ea42be036
Update Cargo.lock 2020-10-09 12:46:26 +02:00
flip1995
6b8d25ecda
Merge commit '2f6439ae6a6803d030cceb3ee14c9150e91b328b' into clippyup 2020-10-09 12:45:29 +02:00
bors
6b8b396aee Auto merge of #77698 - vandenheuvel:chalkup, r=jackh726
Update chalk to 0.32.0

r? `@jackh726`
2020-10-09 10:32:52 +00:00
Ralf Jung
b6bedc80c9 rename __default_lib_allocator -> __default_alloc_error_handler 2020-10-09 11:39:28 +02:00
Ralf Jung
1911d21866 also extend global allocator comment 2020-10-09 11:36:20 +02:00
Ralf Jung
6cd9b88a25 fix __rust_alloc_error_handler comment 2020-10-09 11:36:13 +02:00
Yuki Okushi
fb4d62759b Add a regression test for issue-71443 2020-10-09 18:33:03 +09:00
Yuki Okushi
e4fa906c44 Add a regression test for issue-70292 2020-10-09 18:32:53 +09:00
Yuki Okushi
83370efdb6 Add a regression test for issue-65934 2020-10-09 18:32:42 +09:00
Yuki Okushi
3a4fe97052 Add a regression test for issue-65581 2020-10-09 18:32:33 +09:00
Yuki Okushi
ebc1f89ecf Add a regression test for issue-54108 2020-10-09 18:32:22 +09:00
Yuki Okushi
32bc245bc0 Add a regression test for issue-53448 2020-10-09 18:32:13 +09:00
Yuki Okushi
07627a3aa3 Add a regression test for issue-52843 2020-10-09 18:31:48 +09:00
Julian Wollersberger
bd49ded308 Noticed a potential bug in eat_while(): it doesn't account for number of UTF8 bytes.
Fixed it by inlining it in the two places where the count is used and simplified the logic there.
2020-10-09 11:12:54 +02:00
bors
2f6439ae6a Auto merge of #6136 - dtolnay:serve, r=flip1995
Clippy dev subcommand to build and serve website

This PR adds `clippy dev serve` which will pop open a browser with a local rendered 'ALL the Clippy Lints' website, and re-render as you edit stuff.

---

changelog: none
2020-10-09 08:58:19 +00:00
bors
fc3d8e3fcc Auto merge of #77687 - est31:hash_shorter_path, r=davidtwco
Use shorter path for std:#️⃣:Hash
2020-10-09 08:09:32 +00:00
bors
6fb3b2c160 Auto merge of #6115 - ebroto:changelog_1_48, r=flip1995
Add changelog for 1.48 beta

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

I've not added the PRs fixing `same_item_push` because those were backported, namely:
* [#5908](https://github.com/rust-lang/rust-clippy/pull/5908)
* [#5997](https://github.com/rust-lang/rust-clippy/pull/5997)
* [#6016](https://github.com/rust-lang/rust-clippy/pull/6016)

The following PR was reverted, so I've ignored it too:
* [#5984](https://github.com/rust-lang/rust-clippy/pull/5984)

~~Also, I took the liberty of adding a "Thanks" section, naming all the contributors to this release. I think they deserve visibility in the changelog. Please tell me if we want to add this or maybe it's redundant given we link to the PRs?~~

changelog: none

r? `@flip1995`
2020-10-09 08:09:23 +00:00
bors
195cc9be94 Auto merge of #6145 - flip1995:backport_remerge, r=flip1995
Backport remerge

Step 1 in the release process.

r? `@ghost`

changelog: none
2020-10-09 06:53:55 +00:00
flip1995
58375283e8
Merge remote-tracking branch 'upstream/beta' into backport_remerge 2020-10-09 08:52:06 +02:00
bors
9a74fb726e Auto merge of #77627 - richkadel:rust-demangler, r=tmandry
rust-demangler tool strips crate disambiguators with < 16 digits

Addresses Issue #77615.
2020-10-09 06:15:09 +00:00
Camelid
b9c299effd Update rustdoc intra-doc link docs
* Describe generic parameters feature
* Make general improvements to the docs
2020-10-08 22:24:38 -07:00
Camelid
6df21a326e Fix intra-doc links in core
Caught by my malformed generics diagnostics!
2020-10-08 22:24:37 -07:00
Camelid
4c765f66a4 Allow generic parameters in intra-doc links
The contents of the generics will be mostly ignored (except for warning
if fully-qualified syntax is used, which is currently unsupported in
intra-doc links - see issue #74563).

* Allow links like `Vec<T>`, `Result<T, E>`, and `Option<Box<T>>`
* Allow links like `Vec::<T>::new()`
* Warn on
  * Unbalanced angle brackets (e.g. `Vec<T` or `Vec<T>>`)
  * Missing type to apply generics to (`<T>` or `<Box<T>>`)
  * Use of fully-qualified syntax (`<Vec as IntoIterator>::into_iter`)
  * Invalid path separator (`Vec:<T>:new`)
  * Too many angle brackets (`Vec<<T>>`)
  * Empty angle brackets (`Vec<>`)

Note that this implementation *does* allow some constructs that aren't
valid in the actual Rust syntax, for example `Box::<T>new()`. That may
not be supported in rustdoc in the future; it is an implementation
detail.
2020-10-08 22:24:34 -07:00
bors
2359ecc71f Auto merge of #77578 - euclio:max-suggestion, r=davidtwco
suggest `MAX` constant if -1 is assigned to unsigned type

Fixes #76413.
Fixes #77416.
2020-10-09 04:22:18 +00:00
bors
9ba1d21868 Auto merge of #77519 - jyn514:track-doc-er, r=GuillaumeGomez
Resolve intra-doc links on additional documentation for re-exports in lexical scope

Fixes https://github.com/rust-lang/rust/issues/77254.

- Preserve the parent module of `DocFragment`s
  + Add `parent_module` to `DocFragment`
  + Require the `parent_module` of the item being inlined
  + Preserve the hir_id for ExternCrates so rustdoc can find the parent module later
  + Take an optional `parent_module` for `build_impl` and `merge_attrs`.
    Preserve the difference between parent modules for each doc-comment.
  + Support a single additional re-exports in from_ast. Originally this took a vec but I ended up not using it.
  + Don't require the parent_module for all `impl`s, just inlined items

    In particular, this will be `None` whenever the attribute is not on a
    re-export.

  + Only store the parent_module, not the HirId

    When re-exporting a re-export, the HirId is not available. Fortunately,
    `collect_intra_doc_links` doesn't actually need all the info from a
    HirId, just the parent module.

- Introduce `Divider`

  This distinguishes between documentation on the original from docs on  the re-export.

- Use the new module information for intra-doc links

  + Make the parent module conditional on whether the docs are on a re-export
  + Make `resolve_link` take `&Item` instead of `&mut Item`

    Previously the borrow checker gave an error about multiple mutable
    borrows, because `dox` borrowed from `item`.

  + Fix `crate::` for re-exports

    `crate` means something different depending on where the attribute
    came from.

  + Make it work for `#[doc]` attributes too

    This required combining several attributes as one so they would keep
    the links.

r? `@GuillaumeGomez`
2020-10-09 02:27:33 +00:00
bors
03ef8a081e Auto merge of #76260 - xd009642:rfc/2867, r=jonas-schievink
Implementation of RFC2867

https://github.com/rust-lang/rust/issues/74727

So I've started work on this, I think my next steps are to make use of the `instruction_set` value in the llvm codegen but this is the point where I begin to get a bit lost. I'm looking at the code but it would be nice to have some guidance on what I've currently done and what I'm doing next 😄
2020-10-09 00:29:47 +00:00
Josh Stone
4addede1e7 Update the backtrace crate to fix big-endian ELF 2020-10-08 17:17:28 -07:00
Thom Chiovoloni
4f37220510 Implement the same optimization in windows/time 2020-10-08 17:04:32 -07:00
Thom Chiovoloni
59c06e9e40 Switch to using a single atomic and treating 0 as 'uninitialized' 2020-10-08 17:03:16 -07:00
xd009642
bdb3f7716b Fix typo in error code 2020-10-08 23:56:59 +01:00
bors
e651a04fab Auto merge of #6133 - JPTIZ:no-box-for-c-ffi, r=ebroto
clippy_lints: Do not warn against Box parameter in C FFI

changelog: [`boxed_local`]: don't lint in `extern fn` arguments

Fixes #5542.

When using C FFI, to handle pointers in parameters it is needed to
declare them as `Box` in its Rust-side signature. However, the current
linter warns against the usage of Box stating that "local variable
doesn't need to be boxed here".

This commit fixes it by ignoring functions whose Abi is C.
2020-10-08 22:50:29 +00:00
Mara Bos
f1c3edbfab
Assert state in sys/unsupported's RwLock::write_unlock.
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-09 00:39:03 +02:00
bors
8a84c4f9c8 Auto merge of #77723 - jonas-schievink:rollup-htz44r4, r=jonas-schievink
Rollup of 8 pull requests

Successful merges:

 - #76750 (Don't discourage implementing `core::fmt::Write`)
 - #77449 (BTreeMap: comment why drain_filter's size_hint is somewhat pessimistic)
 - #77660 ((docs): make mutex error comment consistent with codebase)
 - #77663 (Add compile fail test for issue 27675)
 - #77673 (Remove unnecessary lamda on emitter map.)
 - #77701 (Make `max_log_info` easily greppable (for figuring out why debug logging is disabled))
 - #77702 (Remove not needed lambda.)
 - #77710 (Update submodule llvm to get LVI bugfix)

Failed merges:

r? `@ghost`
2020-10-08 22:37:37 +00:00