Commit graph

150129 commits

Author SHA1 Message Date
Smitty
ce63d55bc7 Add suggestions for "undefined reference" link errors 2021-06-30 18:07:40 -04:00
bors
6a5b97adb4 Auto merge of #86210 - ehuss:rustfix-update, r=Mark-Simulacrum
Rustfix update

This updates to rustfix 0.6.0. One of the key changes here is https://github.com/rust-lang/rustfix/pull/195 which changes rustfix to apply multi-part suggestions. One of the tests needs to updated because there are some overlapping suggestions which rustfix cannot handle. The solution is to only apply the machine-applicable suggestions to avoid the overlapping issue.

This also includes a minor change to compiletest to provide better error messages with rustfix.
2021-06-21 12:21:19 +00:00
bors
9d93819fa7 Auto merge of #86157 - jsha:tera, r=jyn514,GuillaumeGomez
Use Tera templates for rustdoc.

Replaces a format!() call in layout::render with a template
expansion. Introduces a `templates` field in SharedContext so parts
of rustdoc can share pre-rendered templates.

This currently builds in a copy of the single template available, like
with static files. However, future work can make this live-loadable with
a perma-unstable flag, to make rustdoc developers' work easier.

Part of #84419.

Demo at https://hoffman-andrews.com/rust/tera/std/string/struct.String.html.
2021-06-21 09:40:34 +00:00
bors
d789de67dc Auto merge of #85775 - adamrk:warn-unused-target-fields, r=nagisa
Emit warnings for unused fields in custom targets.

Add a warning which lists any fields in a custom target `json` file that aren't used. Currently unrecognized fields are ignored so, for example, a typo in the `json` will silently produce a target which isn't the one intended.
2021-06-21 06:56:51 +00:00
Jacob Hoffman-Andrews
cd0f93193c Use Tera templates for rustdoc.
Replaces a format!() call in layout::render with a template
expansion. Introduces a `templates` field in SharedContext so parts
of rustdoc can share pre-rendered templates.

This currently builds in a copy of the single template available, like
with static files. However, future work can make this live-loadable with
a perma-unstable flag, to make rustdoc developers' work easier.
2021-06-20 23:07:28 -07:00
bors
3824017f8e Auto merge of #86166 - tmiasko:no-alloca-for-zsts, r=nagisa
Do not emit alloca for ZST locals with multiple assignments

This extends 35566bfd7d to additionally stop emitting unnecessary allocas for zero sized locals that are assigned multiple times.

When rebuilding the standard library with `-Zbuild-std` this reduces the number of locals that require an allocation from 62315 to 61767.
2021-06-21 04:03:51 +00:00
bors
6a540bd40c Auto merge of #86502 - JohnTitor:rollup-wge0f3x, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #83739 (Account for bad placeholder errors on consts/statics with trait objects)
 - #85637 (document PartialEq, PartialOrd, Ord requirements more explicitly)
 - #86152 (Lazify is_really_default condition in the RustdocGUI bootstrap step)
 - #86156 (Fix a bug in the linkchecker)
 - #86427 (Updated release note)
 - #86452 (fix panic-safety in specialized Zip::next_back)
 - #86484 (Do not set depth to 0 in fully_expand_fragment)
 - #86491 (expand: Move some more derive logic to rustc_builtin_macros)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-06-21 01:16:15 +00:00
Yuki Okushi
8b9e138ecd
Rollup merge of #86491 - petrochenkov:derefact, r=Aaron1011
expand: Move some more derive logic to rustc_builtin_macros

And cleanup some `unwrap`s in `cfg_eval`.

Refactorings extracted from https://github.com/rust-lang/rust/pull/83354 and https://github.com/rust-lang/rust/pull/86057.
r? ``@Aaron1011``
2021-06-21 09:42:19 +09:00
Yuki Okushi
e5ecded392
Rollup merge of #86484 - fee1-dead:builtin-macro-recursion, r=petrochenkov
Do not set depth to 0 in fully_expand_fragment

Fixes #84632.
2021-06-21 09:42:18 +09:00
Yuki Okushi
504c378159
Rollup merge of #86452 - the8472:fix-zip-drop-safety, r=m-ou-se
fix panic-safety in specialized Zip::next_back

