Commit graph

148901 commits

Author SHA1 Message Date
Mara Bos
04a4a8225b Add new traits to 2021 prelude. 2021-05-25 19:58:50 +02:00
Mara Bos
e37ef7a842 Add tracking issue for edition-specific preludes. 2021-05-25 19:58:39 +02:00
bors
cdbe288897 Auto merge of #85634 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/85591
2021-05-25 08:31:56 +00:00
bors
a7890c7952 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`
2021-05-25 05:48:00 +00:00
bors
d568d63b1f 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`
2021-05-25 03:07:03 +00:00
bors
126561cb31 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
2021-05-24 18:05:35 +00:00
Guillaume Gomez
16fe40d3a3
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).
2021-05-24 18:53:37 +02:00
Guillaume Gomez
9d3b9cdb2c
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`
2021-05-24 18:53:36 +02:00
Guillaume Gomez
30f4486ee4
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`
2021-05-24 18:53:35 +02:00
Guillaume Gomez
2a8eeafa9d
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
2021-05-24 18:53:29 +02:00
bors
ef0ec303fa 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`
2021-05-24 15:24:38 +00:00
Ralf Jung
8b8801e591 update Miri 2021-05-24 17:17:45 +02:00
Pietro Albini
9e22b844dd remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
Eric Huss
1c9500a8f4 Bootstrap: skip rustdoc fingerprint for building docs. 2021-05-24 10:37:13 -04:00
Pietro Albini
c81c3d0d73 bootstrap from 1.54.0 beta 2021-05-24 10:37:12 -04:00
LeSeulArtichaut
af3d9a3aa3 Make thir_check_unsafety itself responsible for checking gate 2021-05-24 15:09:33 +02:00
LeSeulArtichaut
13e7b237fd Add comments about stealing THIR in mir_build 2021-05-24 15:05:20 +02:00
bors
bf24e6ba00 Auto merge of #85626 - lnicola:rust-analyzer-2021-05-24, r=jonas-schievink
⬆️ rust-analyzer
2021-05-24 12:43:47 +00:00
LeSeulArtichaut
3559565e07 Replace more "NULL" with "null" 2021-05-24 12:59:33 +02:00
Laurențiu Nicola
4b31d95e18 ⬆️ rust-analyzer 2021-05-24 13:56:09 +03:00
bors
6f6919231e 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.
2021-05-24 10:02:55 +00:00
bors
68424e2f01 Auto merge of #85515 - jedel1043:fix-85480, r=petrochenkov
Fix ast pretty printing for anonymous types

Fixes #85480.
2021-05-24 05:39:07 +00:00
Jacob Hoffman-Andrews
c1c6175e62 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).
2021-05-23 22:28:19 -07:00
jedel1043
d59b1f1ef4 Add test for pretty printing anonymous types 2021-05-24 00:05:46 -05:00
jedel1043
5b4bc05fa5 Fix ast expanded printing for anonymous types 2021-05-24 00:03:59 -05:00
bors
3f9646da57 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.
2021-05-24 01:53:53 +00:00
bors
9f69e2f8b2 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.
2021-05-23 22:06:53 +00:00
bstrie
ed75d62fd5
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.
2021-05-23 15:55:27 -04:00
bors
f64503eb55 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" {}
    }
}

```
2021-05-23 19:42:19 +00:00
bors
d8af907491 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`
2021-05-23 17:13:51 +00:00
12101111
a90ec5d492
remove native_link_modifiers from the list of incomplete features. 2021-05-24 00:36:55 +08:00
bors
13bf0b2a3c 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
2021-05-23 14:54:14 +00:00
Scott McMurray
8be67998a1 Extend rustc_on_implemented to improve a ?-on-ControlFlow error message 2021-05-23 07:18:02 -07:00
Guillaume Gomez
d7579b9134 Don't hide inherent implementations by default 2021-05-23 14:37:41 +02:00
bors
0f8cd43ee8 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`
2021-05-23 12:05:47 +00:00
klensy
7c0db6f0f1 fix pad_integral example 2021-05-23 14:48:16 +03:00
Ralf Jung
f9b36b4f65
fix comment
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2021-05-23 13:26:51 +02:00
Ralf Jung
461b2f83f3 (try to) fix cranelift 2021-05-23 12:44:05 +02:00
Ralf Jung
585141b219 support creating mutable allocations from byte slices 2021-05-23 12:37:16 +02:00
Ralf Jung
c3005e85da avoid redundant immutability check 2021-05-23 11:55:31 +02:00
Ralf Jung
3bcba11c35 reject deallocation of read-only allocations 2021-05-23 11:53:23 +02:00
bors
6e92fb4098 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`.
2021-05-23 05:40:18 +00:00
bors
92418ce65a 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
2021-05-23 03:24:27 +00:00
Dylan DPC
85b45b5163
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`
2021-05-23 03:23:47 +02:00
Dylan DPC
75edb76937
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.
2021-05-23 03:23:47 +02:00
Dylan DPC
d978060cc6
Rollup merge of #85525 - camelid:fix-mailmap, r=Mark-Simulacrum
Fix my mailmap entry

r? `@Mark-Simulacrum`
2021-05-23 03:23:46 +02:00
Dylan DPC
4430aab045
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.
2021-05-23 03:23:41 +02:00
Dylan DPC
b1e0d5fda5
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
2021-05-23 03:23:37 +02:00
Dylan DPC
d5fa533ab0
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.
2021-05-23 03:23:34 +02:00
bors
9c3a2a57ef 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.
2021-05-23 00:40:48 +00:00