Commit graph

142189 commits

Author SHA1 Message Date
Manish Goregaokar
664c3e71b8 Turn old edition lints (anonymous-parameters, keyword-idents) into warn-by-default on 2015 2021-04-12 09:45:59 -07:00
bors
1284da34da Auto merge of #84103 - calebcartwright:bump-rls-rustfmt, r=Xanewok
update RLS and rustfmt

Fixes #83460 and fixes #83459

cc `@Xanewok`
2021-04-12 15:59:35 +00:00
Aaron Hill
eb7b1a150f
Fix lookahead with None-delimited group 2021-04-12 11:50:16 -04:00
Manish Goregaokar
8e9882dbc4 Add css classes 2021-04-12 08:48:04 -07:00
Jacob Hoffman-Andrews
def144c2e7 Improve CSS for "hide contents, not items"
Introduce a first use of the `<details>` and `<summary>` tags as
replacements for the JS-built toggles. I think this has the potential to
replace all the JS toggles and generally clean up the JS, CSS, and HTML.

Split rendering of attributes into two cases: in the case where they are
rendered as descendents of a `<pre>` tag, where they use indent spaces and
newlines for formatting, matching their surrounding markup. In the case
where they are rendered as descendants of a `<code>` tag, they are
rendered as `<div>`. This let me clean up some fragile CSS that was
adjusting the margin-left of attributes depending on context.

Remove toggles for attributes. With the ALLOWED_ATTRIBUTES filter, it's
rare for an item to have more than one attribute, so hiding attributes
behind a toggle doesn't save any screen space in the common case.

Fix a couple of invocations of `matches!` that didn't compile on my
machine.

Fix a boolean for the JS `createToggle` call that was causing
"Expand description" to show up spuriously on already-expanded
descriptions.

Add JS for auto-hide settings and hide all / show all.

Remove a z-index property and some font color tweaks made unnecessary
by the <details> toggles.

Add CSS for the <details> toggles.
2021-04-12 08:48:01 -07:00
Manish Goregaokar
846a4e9b5c Update src/librustdoc/html/render/print_item.rs
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-04-12 08:45:45 -07:00
Manish Goregaokar
e2f59f41f9 Update src/librustdoc/html/render/print_item.rs
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-04-12 08:45:45 -07:00
Manish Goregaokar
256e594b0a rustdoc: Add setting for hiding large items 2021-04-12 08:45:45 -07:00
Manish Goregaokar
173cbecc66 rustdoc: smartly hide associated items of traits if there are too many of them 2021-04-12 08:45:45 -07:00
Manish Goregaokar
f146b9701d rustdoc: hide fields of structs/unions > 5 2021-04-12 08:45:45 -07:00
Manish Goregaokar
71c52acf32 rustdoc: hide variants of enums > 5 2021-04-12 08:45:45 -07:00
Manish Goregaokar
c96f86de30 rustdoc: Stop hiding entire item declarations 2021-04-12 08:45:45 -07:00
Mara Bos
b44ae964e2 Mark Duration::is_zero as rustc_const_stable. 2021-04-12 16:32:57 +02:00
Mara Bos
d1e23b8af8 Stabilize duration_zero. 2021-04-12 16:32:56 +02:00
Caleb Cartwright
e2fe4f2c61 update RLS and rustfmt 2021-04-12 09:01:17 -05:00
Joshua Nelson
1b0b7e95be Update stdarch submodule (to before it switched to const generics)
This also includes a cherry-pick of
ec1461905b
and https://github.com/rust-lang/stdarch/pull/1108 to fix a build
failure.

It also adds a re-export of various macros to the crate root of libstd -
previously they would show up automatically because std_detect was defined
in the same crate.
2021-04-12 09:39:04 -04:00
bors
5e73bd1040 Auto merge of #82300 - andersk:libtest-id, r=Amanieu
libtest: Index tests by a unique TestId

This more robustly avoids problems with duplicate `TestDesc`. See #81852 and #82274.

