]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #85153 - cjgillot:qresolve, r=Aaron1011
bors [Tue, 1 Jun 2021 00:51:00 +0000 (00:51 +0000)]
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.

3 years agoAuto merge of #85866 - Aaron1011:miriup-const-err, r=RalfJung
bors [Mon, 31 May 2021 22:33:54 +0000 (22:33 +0000)]
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`

3 years agoAuto merge of #85702 - Aaron1011:no-vec-sort, r=michaelwoerister
bors [Mon, 31 May 2021 20:03:18 +0000 (20:03 +0000)]
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.

3 years agoBump Miri for const_err changes
Aaron Hill [Mon, 31 May 2021 16:53:46 +0000 (11:53 -0500)]
Bump Miri for const_err changes

r? @RalfJung

3 years agoAuto merge of #85814 - steffahn:fix_linked_list_itermut_debug, r=m-ou-se
bors [Mon, 31 May 2021 15:22:51 +0000 (15:22 +0000)]
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`.

3 years agoAuto merge of #85704 - Aaron1011:const-panic-hard-err, r=RalfJung
bors [Mon, 31 May 2021 12:41:55 +0000 (12:41 +0000)]
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.

3 years agoAuto merge of #85266 - cjgillot:hir-dep-clean, r=michaelwoerister
bors [Mon, 31 May 2021 10:13:46 +0000 (10:13 +0000)]
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.

3 years agoAuto merge of #85395 - 12101111:build-crt, r=petrochenkov
bors [Mon, 31 May 2021 07:32:50 +0000 (07:32 +0000)]
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

3 years agoAuto merge of #85819 - CDirkx:is_unicast_link_local_strict, r=joshtriplett
bors [Mon, 31 May 2021 05:03:26 +0000 (05:03 +0000)]
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

3 years agoBuild crtbengin.o/crtend.o from source code
12101111 [Mon, 17 May 2021 03:22:07 +0000 (11:22 +0800)]
Build crtbengin.o/crtend.o from source code

3 years agoAuto merge of #85597 - 0yoyoyo:fix-issue-71563-remove-redundant-args, r=petrochenkov
bors [Mon, 31 May 2021 01:59:20 +0000 (01:59 +0000)]
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.

3 years agoAuto merge of #85559 - 12101111:sanitizer-crt-static, r=nagisa
bors [Sun, 30 May 2021 23:38:10 +0000 (23:38 +0000)]
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

3 years agoAuto merge of #85838 - GuillaumeGomez:rollup-rk2rh7m, r=GuillaumeGomez
bors [Sun, 30 May 2021 20:20:44 +0000 (20:20 +0000)]
Auto merge of #85838 - GuillaumeGomez:rollup-rk2rh7m, r=GuillaumeGomez

Rollup of 8 pull requests

Successful merges:

 - #85285 (Add eslint checks to CI)
 - #85709 (Use correct edition when parsing `:pat` matchers)
 - #85762 (Do not try to build LLVM with Zlib on Windows)
 - #85770 (Remove `--print unversioned-files` from rustdoc )
 - #85781 (Add documentation for aarch64-apple-ios-sim target)
 - #85801 (Add `String::extend_from_within`)
 - #85817 (Fix a typo)
 - #85818 (Don't drop `PResult` without handling the error)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #85818 - LeSeulArtichaut:85794-diag-drop-ice, r=petrochenkov
Guillaume Gomez [Sun, 30 May 2021 19:06:53 +0000 (21:06 +0200)]
Rollup merge of #85818 - LeSeulArtichaut:85794-diag-drop-ice, r=petrochenkov

Don't drop `PResult` without handling the error

Fixes #85794.

3 years agoRollup merge of #85817 - r00ster91:patch-9, r=dtolnay
Guillaume Gomez [Sun, 30 May 2021 19:06:52 +0000 (21:06 +0200)]
Rollup merge of #85817 - r00ster91:patch-9, r=dtolnay

Fix a typo

See also: #85737

3 years agoRollup merge of #85801 - WaffleLapkin:master, r=joshtriplett
Guillaume Gomez [Sun, 30 May 2021 19:06:51 +0000 (21:06 +0200)]
Rollup merge of #85801 - WaffleLapkin:master, r=joshtriplett

Add `String::extend_from_within`

This PR adds `String::extend_from_within` function under the `string_extend_from_within` feature gate similar to the [`Vec::extend_from_within`] function.

```rust
// String
pub fn extend_from_within<R>(&mut self, src: R)
where
    R: RangeBounds<usize>;
```

[`Vec::extend_from_within`]: https://github.com/rust-lang/rust/issues/81656

3 years agoRollup merge of #85781 - badboy:document-aarch-ios-sim-support, r=Amanieu
Guillaume Gomez [Sun, 30 May 2021 19:06:47 +0000 (21:06 +0200)]
Rollup merge of #85781 - badboy:document-aarch-ios-sim-support, r=Amanieu

Add documentation for aarch64-apple-ios-sim target

