]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoDocument shared_from_cow functions
Deadbeef [Tue, 25 May 2021 12:06:02 +0000 (20:06 +0800)]
Document shared_from_cow functions

3 years agoAuto merge of #85664 - GuillaumeGomez:rollup-o7qgo8c, r=GuillaumeGomez
bors [Tue, 25 May 2021 11:12:47 +0000 (11:12 +0000)]
Auto merge of #85664 - GuillaumeGomez:rollup-o7qgo8c, r=GuillaumeGomez

Rollup of 6 pull requests

Successful merges:

 - #85361 (Use TargetTriple::from_path in rustdoc)
 - #85605 (Replace Local::new(1) with CAPTURE_STRUCT_LOCAL)
 - #85631 (Move keyword primitive css dom)
 - #85644 (Better English for documenting when to use unimplemented!())
 - #85650 (Add some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs)
 - #85657 (Remove doubled braces in non_exhaustive structs’ documentation text.)

Failed merges:

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

3 years agoRollup merge of #85657 - kpreid:brackets, r=jyn514
Guillaume Gomez [Tue, 25 May 2021 11:05:17 +0000 (13:05 +0200)]
Rollup merge of #85657 - kpreid:brackets, r=jyn514

Remove doubled braces in non_exhaustive structs’ documentation text.

In commit 4b806878549990d2ad2aa3c265751d3d89947cdf (part of Rust 1.52.1) many calls to `write!(w,` were replaced with `w.write_str(`, but this one contained braces that were doubled to escape them when taken as a format string, and so changing the call without changing the text caused them to become doubled in the final HTML output.

I examined `print_item.rs` and the diff of that prior commit for any other occurrences of this mistake and I did not find any.

3 years agoRollup merge of #85650 - scottmcm:adjust-adjustment-docs, r=jyn514
Guillaume Gomez [Tue, 25 May 2021 11:05:16 +0000 (13:05 +0200)]
Rollup merge of #85650 - scottmcm:adjust-adjustment-docs, r=jyn514

Add some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs

A few `[i32]`s are getting picked up as intra-doc links, rather than showing as slices, making the sentence quite confusing.

See https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/adjustment/struct.Adjustment.html

3 years agoRollup merge of #85644 - tialaramex:master, r=dtolnay
Guillaume Gomez [Tue, 25 May 2021 11:05:15 +0000 (13:05 +0200)]
Rollup merge of #85644 - tialaramex:master, r=dtolnay

Better English for documenting when to use unimplemented!()

I don't think "plan of using" is correct here. I considered "plan on using" but eventually decided "plan to use" is better.

3 years agoRollup merge of #85631 - GuillaumeGomez:move-keywrod-primitive-css-dom, r=jsha
Guillaume Gomez [Tue, 25 May 2021 11:05:14 +0000 (13:05 +0200)]
Rollup merge of #85631 - GuillaumeGomez:move-keywrod-primitive-css-dom, r=jsha

Move keyword primitive css dom

Fixes #85569.

r? ``@jsha``

3 years agoRollup merge of #85605 - ptrojahn:closure_struct, r=matthewjasper
Guillaume Gomez [Tue, 25 May 2021 11:05:14 +0000 (13:05 +0200)]
Rollup merge of #85605 - ptrojahn:closure_struct, r=matthewjasper

Replace Local::new(1) with CAPTURE_STRUCT_LOCAL

3 years agoRollup merge of #85361 - bjorn3:rustdoc_target_json_path_canonicalize, r=jyn514
Guillaume Gomez [Tue, 25 May 2021 11:05:09 +0000 (13:05 +0200)]
Rollup merge of #85361 - bjorn3:rustdoc_target_json_path_canonicalize, r=jyn514

Use TargetTriple::from_path in rustdoc

This fixes the problem reported in https://github.com/Rust-for-Linux/linux/pull/272 where rustdoc requires the absolute path of a target spec json instead of accepting a relative path like rustc.

3 years agoUpdate keyword GUI test
Guillaume Gomez [Mon, 24 May 2021 12:29:57 +0000 (14:29 +0200)]
Update keyword GUI test

3 years agoMove extra search result information for keywords and primitives from CSS to DOM
Guillaume Gomez [Mon, 24 May 2021 12:24:34 +0000 (14:24 +0200)]
Move extra search result information for keywords and primitives from CSS to DOM

3 years agoAuto merge of #85634 - RalfJung:miri, r=RalfJung
bors [Tue, 25 May 2021 08:31:56 +0000 (08:31 +0000)]
Auto merge of #85634 - RalfJung:miri, r=RalfJung

update Miri

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