Cc `@Mark-Simulacrum.`
2021-04-12 13:30:30 +00:00
bjorn3
15bfd9da85 Introduce CompileMonoItem DepNode 2021-04-12 13:58:12 +02:00
bors
c18c0ad2bc Auto merge of #84068 - Amanieu:fix_lint, r=lcnr
Add `bad_asm_style` to  HardwiredLints

This was missed when the lint was added, which prevents the lint from being ignored with `#[allow]`.
2021-04-12 10:49:39 +00:00
bors
67e402f946 Auto merge of #84095 - infinity0:master, r=Mark-Simulacrum
bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057
2021-04-12 08:03:59 +00:00
Jubilee Young
7baeaa95e2 Stabilize BTree{Map,Set}::retain 2021-04-12 00:01:31 -07:00
bors
d68f7a2f50 Auto merge of #84090 - marmeladema:stabilize-duration-saturating-ops, r=m-ou-se
Stabilize feature `duration_saturating_ops`

FCP here: https://github.com/rust-lang/rust/issues/76416#issuecomment-817201314

Closes #76416

r? `@m-ou-se`
2021-04-12 05:44:25 +00:00
bors
2c56db4e12 Auto merge of #84085 - m-ou-se:stabilize-atomic-fetch-update, r=kennytm
Stabilize atomic_fetch_update methods on AtomicBool and AtomicPtr.

FCP completed here: https://github.com/rust-lang/rust/issues/78639#issuecomment-817201315
2021-04-12 03:13:33 +00:00
bors
e41f378f82 Auto merge of #84112 - Dylan-DPC:rollup-tapsrzz, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #83669 (Issue 81508 fix)
 - #84014 (Improve trait/impl method discrepancy errors)
 - #84059 (Bump libc dependency of std to 0.2.93)
 - #84067 (clean up example on read_to_string)
 - #84079 (Improve test for `rustdoc::bare_urls` lint)
 - #84094 (Remove FixedSizeArray)
 - #84101 (rustdoc: Move crate loader to collect_intra_doc_links::early )

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-04-12 00:38:20 +00:00
Dylan DPC
1ff117e987
Rollup merge of #84101 - jyn514:early-pass, r=Manishearth
rustdoc: Move crate loader to collect_intra_doc_links::early

This groups the similar code together, and also allows making most of collect_intra_doc_links private again.

This builds on https://github.com/rust-lang/rust/pull/84066, but it wouldn't be too hard to base it off master if you want this to land first.
Helps with https://github.com/rust-lang/rust/issues/83761.

r? manishearth

Fixes https://github.com/rust-lang/rust/issues/84046
2021-04-12 01:04:10 +02:00
Dylan DPC
3ea5a9f301
Rollup merge of #84094 - tmiasko:remove-fixed-size-array, r=m-ou-se
Remove FixedSizeArray

Remove `FixedSizeArray` trait, it has been superseded by const generics.

Closes #27778.
2021-04-12 01:04:09 +02:00
Dylan DPC
ae549b5bb7
Rollup merge of #84079 - camelid:improve-bare-urls-test, r=jyn514
Improve test for `rustdoc::bare_urls` lint

- Rename `url-improvements` test to `bare-urls`
- Run rustfix for `bare-urls` test
2021-04-12 01:04:08 +02:00
Dylan DPC
269abd886b
Rollup merge of #84067 - rust-lang:steveklabnik-patch-1, r=joshtriplett
clean up example on read_to_string

This is the same thing, but simpler.

This came out of a comment from a user: https://news.ycombinator.com/item?id=25318117 but rather than hide the signature of main, I think a `use` plus not including the `'static` makes more sense.
2021-04-12 01:04:07 +02:00
Dylan DPC
7b63125c0a
Rollup merge of #84059 - zvirja:update-libc, r=JohnTitor
Bump libc dependency of std to 0.2.93

Update `libc` dependency of `std` to the latest version. That allows to consume the https://github.com/rust-lang/libc/pull/2131 fix and fix build for the `mipsel-unknown-linux-uclibc` target.

r? `@JohnTitor`
2021-04-12 01:04:06 +02:00
Dylan DPC
c905e9d0ca
Rollup merge of #84014 - estebank:cool-bears-hot-tip, r=varkor
Improve trait/impl method discrepancy errors

