]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoUpdate `fs::remove_file` docs
Imbolc [Wed, 29 Jul 2020 05:18:01 +0000 (08:18 +0300)]
Update `fs::remove_file` docs

Mention that absence of file causes an error

3 years agoAuto merge of #74894 - JohnTitor:rollup-4ine62a, r=JohnTitor
bors [Wed, 29 Jul 2020 01:38:00 +0000 (01:38 +0000)]
Auto merge of #74894 - JohnTitor:rollup-4ine62a, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #74266 (Clean up E0720 explanation)
 - #74671 (add const generics array coercion test)
 - #74707 (Add str::[r]split_once)
 - #74814 (Fix RefUnwindSafe & UnwinsSafe impls for lazy::SyncLazy)
 - #74859 (Update outdated readme)
 - #74864 (ayu theme: Change doccomment color to `#a1ac88`)
 - #74872 (Enable to ping RISC-V group via triagebot)
 - #74891 (handle ConstEquate in rustdoc)

Failed merges:

r? @ghost

3 years agoRollup merge of #74891 - lcnr:auto-trait-finder, r=varkor
Yuki Okushi [Wed, 29 Jul 2020 00:24:25 +0000 (09:24 +0900)]
Rollup merge of #74891 - lcnr:auto-trait-finder, r=varkor

handle ConstEquate in rustdoc

fixes #74882

r? @varkor cc @eddyb

3 years agoRollup merge of #74872 - JohnTitor:ping-risc-v, r=Mark-Simulacrum
Yuki Okushi [Wed, 29 Jul 2020 00:24:24 +0000 (09:24 +0900)]
Rollup merge of #74872 - JohnTitor:ping-risc-v, r=Mark-Simulacrum

Enable to ping RISC-V group via triagebot