3 years agoAuto merge of #84985 - pietroalbini:bootstrap-1.54, r=Mark-Simulacrum
bors [Tue, 25 May 2021 05:48:00 +0000 (05:48 +0000)]
Auto merge of #84985 - pietroalbini:bootstrap-1.54, r=Mark-Simulacrum

Bump bootstrap compiler to beta 1.53.0

This PR bumps the bootstrap compiler to version 1.53.0 beta, as part of our usual release process (this was supposed to be Wednesday's step, but creating the beta release took longer than expected).

The PR also includes the "Bootstrap: skip rustdoc fingerprint for building docs" commit, see the reasoning [on Zulip](https://zulip-archive.rust-lang.org/241545trelease/88450153betabootstrap.html).

r? `@Mark-Simulacrum`

3 years agoRemove doubled braces in non_exhaustive structs’ documentation text.
Kevin Reid [Tue, 25 May 2021 03:47:10 +0000 (20:47 -0700)]
Remove doubled braces in non_exhaustive structs’ documentation text.

In commit 4b806878549990d2ad2aa3c265751d3d89947cdf (part of Rust 1.52.1)
many calls to `write!(w,` were replaced with `w.write_str(`, but this
one contained braces that were doubled to escape them when taken as a
format string, and so changing the call without changing the text caused
them to become doubled in the final HTML output.

I examined `print_item.rs` and the diff of that prior commit for any
other occurrences of this mistake and I did not find any.

3 years agoAuto merge of #85273 - LeSeulArtichaut:thir-query, r=nikomatsakis
bors [Tue, 25 May 2021 03:07:03 +0000 (03:07 +0000)]
Auto merge of #85273 - LeSeulArtichaut:thir-query, r=nikomatsakis

Make building THIR a stealable query

This PR creates a stealable `thir_body` query so that we can build the THIR only once for THIR unsafeck and MIR build.

Blocked on #83842.
r? `@nikomatsakis`

3 years agoAdd some tests for the linkchecker.
Eric Huss [Mon, 24 May 2021 23:25:23 +0000 (16:25 -0700)]
Add some tests for the linkchecker.

3 years agoOptimize linkchecker by caching all filesystem access.
Eric Huss [Mon, 24 May 2021 23:24:27 +0000 (16:24 -0700)]
Optimize linkchecker by caching all filesystem access.

This should improve performance 2-3x depending on the system.

3 years agoAdd some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs
Scott McMurray [Mon, 24 May 2021 22:47:28 +0000 (15:47 -0700)]
Add some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs

A few `[i32]`s are getting picked up as intra-doc links, rather than showing as slices, making the sentence quite confusing.

3 years agoUpdate cc
Chris Denton [Mon, 24 May 2021 22:34:12 +0000 (23:34 +0100)]
Update cc

Recent commits to cc have helped to address #83043 and #43468

3 years agoRevert "Move llvm submodule updates to rustbuild"
Mark Rousskov [Mon, 24 May 2021 21:52:18 +0000 (17:52 -0400)]
Revert "Move llvm submodule updates to rustbuild"

3 years agoDemote ControlFlow::{from|into}_try to pub(crate)
Scott McMurray [Mon, 24 May 2021 21:29:44 +0000 (14:29 -0700)]
Demote ControlFlow::{from|into}_try to pub(crate)

3 years agoBetter English for documenting when to use unimplemented!()
Nick Lamb [Mon, 24 May 2021 21:21:05 +0000 (22:21 +0100)]
Better English for documenting when to use unimplemented!()

3 years agoApply suggestions from code review
Felix S Klock II [Mon, 24 May 2021 20:50:01 +0000 (16:50 -0400)]
Apply suggestions from code review

test THIR unsafeck too

Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
3 years agoAdd a comment
hyd-dev [Mon, 24 May 2021 19:51:41 +0000 (03:51 +0800)]
Add a comment

3 years ago`can_unwind` -> `caller_can_unwind`
hyd-dev [Mon, 24 May 2021 19:47:24 +0000 (03:47 +0800)]
`can_unwind` -> `caller_can_unwind`

3 years agoCheck whether unwinding is allowed before popping the stack frame
hyd-dev [Mon, 24 May 2021 16:08:26 +0000 (00:08 +0800)]
Check whether unwinding is allowed before popping the stack frame

3 years agoAuto merge of #85639 - GuillaumeGomez:rollup-modinsi, r=GuillaumeGomez
bors [Mon, 24 May 2021 18:05:35 +0000 (18:05 +0000)]
Auto merge of #85639 - GuillaumeGomez:rollup-modinsi, r=GuillaumeGomez

Rollup of 4 pull requests

Successful merges:

 - #85271 (Fix indentation in move keyword documentation)
 - #85551 (Fix search results display)
 - #85621 (Restore sans-serif font for module items.)
 - #85628 (Replace more "NULL" with "null")

Failed merges:

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

3 years agoAdd test
bjorn3 [Sun, 16 May 2021 16:41:54 +0000 (18:41 +0200)]
Add test

3 years agoUse parse_target_triple in rustdoc
bjorn3 [Sun, 16 May 2021 13:35:10 +0000 (15:35 +0200)]
Use parse_target_triple in rustdoc

3 years agoRollup merge of #85628 - LeSeulArtichaut:thir-null-lowercase, r=estebank
Guillaume Gomez [Mon, 24 May 2021 16:53:37 +0000 (18:53 +0200)]
Rollup merge of #85628 - LeSeulArtichaut:thir-null-lowercase, r=estebank

Replace more "NULL" with "null"

Error messages in THIR unsafeck still contain "NULL", make them lowercase to be consistent with MIR unsafeck (cc #84842).

3 years agoRollup merge of #85621 - jsha:serif-in-table, r=GuillaumeGomez
Guillaume Gomez [Mon, 24 May 2021 16:53:36 +0000 (18:53 +0200)]
Rollup merge of #85621 - jsha:serif-in-table, r=GuillaumeGomez

Restore sans-serif font for module items.

This was broke in #84462 by modifying a style that applied both to
searches and to module items (and other tables).

Fixes #85616.
Fixes https://github.com/rust-lang/rust/issues/85545.

r? `@camelid`

3 years agoRollup merge of #85551 - GuillaumeGomez:fix-search-result-overflow, r=jsha
Guillaume Gomez [Mon, 24 May 2021 16:53:35 +0000 (18:53 +0200)]
Rollup merge of #85551 - GuillaumeGomez:fix-search-result-overflow, r=jsha

Fix search results display

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

cc `@dns2utf8`

r? `@jsha`

3 years agoRollup merge of #85271 - th1000s:master, r=JohnTitor
Guillaume Gomez [Mon, 24 May 2021 16:53:29 +0000 (18:53 +0200)]
Rollup merge of #85271 - th1000s:master, r=JohnTitor

Fix indentation in move keyword documentation

See (at the time of writing) the second example code block with `create_fn()` at https://doc.rust-lang.org/std/keyword.move.html

3 years agoRustfmt
bjorn3 [Mon, 24 May 2021 16:41:45 +0000 (18:41 +0200)]
Rustfmt

3 years agoUpdate rustc bootstrap patch
bjorn3 [Mon, 24 May 2021 15:16:45 +0000 (17:16 +0200)]
Update rustc bootstrap patch

3 years agoAuto merge of #85596 - scottmcm:more-on-unimplemented, r=estebank
bors [Mon, 24 May 2021 15:24:38 +0000 (15:24 +0000)]
Auto merge of #85596 - scottmcm:more-on-unimplemented, r=estebank

Extend `rustc_on_implemented` to improve more `?` error messages

`_Self` could match the generic definition; this adds that functionality for matching the generic definition of type parameters too.

Your advice welcome on the wording of all these messages, and which things belong in the message/label/note.

r? `@estebank`

3 years agoupdate Miri
Ralf Jung [Mon, 24 May 2021 15:17:45 +0000 (17:17 +0200)]
update Miri

3 years agoremove cfg(bootstrap)
Pietro Albini [Thu, 6 May 2021 11:36:07 +0000 (13:36 +0200)]
remove cfg(bootstrap)

3 years agoBootstrap: skip rustdoc fingerprint for building docs.
Eric Huss [Tue, 27 Apr 2021 22:08:14 +0000 (15:08 -0700)]
Bootstrap: skip rustdoc fingerprint for building docs.

3 years agobootstrap from 1.54.0 beta
Pietro Albini [Thu, 6 May 2021 07:58:32 +0000 (09:58 +0200)]
bootstrap from 1.54.0 beta

3 years agominor rewording after review
Taylor Yu [Mon, 24 May 2021 14:24:35 +0000 (09:24 -0500)]
minor rewording after review

Use "the `WouldBlock` error" instead of "the error `WouldBlock`", etc.

3 years agoUpdate Cranelift, object and gimli
bjorn3 [Mon, 24 May 2021 14:06:54 +0000 (16:06 +0200)]
Update Cranelift, object and gimli

3 years agoMake `thir_check_unsafety` itself responsible for checking gate
LeSeulArtichaut [Mon, 24 May 2021 13:09:33 +0000 (15:09 +0200)]
Make `thir_check_unsafety` itself responsible for checking gate

3 years agoAdd comments about stealing THIR in `mir_build`
LeSeulArtichaut [Mon, 24 May 2021 13:05:20 +0000 (15:05 +0200)]
Add comments about stealing THIR in `mir_build`

3 years agoAuto merge of #85626 - lnicola:rust-analyzer-2021-05-24, r=jonas-schievink
bors [Mon, 24 May 2021 12:43:47 +0000 (12:43 +0000)]
Auto merge of #85626 - lnicola:rust-analyzer-2021-05-24, r=jonas-schievink

:arrow_up: rust-analyzer

3 years agoReplace more "NULL" with "null"
LeSeulArtichaut [Mon, 24 May 2021 10:59:33 +0000 (12:59 +0200)]
Replace more "NULL" with "null"

3 years ago:arrow_up: rust-analyzer
Laurențiu Nicola [Mon, 24 May 2021 10:56:09 +0000 (13:56 +0300)]
:arrow_up: rust-analyzer

3 years agoMake Vec::dedup panicking test actually detect double panics
Giacomo Stevanato [Mon, 24 May 2021 10:42:04 +0000 (12:42 +0200)]
Make Vec::dedup panicking test actually detect double panics

3 years agoAvoid a double drop in Vec::dedup if a destructor panics
Giacomo Stevanato [Mon, 24 May 2021 10:41:13 +0000 (12:41 +0200)]
Avoid a double drop in Vec::dedup if a destructor panics

3 years agoAuto merge of #85601 - klensy:padint-example-fix, r=dtolnay
bors [Mon, 24 May 2021 10:02:55 +0000 (10:02 +0000)]
Auto merge of #85601 - klensy:padint-example-fix, r=dtolnay

fix pad_integral example

pad_integral's parameter `is_nonnegative - whether the original integer was either positive or zero`, but in example it checked as `self.nb > 0`, so it previously printed `-0` for `format!("{}", Foo::new(0)`, what is wrong.

3 years agoRemove stray .stderr files
LeSeulArtichaut [Mon, 24 May 2021 08:50:51 +0000 (10:50 +0200)]
Remove stray .stderr files

3 years agoAuto merge of #85515 - jedel1043:fix-85480, r=petrochenkov
bors [Mon, 24 May 2021 05:39:07 +0000 (05:39 +0000)]
Auto merge of #85515 - jedel1043:fix-85480, r=petrochenkov

Fix ast pretty printing for anonymous types

Fixes #85480.

3 years agoRestore sans-serif font for module items.
Jacob Hoffman-Andrews [Mon, 24 May 2021 05:28:19 +0000 (22:28 -0700)]
Restore sans-serif font for module items.

This was broke in #84462 by modifying a style that applied both to
searches and to module items (and other tables).

3 years agoAdd test for pretty printing anonymous types
jedel1043 [Fri, 21 May 2021 16:45:55 +0000 (11:45 -0500)]
Add test for pretty printing anonymous types

3 years agoFix ast expanded printing for anonymous types
jedel1043 [Thu, 20 May 2021 15:06:11 +0000 (10:06 -0500)]
Fix ast expanded printing for anonymous types

3 years agoAuto merge of #85611 - rust-lang:array-mod-doc, r=jyn514
bors [Mon, 24 May 2021 01:53:53 +0000 (01:53 +0000)]
Auto merge of #85611 - rust-lang:array-mod-doc, r=jyn514

Update std::array module doc header

This line is very outdated; not only are traits implemented on arrays of arbitrary length, those implementations are documented on the primitive type, not in this module.

3 years agoAuto merge of #85606 - 12101111:link_modifiers, r=petrochenkov
bors [Sun, 23 May 2021 22:06:53 +0000 (22:06 +0000)]
Auto merge of #85606 - 12101111:link_modifiers, r=petrochenkov

remove native_link_modifiers from the list of incomplete features.

These features are fully implemented and not incomplete.
The tracking issue of them is https://github.com/rust-lang/rust/issues/81490.
The implement PR is https://github.com/rust-lang/rust/pull/83507.

3 years agoDon't reborrow self when computing the dest pointer in <[T]>::copy_within
Giacomo Stevanato [Sun, 23 May 2021 19:43:11 +0000 (21:43 +0200)]
Don't reborrow self when computing the dest pointer in <[T]>::copy_within

3 years agoUpdate std::array module doc header
bstrie [Sun, 23 May 2021 19:55:27 +0000 (15:55 -0400)]
Update std::array module doc header

Extremely outdated; not only are traits implemented on arrays of arbitrary length, those implementations are documented on the primitive type, not in this module.

3 years agoAuto merge of #85554 - 12101111:fix-dedup-native-libs, r=petrochenkov
bors [Sun, 23 May 2021 19:42:19 +0000 (19:42 +0000)]
Auto merge of #85554 - 12101111:fix-dedup-native-libs, r=petrochenkov

native lib: defer the duplicate check after relevant_lib check.

https://github.com/rust-lang/rust/pull/84794 break code using conditional-compilation with `#[link]` attributes.

```rust
#[cfg(target_env = "musl")]
cfg_if::cfg_if! {
    if #[cfg(any(target_feature = "crt-static", feature = "llvm-libunwind"))] {
        #[link(name = "unwind", kind = "static", modifiers = "-bundle")]
        extern "C" {}
    } else {
        #[link(name = "unwind", cfg(feature = "system-llvm-libunwind"))]
        #[link(name = "gcc_s", cfg(not(feature = "system-llvm-libunwind")))]
        extern "C" {}
    }
}

```

3 years agoAuto merge of #85602 - GuillaumeGomez:donthide-inherent-impls, r=jsha
bors [Sun, 23 May 2021 17:13:51 +0000 (17:13 +0000)]
Auto merge of #85602 - GuillaumeGomez:donthide-inherent-impls, r=jsha

Don't hide inherent implementations by default

Fixes a regression introduced in #85575.

r? `@jsha`

3 years agoremove native_link_modifiers from the list of incomplete features.
12101111 [Sun, 23 May 2021 16:36:55 +0000 (00:36 +0800)]
remove native_link_modifiers from the list of incomplete features.

3 years agoReplace Local::new(1) with CAPTURE_STRUCT_LOCAL
Paul Trojahn [Fri, 21 May 2021 19:01:27 +0000 (21:01 +0200)]
Replace Local::new(1) with CAPTURE_STRUCT_LOCAL

3 years agoAuto merge of #85479 - Stupremee:render-Self_as-type-casts, r=CraftSpider
bors [Sun, 23 May 2021 14:54:14 +0000 (14:54 +0000)]
Auto merge of #85479 - Stupremee:render-Self_as-type-casts, r=CraftSpider

rustdoc: render `<Self as X>::Y` type casts properly

Rustdoc didn't render any `<Self as X>` casts which causes invalid code inside the documentation. This is fixed by this PR by checking if the target type `X` is different from `Self`, and if so, it will render a typecast.

Resolves #85454

3 years ago:facepalm:
hyd-dev [Sun, 23 May 2021 14:19:12 +0000 (22:19 +0800)]
:facepalm:

3 years agoExtend rustc_on_implemented to improve a ?-on-ControlFlow error message
Scott McMurray [Sun, 23 May 2021 06:47:12 +0000 (23:47 -0700)]
Extend rustc_on_implemented to improve a ?-on-ControlFlow error message

3 years agoPass `StackPopUnwind` to `eval_fn_call()` and some other functions that are called...
hyd-dev [Sat, 22 May 2021 20:37:17 +0000 (04:37 +0800)]
Pass `StackPopUnwind` to `eval_fn_call()` and some other functions that are called by `eval_fn_call()`

3 years ago"unwind" -> "unwinding"
hyd-dev [Sat, 22 May 2021 13:24:13 +0000 (21:24 +0800)]
"unwind" -> "unwinding"

3 years ago`Cleanup(Option<_>)` -> `Cleanup(BasicBlock), Skip`
hyd-dev [Sat, 22 May 2021 13:05:59 +0000 (21:05 +0800)]
`Cleanup(Option<_>)` -> `Cleanup(BasicBlock), Skip`

3 years agoDon't hide inherent implementations by default
Guillaume Gomez [Sun, 23 May 2021 12:33:50 +0000 (14:33 +0200)]
Don't hide inherent implementations by default

3 years agoAuto merge of #85599 - RalfJung:immut-allocs, r=oli-obk
bors [Sun, 23 May 2021 12:05:47 +0000 (12:05 +0000)]
Auto merge of #85599 - RalfJung:immut-allocs, r=oli-obk

fix deallocation of immutable allocations

As part of https://github.com/rust-lang/miri/pull/1814, I realized that we currently allow deallocating immutable allocations. This PR fixes that, and also adds some new APIs that are required to still support the existing Miri backtrace support.

r? `@oli-obk`

3 years agofix pad_integral example
klensy [Sun, 23 May 2021 11:48:16 +0000 (14:48 +0300)]
fix pad_integral example

3 years agofix comment
Ralf Jung [Sun, 23 May 2021 11:26:51 +0000 (13:26 +0200)]
fix comment

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
3 years ago(try to) fix cranelift
Ralf Jung [Sun, 23 May 2021 10:44:05 +0000 (12:44 +0200)]
(try to) fix cranelift

3 years ago(try to) fix cranelift
Ralf Jung [Sun, 23 May 2021 10:44:05 +0000 (12:44 +0200)]
(try to) fix cranelift

3 years agosupport creating mutable allocations from byte slices
Ralf Jung [Sun, 23 May 2021 10:03:39 +0000 (12:03 +0200)]
support creating mutable allocations from byte slices

3 years agoavoid redundant immutability check
Ralf Jung [Sun, 23 May 2021 09:55:31 +0000 (11:55 +0200)]
avoid redundant immutability check

3 years agoreject deallocation of read-only allocations
Ralf Jung [Sun, 23 May 2021 09:53:23 +0000 (11:53 +0200)]
reject deallocation of read-only allocations

3 years agoAuto merge of #85490 - CDirkx:fix-vxworks, r=dtolnay
bors [Sun, 23 May 2021 05:40:18 +0000 (05:40 +0000)]
Auto merge of #85490 - CDirkx:fix-vxworks, r=dtolnay

Fix `vxworks`

Some PRs made the `vxworks` target not build anymore. This PR fixes that:

- #82973: copy `ExitStatusError` implementation from `unix`.
- #84716: no `libc::chroot` available on `vxworks`, so for now don't implement `os::unix::fs::chroot`.

3 years agoAuto merge of #85594 - Dylan-DPC:rollup-40sgqgg, r=Dylan-DPC
bors [Sun, 23 May 2021 03:24:27 +0000 (03:24 +0000)]
Auto merge of #85594 - Dylan-DPC:rollup-40sgqgg, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #84758 (MSVC: Avoid using jmp stubs for dll function imports)
 - #85288 (add an example to explain std::io::Read::read returning 0 in some cases)
 - #85334 (Add doc aliases to `unit`)
 - #85525 (Fix my mailmap entry)
 - #85571 (Remove surplus prepend LinkedList fn)
 - #85575 (Fix auto-hide for implementations and implementors.)

Failed merges:

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

3 years agoRollup merge of #85575 - jsha:fix-toggle-settings, r=GuillaumeGomez
Dylan DPC [Sun, 23 May 2021 01:23:47 +0000 (03:23 +0200)]
Rollup merge of #85575 - jsha:fix-toggle-settings, r=GuillaumeGomez

Fix auto-hide for implementations and implementors.

This sets their toggles to be closed in the HTML (matching the default
setting), and opens them if the setting indicates to do so.

This distinguishes between implementations and implementors based on
being descendants of certain named elements.

Demo https://hoffman-andrews.com/rust/fix-toggle-settings/std/io/trait.Read.html#implementors
and https://hoffman-andrews.com/rust/fix-toggle-settings/std/string/struct.String.html#trait-implementations

Fixes #85411

r? `@GuillaumeGomez`

3 years agoRollup merge of #85571 - workingjubilee:reverse-prepend, r=Amanieu
Dylan DPC [Sun, 23 May 2021 01:23:47 +0000 (03:23 +0200)]
Rollup merge of #85571 - workingjubilee:reverse-prepend, r=Amanieu

Remove surplus prepend LinkedList fn

This nightly library feature provides a function on `LinkedList<T>` that is identical to `fn append` with a reversed order of arguments. Observe this diff against the `fn append` doctest:
```diff
+#![feature(linked_list_prepend)]
 fn main() {
    use std::collections::LinkedList;
    let mut list1 = LinkedList::new();
    list1.push_back('a');
    let mut list2 = LinkedList::new();
    list2.push_back('b');
    list2.push_back('c');

-    list1.append(&mut list2);
+    list2.prepend(&mut list1);

-    let mut iter = list1.iter();
+    let mut iter = list2.iter();
     assert_eq!(iter.next(), Some(&'a'));
     assert_eq!(iter.next(), Some(&'b'));
     assert_eq!(iter.next(), Some(&'c'));
     assert!(iter.next().is_none());

-    assert!(list2.is_empty());
+    assert!(list1.is_empty());
 }
```

As this has received no obvious request to stabilize it, nor does it have a tracking issue, and was left on nightly and the consensus seems to have been to deprecate it in this pre-1.0 PR in 2014, https://github.com/rust-lang/rust/pull/20356, I propose simply removing it.

3 years agoRollup merge of #85525 - camelid:fix-mailmap, r=Mark-Simulacrum
Dylan DPC [Sun, 23 May 2021 01:23:46 +0000 (03:23 +0200)]
Rollup merge of #85525 - camelid:fix-mailmap, r=Mark-Simulacrum

Fix my mailmap entry

r? `@Mark-Simulacrum`

3 years agoRollup merge of #85334 - r00ster91:patch-8, r=dtolnay
Dylan DPC [Sun, 23 May 2021 01:23:41 +0000 (03:23 +0200)]
Rollup merge of #85334 - r00ster91:patch-8, r=dtolnay

Add doc aliases to `unit`

I think it makes sense for `unit` to have the same doc aliases as `tuple` does.

3 years agoRollup merge of #85288 - Geal:clarify-std-io-read, r=dtolnay
Dylan DPC [Sun, 23 May 2021 01:23:37 +0000 (03:23 +0200)]
Rollup merge of #85288 - Geal:clarify-std-io-read, r=dtolnay

add an example to explain std::io::Read::read returning 0 in some cases

I have always found the explanation about `Read::read` returning 0 to indicate EOF but not indefinitely, so here's more info using Linux as example. I can also add example code if necessary

3 years agoRollup merge of #84758 - ChrisDenton:dllimport, r=dtolnay
Dylan DPC [Sun, 23 May 2021 01:23:34 +0000 (03:23 +0200)]
Rollup merge of #84758 - ChrisDenton:dllimport, r=dtolnay

MSVC: Avoid using jmp stubs for dll function imports

Windows import libraries contain two symbols for every function: `__imp_FunctionName` and `FunctionName` (where `FunctionName` is the name of the function to be imported).

`__imp_FunctionName` contains the address of the imported function. This will be filled in by the Windows executable loader at runtime. `FunctionName` contains a jmp stub that simply jumps to the address given by `__imp_FunctionName`. E.g. it's a function that solely contains a single jmp instruction:

```asm
jmp __imp_FunctionName
```

When using an external DLL function in Rust, by default the linker will link to FunctionName, causing a bit of indirection at runtime. In Microsoft's C++ it's possible to instead tell it to insert calls to the address in `__imp_FunctionName` by using the  `__declspec(dllimport)` attribute. In Rust it's possible to get effectively the same behaviour using the `#[link]` attribute on `extern` blocks.

----

The second commit also merges multiple `extern` blocks into one block. This is because otherwise Rust will currently create duplicate linker arguments for each block. In this case having duplicates shouldn't matter much other than the noise when displaying the linker command.

3 years agoAuto merge of #81601 - jyn514:llvm-on-demand, r=Mark-Simulacrum
bors [Sun, 23 May 2021 00:40:48 +0000 (00:40 +0000)]
Auto merge of #81601 - jyn514:llvm-on-demand, r=Mark-Simulacrum

Move llvm submodule updates to rustbuild

This enables better caching, since LLVM is only updated when needed, not
whenever x.py is run. Before, bootstrap.py had to use heuristics to
guess if LLVM would be needed, and updated the module more often than
necessary as a result.

This syncs the LLVM submodule only just before building the compiler, so
people working on the standard library never have to worry about it.
Example output:

```
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Updating submodule src/llvm-project
Submodule 'src/llvm-project' (https://github.com/rust-lang/llvm-project.git) registered for path 'src/llvm-project'
Submodule path 'src/llvm-project': checked out 'f9a8d70b6e0365ac2172ca6b7f1de0341297458d'
```

Implements https://github.com/rust-lang/rust/issues/76653#issuecomment-770265169. This could be easily extended to other submodules, like `rust-by-example` and `rustc-dev-guide`, which aren't needed for cargo's workspace resolution.

3 years agoMove llvm submodule updates to rustbuild
Joshua Nelson [Sun, 31 Jan 2021 17:20:30 +0000 (12:20 -0500)]
Move llvm submodule updates to rustbuild

This enables better caching, since LLVM is only updated when needed, not
whenever x.py is run. Before, bootstrap.py had to use heuristics to
guess if LLVM would be needed, and updated the module more often than
necessary as a result.

This syncs the LLVM submodule only just before building the compiler, so
people working on the standard library never have to worry about it.
Example output:

```
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Updating submodule src/llvm-project
Submodule 'src/llvm-project' (https://github.com/rust-lang/llvm-project.git) registered for path 'src/llvm-project'
Submodule path 'src/llvm-project': checked out 'f9a8d70b6e0365ac2172ca6b7f1de0341297458d'
```

- Don't try to update the LLVM submodule when using system LLVM

  Previously, this would try to update LLVM unconditionally. Now the
  submodule is only initialized if `llvm-config` is not set.

- Don't update LLVM submodule in dry runs

  This prevents the following test failures:

  ```
  running 17 tests
  fatal: invalid gitfile format: /checkout/src/llvm-project/.git
  test builder::tests::defaults::build_cross_compile ... FAILED

  ---- builder::tests::defaults::build_default stdout ----
  thread 'main' panicked at 'command did not execute successfully: "git" "rev-parse" "HEAD"
  expected success, got: exit code: 128', src/build_helper/lib.rs:139:9
  ```

- Try running git without --progress if it fails the first time

  This avoids having to do version detection to see if --progress is
  supported or not.

- Don't try to update submodules when the source repository isn't managed by git

- Update LLVM submodules that have already been checked out

- Only check for whether the submodule should be updated in lib.rs; update
it unconditionally in native.rs

3 years agolinkchecker: Organize state into a struct, and add report.
Eric Huss [Mon, 11 Jan 2021 18:13:08 +0000 (10:13 -0800)]
linkchecker: Organize state into a struct, and add report.

Moves all the state into a struct so it doesn't need to be passed around
as much.

Also adds a report showing how long it took and what it found.

This includes a minor change: a failure to load a file is now an error,
instead of being ignored. This should only happen if there is a
permission error or some other shenanigans going on.

3 years agoFix boostrap using host exe suffix for cargo
jam1garner [Sat, 22 May 2021 21:48:26 +0000 (17:48 -0400)]
Fix boostrap using host exe suffix for cargo

3 years agoDon't evaluate `self.fn_can_unwind(...)` if `can_unwind` is already true
hyd-dev [Sat, 22 May 2021 11:32:55 +0000 (19:32 +0800)]
Don't evaluate `self.fn_can_unwind(...)` if `can_unwind` is already true

3 years agoRefactor `match` + `if`
hyd-dev [Fri, 21 May 2021 20:14:35 +0000 (04:14 +0800)]
Refactor `match` + `if`

3 years agoMove the callee "can unwind" check to the right place
hyd-dev [Fri, 21 May 2021 19:53:00 +0000 (03:53 +0800)]
Move the callee "can unwind" check to the right place

3 years agoconst-eval: disallow unwinding across functions that `!fn_can_unwind()`
hyd-dev [Fri, 21 May 2021 12:40:36 +0000 (20:40 +0800)]
const-eval: disallow unwinding across functions that `!fn_can_unwind()`

3 years agoAuto merge of #85578 - RalfJung:alloc-mem-extra, r=oli-obk
bors [Sat, 22 May 2021 20:04:52 +0000 (20:04 +0000)]
Auto merge of #85578 - RalfJung:alloc-mem-extra, r=oli-obk

CTFE get_alloc_extra_mut: also provide ref to MemoryExtra

This would let me use mutable references in more places in Stacked Borrows, avoiding some `RefCell` overhead. :)

r? `@oli-obk`

3 years agoAuto merge of #85078 - RalfJung:const_fn_unsize, r=oli-obk
bors [Sat, 22 May 2021 17:38:15 +0000 (17:38 +0000)]
Auto merge of #85078 - RalfJung:const_fn_unsize, r=oli-obk

stabilize const_fn_unsize

I will post a stabilization report and ask for FCP in https://github.com/rust-lang/rust/issues/64992.
This PR is for the implementation side of stabilization.

r? `@oli-obk`
Fixes https://github.com/rust-lang/rust/issues/64992

3 years agoFix auto-hide for implementations and implementors.
Jacob Hoffman-Andrews [Sat, 22 May 2021 04:24:03 +0000 (21:24 -0700)]
Fix auto-hide for implementations and implementors.

This sets their toggles to be closed in the HTML (matching the default
setting), and opens them if the setting indicates to do so.

This distinguishes between implementations and implementors based on
being descendants of certain named elements.

3 years agoAuto merge of #85514 - GuillaumeGomez:upgrade-minifer-version, r=Mark-Simulacrum
bors [Sat, 22 May 2021 14:54:45 +0000 (14:54 +0000)]
Auto merge of #85514 - GuillaumeGomez:upgrade-minifer-version, r=Mark-Simulacrum

Upgrade minifier version to 0.0.41

3 years agoAdd test for search result resize width
Guillaume Gomez [Sat, 22 May 2021 14:41:26 +0000 (16:41 +0200)]
Add test for search result resize width

3 years agoHandle typeck errors properly
LeSeulArtichaut [Sat, 22 May 2021 13:40:26 +0000 (15:40 +0200)]
Handle typeck errors properly

3 years agoRemove some errors in UI tests
LeSeulArtichaut [Sat, 15 May 2021 09:42:10 +0000 (11:42 +0200)]
Remove some errors in UI tests
As we now need to run THIR unsafeck before MIR build, errors in unsafeck can cause the compilation to be aborted earlier.