* Use more accurate spans
* Clean up some code by removing previous hack
* Provide structured suggestions

Structured suggestions are particularly useful for cases where arbitrary self types are used, like in custom `Future`s, because the way to write `self: Pin<&mut Self>` is not necessarily self-evident when first encountered.
2021-04-12 01:04:04 +02:00
Dylan DPC
b6780b3a20
Rollup merge of #83669 - kwj2104:issue-81508-fix, r=varkor
Issue 81508 fix

Fix #81508

**Problem**: When variable name is used incorrectly as path, error and warning point to undeclared/unused name, when in fact the name is used, just incorrectly (should be used as a variable, not part of a path).

**Summary for fix**: When path resolution errs, diagnostics checks for variables in ```ValueNS``` that have the same name (e.g., variable rather than path named Foo), and adds additional suggestion that user may actually intend to use the variable name rather than a path.

The fix does not suppress or otherwise change the *warning* that results. I did not find a straightforward way in the code to modify this, but would love to make changes here as well with any guidance.
2021-04-12 01:04:03 +02:00
SNCPlay42
a3ee0bb726 detect when suggested paths enter extern crates more rigorously 2021-04-11 23:44:54 +01:00
bors
3f8added70 Auto merge of #84100 - sjakobi:77548-reenable-check, r=jyn514
tidy: Re-enable the "ignoring line length unnecessarily" check

Closes #77548.
2021-04-11 22:11:31 +00:00
Joshua Nelson
cba50731a6 Move crate loader to collect_intra_doc_links::early
This groups the similar code together, and also allows making most of collect_intra_doc_links private again
2021-04-11 16:00:26 -04:00
bors
a866124564 Auto merge of #83482 - hyd-dev:uwtable, r=nagisa
Allow using `-C force-unwind-tables=no` when `panic=unwind`

It seems LLVM still generates proper unwind tables even there is no `uwtable` attribute, unless I looked at the wrong place 🤔:
c21016715f/llvm/include/llvm/IR/Function.h (L666)

Therefore, I *assume* it's safe to omit `uwtable` even when `panic=unwind`, and this PR removes the restriction that disallows using `-C force-unwind-tables=no` when `panic=unwind`.
2021-04-11 19:50:19 +00:00
AngelicosPhosphoros
f8a12c6311 Add some #[inline(always)] to arithmetic methods of integers
I tried to add it only to methods which return results of intrinsics and don't have any branching.
Branching could made performance of debug builds (`-Copt-level=0`) worse.
Main goal of changes is allowing wider optimizations in `-Copt-level=1`.

Closes: https://github.com/rust-lang/rust/issues/75598
2021-04-11 21:19:39 +03:00
Andreas Jonson
12249acdc8 Stabilize nonzero_leading_trailing_zeros 2021-04-11 19:15:55 +02:00
Andreas Jonson
2d99a8650a stabilize const_cttz 2021-04-11 19:13:27 +02:00
Simon Jakobi
761ef8fc53 tidy: Re-enable the "ignoring file length unnecessarily" check
Closes #77548.
2021-04-11 16:38:13 +02:00
hyd-dev
2fd4dd20d7
Allow using -C force-unwind-tables=no when panic=unwind 2021-04-11 22:32:40 +08:00
Amanieu d'Antras
83c2c5b98c Add test to allow bad_asm_style 2021-04-11 15:11:02 +01:00
Ximin Luo
be5d72129e bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057 2021-04-11 14:02:28 +01:00
bors
7953910464 Auto merge of #81469 - tweksteen:android_set_message, r=m-ou-se
android: set abort message

Android has the ability to supply an abort message [1]. This message is
automatically included in the debug trace, which helps debugging [2].
Modify panic_abort to populate this message before calling abort().

