Commit Graph

149435 Commits

Author SHA1 Message Date
klensy
c63cb014a0 updated shlex for jsondocck 2021-06-01 18:25:36 +03:00
bjorn3
5ab25ab682 Fix test 2021-06-01 17:00:54 +02:00
bors
7f9ab0300c Auto merge of #85886 - GuillaumeGomez:rollup-l3yr3np, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #85473 (fix split-debuginfo error message)
 - #85622 (Remove toggle for "undocumented items.")
 - #85826 (Mention "null pointer optimization" in option docs.)
 - #85860 (Fix details rustdoc toggle for blanket impl)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-06-01 12:10:15 +00:00
Frank Steffahn
c5233b7d4b Fix typo in internal documentation for TrustedRandomAccess
`next_back` is a method of DoubleEndedIterator, not Iterator.
2021-06-01 13:18:20 +02:00
Guillaume Gomez
82b84bfca4
Rollup merge of #85860 - pickfire:patch-5, r=GuillaumeGomez
Fix details rustdoc toggle for blanket impl

In the meantime, allow all of the details to have the same top.

Before

![image](https://user-images.githubusercontent.com/4687791/120214139-a673ed00-c266-11eb-9154-3a8148199c8f.png)
![image](https://user-images.githubusercontent.com/4687791/120214232-c5727f00-c266-11eb-8bda-871e6e04819e.png)

After

![image](https://user-images.githubusercontent.com/4687791/120214121-9d831b80-c266-11eb-8c33-db1317c42375.png)
![image](https://user-images.githubusercontent.com/4687791/120214273-d4f1c800-c266-11eb-89ee-0f2b7c2e5bdb.png)

I stumbled across this while wanting to do a details button for the layout.
2021-06-01 11:29:45 +02:00
Guillaume Gomez
f4d3f32f45
Rollup merge of #85826 - jsha:npo, r=joshtriplett
Mention "null pointer optimization" in option docs.

I had seen people discuss "null pointer optimization," but when I tried to find official documentation (using Google), the `std::option` page didn't show up, because it doesn't use that term. Hopefully adding the term will help others find it in the future.
2021-06-01 11:29:44 +02:00
Guillaume Gomez
085691b137
Rollup merge of #85622 - jsha:untoggle-undocumented, r=GuillaumeGomez
Remove toggle for "undocumented items."

Per discussion in #84326. For trait implementations, this was
misleading: the items actually do have documentation (but it comes from
the trait definition).

For both trait implementations and trait implementors, this was
redundant: in both of those cases, the items are default-hidden by
different toggle at the level above.

Update tests: Remove XPath selectors that over-specified on details tag,
in cases that weren't testing toggles. Add an explicit test for toggles
on methods. Rename item-hide-threshold to toggle-item-contents for
consistency.

Demo:
https://hoffman-andrews.com/rust/untoggle-undocumented/std/string/struct.String.html
https://hoffman-andrews.com/rust/untoggle-undocumented/std/io/trait.Read.html
2021-06-01 11:29:43 +02:00
Guillaume Gomez
2ffe87a434
Rollup merge of #85473 - infinity0:master, r=jackh726
fix split-debuginfo error message
2021-06-01 11:29:42 +02:00
bors
1160cf864f Auto merge of #85884 - rust-lang:revert-85153-qresolve, r=michaelwoerister
Revert "Reduce the amount of untracked state in TyCtxt"

Reverts rust-lang/rust#85153
Fixes https://github.com/rust-lang/rust/issues/85878

The performance hit is massive, and was not visible in the in-review perf run.

r? `@Aaron1011`
2021-06-01 09:22:01 +00:00
Camille Gillot
0f0f3138cb
Revert "Reduce the amount of untracked state in TyCtxt" 2021-06-01 09:05:22 +02:00
bors
80af6b091f Auto merge of #85859 - pickfire:patch-3, r=CraftSpider
Add title for copy to clipboard button in rustdoc

This button
![image](https://user-images.githubusercontent.com/4687791/120210874-da4d1380-c262-11eb-9987-9145c4354029.png)
2021-06-01 06:40:57 +00:00
csmoe
9283956350 skip check_static on rvalue::threadlocalref 2021-06-01 13:59:17 +08:00
bors
c9c1f8be3f Auto merge of #85856 - lnicola:rust-analyzer-2021-05-31, r=jonas-schievink
⬆️ rust-analyzer
2021-06-01 04:01:10 +00:00
est31
a0228d9b87 Intra doc link-ify a reference to a function 2021-06-01 05:04:48 +02:00
bors
cf5f894536 Auto merge of #7297 - flip1995:rm-cov, r=giraffate
Remove util/cov.sh script

This script hasn't been working and wasn't used for years.

changelog: none
2021-06-01 01:22:43 +00:00
bors
41278062c8 Auto merge of #85153 - cjgillot:qresolve, r=Aaron1011
Reduce the amount of untracked state in TyCtxt

Access to untracked global state may generate instances of #84970.

The GlobalCtxt contains the lowered HIR, the resolver outputs and interners.
By wrapping the resolver inside a query, we make sure those accesses are properly tracked.
As a no_hash query, all dependent queries essentially become `eval_always`,
what they should have been from the beginning.
2021-06-01 00:51:00 +00:00
bors
ca570f9b84 Auto merge of #7265 - Jarcho:manual_str_repeat, r=giraffate
Add lint `manual_str_repeat`

fixes: #7260

There's a similar function for slices. Should this be renamed to include it, or should that be a separate lint? If we are going to have them as one lint a better name will be needed. `manual_repeat` isn't exactly clear as it's replacing a call to `iter::repeat`.

changelog: Add new lint `manual_str_repeat`
2021-06-01 00:47:05 +00:00
bors
d2091147b1 Auto merge of #85866 - Aaron1011:miriup-const-err, r=RalfJung
Bump Miri for const_err changes

Fixes https://github.com/rust-lang/rust/issues/85861
r? `@RalfJung`
2021-05-31 22:33:54 +00:00
bors
657bc01888 Auto merge of #85702 - Aaron1011:no-vec-sort, r=michaelwoerister
Don't sort a `Vec` before computing its `DepTrackingHash`

Previously, we sorted the vec prior to hashing, making the hash
independent of the original (command-line argument) order. However, the
original vec was still always kept in the original order, so we were
relying on the rest of the compiler always working with it in an
'order-independent' way.

This assumption was not being upheld by the `native_libraries` query -
the order of the entires in its result depends on the order of entries
in `Options.libs`. This lead to an 'unstable fingerprint' ICE when the
`-l` arguments were re-ordered.

This PR removes the sorting logic entirely. Re-ordering command-line
arguments (without adding/removing/changing any arguments) seems like a
really niche use case, and correctly optimizing for it would require
additional work. By always hashing arguments in their original order, we
can entirely avoid a cause of 'unstable fingerprint' errors.
2021-05-31 20:03:18 +00:00
Frank Steffahn
5ea3e733cb Update documentation of SpecFromIter to reflect the removed impls 2021-05-31 21:07:03 +02:00
Frank Steffahn
c902fdca45 Remove unnecessary SpecFromIter impls 2021-05-31 19:18:20 +02:00
Aaron Hill
a258feb6eb
Bump Miri for const_err changes
r? @RalfJung
2021-05-31 12:05:22 -05:00
bors
6a3dce99f6 Auto merge of #85814 - steffahn:fix_linked_list_itermut_debug, r=m-ou-se
Fix unsoundness of Debug implementation for linked_list::IterMut

Fix #85813, new `marker` field follows the example of `linked_list::Iter`.
2021-05-31 15:22:51 +00:00
Ivan Tham
2970479412
Fix details rustdoc toggle for blanket impl
In the meantime, allow all of the details to have the same top.
2021-05-31 23:18:53 +08:00
flip1995
f49251a33e
Remove util/cov.sh script
This script hasn't been working and wasn't used for years.
2021-05-31 17:09:21 +02:00
Ivan Tham
0c5ed2cb95
Add title for copy to clipboard button in rustdoc 2021-05-31 22:51:59 +08:00
Laurențiu Nicola
6b6a16d413 ⬆️ rust-analyzer 2021-05-31 16:53:42 +03:00
Jason Newcomb
cfddf0927b
Fix type checks for manual_str_repeat 2021-05-31 09:37:13 -04:00
Guillaume Gomez
9b637fa72e Improve display of the separation between page items and siblings in the sidebar 2021-05-31 15:20:45 +02:00
Guillaume Gomez
a2ba9ef1ff Only list crates on the crate page 2021-05-31 15:20:45 +02:00
bors
d9feaaa548 Auto merge of #85704 - Aaron1011:const-panic-hard-err, r=RalfJung
Emit a hard error when a panic occurs during const-eval

Previous, a panic during const evaluation would go through the
`const_err` lint. This PR ensures that such a panic always causes
compilation to fail.
2021-05-31 12:41:55 +00:00
bjorn3
312f964478 Remove unused feature gates 2021-05-31 13:55:43 +02:00
Mara Bos
dbff14b879 Clarify meaning of MachineApplicable suggestions. 2021-05-31 13:26:36 +02:00
bjorn3
9de82d7611 Use allow_internal_unstable more in rustc_index 2021-05-31 12:13:47 +02:00
bjorn3
b4ed7114bd Remove unnecessary unboxed_closures feature usage
It has been possible to clone closures for a while now
2021-05-31 12:13:47 +02:00
bors
91ddf3e76a Auto merge of #85266 - cjgillot:hir-dep-clean, r=michaelwoerister
Remove obsolete workaround.

The regression test for #62649 appears to pass even without the workaround.
2021-05-31 10:13:46 +00:00
Guillaume Gomez
e081cd48f4 Remove unneeded file to load sidebar items at crate level 2021-05-31 10:30:36 +02:00
Guillaume Gomez
5a87482eff Update rustdoc test 2021-05-31 10:30:16 +02:00
Guillaume Gomez
e9b1283bdf Add some commented options that could be useful for other contributors in rustdoc-gui tool 2021-05-31 10:30:16 +02:00
Guillaume Gomez
bc888ba840 Add sidebar GUI tests 2021-05-31 10:30:16 +02:00
Guillaume Gomez
dab01a05fb * Put crates list at all levels
* Fix bug in module sidebar: the list of items was from the parent module
2021-05-31 10:30:16 +02:00
bors
7baa7afd0f Auto merge of #85395 - 12101111:build-crt, r=petrochenkov
Build crtbegin.o/crtend.o from source code

Build crtbengin.o/crtend.o from source code instead of copying from gcc.

The crtbegin and crtend implementation from llvm don't need `crtbeginS.o` for PIC. `crtbegin{,S,T}.o` is unified into one generic `crtbegin.o`. See the comments in https://reviews.llvm.org/D28791#1419436 and https://reviews.llvm.org/D28791#1420914

fix: https://github.com/rust-lang/rust/issues/85310 , fix: https://github.com/rust-lang/rust/issues/47551 , fix: https://github.com/rust-lang/rust/issues/84033
2021-05-31 07:32:50 +00:00
bors
dc08641128 Auto merge of #85819 - CDirkx:is_unicast_link_local_strict, r=joshtriplett
Remove `Ipv6Addr::is_unicast_link_local_strict`

Removes the unstable method `Ipv6Addr::is_unicast_link_local_strict` and keeps the behaviour of `Ipv6Addr::is_unicast_link_local`, see also #85604 where I have tried to summarize related discussion so far.

My intent is for `is_unicast_link_local`, `is_unicast_site_local` and `is_unicast_global` to have the semantics of checking if an address has Link-Local, Site-Local or Global scope, see also #85696 which changes the behaviour of `is_unicast_global` and renames these methods to `has_unicast_XXX_scope` to reflect this.

For checking Link-Local scope we currently have two methods: `is_unicast_link_local` and `is_unicast_link_local_strict`. This is because of what appears to be conflicting definitions in [IETF RFC 4291](https://datatracker.ietf.org/doc/html/rfc4291).

From [IETF RFC 4291 section 2.4](https://datatracker.ietf.org/doc/html/rfc4291#section-2.4): "Link-Local unicast" (`FE80::/10`)
```text
Address type         Binary prefix        IPv6 notation   Section
------------         -------------        -------------   -------
Unspecified          00...0  (128 bits)   ::/128          2.5.2
Loopback             00...1  (128 bits)   ::1/128         2.5.3
Multicast            11111111             FF00::/8        2.7
Link-Local unicast   1111111010           FE80::/10       2.5.6
Global Unicast       (everything else)
```

From [IETF RFC 4291 section 2.5.6](https://datatracker.ietf.org/doc/html/rfc4291#section-2.5.6): "Link-Local IPv6 Unicast Addresses" (`FE80::/64`)
```text
| 10 bits  |         54 bits         |          64 bits           |
+----------+-------------------------+----------------------------+
|1111111010|           0             |       interface ID         |
+----------+-------------------------+----------------------------+
```

With `is_unicast_link_local` checking `FE80::/10` and `is_unicast_link_local_strict` checking `FE80::/64`.

There is also [IETF RFC 5156 section 2.4](https://datatracker.ietf.org/doc/html/rfc5156#section-2.4) which defines "Link-Scoped Unicast" as `FE80::/10`.

It has been pointed out that implementations in other languages and the linux kernel all use `FE80::/10` (https://github.com/rust-lang/rust/pull/76098#issuecomment-706916840, https://github.com/rust-lang/rust/pull/76098#issuecomment-705928605).

Given all of this I believe the correct interpretation to be the following: All addresses in `FE80::/10` are defined as having Link-Local scope, however currently only the block `FE80::/64` has been allocated for "Link-Local IPv6 Unicast Addresses". This might change in the future however; more addresses in `FE80::/10` could be allocated and those will have Link-Local scope. I therefore believe the current behaviour of `is_unicast_link_local` to be correct (if interpreting it to have the semantics of `has_unicast_link_local_scope`) and `is_unicast_link_local_strict` to be unnecessary, confusing and even a potential source of future bugs:

Currently there is no real difference in checking `FE80::/10` or `FE80::/64`, since any address in practice will be `FE80::/64`. However if an application uses `is_unicast_link_local_strict` to implement link-local (so non-global) behaviour, it will be incorrect in the future if addresses outside of `FE80::/64` are allocated.

r? `@joshtriplett` as reviewer of all the related PRs
2021-05-31 05:03:26 +00:00
Jacob Hoffman-Andrews
10bafe1975 Remove toggle for "undocumented items."
Per discussion in #84326. For trait implementations, this was
misleading: the items actually do have documentation (but it comes from
the trait definition).

For both trait implementations and trait implementors, this was
redundant: in both of those cases, the items are default-hidden by
different toggle at the level above.

Update tests: Remove XPath selectors that over-specified on details tag,
in cases that weren't testing toggles. Add an explicit test for toggles
on methods. Rename item-hide-threshold to toggle-item-contents for
consistency.
2021-05-30 21:15:22 -07:00
Jason Newcomb
97311f0906
Add lint manual_str_repeat 2021-05-30 23:26:48 -04:00
12101111
61c1155d17
Build crtbengin.o/crtend.o from source code 2021-05-31 11:11:38 +08:00
bors
b348385da1 Auto merge of #85597 - 0yoyoyo:fix-issue-71563-remove-redundant-args, r=petrochenkov
Fix span of redundant generic arguments

Fixes #71563

Above issue is about lifetime arguments, but generic arguments also have same problem.
This PR fixes both help messages.
2021-05-31 01:59:20 +00:00
bors
860cb8f977 Auto merge of #7294 - stevenengler:unsafe-ptr-deref-msg, r=Manishearth
Improve message for `not_unsafe_ptr_arg_deref` lint

changelog: Improved message for the ['not_unsafe_ptr_arg_deref'] lint

Doesn't close any issue, but implements a suggestion from https://github.com/rust-lang/rust-clippy/issues/3045#issuecomment-791556803.
2021-05-31 00:36:46 +00:00
Steven Engler
58491d386a Update message for 'not_unsafe_ptr_arg_deref' lint 2021-05-30 20:19:57 -04:00
bors
aab93ca37f Auto merge of #85559 - 12101111:sanitizer-crt-static, r=nagisa
Diagnose use sanitizers with crt-static

Fix: https://github.com/rust-lang/rust/issues/85459
2021-05-30 23:38:10 +00:00