Documentation as requested for [MCP 428](https://github.com/rust-lang/compiler-team/issues/428) to promote this target to Tier 2.

Currently it calls out that it's Tier 3. That should be changed if this target is promoted, but this PR could also land before that.

Note: probably should get signoff from the compiler team based on that MCP.

3 years agoRollup merge of #85770 - Bobo1239:set_locale_for_sort, r=jyn514
Guillaume Gomez [Sun, 30 May 2021 19:06:46 +0000 (21:06 +0200)]
Rollup merge of #85770 - Bobo1239:set_locale_for_sort, r=jyn514

Remove `--print unversioned-files` from rustdoc

This flag isn't needed anymore. See #83784.

3 years agoRollup merge of #85762 - mati865:disable-zlib-on-windows, r=Mark-Simulacrum
Guillaume Gomez [Sun, 30 May 2021 19:06:45 +0000 (21:06 +0200)]
Rollup merge of #85762 - mati865:disable-zlib-on-windows, r=Mark-Simulacrum

Do not try to build LLVM with Zlib on Windows

Fixes https://github.com/rust-lang/rust/issues/85422
Fixes https://github.com/rust-lang/rust/issues/85624

We do not install Zlib on the CI but recent builds somehow started picking it's shared version.
To avoid relying on CI binaries so let's explicitly disable it.

3 years agoRollup merge of #85709 - Aaron1011:fix-pat-crate-edition, r=petrochenkov
Guillaume Gomez [Sun, 30 May 2021 19:06:44 +0000 (21:06 +0200)]
Rollup merge of #85709 - Aaron1011:fix-pat-crate-edition, r=petrochenkov

Use correct edition when parsing `:pat` matchers

As described in issue #85708, we currently do not properly decode
`SyntaxContext::root()` and `ExpnId::root()` from foreign crates. As a
result, when we decode a span from a foreign crate with
`SyntaxContext::root()`, we end up up considering it to have the edition
of the *current* crate, instead of the foreign crate where it was
originally created.

A full fix for this issue will be a fairly significant undertaking.
Fortunately, it's possible to implement a partial fix, which gives us
the correct edition-dependent behavior for `:pat` matchers when the
macro is loaded from another crate. Since we have the edition of the
macro's defining crate available, we can 'recover' from seeing a
`SyntaxContext::root()` and use the edition of the macro's defining
crate.

Any solution to issue #85708 must reproduce the behavior of this
targeted fix - properly preserving a foreign `SyntaxContext::root()`
means (among other things) preserving its edition, which by definition
is the edition of the foreign crate itself. Therefore, this fix moves us
closer to the correct overall solution, and does not expose any new
incorrect behavior to macros.

3 years agoRollup merge of #85285 - GuillaumeGomez:eslint-check, r=jsha,Mark-Simulacrum
Guillaume Gomez [Sun, 30 May 2021 19:06:43 +0000 (21:06 +0200)]
Rollup merge of #85285 - GuillaumeGomez:eslint-check, r=jsha,Mark-Simulacrum

Add eslint checks to CI

It also allowed me to fix some potential issues that went unnoticed. Having this process automated will hopefully prevent us to add more errors. :)

cc `@Mark-Simulacrum` (for the add in the CI).
r? `@jsha`

3 years agoFix eslint error in sidebar-items.js
Guillaume Gomez [Sun, 30 May 2021 18:20:59 +0000 (20:20 +0200)]
Fix eslint error in sidebar-items.js

3 years agoAdd eslint checks in CI
Guillaume Gomez [Fri, 14 May 2021 11:41:19 +0000 (13:41 +0200)]
Add eslint checks in CI

3 years agoRename take_trait_map.
Camille GILLOT [Sat, 29 May 2021 21:10:04 +0000 (23:10 +0200)]
Rename take_trait_map.

3 years agoCheck that trait_map is not moved twice.
Camille GILLOT [Sat, 29 May 2021 20:56:23 +0000 (22:56 +0200)]
Check that trait_map is not moved twice.

3 years agoDrop metadata_encoding_version.
Camille GILLOT [Sat, 29 May 2021 20:49:59 +0000 (22:49 +0200)]
Drop metadata_encoding_version.

3 years agoBless tests.
Camille GILLOT [Thu, 20 May 2021 20:21:59 +0000 (22:21 +0200)]
Bless tests.

3 years agoCorrect comments about untracked accesses.
Camille GILLOT [Thu, 20 May 2021 18:17:45 +0000 (20:17 +0200)]
Correct comments about untracked accesses.

3 years agoMake is_private_dep a query.
Camille GILLOT [Tue, 11 May 2021 20:06:07 +0000 (22:06 +0200)]
Make is_private_dep a query.

3 years agoMake allocator_kind a query.
Camille GILLOT [Tue, 11 May 2021 20:05:54 +0000 (22:05 +0200)]
Make allocator_kind a query.

3 years agoAvoid a clone of output_filenames.
Camille GILLOT [Tue, 11 May 2021 13:03:53 +0000 (15:03 +0200)]
Avoid a clone of output_filenames.

3 years agoRemove StableVec.
Camille GILLOT [Tue, 11 May 2021 08:38:54 +0000 (10:38 +0200)]
Remove StableVec.

3 years agoRestrict access to crate_name.
Camille GILLOT [Mon, 10 May 2021 16:23:32 +0000 (18:23 +0200)]
Restrict access to crate_name.

Also remove original_crate_name, which had the exact same implementation

3 years agoMake resolutions a query.
Camille GILLOT [Sun, 4 Apr 2021 12:40:35 +0000 (14:40 +0200)]
Make resolutions a query.

3 years agoAuto merge of #85362 - jsgf:fix-emit-metadata, r=estebank
bors [Sun, 30 May 2021 17:39:45 +0000 (17:39 +0000)]
Auto merge of #85362 - jsgf:fix-emit-metadata, r=estebank

Use command line metadata path if provided

If the command-line has `--emit metadata=some/path/libfoo.rmeta` then
use that.

Closes #85356

I couldn't find any existing tests for the `--emit TYPE=PATH` command line syntax, so I wasn't sure how to test this aside from ad-hoc manual testing. Is there a ui test type for "generated output file with expected name"?