We have the RISC-V group (https://github.com/rust-lang/team/blob/master/teams/risc-v.toml) but don't enable to ping on this repository (https://github.com/rust-lang/rust/pull/74813#issuecomment-664841177).
We don't have the instructions on the rustc-dev-guide yet but I'll create it soonish.

3 years agoRollup merge of #74864 - lzutao:ayu-doccolor, r=GuillaumeGomez
Yuki Okushi [Wed, 29 Jul 2020 00:24:22 +0000 (09:24 +0900)]
Rollup merge of #74864 - lzutao:ayu-doccolor, r=GuillaumeGomez

ayu theme: Change doccomment color to `#a1ac88`

Before:
![image](https://user-images.githubusercontent.com/15225902/88621499-d1cbff80-d0ca-11ea-99c3-5e2632709274.png)

After:
![image](https://user-images.githubusercontent.com/15225902/88621471-bf51c600-d0ca-11ea-9455-9c297f50f15f.png)

Close #74788

3 years agoRollup merge of #74859 - mark-i-m:patch-1, r=JohnTitor
Yuki Okushi [Wed, 29 Jul 2020 00:24:20 +0000 (09:24 +0900)]
Rollup merge of #74859 - mark-i-m:patch-1, r=JohnTitor

Update outdated readme

3 years agoRollup merge of #74814 - matklad:unwind-safe, r=KodrAus
Yuki Okushi [Wed, 29 Jul 2020 00:24:19 +0000 (09:24 +0900)]
Rollup merge of #74814 - matklad:unwind-safe, r=KodrAus

Fix RefUnwindSafe & UnwinsSafe impls for lazy::SyncLazy

I *think* we should implement those unconditionally with respect to `F`.

The user code can't observe the closure in any way, and we poison lazy if the closure itself panics.

But I've never fully wrapped my head around `UnwindSafe` traits, so :man_shrugging:

3 years agoRollup merge of #74707 - matklad:split_once, r=dtolnay
Yuki Okushi [Wed, 29 Jul 2020 00:24:17 +0000 (09:24 +0900)]
Rollup merge of #74707 - matklad:split_once, r=dtolnay

Add str::[r]split_once

This is useful for quick&dirty parsing of key: value config pairs. Used a bunch in Cargo and rust-analyzer:

* https://github.com/rust-lang/cargo/search?q=splitn%282&unscoped_q=splitn%282
* https://github.com/rust-analyzer/rust-analyzer/search?q=split_delim&unscoped_q=split_delim

In theory, once const-generics are done, this functionality could be achieved without a dedicated method with

```rust
match s.splitn(delimier, 2).collect_array::<2>() {
  Some([prefix, suffix]) => todo!(),
  None => todo!(),
}
```

Even in that world, having a dedicated method seems clearer on the intention.

I am not sure about naming -- this is something I've just came up with yesterday, I don't know off the top of my head analogs in other languages.

If T-libs thinks this is a reasonable API to have, I'll open a tracking issue and add more thorough tests.

3 years agoRollup merge of #74671 - rust-lang:const-generics-coerce-unsized, r=nikomatsakis
Yuki Okushi [Wed, 29 Jul 2020 00:24:15 +0000 (09:24 +0900)]
Rollup merge of #74671 - rust-lang:const-generics-coerce-unsized, r=nikomatsakis

add const generics array coercion test

3 years agoRollup merge of #74266 - GuillaumeGomez:cleanup-e0720, r=Dylan-DPC
Yuki Okushi [Wed, 29 Jul 2020 00:24:13 +0000 (09:24 +0900)]
Rollup merge of #74266 - GuillaumeGomez:cleanup-e0720, r=Dylan-DPC

Clean up E0720 explanation

r? @Dylan-DPC

3 years agoAuto merge of #74791 - tmiasko:raw-waker-inline, r=LukasKalbertodt
bors [Tue, 28 Jul 2020 23:45:05 +0000 (23:45 +0000)]
Auto merge of #74791 - tmiasko:raw-waker-inline, r=LukasKalbertodt

Add #[inline] to RawWaker::new

`RawWaker::new` is used when creating a new waker or cloning an existing one,
for example as in code below. The `RawWakerVTable::new` can be const evaluated,
but `RawWaker::new` itself cannot since waker pointer is not known at compile
time. Add `#[inline]` to avoid overhead of a function call.

```rust
unsafe fn clone_waker<W: Wake + Send + Sync + 'static>(waker: *const ()) -> RawWaker {
    unsafe { Arc::incr_strong_count(waker as *const W) };
    RawWaker::new(
        waker as *const (),
        &RawWakerVTable::new(clone_waker::<W>, wake::<W>, wake_by_ref::<W>, drop_waker::<W>),
    )
}
```

3 years agohandle ConstEquate in rustdoc
Bastian Kauschke [Tue, 28 Jul 2020 22:00:55 +0000 (00:00 +0200)]
handle ConstEquate in rustdoc

3 years agoAuto merge of #74861 - mark-i-m:mv-std-followup, r=Mark-Simulacrum
bors [Tue, 28 Jul 2020 21:48:22 +0000 (21:48 +0000)]
Auto merge of #74861 - mark-i-m:mv-std-followup, r=Mark-Simulacrum

Re-enable linkcheck after moving std

3 years agoAuto merge of #74471 - da-x:string-type-diagnostic-item, r=petrochenkov
bors [Tue, 28 Jul 2020 20:00:37 +0000 (20:00 +0000)]
Auto merge of #74471 - da-x:string-type-diagnostic-item, r=petrochenkov

librustc_typeck: use diag item instead of string compare

3 years agoCollect library features from library/
Mark Rousskov [Tue, 28 Jul 2020 13:52:39 +0000 (09:52 -0400)]
Collect library features from library/

3 years agoreenable tests after moving std
mark [Tue, 28 Jul 2020 04:02:34 +0000 (23:02 -0500)]
reenable tests after moving std

3 years agoAuto merge of #74482 - alexcrichton:update-stdarch, r=hanna-kruppe
bors [Tue, 28 Jul 2020 17:39:39 +0000 (17:39 +0000)]
Auto merge of #74482 - alexcrichton:update-stdarch, r=hanna-kruppe

Update stdarch submodule

This commit updates the src/stdarch submodule primarily to include
rust-lang/stdarch#874 which updated and revamped WebAssembly SIMD
intrinsics and renamed WebAssembly atomics intrinsics. This is all
unstable surface area of the standard library so the changes should be
ok here. The SIMD updates also enable SIMD intrinsics to be used by any
program any any time, yay!

cc #74372, a tracking issue I've opened for the stabilization of SIMD
intrinsics

3 years agoUpdate stdarch submodule
Alex Crichton [Sat, 18 Jul 2020 15:43:09 +0000 (08:43 -0700)]
Update stdarch submodule

This commit updates the src/stdarch submodule primarily to include
rust-lang/stdarch#874 which updated and revamped WebAssembly SIMD
intrinsics and renamed WebAssembly atomics intrinsics. This is all
unstable surface area of the standard library so the changes should be
ok here. The SIMD updates also enable SIMD intrinsics to be used by any
program any any time, yay!

cc #74372, a tracking issue I've opened for the stabilization of SIMD
intrinsics

3 years agoAuto merge of #73964 - jyn514:sane-defaults, r=Mark-Simulacrum
bors [Tue, 28 Jul 2020 13:56:32 +0000 (13:56 +0000)]
Auto merge of #73964 - jyn514:sane-defaults, r=Mark-Simulacrum

Improve defaults in x.py

- Make the default stage dependent on the subcommand
- Don't build stage1 rustc artifacts with x.py build --stage 1. If this is what you want, use x.py build --stage 2 instead, which gives you a working libstd.
- Change default debuginfo when debug = true from 2 to 1

I tried to fix CI to use `--stage 2` everywhere it currently has no stage, but I might have missed a spot.
This does not update much of the documentation - most of it is in https://github.com/rust-lang/rustc-dev-guide/ or https://github.com/rust-lang/rust-forge and will need a separate PR.

See individual commits for a detailed rationale of each change.
See also the MCP: https://github.com/rust-lang/compiler-team/issues/326

r? @Mark-Simulacrum , but anyone is free to give an opinion.

3 years agoUse --stage 2 in checktools
Joshua Nelson [Tue, 28 Jul 2020 13:36:56 +0000 (09:36 -0400)]
Use --stage 2 in checktools

- Remove useless --stage 2 argument to checktools.sh
- Fix help text for expand-yaml-anchors (it had a typo)

3 years agoFix bad rebase
Joshua Nelson [Tue, 28 Jul 2020 12:34:59 +0000 (08:34 -0400)]
Fix bad rebase

3 years agoEnable to ping RISC-V group via triagebot
Yuki Okushi [Tue, 28 Jul 2020 12:01:13 +0000 (21:01 +0900)]
Enable to ping RISC-V group via triagebot

3 years agoAuto merge of #74796 - infinity0:master, r=nikomatsakis
bors [Tue, 28 Jul 2020 09:02:32 +0000 (09:02 +0000)]
Auto merge of #74796 - infinity0:master, r=nikomatsakis

config.toml.example: Update remap-debuginfo doc to be more general & accurate

This makes it more obvious that the work-around to #74786 is actually correct, and a custom `--remap-path-prefix` isn't needed.

In fact the previous comment `/rustc/$hash/$crate` was wrong, it is not `$crate` but whatever path exists in the rustc source tree, so either `src/$crate` or `vendor/$crate`. I've fixed that as well to avoid future confusion.

3 years agoAdd str::[r]split_once
Aleksey Kladov [Fri, 24 Jul 2020 07:39:09 +0000 (09:39 +0200)]
Add str::[r]split_once

This is useful for quick&dirty parsing of key: value config pairs

3 years agoFix RefUnwindSafe & UnwinsSafe impls for lazy::SyncLazy
Aleksey Kladov [Mon, 27 Jul 2020 09:22:36 +0000 (11:22 +0200)]
Fix RefUnwindSafe & UnwinsSafe impls for lazy::SyncLazy

The logic here is the same as for Send&Sync impls.

3 years agoAuto merge of #74855 - jyn514:separate-lints, r=Manishearth
bors [Tue, 28 Jul 2020 05:49:59 +0000 (05:49 +0000)]
Auto merge of #74855 - jyn514:separate-lints, r=Manishearth

Separate `missing_doc_code_examples` from intra-doc links

These two lints have no relation other than both being nightly-only.
This allows stabilizing intra-doc links without stabilizing `missing_doc_code_examples`.

Fixes one of the issues spotted by @ollie27 in https://github.com/rust-lang/rust/pull/74430#issuecomment-664693080.

r? @Manishearth

3 years agoayu theme: Change doccomment color to `#a1ac88`
Lzu Tao [Tue, 28 Jul 2020 05:12:12 +0000 (05:12 +0000)]
ayu theme: Change doccomment color to `#a1ac88`

Co-authored-by: Cldfire <cldfire@3grid.net>
3 years agoAdd #[inline] to RawWaker::new
Tomasz Miąsko [Sun, 26 Jul 2020 00:00:00 +0000 (00:00 +0000)]
Add #[inline] to RawWaker::new

3 years agoAuto merge of #74841 - infinity0:fix-exec, r=Mark-Simulacrum
bors [Tue, 28 Jul 2020 03:42:22 +0000 (03:42 +0000)]
Auto merge of #74841 - infinity0:fix-exec, r=Mark-Simulacrum

rustbuild: use Display for exit status instead of Debug, see #74832 for justification

3 years agoprivate_items_doc_tests -> doc_test_lints
Joshua Nelson [Tue, 28 Jul 2020 03:05:01 +0000 (23:05 -0400)]
private_items_doc_tests -> doc_test_lints

3 years agoUse exhaustive match for assert
Joshua Nelson [Tue, 28 Jul 2020 01:53:10 +0000 (21:53 -0400)]
Use exhaustive match for assert

3 years agoAdd assert that tests happen with stage 2 in CI
Joshua Nelson [Mon, 27 Jul 2020 19:53:01 +0000 (15:53 -0400)]
Add assert that tests happen with stage 2 in CI

- Use stage 2 for makefile
- Move assert to builder
- Don't add an assert for --help
- Allow --stage 0 if passed explicitly
- Don't assert defaults during tests

Otherwise it's impossible to test the defaults!

3 years agoUse --stage 2 explicitly in CI
Joshua Nelson [Tue, 14 Jul 2020 02:28:26 +0000 (22:28 -0400)]
Use --stage 2 explicitly in CI

- expand yaml anchors
- don't use --stage 2 for dist; that's already the default

3 years agoAdd tests for the new behavior
Joshua Nelson [Tue, 14 Jul 2020 00:25:21 +0000 (20:25 -0400)]
Add tests for the new behavior

- Only set stage 2 in dist tests
- Add test for `x.py doc` without args
- Add test for `x.py build` without args
- Add test for `x.py build --stage 0`

3 years agoMove tests into a submodule
Joshua Nelson [Tue, 14 Jul 2020 00:20:42 +0000 (20:20 -0400)]
Move tests into a submodule

3 years agoFix most bootstrap tests
Joshua Nelson [Mon, 13 Jul 2020 23:55:33 +0000 (19:55 -0400)]
Fix most bootstrap tests

Uses --stage 2 for all the existing tests

3 years agoChange debuginfo to default to 1 if `debug = true` is set
Joshua Nelson [Thu, 2 Jul 2020 12:59:50 +0000 (08:59 -0400)]
Change debuginfo to default to 1 if `debug = true` is set

From [a conversation in discord](https://discordapp.com/channels/442252698964721669/443151243398086667/719200989269327882):

> Linking seems to consume all available RAM, leading to the OS to swap memory to disk and slowing down everything in the process
Compiling itself doesn't seem to take up as much RAM, and I'm only looking to check whether a minimal testcase can be compiled by rustc, where the runtime performance isn't much of an issue

> do you have debug = true or debuginfo-level = 2 in config.toml?
> if so I think that results in over 2GB of debuginfo nowadays and is likely the culprit
> which might mean we're giving out bad advice :(

Anecdotally, this sped up my stage 1 build from 15 to 10 minutes.

This still adds line numbers, it only removes variable and type information.

- Improve wording for debuginfo description

Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
3 years agoDon't build rustc without std
Joshua Nelson [Thu, 2 Jul 2020 12:40:34 +0000 (08:40 -0400)]
Don't build rustc without std

- Set rustc to build only when explicitly asked for

This allows building the stage2 rustc artifacts, which nothing depends
on.

Previously the behavior was as follows (where stageN <-> stage(N-1) artifacts, except for stage0 libstd):

- `x.py build --stage 0`:
  - stage0 libstd
  - stage1 rustc (but without putting rustc in stage0/)

This leaves you without any rustc at all except for the beta compiler
(https://github.com/rust-lang/rust/issues/73519). This is never what you want.

- `x.py build --stage 1`:
  - stage0 libstd
  - stage1 rustc
  - stage1 libstd
  - stage1 rustdoc
  - stage2 rustc

This leaves you with a broken stage2 rustc which doesn't even have
libcore and is effectively useless. Additionally, it compiles rustc
twice, which is not normally what you want.

- `x.py build --stage 2`:
  - stage0 libstd
  - stage1 rustc
  - stage1 libstd
  - stage2 rustc
  - stage2 rustdoc and tools

This builds all tools in release mode. This is the correct usage for CI,
but takes far to long for development.

Now the behavior is as follows:

- `x.py build --stage 0`:
  - stage0 libstd

This is suitable for contributors only working on the standard library,
as it means rustc never has to be compiled.

- `x.py build --stage 1`:
  - stage0 libstd
  - stage1 rustc
  - stage1 libstd
  - stage1 rustdoc

This is suitable for contributors working on the compiler. It ensures
that you have a working rustc and libstd without having to pass
`src/libstd` in addition.

- `x.py build --stage 2`:
  - stage0 libstd
  - stage1 rustc
  - stage1 libstd
  - stage2 rustc
  - stage2 libstd
  - stage2 rustdoc

This is suitable for debugging errors which only appear with the stage2
compiler.

- `x.py build --stage 2 src/libstd src/rustc`
  - stage0 libstd
  - stage1 rustc
  - stage1 libstd
  - stage2 rustc
  - stage2 libstd
  - stage2 rustdoc, tools, etc.
  - stage2 rustc artifacts ('stage3')

This is suitable for CI, which wants all tools in release mode.
However, most of the use cases for this should use `x.py dist` instead,
which builds all the tools without each having to be named individually.

3 years agoMake the default stage dependent on the subcommand
Joshua Nelson [Thu, 2 Jul 2020 12:08:09 +0000 (08:08 -0400)]
Make the default stage dependent on the subcommand

 ### x.py build/test: stage 1

I've seen very few people who actually use full stage 2 builds on purpose. These compile rustc and libstd twice and don't give you much more information than a stage 1 build (except in rare cases like https://github.com/rust-lang/rust/pull/68692#discussion_r376392145). For new contributors, this makes the build process even more daunting than it already is. As long as CI is changed to use `--stage 2` I see no downside here.

 ### x.py bench/dist/install: stage 2

These commands have to do with a finished, optimized version of rustc. It seems very rare to want to use these with a stage 1 build.

 ### x.py doc: stage 0

Normally when you document things you're just fixing a typo. In this case there is no need to build the whole rust compiler, since the documentation will usually be the same when generated with the beta compiler or with stage 1.

Note that for this release cycle only there will be a significant different between stage0 and stage1 docs: https://github.com/rust-lang/rust/pull/73101. However most of the time this will not be the case.

3 years agoDon't duplicate builder code
Joshua Nelson [Thu, 2 Jul 2020 12:07:56 +0000 (08:07 -0400)]
Don't duplicate builder code

- Add Builder::new_internal

3 years agoUpdate outdated readme
Who? Me?! [Tue, 28 Jul 2020 03:05:34 +0000 (22:05 -0500)]
Update outdated readme

3 years agoMove `look_for_tests` to `private_items_doc_tests`
Joshua Nelson [Tue, 28 Jul 2020 03:03:56 +0000 (23:03 -0400)]
Move `look_for_tests` to `private_items_doc_tests`

3 years agoSeparate `missing_doc_code_examples` from intra-doc links
Joshua Nelson [Tue, 28 Jul 2020 02:16:41 +0000 (22:16 -0400)]
Separate `missing_doc_code_examples` from intra-doc links

These two lints have no relation other than both being nightly-only.
This allows stabilizing intra-doc links without stabilizing
missing_doc_code_examples.

3 years agoAuto merge of #73265 - mark-i-m:mv-std, r=Mark-Simulacrum,mark-i-m
bors [Tue, 28 Jul 2020 00:51:53 +0000 (00:51 +0000)]
Auto merge of #73265 - mark-i-m:mv-std, r=Mark-Simulacrum,mark-i-m

mv std libs to library/

This is the first step in refactoring the directory layout of this repository, with further followup steps planned (but not done yet).

Background: currently, all crates are under src/, without nested src directories and with the unconventional `lib*` prefixes (e.g., `src/libcore/lib.rs`). This directory structures is not idiomatic and makes the `src/` directory rather overwhelming. To improve contributor experience and make things a bit more approachable, we are reorganizing the repo a bit.

In this PR, we move the standard libs (basically anything that is "runtime", as opposed to part of the compiler, build system, or one of the tools, etc). The new layout moves these libraries to a new `library/` directory in the root of the repo. Additionally, we remove the `lib*` prefixes and add nested `src/` directories.  The other crates/tools in this repo are not touched. So in summary:

```
library/<crate>/src/*.rs
src/<all the rest>     // unchanged
```

where `<crate>` is:
- core
- alloc
- std
- test
- proc_macro
- panic_abort
- panic_unwind
- profiler_builtins
- term
- unwind
- rtstartup
- backtrace
- rustc-std-workspace-*

There was a lot of discussion about this and a few rounds of compiler team approvals, FCPs, MCPs, and nominations. The original MCP is https://github.com/rust-lang/compiler-team/issues/298. The final approval of the compiler team was given here: https://github.com/rust-lang/rust/pull/73265#issuecomment-659498446.

The name `library` was chosen to complement a later move of the compiler crates to a `compiler/` directory. There was a lot of discussion around adding the nested `src/` directories. Note that this does increase the nesting depth (plausibly important for manual traversal of the tree, e.g., through GitHub's UI or `cd`), but this is deemed to be better as it fits the standard layout of Rust crates throughout most of the ecosystem, though there is some debate about how much this should apply to multi-crate projects. Overall, there seem to be more people in favor of nested `src/` than against.

After this PR, there are no dependencies out of the `library/` directory except on the `build_helper` (or crates.io crates).

3 years agomv std libs to library/
mark [Fri, 12 Jun 2020 02:31:49 +0000 (21:31 -0500)]
mv std libs to library/

3 years agoAuto merge of #73583 - anp:location-eq, r=dtolnay
bors [Mon, 27 Jul 2020 22:38:25 +0000 (22:38 +0000)]
Auto merge of #73583 - anp:location-eq, r=dtolnay

Derive common traits for panic::Location.

Now that `#[track_caller]` is on track to stabilize, one of the roughest edges of working with it is the fact that you can't do much with `Location` except turn it back into a `(&str, u32, u32)`. Which makes sense because the type was defined around the panic machinery originally passing around that tuple (it has the same layout as Location even).

This PR derives common traits for the type in accordance with the [API guidelines](https://rust-lang.github.io/api-guidelines/interoperability.html#types-eagerly-implement-common-traits-c-common-traits) (those apply to core, right?).

There's a risk here, e.g. if we ever change the representation of `Location` in a way that makes it harder to implement `Ord`, we might not be able to make that change in a backwards-compatible way. I don't think there's any other compatibility hazard here, as the only changes we currently imagine for the type are to add end fields.

cc @rust-lang/libs

3 years agorustbuild: refactor how the wrapper deals with exit codes
Ximin Luo [Mon, 27 Jul 2020 22:22:07 +0000 (23:22 +0100)]
rustbuild: refactor how the wrapper deals with exit codes

3 years agorustbuild: format both Ok/Err separately, since Result doesn't do it
Ximin Luo [Mon, 27 Jul 2020 21:44:48 +0000 (22:44 +0100)]
rustbuild: format both Ok/Err separately, since Result doesn't do it

3 years agorustbuild: use Display for exit status instead of Debug, see #74832 for justification
Ximin Luo [Mon, 27 Jul 2020 21:06:04 +0000 (22:06 +0100)]
rustbuild: use Display for exit status instead of Debug, see #74832 for justification

3 years agoAuto merge of #73503 - lcnr:forall-predicate-what-and-why-2, r=nikomatsakis
bors [Mon, 27 Jul 2020 20:16:36 +0000 (20:16 +0000)]
Auto merge of #73503 - lcnr:forall-predicate-what-and-why-2, r=nikomatsakis

convert higher ranked `Predicate`s to `PredicateKind::ForAll`

implements step 2 of https://github.com/rust-lang/compiler-team/issues/285
r? @nikomatsakis

3 years agoclippy
Bastian Kauschke [Mon, 27 Jul 2020 19:17:28 +0000 (21:17 +0200)]
clippy

3 years agocleanup
Bastian Kauschke [Tue, 21 Jul 2020 13:42:18 +0000 (15:42 +0200)]
cleanup

3 years agofix rustdoc
Bastian Kauschke [Sat, 18 Jul 2020 16:46:30 +0000 (18:46 +0200)]
fix rustdoc

3 years agoit works again :tada:
Bastian Kauschke [Sat, 18 Jul 2020 12:37:36 +0000 (14:37 +0200)]
it works again :tada:

3 years agofix rebase
Bastian Kauschke [Sat, 18 Jul 2020 10:06:47 +0000 (12:06 +0200)]
fix rebase

3 years agodirectly contain `PredicateAtom` in `PredicateKind::ForAll`
Bastian Kauschke [Sat, 18 Jul 2020 09:46:38 +0000 (11:46 +0200)]
directly contain `PredicateAtom` in `PredicateKind::ForAll`

3 years agointroduce PredicateAtom
Bastian Kauschke [Wed, 8 Jul 2020 22:35:55 +0000 (00:35 +0200)]
introduce PredicateAtom

3 years agoadd reuse_or_mk_predicate
Bastian Kauschke [Wed, 24 Jun 2020 16:06:04 +0000 (18:06 +0200)]
add reuse_or_mk_predicate

3 years agorefactor query_outlives_constraints_into_obligations
Bastian Kauschke [Wed, 24 Jun 2020 15:54:13 +0000 (17:54 +0200)]
refactor query_outlives_constraints_into_obligations

3 years agothis might be unqualified, but at least it's now quantified
Bastian Kauschke [Wed, 24 Jun 2020 15:40:28 +0000 (17:40 +0200)]
this might be unqualified, but at least it's now quantified

3 years agofix rustdoc
Bastian Kauschke [Sun, 21 Jun 2020 12:42:47 +0000 (14:42 +0200)]
fix rustdoc

3 years agosplit ignore_qualifiers
Bastian Kauschke [Sun, 21 Jun 2020 10:26:17 +0000 (12:26 +0200)]
split ignore_qualifiers

3 years agoreview
Bastian Kauschke [Fri, 19 Jun 2020 22:21:59 +0000 (00:21 +0200)]
review

3 years agofix elaborate for predicates with unbound variables
Bastian Kauschke [Fri, 19 Jun 2020 17:19:21 +0000 (19:19 +0200)]
fix elaborate for predicates with unbound variables

3 years agoclippy
Bastian Kauschke [Fri, 19 Jun 2020 08:22:25 +0000 (10:22 +0200)]
clippy

3 years agorustdoc
Bastian Kauschke [Fri, 19 Jun 2020 08:05:05 +0000 (10:05 +0200)]
rustdoc

3 years ago`PredicateKint` -> `PredicateKind`, the beginning of the end
Bastian Kauschke [Thu, 18 Jun 2020 18:41:43 +0000 (20:41 +0200)]
`PredicateKint` -> `PredicateKind`, the beginning of the end

3 years agoprogress
Bastian Kauschke [Thu, 18 Jun 2020 18:33:52 +0000 (20:33 +0200)]
progress

3 years agoelaborate
Bastian Kauschke [Thu, 18 Jun 2020 15:43:26 +0000 (17:43 +0200)]
elaborate

3 years agosubst_supertrait
Bastian Kauschke [Wed, 17 Jun 2020 22:18:58 +0000 (00:18 +0200)]
subst_supertrait

3 years agosomewhat related cleanup
Bastian Kauschke [Wed, 17 Jun 2020 21:20:17 +0000 (23:20 +0200)]
somewhat related cleanup

3 years agowf
Bastian Kauschke [Wed, 17 Jun 2020 20:50:28 +0000 (22:50 +0200)]
wf

3 years agoconvert trivial predicates
Bastian Kauschke [Wed, 17 Jun 2020 09:30:18 +0000 (11:30 +0200)]
convert trivial predicates

3 years agoquery_outlives_constraints_into_obligations
Bastian Kauschke [Wed, 17 Jun 2020 08:46:52 +0000 (10:46 +0200)]
query_outlives_constraints_into_obligations

3 years agoanonymize_predicate
Bastian Kauschke [Tue, 16 Jun 2020 22:13:00 +0000 (00:13 +0200)]
anonymize_predicate

3 years agoHandle trait/projection predicates with bound regions correctly
Matthew Jasper [Sun, 14 Jun 2020 12:22:51 +0000 (13:22 +0100)]
Handle trait/projection predicates with bound regions correctly

3 years agominimal
Bastian Kauschke [Sat, 13 Jun 2020 13:04:28 +0000 (15:04 +0200)]
minimal

3 years agoadd `PredicateKint`, because who doesn't like bodging
Bastian Kauschke [Thu, 11 Jun 2020 19:42:39 +0000 (21:42 +0200)]
add `PredicateKint`, because who doesn't like bodging

3 years agoAuto merge of #74831 - Manishearth:rollup-ugw4pt4, r=Manishearth
bors [Mon, 27 Jul 2020 16:21:09 +0000 (16:21 +0000)]
Auto merge of #74831 - Manishearth:rollup-ugw4pt4, r=Manishearth

Rollup of 4 pull requests

Successful merges:

 - #73858 (Make more primitive integer methods const)
 - #74487 (Forbid generic parameters in anon consts inside of type defaults)
 - #74803 (rustbuild: fix bad usage of UNIX exec() in rustc wrapper)
 - #74822 (More ensure stack to avoid segfault with increased `recursion_limit`)

Failed merges:

r? @ghost

3 years agoRollup merge of #74822 - JohnTitor:no-sigsegv, r=oli-obk
Manish Goregaokar [Mon, 27 Jul 2020 16:20:20 +0000 (09:20 -0700)]
Rollup merge of #74822 - JohnTitor:no-sigsegv, r=oli-obk

More ensure stack to avoid segfault with increased `recursion_limit`

Fixes #74711
I do not add the test here since the limit value depends on the machine and it's hard to test the output.
r? @oli-obk

3 years agoRollup merge of #74803 - infinity0:fix-exec, r=nagisa
Manish Goregaokar [Mon, 27 Jul 2020 16:20:18 +0000 (09:20 -0700)]
Rollup merge of #74803 - infinity0:fix-exec, r=nagisa

rustbuild: fix bad usage of UNIX exec() in rustc wrapper

exec never returns, it replaces the current process. so anything after it is unreachable. that's not how exec_cmd() is used in the surrounding code

We use `--on-fail env` on Debian. `env` always returns exit code 0. This means that the `rustc` bootstrap wrapper always returns exit code 0 even when it fails. However, the crossbeam-utils build process (due to autocfg) relies on `rustc` returning error exit codes when detecting CPU features, and ends up writing `cargo:rustc-cfg=has_atomic_u128` even when it's not detected, because the `rustc` wrapper is always giving exit code 0.

(This separately is causing our builds to try to compile rustc 40+ times, due to #74801.)

3 years agoRollup merge of #74487 - lcnr:const-in-ty-default, r=varkor
Manish Goregaokar [Mon, 27 Jul 2020 16:20:16 +0000 (09:20 -0700)]
Rollup merge of #74487 - lcnr:const-in-ty-default, r=varkor

Forbid generic parameters in anon consts inside of type defaults

Emit a resolution error for `struct Foo<T, U = [u8; std::mem::size_of::<T>()]>`.
We are unable to support this with the way `ty::Generics` is currently used,
so let's just forbid it entirely for now.

Fixes some ICE on stable, e.g.
```rust
struct Foo<T, U = [u8; std::mem::size_of::<*mut T>()]>(T, U);
```

r? @varkor @eddyb

3 years agoRollup merge of #73858 - tspiteri:const-methods, r=oli-obk
Manish Goregaokar [Mon, 27 Jul 2020 16:20:15 +0000 (09:20 -0700)]
Rollup merge of #73858 - tspiteri:const-methods, r=oli-obk

Make more primitive integer methods const

Now that #72437 has been merged and `const_if_match` is stable, these methods can be stabilized const. The methods are grouped in commits according to feature names:

* `const_nonzero_int_methods`
    - `NonZero*::new`
* some `const_checked_int_methods`
    - `{i*,u*}::checked_add`
    - `{i*,u*}::checked_sub`
    - `{i*,u*}::checked_mul`
    - `{i*,u*}::checked_neg`
    - `{i*,u*}::checked_shl`
    - `{i*,u*}::checked_shr`
    - `i*::checked_abs`
* `const_saturating_int_methods`
    - `{i*,u*}::saturating_add`
    - `{i*,u*}::saturating_sub`
    - `{i*,u*}::saturating_mul`
    - `i*::saturating_neg`
    - `i*::saturating_abs`
* `const_int_sign`
    - `i*::signum`
* `const_ascii_ctype_on_intrinsics`
    - `{char,u8}::is_ascii_alphabetic`
    - `{char,u8}::is_ascii_uppercase`
    - `{char,u8}::is_ascii_lowercase`
    - `{char,u8}::is_ascii_alphanumeric`
    - `{char,u8}::is_ascii_digit`
    - `{char,u8}::is_ascii_hexdigit`
    - `{char,u8}::is_ascii_punctuation`
    - `{char,u8}::is_ascii_graphic`
    - `{char,u8}::is_ascii_whitespace`
    - `{char,u8}::is_ascii_control`

3 years agoupdate tests
Bastian Kauschke [Mon, 27 Jul 2020 14:41:27 +0000 (16:41 +0200)]
update tests

3 years agoforbid generic params inside of anon consts in ty defaults
Bastian Kauschke [Sat, 18 Jul 2020 21:42:10 +0000 (23:42 +0200)]
forbid generic params inside of anon consts in ty defaults

3 years agoname `ParamInTyOfConstArg`
Bastian Kauschke [Sat, 18 Jul 2020 20:35:50 +0000 (22:35 +0200)]
name `ParamInTyOfConstArg`

3 years agoAuto merge of #74775 - RalfJung:miri-alloc-ids, r=oli-obk
bors [Mon, 27 Jul 2020 13:07:46 +0000 (13:07 +0000)]
Auto merge of #74775 - RalfJung:miri-alloc-ids, r=oli-obk

 Miri: replace canonical_alloc_id mechanism by extern_static_alloc_id

We only have to call `extern_static_alloc_id` when a `Pointer` is "imported" from the `tcx` to the machine, not on each access. Also drop the old hook for TLS handling, it is not needed any more.

The Miri side of this is at https://github.com/rust-lang/miri/pull/1489.

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

3 years agoMore ensure stack to avoid segfault with increased `recursion_limit`
Yuki Okushi [Mon, 27 Jul 2020 11:41:53 +0000 (20:41 +0900)]
More ensure stack to avoid segfault with increased `recursion_limit`

3 years agoAuto merge of #74817 - JohnTitor:rollup-0fchdye, r=JohnTitor
bors [Mon, 27 Jul 2020 11:07:32 +0000 (11:07 +0000)]
Auto merge of #74817 - JohnTitor:rollup-0fchdye, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #74088 (Avoid writes without any data in `Write::write_all_vectored`)
 - #74598 (Fix sync_once_cell_does_not_leak_partially_constructed_boxes)
 - #74750 (Clean up some uses of logging in ui tests)
 - #74783 (python codes cleanup)
 - #74790 (Don't italicize comments in ayu theme)
 - #74799 (Fixed typo in `closure`)

Failed merges:

r? @ghost

3 years agorename eval_const_to_op -> const_to_op
Ralf Jung [Mon, 27 Jul 2020 11:01:01 +0000 (13:01 +0200)]
rename eval_const_to_op -> const_to_op

3 years agoRollup merge of #74799 - Dhs92:master, r=joshtriplett
Yuki Okushi [Mon, 27 Jul 2020 10:32:02 +0000 (19:32 +0900)]
Rollup merge of #74799 - Dhs92:master, r=joshtriplett

Fixed typo in `closure`

3 years agoRollup merge of #74790 - Cldfire:ayu-no-italic-comments, r=GuillaumeGomez
Yuki Okushi [Mon, 27 Jul 2020 10:32:00 +0000 (19:32 +0900)]
Rollup merge of #74790 - Cldfire:ayu-no-italic-comments, r=GuillaumeGomez

Don't italicize comments in ayu theme

Closes #74770.

Before:

![image](https://user-images.githubusercontent.com/13814214/88486217-2bf18700-cf4a-11ea-896d-e7787b94e7a7.png)

After:

![image](https://user-images.githubusercontent.com/13814214/88486225-3a3fa300-cf4a-11ea-929f-90461799dc01.png)

3 years agoRollup merge of #74783 - jnozsc:python_cleanup, r=Mark-Simulacrum
Yuki Okushi [Mon, 27 Jul 2020 10:31:58 +0000 (19:31 +0900)]
Rollup merge of #74783 - jnozsc:python_cleanup, r=Mark-Simulacrum

python codes cleanup

3 years agoRollup merge of #74750 - oli-obk:logging_and_test_cleanups, r=JohnTitor
Yuki Okushi [Mon, 27 Jul 2020 10:31:56 +0000 (19:31 +0900)]
Rollup merge of #74750 - oli-obk:logging_and_test_cleanups, r=JohnTitor

Clean up some uses of logging in ui tests

The removed test can't possibly trigger anything today as we don't have logging in libstd.

The `exec-env` flag was mistakenly used for adding env vars to rustc invocations both in test and in the test suite and there were some accidental renames from RUST_LOG to RUSTC_LOG that I reverted.

3 years agoRollup merge of #74598 - mzohreva:mz/fix-test, r=KodrAus
Yuki Okushi [Mon, 27 Jul 2020 10:31:55 +0000 (19:31 +0900)]
Rollup merge of #74598 - mzohreva:mz/fix-test, r=KodrAus

Fix sync_once_cell_does_not_leak_partially_constructed_boxes

Spinning multiple threads in this test causes a deadlock in
SGX where thread scheduling is not preemptive.

cc @jethrogb @AdrianCX

3 years agoRollup merge of #74088 - tmiasko:write-all-vectored-empty, r=KodrAus
Yuki Okushi [Mon, 27 Jul 2020 10:31:53 +0000 (19:31 +0900)]
Rollup merge of #74088 - tmiasko:write-all-vectored-empty, r=KodrAus

Avoid writes without any data in `Write::write_all_vectored`

Previously, when non-empty sequence of empty IoSlices have been provided
to `Write::write_all_vectored`, the buffers would be written as is with
`Write::write_vectored` and subsequently the return value `Ok(0)` would
be misinterpreted as an error.

Avoid writes without any data by advancing the buffers first. This
matches the documented behaviour of `Write::write_all_vectored`
and is analogous to what happens in `Write::write_all`.

3 years agoAuto merge of #74737 - smmalis37:astconv-factor, r=davidtwco
bors [Mon, 27 Jul 2020 09:22:09 +0000 (09:22 +0000)]
Auto merge of #74737 - smmalis37:astconv-factor, r=davidtwco

Pull out some duplicated code into a new function

I debated pulling the actual struct_span_err calls into the new method, but I felt like having to pass in multiple arguments for it and wiring up string formatting outweighed the benefits.

Viewing the diff with whitespace ignored is recommended.

3 years agoAuto merge of #74653 - petrochenkov:pmenv, r=dtolnay
bors [Mon, 27 Jul 2020 05:50:29 +0000 (05:50 +0000)]
Auto merge of #74653 - petrochenkov:pmenv, r=dtolnay

proc_macro: Add API for tracked access to environment variables

Continuation of https://github.com/rust-lang/rust/pull/71858.

`proc_macro::tracked_env::var` is similar to regular `env::var` called from a proc macro, except that it also adds the accessed variable to depinfo.

3 years agoAuto merge of #74784 - anp:track-vtables, r=eddyb
bors [Mon, 27 Jul 2020 03:47:17 +0000 (03:47 +0000)]
Auto merge of #74784 - anp:track-vtables, r=eddyb

Fix #[track_caller] shims for trait objects.

We were missing an Instance::resolve_for_fn_ptr in resolve_for_vtable.

Closes #74764.

3 years agorustbuild: rename exec_cmd -> status_code for clarity
Ximin Luo [Mon, 27 Jul 2020 02:00:28 +0000 (03:00 +0100)]
rustbuild: rename exec_cmd -> status_code for clarity