This was unsound since a panic in a.next_back() would result in the
length not being updated which would then lead to the same element
being revisited in the side-effect preserving code.

fixes #86443
2021-06-21 09:42:17 +09:00
Yuki Okushi
13b0f1a29b
Rollup merge of #86427 - hi-rustin:rustin-patch-release-note, r=Mark-Simulacrum
Updated release note

close https://github.com/rust-lang/rust/issues/77098

base on https://github.com/rust-lang/rust/pull/78690
2021-06-21 09:42:16 +09:00
Yuki Okushi
e435e3259d
Rollup merge of #86156 - ehuss:linkchecker-fixes, r=Mark-Simulacrum
Fix a bug in the linkchecker

There was a small typo in the linkchecker (in #85652) that caused it to report a `#` fragment link error pointing to the wrong file (it was displaying the path to the source file, not the target of the link).

This also includes a few other changes:
- Fixes the tests due to some changes in the redirect handling in #84703.
- Adds the tests to rustbuild to run whenever the linkchecker itself is run.
- Updates the tests to validate more of the output (so that a mistake like this would have been caught).

Closes #86144
2021-06-21 09:42:15 +09:00
Yuki Okushi
e7a4f1e3fc
Rollup merge of #86152 - the8472:lazify-npm-queries, r=Mark-Simulacrum
Lazify is_really_default condition in the RustdocGUI bootstrap step

The `RustdocGUI::should_run` condition spawns `npm list` several times which adds up to seconds of wall-time.
Evaluate the condition lazily to to keep `./x.py test tidy` and similar short-running tasks fast.

Fixes #86147
2021-06-21 09:42:15 +09:00
Yuki Okushi
e6732e05e4
Rollup merge of #85637 - RalfJung:partial-ord, r=m-ou-se
document PartialEq, PartialOrd, Ord requirements more explicitly

This is the result of discussion in https://github.com/rust-lang/rust/issues/50230, in particular [this summary comment](https://github.com/rust-lang/rust/issues/50230#issuecomment-392819364).

Fixes https://github.com/rust-lang/rust/issues/50230.
2021-06-21 09:42:13 +09:00
Yuki Okushi
1a1909a8a6
Rollup merge of #83739 - JohnTitor:issue-75889, r=estebank
Account for bad placeholder errors on consts/statics with trait objects

Fixes #75889
r? ``@estebank``
2021-06-21 09:42:12 +09:00
Eric Huss
35bf1becaa tidy: Check that cargo and compiletest share the same rustfix. 2021-06-20 16:36:26 -07:00
Eric Huss
f2ef8bf776 compiletest: display the error if rustfix fails 2021-06-20 16:35:14 -07:00
Eric Huss
2817be94cc Update rustfix for compiletest. 2021-06-20 16:35:14 -07:00
bors
03b845a41f Auto merge of #85980 - ssomers:btree_cleanup_LeafRange, r=Mark-Simulacrum
BTree: encapsulate LeafRange better & some debug asserts

Looking at iterators again, I think #81937 didn't house enough code in `LeafRange`. Moving the API boundary a little makes things more local in navigate.rs and less complicated in map.rs.

r? `@Mark-Simulacrum`
2021-06-20 22:52:49 +00:00
bors
e82b65026d Auto merge of #85538 - r00ster91:iterrepeat, r=Mark-Simulacrum
Replace some `std::iter::repeat` with `str::repeat`

I noticed that there were some instances where `std::iter::repeat` would be used to repeat a string or a char to take a specific count of it and then collect it into a `String` when `str::repeat` is actually much faster and better for that.

See also: https://github.com/rust-lang/rust-clippy/issues/7260.
2021-06-20 20:07:13 +00:00
Deadbeef
37d0d2705d
Do not set depth to 0 in fully_expand_fragment 2021-06-21 02:05:37 +08:00
bors
dd941450fb Auto merge of #84967 - CDirkx:os_str_ext, r=m-ou-se
Move `OsStringExt` and `OsStrExt` to `std::os`

Moves the `OsStringExt` and `OsStrExt` traits and implementations from `sys_common` to `os`. `sys_common` is for abstractions over `sys` and shouldn't really contain publicly exported items.

This does introduce some duplication: the traits and implementations are now duplicated in `unix`, `wasi`, `hermit`, and `sgx`. However, I would argue that this duplication is no different to how something like `MetadataExt` is duplicated in `linux`, `vxworkx`, `redox`, `solaris` etc. The duplication also matches the fact that the traits on different platforms are technically distinct types: any platform is free to add it's own extra methods to the extension trait.
2021-06-20 16:42:13 +00:00
Vadim Petrochenkov
d9fd5eaae8 cfg_eval: Replace multiple unwraps with a single unwrap 2021-06-20 18:54:45 +03:00
Vadim Petrochenkov
3f0729f378 expand: Move some more derive logic to rustc_builtin_macros 2021-06-20 18:48:42 +03:00
bors
2e940ac5e9 Auto merge of #86250 - RalfJung:intrinsic_operation_unsafety, r=oli-obk
fix intrinsic_operation_unsafety comment
2021-06-20 14:01:26 +00:00
bors
75d1500f02 Auto merge of #86486 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/86474
2021-06-20 11:20:39 +00:00
Ralf Jung
dbb8d1a804 update Miri 2021-06-20 12:58:04 +02:00
The8472
b4734b7c38 disable test on platforms that don't support unwinding 2021-06-20 12:20:05 +02:00
Christiaan Dirkx
ad7b8975e0 Add comment to std::os::unix::ffi::os_str explaining that the module is reused on other platforms. 2021-06-20 12:06:19 +02:00
Christiaan Dirkx
835561ac5b Make os_str_bytes::{Buf, Slice} pub and repr(transparent) 2021-06-20 11:55:26 +02:00
Christiaan Dirkx
1a96d2272e Move OsStringExt and OsStrExt to std::os 2021-06-20 11:55:01 +02:00
bors
9543636cd6 Auto merge of #86468 - GuillaumeGomez:update-browser-ui-test-version, r=jsha
Update browser-ui-test version

It greatly improves the test readability (thanks to `@jsha` for the suggestions!).

r? `@jsha`
2021-06-20 05:47:13 +00:00
bors
192920c22b Auto merge of #86463 - fee1-dead:fixed-encode_wide, r=m-ou-se
Account for self.extra in size_hint for EncodeWide

Fixes #86414.
2021-06-20 02:18:51 +00:00
bors
f639657fe4 Auto merge of #86433 - paolobarbolini:string-overlapping, r=m-ou-se
Use `copy_nonoverlapping` to copy `bytes` in `String::insert_bytes`

The second copy could be made using `ptr::copy_nonoverlapping` instead of `ptr::copy`, since aliasing won't allow `self` and `bytes` to overlap. LLVM even seems to recognize this, [replacing the second `memmove` with a `memcopy`](https://rust.godbolt.org/z/Yoaa6rrGn), so this makes it so it's always applied.
2021-06-19 23:10:55 +00:00
bors
150fad30ea Auto merge of #86460 - JohnTitor:use-static-in-pattern-err, r=oli-obk
Refactor `PatternError` structure

Now we emit the `StaticInPattern` error precisely.
Fixes #68395
r? `@oli-obk`
2021-06-19 19:46:02 +00:00
bors
6b354a1382 Auto merge of #86034 - nagisa:nagisa/rt-soundness, r=m-ou-se
Change entry point to 🛡️ against 💥 💥-payloads

Guard against panic payloads panicking within entrypoints, where it is
UB to do so.

Note that there are a number of tradeoffs to consider. For instance, I
considered guarding against accidental panics inside the `rt::init` and
`rt::cleanup` code as well, as it is not all that obvious these may not
panic, but doing so would mean that we initialize certain thread-local
slots unconditionally, which has its own problems.

Fixes #86030
r? `@m-ou-se`
2021-06-19 17:05:08 +00:00
bors
29cd70d407 Auto merge of #86437 - nikomatsakis:tait-docs, r=oli-obk
add various coments to explain how the TAIT code works

r? `@oli-obk`
2021-06-19 12:41:10 +00:00
Guillaume Gomez
1e222ba58a Update browser-ui-test version 2021-06-19 14:19:39 +02:00
Simonas Kazlauskas
9c9a0da132 Change entry point to 🛡️ against 💥 💥-payloads
Guard against panic payloads panicking within entrypoints, where it is
UB to do so.

Note that there are a number of implementation approaches to consider.
Some simpler, some more complicated. This particular solution is nice in
that it also guards against accidental implementation issues in
various pieces of runtime code, something we cannot prevent statically
right now.

Fixes #86030
2021-06-19 11:46:56 +03:00
bors
39260f6d49 Auto merge of #86426 - hi-rustin:rustin-patch-lint-warn, r=Aaron1011
Lint for unused borrows as part of UNUSED_MUST_USE

close https://github.com/rust-lang/rust/issues/76264

base on https://github.com/rust-lang/rust/pull/76894

r? `@RalfJung`
2021-06-19 08:41:58 +00:00
bors
9cf05f3614 Auto merge of #86378 - Smittyvb:thir-walker-pat, r=LeSeulArtichaut
Add pattern walking support to THIR walker

Suggested in https://github.com/rust-lang/rust/pull/85263#issuecomment-861906730, this splits off the support for pattern walking in THIR from #85263. This has no observable effect on THIR unsafety checking, since it is not currently possible to trigger unsafety from the THIR checker using the additional patterns or constants that are now walked. THIR patterns are walked in source code order.

r? `@LeSeulArtichaut`
2021-06-19 05:44:11 +00:00
Deadbeef
15cdb28f5b Account for self.extra in size_hint for EncodeWide 2021-06-19 12:59:22 +08:00
Yuki Okushi
e44e65e888
Assert is_associated_const when resolving 2021-06-19 13:55:24 +09:00
Yuki Okushi
bc243a7f55
Refactor PatternError structure 2021-06-19 11:47:15 +09:00
bors
9839f9c7ff Auto merge of #86456 - JohnTitor:rollup-jjzupny, r=JohnTitor
Rollup of 9 pull requests

Successful merges:

 - #86136 (Stabilize span_open() and span_close().)
 - #86359 (Use as_secs_f64 in JunitFormatter)
 - #86370 (Fix rustdoc stabilized versions layout)
 - #86397 (Alter std::cell::Cell::get_mut documentation)
 - #86407 (Use `map_or` instead of open-coding it)
 - #86425 (Update rustversion to 1.0.5)
 - #86440 (Update library tracking issue for libs-api rename.)
 - #86444 (Fix ICE with `#[repr(simd)]` on enum)
 - #86453 (stdlib: Fix typo in internal RefCell docs )

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-06-19 01:57:14 +00:00
Yuki Okushi
ad79aba2bc
Rollup merge of #86453 - akiselev:patch-1, r=dtolnay
stdlib: Fix typo in internal RefCell docs

`BorroeError` => `BorrowError` in [cell.rs](https://github.com/rust-lang/rust/blob/master/library/core/src/cell.rs#L581)
2021-06-19 10:14:15 +09:00
Yuki Okushi
84d6c68822
Rollup merge of #86444 - FabianWolff:issue-83505, r=LeSeulArtichaut
Fix ICE with `#[repr(simd)]` on enum

This pull request fixes #83505. `#[repr(simd)]` may only be applied to structs, which correctly causes `E0517` for the example given in #83505, but the compiler attempts to recover from this error, which leads to an ICE later, when `.non_enum_variant()` is called on the `AdtDef`. I have added a check that prevents this from happening.
2021-06-19 10:14:14 +09:00
Yuki Okushi
90e5fe5f86
Rollup merge of #86440 - rust-lang:libs-api-issue-template, r=m-ou-se
Update library tracking issue for libs-api rename.
2021-06-19 10:14:13 +09:00
Yuki Okushi
7de3a0e67f
Rollup merge of #86425 - dtolnay:rustversion, r=Mark-Simulacrum
Update rustversion to 1.0.5

1.0.4 was problematic for bootstrapping rustc on gentoo. See https://github.com/dtolnay/rustversion/issues/28.
2021-06-19 10:14:12 +09:00
Yuki Okushi
b6e234c6cf
Rollup merge of #86407 - LingMan:map-or, r=LeSeulArtichaut
Use `map_or` instead of open-coding it

`@rustbot` modify labels +C-cleanup +T-compiler
2021-06-19 10:14:11 +09:00