Commit graph

149224 commits

Author SHA1 Message Date
LingMan
86562b4fdb Use Iterator::find instead of open-coding it 2021-06-01 20:50:08 +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
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
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
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
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
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
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
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
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
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
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
bors
c1e8f3a585 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
2021-05-30 20:20:44 +00:00
Guillaume Gomez
71a7f8f188
Rollup merge of #85818 - LeSeulArtichaut:85794-diag-drop-ice, r=petrochenkov
Don't drop `PResult` without handling the error

Fixes #85794.
2021-05-30 21:06:53 +02:00
Guillaume Gomez
980a4a725e
Rollup merge of #85817 - r00ster91:patch-9, r=dtolnay
Fix a typo

See also: #85737
2021-05-30 21:06:52 +02:00
Guillaume Gomez
b0f2a4c660
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
2021-05-30 21:06:51 +02:00
Guillaume Gomez
2d30bc78da
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.
2021-05-30 21:06:47 +02:00
Guillaume Gomez
f7fb29b59d
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.
2021-05-30 21:06:46 +02:00
Guillaume Gomez
957badbcc4
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.
2021-05-30 21:06:45 +02:00
Guillaume Gomez
bdd70622e2
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.
2021-05-30 21:06:44 +02:00
Guillaume Gomez
9c873c1240
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`
2021-05-30 21:06:43 +02:00
Guillaume Gomez
558b073c4c Fix eslint error in sidebar-items.js 2021-05-30 20:20:59 +02:00
Guillaume Gomez
b4148e926a Add eslint checks in CI 2021-05-30 20:19:59 +02:00
Camille GILLOT
2b6daf9e14 Rename take_trait_map. 2021-05-30 20:07:25 +02:00
Camille GILLOT
8832cc20b7 Check that trait_map is not moved twice. 2021-05-30 20:06:57 +02:00
Camille GILLOT
2543028161 Drop metadata_encoding_version. 2021-05-30 20:05:46 +02:00
Camille GILLOT
58126042ea Bless tests. 2021-05-30 20:05:33 +02:00
Camille GILLOT
1119b48e02 Correct comments about untracked accesses. 2021-05-30 20:04:37 +02:00
Camille GILLOT
f0e5e22806 Make is_private_dep a query. 2021-05-30 20:04:22 +02:00
Camille GILLOT
ee94fbb607 Make allocator_kind a query. 2021-05-30 19:58:01 +02:00
Camille GILLOT
e1e6949558 Avoid a clone of output_filenames. 2021-05-30 19:57:13 +02:00
Camille GILLOT
ee567fe1b1 Remove StableVec. 2021-05-30 19:54:21 +02:00
Camille GILLOT
10fb4b2fe5 Restrict access to crate_name.
Also remove original_crate_name, which had the exact same implementation
2021-05-30 19:54:04 +02:00
Camille GILLOT
5d9f96ab27 Make resolutions a query. 2021-05-30 19:47:00 +02:00
bors
758c00ea40 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"?
2021-05-30 17:39:45 +00:00
Camille GILLOT
139f7ad637 Only compute the trait_map once. 2021-05-30 19:37:53 +02:00
Aaron Hill
2779fc1c47
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-30 11:59:54 -05:00
bors
59579907ab 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
2021-05-30 14:48:26 +00:00
0yoyoyo
0edf4da043 Fix span of redundant generic arguments 2021-05-30 22:46:06 +09:00
bors
2023cc3aa1 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
2021-05-30 12:32:41 +00:00
bjorn3
e0e0cfa649 Update mir opt tests 2021-05-30 12:51:36 +02:00
bjorn3
c76b1b0317 Update tests 2021-05-30 12:51:36 +02:00
bjorn3
3abdebe79d Fix test 2021-05-30 12:51:36 +02:00