3 years agoOnly compute the trait_map once.
Camille GILLOT [Sun, 4 Apr 2021 12:24:27 +0000 (14:24 +0200)]
Only compute the trait_map once.

3 years agoEmit a hard error when a panic occurs during const-eval
Aaron Hill [Wed, 26 May 2021 01:54:59 +0000 (20:54 -0500)]
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.

3 years agoAuto merge of #85804 - bjorn3:merge_crate_disambiguator, r=cjgillot
bors [Sun, 30 May 2021 14:48:26 +0000 (14:48 +0000)]
Auto merge of #85804 - bjorn3:merge_crate_disambiguator, r=cjgillot

Merge CrateDisambiguator into StableCrateId

This simplifies the code and potentially improves performance by reducing the amount of hashed data.

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

3 years agoFix span of redundant generic arguments
0yoyoyo [Sun, 16 May 2021 14:54:14 +0000 (23:54 +0900)]
Fix span of redundant generic arguments

3 years agoAuto merge of #84586 - GuillaumeGomez:enforce-rustdoc-gui-test-suite-run, r=Mark...
bors [Sun, 30 May 2021 12:32:41 +0000 (12:32 +0000)]
Auto merge of #84586 - GuillaumeGomez:enforce-rustdoc-gui-test-suite-run, r=Mark-Simulacrum

Enforce rustdoc-gui test-suite run

Part of https://github.com/rust-lang/rust/issues/84550

3 years agoUpdate mir opt tests
bjorn3 [Sat, 29 May 2021 16:36:54 +0000 (18:36 +0200)]
Update mir opt tests

3 years agoUpdate tests
bjorn3 [Sat, 29 May 2021 12:16:49 +0000 (14:16 +0200)]
Update tests

3 years agoFix test
bjorn3 [Sat, 29 May 2021 10:22:19 +0000 (12:22 +0200)]
Fix test

3 years agoMerge CrateDisambiguator into StableCrateId
bjorn3 [Sat, 29 May 2021 10:09:23 +0000 (12:09 +0200)]
Merge CrateDisambiguator into StableCrateId

3 years agoAuto merge of #85319 - cjgillot:query-simp, r=Mark-Simulacrum
bors [Sun, 30 May 2021 10:11:23 +0000 (10:11 +0000)]
Auto merge of #85319 - cjgillot:query-simp, r=Mark-Simulacrum

Simplification of query forcing

Extracted from #78780

3 years agoAuto merge of #85786 - GuillaumeGomez:error-code-checker-improvement, r=Mark-Simulacrum
bors [Sun, 30 May 2021 07:25:38 +0000 (07:25 +0000)]
Auto merge of #85786 - GuillaumeGomez:error-code-checker-improvement, r=Mark-Simulacrum

Error code checker improvement

Just realized that some error codes shouldn't be ignored anymore. So I updated the script to ensure that if an error code is tested and ignored, it will trigger an error.

3 years agoAuto merge of #85754 - the8472:revert-83770, r=Mark-Simulacrum
bors [Sun, 30 May 2021 04:12:44 +0000 (04:12 +0000)]
Auto merge of #85754 - the8472:revert-83770, r=Mark-Simulacrum

Revert "Auto merge of #83770 - the8472:tra-extend, r=Mark-Simulacrum"