[1] https://android.googlesource.com/platform/bionic/+/master/libc/include/android/set_abort_message.h
[2] https://source.android.com/devices/tech/debug/native-crash
2021-04-11 12:29:36 +00:00
marmeladema
7d89148385 Stabilize feature duration_saturating_ops
Closes #76416
2021-04-11 11:34:42 +01:00
Mara Bos
a931060107 Stabilize option_insert. 2021-04-11 12:22:08 +02:00
bors
58f32da346 Auto merge of #84063 - LingMan:patch-1, r=nagisa
Add note about reverting a workaround in the future

The root cause was fixed upstream in LLVM main. This adds a reminder to revert the workaround once the LLVM rustc depends on is new enough. Since I'm not sure how such optimizations get routed to LLVM releases, I used the conservative assumption that it will only show up with LLVM 13.
2021-04-11 10:04:46 +00:00
Mara Bos
1a62bdbc30 Stabilize is_subnormal. 2021-04-11 11:48:26 +02:00
Mara Bos
d331e5e50c Stabilize atomic_fetch_update methods on AtomicBool and AtomicPtr. 2021-04-11 11:45:46 +02:00
bors
ba6275b6a9 Auto merge of #82608 - Aaron1011:feature/final-preexp-tts, r=petrochenkov
Implement token-based handling of attributes during expansion

This PR modifies the macro expansion infrastructure to handle attributes
in a fully token-based manner. As a result:

* Derives macros no longer lose spans when their input is modified
  by eager cfg-expansion. This is accomplished by performing eager
  cfg-expansion on the token stream that we pass to the derive
  proc-macro
* Inner attributes now preserve spans in all cases, including when we
  have multiple inner attributes in a row.

This is accomplished through the following changes:

* New structs `AttrAnnotatedTokenStream` and `AttrAnnotatedTokenTree` are introduced.
  These are very similar to a normal `TokenTree`, but they also track
  the position of attributes and attribute targets within the stream.
  They are built when we collect tokens during parsing.
  An `AttrAnnotatedTokenStream` is converted to a regular `TokenStream` when
  we invoke a macro.
* Token capturing and `LazyTokenStream` are modified to work with
  `AttrAnnotatedTokenStream`. A new `ReplaceRange` type is introduced, which
  is created during the parsing of a nested AST node to make the 'outer'
  AST node aware of the attributes and attribute target stored deeper in the token stream.
* When we need to perform eager cfg-expansion (either due to `#[derive]` or `#[cfg_eval]`), we tokenize and reparse our target, capturing additional information about the locations of `#[cfg]` and `#[cfg_attr]` attributes at any depth within the target. This is a performance optimization, allowing us to perform less work in the typical case where captured tokens never have eager cfg-expansion run.
2021-04-11 07:36:33 +00:00
Aaron Hill
a93c4f05de
Implement token-based handling of attributes during expansion
This PR modifies the macro expansion infrastructure to handle attributes
in a fully token-based manner. As a result:

* Derives macros no longer lose spans when their input is modified
  by eager cfg-expansion. This is accomplished by performing eager
  cfg-expansion on the token stream that we pass to the derive
  proc-macro
* Inner attributes now preserve spans in all cases, including when we
  have multiple inner attributes in a row.

This is accomplished through the following changes:

* New structs `AttrAnnotatedTokenStream` and `AttrAnnotatedTokenTree` are introduced.
  These are very similar to a normal `TokenTree`, but they also track
  the position of attributes and attribute targets within the stream.
  They are built when we collect tokens during parsing.
  An `AttrAnnotatedTokenStream` is converted to a regular `TokenStream` when
  we invoke a macro.
* Token capturing and `LazyTokenStream` are modified to work with
  `AttrAnnotatedTokenStream`. A new `ReplaceRange` type is introduced, which
  is created during the parsing of a nested AST node to make the 'outer'
  AST node aware of the attributes and attribute target stored deeper in the token stream.
* When we need to perform eager cfg-expansion (either due to `#[derive]` or `#[cfg_eval]`),
we tokenize and reparse our target, capturing additional information about the locations of
`#[cfg]` and `#[cfg_attr]` attributes at any depth within the target.
This is a performance optimization, allowing us to perform less work
in the typical case where captured tokens never have eager cfg-expansion run.
2021-04-11 01:31:36 -04:00