Due to a performance regression that didn't show up in the original perf run
this reverts commit 9111b8ae9793f18179a1336417618fc07a9cac85 (#83770), reversing
changes made to 9a700d2947f2d7f97a2c0dfca3117a8dcc255bdd.

Since since is expected to have the inverse impact it should probably be rollup=never.

r? `@Mark-Simulacrum`

3 years agoAuto merge of #83772 - jhpratt:revamp-step-trait, r=Mark-Simulacrum
bors [Sun, 30 May 2021 01:21:39 +0000 (01:21 +0000)]
Auto merge of #83772 - jhpratt:revamp-step-trait, r=Mark-Simulacrum

Make `Step` trait safe to implement

This PR makes a few modifications to the `Step` trait that I believe better position it for stabilization in the short term. In particular,

1. `unsafe trait TrustedStep` is introduced, indicating that the implementation of `Step` for a given type upholds all stated invariants (which have remained unchanged). This is gated behind a new `trusted_step` feature, as stabilization is realistically blocked on min_specialization.
2. The `Step` trait is internally specialized on the `TrustedStep` trait, which avoids a serious performance regression.
3. `TrustedLen` is implemented for `T: TrustedStep` as the latter's invariants subsume the former's.
4. The `Step` trait is no longer `unsafe`, as the invariants must not be relied upon by unsafe code (unless the type implements `TrustedStep`).
5. `TrustedStep` is implemented for all types that implement `Step` in the standard library and compiler.
6. The `step_trait_ext` feature is merged into the `step_trait` feature. I was unable to find any reasoning for the features being split; the `_unchecked` methods need not necessarily be stabilized at the same time, but I think it is useful to have them under the same feature flag.

All existing implementations of `Step` will be broken, as it is not possible to `unsafe impl` a safe trait. Given this trait only exists on nightly, I feel this breakage is acceptable. The blanket `impl<T: Step> TrustedLen for T` will likely cause some minor breakage, but this should be covered by the equivalent impl for `TrustedStep`.

Hopefully these changes are sufficient to place `Step` in decent position for stabilization, which would allow user-defined types to be used with `a..b` syntax.

3 years agoImprove Debug impls for LinkedList reference iterators to show items
Frank Steffahn [Sat, 29 May 2021 23:03:34 +0000 (01:03 +0200)]
Improve Debug impls for LinkedList reference iterators to show items

3 years agoAuto merge of #85390 - Mark-Simulacrum:fast-bridge, r=petrochenkov
bors [Sat, 29 May 2021 22:55:40 +0000 (22:55 +0000)]
Auto merge of #85390 - Mark-Simulacrum:fast-bridge, r=petrochenkov

Optimize proc macro bridge

This optimizes the proc macro bridge code for a win of 0.7% instruction counts on the diesel-check benchmark (non-incr, full). These wins are small, but hopefully not limited to just the diesel benchmark; the code is also not seriously impacted by the changes here.

3 years agoRemove `is_unicast_link_local_strict`
Christiaan Dirkx [Sat, 29 May 2021 21:48:56 +0000 (23:48 +0200)]
Remove `is_unicast_link_local_strict`

3 years agoDon't drop `PResult` without handling the error
LeSeulArtichaut [Sat, 29 May 2021 22:07:34 +0000 (00:07 +0200)]
Don't drop `PResult` without handling the error

3 years agoFix a typo
r00ster [Sat, 29 May 2021 22:06:27 +0000 (00:06 +0200)]
Fix a typo

3 years agoMove reconstruct test inwards.
Camille GILLOT [Sat, 29 May 2021 20:38:51 +0000 (22:38 +0200)]
Move reconstruct test inwards.

3 years agoFix unsoundness of Debug implementation for linked_list::IterMut
Frank Steffahn [Sat, 29 May 2021 19:33:31 +0000 (21:33 +0200)]
Fix unsoundness of Debug implementation for linked_list::IterMut

3 years agoAuto merge of #85698 - ehuss:incremental-session-panic, r=estebank
bors [Sat, 29 May 2021 19:27:53 +0000 (19:27 +0000)]
Auto merge of #85698 - ehuss:incremental-session-panic, r=estebank

Don't panic when failing to initialize incremental directory.

This removes a panic when rustc fails to initialize the incremental directory. This can commonly happen on various filesystems that don't support locking (often various network filesystems). Panics can be confusing and scary, and there are already plenty of issues reporting this.

This has been panicking since 1.22 due to I think #44502 which was a major rework of how things work. Previously, things were simpler and the [`load_dep_graph`](https://github.com/rust-lang/rust/blob/1.21.0/src/librustc_incremental/persist/load.rs#L43-L65) function would emit an error and then continue on without panicking. With 1.22, [`load_dep_graph`](https://github.com/rust-lang/rust/blob/1.22.0/src/librustc_incremental/persist/load.rs#L44) was changed so that it assumes it can load the data without errors. Today, the problem is that it calls [`prepare_session_directory`](https://github.com/rust-lang/rust/blob/fbf1b1a7193cda17008ab590e06ad28d9924023b/compiler/rustc_interface/src/passes.rs#L175-L179) and then immediately calls `garbage_collect_session_directories` which will panic since the session is `IncrCompSession::NotInitialized`.

The solution here is to have `prepare_session_directory` return an error that must be handled so that compilation stops if it fails.

Some other options:

* Ignore directory lock failures.
* Print a warning on directory lock failure, but otherwise continue with incremental enabled.
* Print a warning on directory lock failure, and disable incremental.
* Provide a different locking mechanism.

Cargo ignores lock errors if locking is not supported, so that would be a precedent for the first option. These options would require quite a bit more changes, but I'm happy to entertain any of them, as I think they all have valid justifications.

There is more discussion on the many issues where this is reported: #49773, #59224, #66513, #76251. I'm not sure if this can be considered closing any of those, though, since I think there is some value in discussing if there is a way to avoid the error altogether. But I think it would make sense to at least close all but one to consolidate them.

3 years agoUse correct edition when parsing `:pat` matchers
Aaron Hill [Wed, 26 May 2021 03:58:42 +0000 (22:58 -0500)]
Use correct edition when parsing `:pat` matchers

As described in issue #85708, we currently do not properly decode
`SyntaxContext::root()` and `ExpnId::root()` from foreign crates. As a
result, when we decode a span from a foreign crate with
`SyntaxContext::root()`, we end up up considering it to have the edition
of the *current* crate, instead of the foreign crate where it was
originally created.

A full fix for this issue will be a fairly significant undertaking.
Fortunately, it's possible to implement a partial fix, which gives us
the correct edition-dependent behavior for `:pat` matchers when the
macro is loaded from another crate. Since we have the edition of the
macro's defining crate available, we can 'recover' from seeing a
`SyntaxContext::root()` and use the edition of the macro's defining
crate.

Any solution to issue #85708 must reproduce the behavior of this
targeted fix - properly preserving a foreign `SyntaxContext::root()`
means (among other things) preserving its edition, which by definition
is the edition of the foreign crate itself. Therefore, this fix moves us
closer to the correct overall solution, and does not expose any new
incorrect behavior to macros.

3 years agoWrite primitive types via array buffers
Mark Rousskov [Sun, 16 May 2021 01:39:45 +0000 (21:39 -0400)]
Write primitive types via array buffers

This allows a more efficient implementation (avoiding a fallback to memmove,
which is not optimal for short writes).

This saves 0.29% on diesel.

3 years agoSwitch to reserve over extend_from_slice
Mark Rousskov [Sat, 15 May 2021 23:49:54 +0000 (19:49 -0400)]
Switch to reserve over extend_from_slice

This is a 0.15% win on diesel.

3 years agoSpecialize single-element writes to buffer
Mark Rousskov [Sat, 15 May 2021 22:54:57 +0000 (18:54 -0400)]
Specialize single-element writes to buffer

copy_from_slice generally falls back to memcpy/memmove, which is much more expensive
than we need to write a single element in.

This saves 0.26% instructions on the diesel benchmark.

3 years agoAuto merge of #85540 - GuillaumeGomez:better-result-dom-generation, r=jsha
bors [Sat, 29 May 2021 16:27:14 +0000 (16:27 +0000)]
Auto merge of #85540 - GuillaumeGomez:better-result-dom-generation, r=jsha

Better result dom generation

First commit is from https://github.com/rust-lang/rust/pull/85506.

We realized in https://github.com/rust-lang/rust/pull/85506#issuecomment-844984162 thanks to `@dns2utf8` that in some cases, the generated search result DOM was invalid. This was not strict enough and the DOM was inserted as a big string, which wasn't great.

r? `@jsha`

3 years agoFix incremental-session-fail to work when run as root.
Eric Huss [Sat, 29 May 2021 15:54:51 +0000 (08:54 -0700)]
Fix incremental-session-fail to work when run as root.

3 years agoAuto merge of #85767 - lqd:stackless_span_stacks, r=oli-obk
bors [Sat, 29 May 2021 13:34:20 +0000 (13:34 +0000)]
Auto merge of #85767 - lqd:stackless_span_stacks, r=oli-obk

A bit more polish on const eval errors

This PR adds a bit more polish to the const eval errors:
- a slight improvement to the PME messages from #85633: I mentioned there that the erroneous item's paths were dependent on the environment, and could be displayed fully qualified or not. This can obscure the items when they come from a dependency. This PR uses the pretty-printing code ensuring the items' paths are not trimmed.
- whenever there are generics involved in an item where const evaluation errors out, the error message now displays the instance and its const arguments, so that we can see which instantiated item and compile-time values lead to the error.

So we get this slight improvement for our beloved `stdarch` example, on nightly:
```
error[E0080]: evaluation of constant value failed
 --> ./stdarch/crates/core_arch/src/macros.rs:8:9
  |
8 |         assert!(IMM >= MIN && IMM <= MAX, "IMM value not in expected range");
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'IMM value not in expected range', /rustc/9111b8ae9793f18179a1336417618fc07a9cac85/library/core/src/../../stdarch/crates/core_arch/src/macros.rs:8:9
  |
```

to this PR's:

```
error[E0080]: evaluation of `core::core_arch::macros::ValidateConstImm::<51_i32, 0_i32, 15_i32>::VALID` failed
 --> ./stdarch/crates/core_arch/src/macros.rs:8:9
  |
8 |         assert!(IMM >= MIN && IMM <= MAX, "IMM value not in expected range");
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'IMM value not in expected range', ./stdarch/crates/core_arch/src/macros.rs:8:9
  |
```

with this PR.

Of course this is an idea from Oli, so maybe r? `@oli-obk` if they have the time.

3 years agotier-check: Check for lines with '[' such as those containing links
Jan-Erik Rediger [Fri, 28 May 2021 13:33:09 +0000 (15:33 +0200)]
tier-check: Check for lines with '[' such as those containing links

3 years agoAdd documentation for aarch64-apple-ios-sim target
Jan-Erik Rediger [Fri, 28 May 2021 12:23:12 +0000 (14:23 +0200)]
Add documentation for aarch64-apple-ios-sim target

3 years agoAuto merge of #85798 - hyd-dev:miri, r=RalfJung
bors [Sat, 29 May 2021 09:07:33 +0000 (09:07 +0000)]
Auto merge of #85798 - hyd-dev:miri, r=RalfJung

Update Miri

Fixes #85780.

3 years agoAdd `String::extend_from_within`
Waffle [Sat, 29 May 2021 07:36:30 +0000 (10:36 +0300)]
Add `String::extend_from_within`

This patch adds `String::extend_from_within` function under the
`string_extend_from_within` feature gate similar to the
`Vec::extend_from_within` function.

3 years agoAdd test for --emit TYPE=path
Jeremy Fitzhardinge [Sat, 29 May 2021 05:47:58 +0000 (22:47 -0700)]
Add test for --emit TYPE=path

3 years agoUse command line metadata path if provided
Jeremy Fitzhardinge [Sun, 16 May 2021 09:06:00 +0000 (02:06 -0700)]
Use command line metadata path if provided

If the command-line has `--emit metadata=some/path/libfoo.rmeta` then
use that.

Closes #85356

3 years agoAuto merge of #85703 - clarfonthey:unchecked_shift, r=scottmcm
bors [Sat, 29 May 2021 05:16:09 +0000 (05:16 +0000)]
Auto merge of #85703 - clarfonthey:unchecked_shift, r=scottmcm

Add inherent unchecked_shl, unchecked_shr to integers

Tracking issue: #85122.

Adding more of these methods, since these are missing.

3 years agoAdd inherent unchecked_shl, unchecked_shr to integers
ltdk [Wed, 26 May 2021 01:46:07 +0000 (21:46 -0400)]
Add inherent unchecked_shl, unchecked_shr to integers

3 years agoAuto merge of #85790 - ehuss:nvptx-no-std, r=nagisa
bors [Sat, 29 May 2021 01:01:13 +0000 (01:01 +0000)]
Auto merge of #85790 - ehuss:nvptx-no-std, r=nagisa

Fix typo on nvptx support

I made a minor mistake in https://github.com/rust-lang/rust-forge/pull/356 setting nvptx as std instead of no-std.

3 years agoUpdate Miri
hyd-dev [Sat, 29 May 2021 00:52:58 +0000 (08:52 +0800)]
Update Miri

3 years agoAdd specific help for *how* to fix an incremental lock error.
Eric Huss [Fri, 28 May 2021 23:40:22 +0000 (16:40 -0700)]
Add specific help for *how* to fix an incremental lock error.

3 years agoAuto merge of #85607 - LeSeulArtichaut:thir-unsafeck-closures, r=nikomatsakis
bors [Fri, 28 May 2021 20:26:00 +0000 (20:26 +0000)]
Auto merge of #85607 - LeSeulArtichaut:thir-unsafeck-closures, r=nikomatsakis

Make closures inherit their parent's "safety context"

Fixes rust-lang/project-thir-unsafeck#9, ~~blocked on #85273~~.
r? `@nikomatsakis`

3 years agoRemove `--print unversioned-files` from rustdoc
Boris-Chengbiao Zhou [Fri, 28 May 2021 19:23:39 +0000 (21:23 +0200)]
Remove `--print unversioned-files` from rustdoc

This flag isn't needed anymore. See #83784.

3 years agoMerge fields and comment.
Camille GILLOT [Fri, 28 May 2021 19:14:11 +0000 (21:14 +0200)]
Merge fields and comment.

3 years agoAuto merge of #85789 - ptrojahn:generator_typo, r=nagisa
bors [Fri, 28 May 2021 17:44:47 +0000 (17:44 +0000)]
Auto merge of #85789 - ptrojahn:generator_typo, r=nagisa

Fix typo

3 years agoFix typo on nvptx support
Eric Huss [Fri, 28 May 2021 17:14:56 +0000 (10:14 -0700)]
Fix typo on nvptx support

3 years agoDiagnose use sanitizers with crt-static
12101111 [Fri, 21 May 2021 17:24:50 +0000 (01:24 +0800)]
Diagnose use sanitizers with crt-static

3 years agoClean up error codes from being ignored
Guillaume Gomez [Fri, 28 May 2021 15:14:53 +0000 (17:14 +0200)]
Clean up error codes from being ignored

3 years agoAdd checks to ensure the error_codes checker is "clean"
Guillaume Gomez [Fri, 28 May 2021 15:12:58 +0000 (17:12 +0200)]
Add checks to ensure the error_codes checker is "clean"

3 years agoAuto merge of #85700 - Bobo1239:dso_local_ppc64, r=nagisa
bors [Fri, 28 May 2021 15:03:52 +0000 (15:03 +0000)]
Auto merge of #85700 - Bobo1239:dso_local_ppc64, r=nagisa

Fix static relocation model for PowerPC64

We now also use `should_assume_dso_local()` for declarations and port two
additional cases from clang:
- Exclude PPC64 [1]
- Exclude thread-local variables [2]

[1]: https://github.com/llvm/llvm-project/blob/033138ea452f5f493fb5095e5963419905ad12e1/clang/lib/CodeGen/CodeGenModule.cpp#L1038-L1040
[2]: https://github.com/llvm/llvm-project/blob/033138ea452f5f493fb5095e5963419905ad12e1/clang/lib/CodeGen/CodeGenModule.cpp#L1048-L1050

Tbh I don't know enough about PowerPC(64) to explain why the TOC (table of contents; like the GOT in x86?) is still needed even with the static relocation model. But with these changes [Rust-For-Linux](https://github.com/Rust-for-Linux/linux) runs again on ppc64le. (instead of [getting loaded successfully but crashing](https://github.com/Bobo1239/linux/runs/2646478783?check_suite_focus=true#step:47:358))

r? `@nagisa`

3 years agoAuto merge of #85546 - hyd-dev:unwind, r=RalfJung
bors [Fri, 28 May 2021 08:49:48 +0000 (08:49 +0000)]
Auto merge of #85546 - hyd-dev:unwind, r=RalfJung

const-eval: disallow unwinding across functions that `!fn_can_unwind()`

Following https://github.com/rust-lang/miri/pull/1776#discussion_r633074343, so r? `@RalfJung`

This PR turns `unwind` in `StackPopCleanup::Goto` into a new enum `StackPopUnwind`, with a `NotAllowed` variant to indicate that unwinding is not allowed. This variant is chosen based on `rustc_middle::ty::layout::fn_can_unwind()` in `eval_fn_call()` when pushing the frame. A check is added in `unwind_to_block()` to report UB if unwinding happens across a `StackPopUnwind::NotAllowed` frame.

Tested with Miri `HEAD` with [minor changes](https://github.com/rust-lang/miri/compare/HEAD..9cf3c7f0d86325a586fbcbf2acdc9232b861f1d8) and the rust-lang/miri#1776 branch with [these changes](https://github.com/rust-lang/miri/compare/d866c1c52f48bf562720383455b75c257bb1ad92..626638fbfe2fff34648dda29a34d59db498a6e52).

3 years agoAuto merge of #85745 - veber-alex:panic_any, r=m-ou-se
bors [Fri, 28 May 2021 06:08:58 +0000 (06:08 +0000)]
Auto merge of #85745 - veber-alex:panic_any, r=m-ou-se

Add #[track_caller] to panic_any

Report the panic location from the user code.

```rust
use std::panic;
use std::panic::panic_any;

fn main() {
    panic::set_hook(Box::new(|panic_info| {
        if let Some(location) = panic_info.location() {
            println!(
                "panic occurred in file '{}' at line {}",
                location.file(),
                location.line(),
            );
        } else {
            println!("panic occurred but can't get location information...");
        }
    }));

    panic_any(42);
}
````

Before:
`panic occurred in file '/rustc/ff2c947c00f867b9f012e28ba88cecfbe556f904/library/std/src/panic.rs' at line 59`

After:
`panic occurred in file 'src/main.rs' at line 17`

3 years agoAuto merge of #84968 - FabianWolff:master, r=estebank
bors [Fri, 28 May 2021 03:38:28 +0000 (03:38 +0000)]
Auto merge of #84968 - FabianWolff:master, r=estebank

Fix incorrect suggestions for E0605

Fixes #84598. Here is a simplified version of the problem presented in issue #84598:

```Rust
#![allow(unused_variables)]
#![allow(dead_code)]

trait T { fn t(&self) -> i32; }

unsafe fn foo(t: *mut dyn T) {
    (t as &dyn T).t();
}

fn main() {}
```

The current output is:
```
error[E0605]: non-primitive cast: `*mut (dyn T + 'static)` as `&dyn T`
 --> src/main.rs:7:5
  |
7 |     (t as &dyn T).t();
  |     ^^^^^^^^^^^^^ invalid cast
  |
help: borrow the value for the cast to be valid
  |
7 |     (&t as &dyn T).t();
  |      ^
```

This is incorrect, though: The cast will _not_ be valid when writing `&t` instead of `t`:
```
error[E0277]: the trait bound `*mut (dyn T + 'static): T` is not satisfied
 --> t4.rs:7:6
  |
7 |     (&t as &dyn T).t();
  |      ^^ the trait `T` is not implemented for `*mut (dyn T + 'static)`
  |
  = note: required for the cast to the object type `dyn T`
```

The correct suggestion is `&*t`, which I have implemented in this pull request. Of course, this suggestion will always require an unsafe block, but arguably, that's what the user really wants if they're trying to cast a pointer to a reference.

In any case, claiming that the cast will be valid after implementing the suggestion is overly optimistic, as the coercion logic doesn't seem to resolve all nested obligations, i.e. the cast may still be invalid after implementing the suggestion. I have therefore rephrased the suggestion slightly ("consider borrowing the value" instead of "borrow the value for the cast to be valid").

Additionally, I have fixed another incorrect suggestion not mentioned in #84598, which relates to casting immutable references to mutable ones:

```rust
fn main() {
    let mut x = 0;
    let m = &x as &mut i32;
}
```
currently leads to
```
error[E0605]: non-primitive cast: `&i32` as `&mut i32`
 --> t5.rs:3:13
  |
3 |     let m = &x as &mut i32;
  |             ^^^^^^^^^^^^^^ invalid cast
  |
help: borrow the value for the cast to be valid
  |
3 |     let m = &mut &x as &mut i32;
  |             ^^^^
```
which is obviously incorrect:
```
error[E0596]: cannot borrow data in a `&` reference as mutable
 --> t5.rs:3:13
  |
3 |     let m = &mut &x as &mut i32;
  |             ^^^^^^^ cannot borrow as mutable
```
I've changed the suggestion to a note explaining the problem:
```
error[E0605]: non-primitive cast: `&i32` as `&mut i32`
 --> t5.rs:3:13
  |
3 |     let m = &x as &mut i32;
  |             ^^^^^^^^^^^^^^ invalid cast
  |
note: this reference is immutable
 --> t5.rs:3:13
  |
3 |     let m = &x as &mut i32;
  |             ^^
note: trying to cast to a mutable reference type
 --> t5.rs:3:19
  |
3 |     let m = &x as &mut i32;
  |                   ^^^^^^^^
```
In this example, it would have been even nicer to suggest replacing `&x` with `&mut x`, but this would be much more complex because we would have to take apart the expression to be cast (currently, we only look at its type), and `&x` could be stored in a variable, where such a suggestion would not even be directly applicable:
```rust
fn main() {
    let mut x = 0;
    let r = &x;
    let m = r as &mut i32;
}
```
My solution covers this case, too.

3 years agoFix static relocation model for PowerPC64
Boris-Chengbiao Zhou [Tue, 25 May 2021 21:54:07 +0000 (23:54 +0200)]
Fix static relocation model for PowerPC64

We now also use `should_assume_dso_local()` for declarations and port two
additional cases from clang:
- Exclude PPC64 [1]
- Exclude thread-local variables [2]

[1]: https://github.com/llvm/llvm-project/blob/033138ea452f5f493fb5095e5963419905ad12e1/clang/lib/CodeGen/CodeGenModule.cpp#L1038-L1040
[2]: https://github.com/llvm/llvm-project/blob/033138ea452f5f493fb5095e5963419905ad12e1/clang/lib/CodeGen/CodeGenModule.cpp#L1048-L1050

3 years agoRewrite to a `match`
hyd-dev [Fri, 28 May 2021 01:20:43 +0000 (09:20 +0800)]
Rewrite to a `match`

3 years ago"a frame" -> "a stack frame"
hyd-dev [Fri, 28 May 2021 01:18:18 +0000 (09:18 +0800)]
"a frame" -> "a stack frame"

3 years agoAuto merge of #85743 - bjorn3:sync_cg_clif-2021-05-27, r=bjorn3
bors [Fri, 28 May 2021 00:57:39 +0000 (00:57 +0000)]
Auto merge of #85743 - bjorn3:sync_cg_clif-2021-05-27, r=bjorn3

Sync rustc_codegen_cranelift

The main highlight this sync is the removal of several dependencies, making compilation of cg_clif itself faster. There have also been a couple of new features like `#[link_section]` now supporting different segments for Mach-O binaries (thanks `@eggyal!)` and the `imported_main` feature, which is currently unstable.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler

3 years agoconst eval errors: display the current item instance if there are generics involved
Rémy Rakic [Thu, 27 May 2021 20:42:07 +0000 (22:42 +0200)]
const eval errors: display the current item instance if there are generics involved

3 years agoDo not try to build LLVM with Zlib on Windows
Mateusz Mikuła [Thu, 27 May 2021 21:12:15 +0000 (23:12 +0200)]
Do not try to build LLVM with Zlib on Windows

We do not install Zlib on the CI but recent builds somehow started picking it's shared version.
To avoid relying on CI binaries so let's explicitly disable it.

3 years agoAuto merge of #84568 - andoriyu:libtest/junit_formatter, r=yaahc
bors [Thu, 27 May 2021 21:14:55 +0000 (21:14 +0000)]
Auto merge of #84568 - andoriyu:libtest/junit_formatter, r=yaahc

feat(libtest): Add JUnit formatter

tracking issue: https://github.com/rust-lang/rust/issues/85563

Add an alternative formatter to `libtest`. Formatter produces valid xml that later can be interpreted as JUnit report.

Caveats:

- `timestamp` is required by schema, but every viewer/parser ignores it. Attribute is not set to avoid depending on chrono;
- Running all "suits" (unit tests, doc-tests and integration tests) will produce a mess;
- I couldn't find a way to get integration test binary name, so it's just goes by "integration";

Sample output for unit tests (pretty printed by 3rd party tool):
```
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="test" package="test" id="0" errors="0" failures="0" tests="13" skipped="1">
    <testcase classname="results::tests" name="test_completed_bad" time="0"/>
    <testcase classname="results::tests" name="suite_started" time="0"/>
    <testcase classname="results::tests" name="suite_ended_ok" time="0"/>
    <testcase classname="results::tests" name="suite_ended_bad" time="0"/>
    <testcase classname="junit::tests" name="test_failed_output" time="0"/>
    <testcase classname="junit::tests" name="test_simple_output" time="0"/>
    <testcase classname="junit::tests" name="test_multiple_outputs" time="0"/>
    <testcase classname="results::tests" name="test_completed_ok" time="0"/>
    <testcase classname="results::tests" name="test_stared" time="0"/>
    <testcase classname="junit::tests" name="test_generate_xml_no_error_single_testsuite" time="0"/>
    <testcase classname="results::tests" name="test_simple_output" time="0"/>
    <testcase classname="test" name="should_panic" time="0"/>
    <system-out/>
    <system-err/>
  </testsuite>
</testsuites>
```

Sample output for integration tests (pretty printed by 3rd party tool):

```
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="test" package="test" id="0" errors="0" failures="0" tests="1" skipped="0">
    <testcase classname="integration" name="test_add" time="0"/>
    <system-out/>
    <system-err/>
  </testsuite>
</testsuites>
```

Sample output for Doc-tests (pretty printed by 3rd party tool):

```
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="test" package="test" id="0" errors="0" failures="0" tests="1" skipped="0">
    <testcase classname="src/lib.rs" name="(line 2)" time="0"/>
    <system-out/>
    <system-err/>
  </testsuite>
</testsuites>
```

3 years agodon't trim paths in collector PME message
Rémy Rakic [Thu, 27 May 2021 20:28:04 +0000 (22:28 +0200)]
don't trim paths in collector PME message

3 years agoTest THIR unsafeck for unsafe ops in closures
LeSeulArtichaut [Thu, 27 May 2021 18:37:49 +0000 (20:37 +0200)]
Test THIR unsafeck for unsafe ops in closures

3 years agoAuto merge of #85757 - GuillaumeGomez:rollup-k8hfhp8, r=GuillaumeGomez
bors [Thu, 27 May 2021 18:33:43 +0000 (18:33 +0000)]
Auto merge of #85757 - GuillaumeGomez:rollup-k8hfhp8, r=GuillaumeGomez

Rollup of 3 pull requests

Successful merges:

 - #85722 (Fix trait methods' toggle)
 - #85730 (Mention workaround for floats in Iterator::{min, max})
 - #85738 (Rename opensbd to openbsd)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #85738 - 370417:opensbd, r=m-ou-se
Guillaume Gomez [Thu, 27 May 2021 18:08:24 +0000 (20:08 +0200)]
Rollup merge of #85738 - 370417:opensbd, r=m-ou-se

Rename opensbd to openbsd

OpenBsd was sometimes spelled "opensbd" in the standard library.

3 years agoRollup merge of #85730 - Smittyvb:iter-min-max-floats, r=m-ou-se
Guillaume Gomez [Thu, 27 May 2021 18:08:21 +0000 (20:08 +0200)]
Rollup merge of #85730 - Smittyvb:iter-min-max-floats, r=m-ou-se

Mention workaround for floats in Iterator::{min, max}

`Iterator::{min, max}` can't be used with iterators of floats due to NaN issues. This suggests a workaround in the documentation of those functions.

3 years agoRollup merge of #85722 - GuillaumeGomez:trait-toggle, r=jsha
Guillaume Gomez [Thu, 27 May 2021 18:08:17 +0000 (20:08 +0200)]
Rollup merge of #85722 - GuillaumeGomez:trait-toggle, r=jsha

Fix trait methods' toggle

A `<details>` tag wasn't closed on trait methods, which created broken DOM. I also used this occasion to only generate the toggle in case there is documentation on the method.

r? `@jsha`

3 years agoRemove obsolete workaround.
Camille GILLOT [Thu, 13 May 2021 17:15:29 +0000 (19:15 +0200)]
Remove obsolete workaround.