]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoMove `is_raw_guess` check in `ty::print::pretty`
marmeladema [Thu, 24 Sep 2020 09:23:01 +0000 (10:23 +0100)]
Move `is_raw_guess` check in `ty::print::pretty`

3 years agoAddress review comment
marmeladema [Wed, 23 Sep 2020 22:38:38 +0000 (23:38 +0100)]
Address review comment

3 years agoFix tests
marmeladema [Mon, 21 Sep 2020 21:19:44 +0000 (22:19 +0100)]
Fix tests

3 years agoRemove now unused `double_braced_*` symbols
marmeladema [Tue, 1 Sep 2020 18:37:12 +0000 (19:37 +0100)]
Remove now unused `double_braced_*` symbols

3 years agoFix profiling query key creation
marmeladema [Tue, 1 Sep 2020 18:34:46 +0000 (19:34 +0100)]
Fix profiling query key creation

3 years agoSimplify some match statements on `DefPathDataName'
marmeladema [Tue, 1 Sep 2020 12:11:28 +0000 (13:11 +0100)]
Simplify some match statements on `DefPathDataName'

3 years agoAvoid calling `Symbol::interner` in `compute_codegen_unit_name`
marmeladema [Tue, 1 Sep 2020 08:31:02 +0000 (09:31 +0100)]
Avoid calling `Symbol::interner` in `compute_codegen_unit_name`

3 years agoRename `DefPathData::get_name()` to `DefPathData::name()`
marmeladema [Mon, 31 Aug 2020 23:42:30 +0000 (00:42 +0100)]
Rename `DefPathData::get_name()` to `DefPathData::name()`

3 years agoFix pretty-printing of `DisambiguatedDefPathData`
marmeladema [Mon, 31 Aug 2020 22:26:15 +0000 (23:26 +0100)]
Fix pretty-printing of `DisambiguatedDefPathData`

3 years agoImplement `Display` for `DisambiguatedDefPathData` and `DefPathData`
marmeladema [Mon, 31 Aug 2020 21:57:48 +0000 (22:57 +0100)]
Implement `Display` for `DisambiguatedDefPathData` and `DefPathData`

3 years agoMove from {{closure}}#0 syntax to {closure#0} for (def) path components
marmeladema [Mon, 31 Aug 2020 17:11:44 +0000 (18:11 +0100)]
Move from {{closure}}#0 syntax to {closure#0} for (def) path components

3 years agoAuto merge of #77201 - matthewjasper:rename-get-unchecked, r=spastorino
bors [Fri, 25 Sep 2020 21:44:26 +0000 (21:44 +0000)]
Auto merge of #77201 - matthewjasper:rename-get-unchecked, r=spastorino

Rename Iterator::get_unchecked

Closes #76479

r? `@pnkfelix`

3 years agoRemove stray word from `ClosureKind::extends` docs
LingMan [Fri, 25 Sep 2020 21:35:07 +0000 (23:35 +0200)]
Remove stray word from `ClosureKind::extends` docs

3 years agoTest for missing const-stability attributes
Dylan MacKenzie [Fri, 25 Sep 2020 20:51:52 +0000 (13:51 -0700)]
Test for missing const-stability attributes

3 years agoNo need to call `is_min_const_fn` for side-effects
Dylan MacKenzie [Fri, 25 Sep 2020 20:50:18 +0000 (13:50 -0700)]
No need to call `is_min_const_fn` for side-effects

3 years agoChange error in `fn_queries` to `delay_span_bug`
Dylan MacKenzie [Fri, 25 Sep 2020 21:08:44 +0000 (14:08 -0700)]
Change error in `fn_queries` to `delay_span_bug`

This should be caught by the new check in `rustc_passes`. At some point,
this function will be removed entirely.

3 years agoCheck for missing const-stability attributes in `stability`
Dylan MacKenzie [Fri, 25 Sep 2020 20:48:48 +0000 (13:48 -0700)]
Check for missing const-stability attributes in `stability`

This used to happen as a side-effect of `is_min_const_fn`, which was
subtle.

3 years agoAuto merge of #77198 - jonas-schievink:rollup-i59i41h, r=jonas-schievink
bors [Fri, 25 Sep 2020 19:35:33 +0000 (19:35 +0000)]
Auto merge of #77198 - jonas-schievink:rollup-i59i41h, r=jonas-schievink

Rollup of 15 pull requests

Successful merges:

 - #76932 (Relax promises about condition variable.)
 - #76973 (Unstably allow assume intrinsic in const contexts)
 - #77005 (BtreeMap: refactoring around edges)
 - #77066 (Fix dest prop miscompilation around references)
 - #77073 (dead_code: look at trait impls even if they don't contain items)
 - #77086 (Include libunwind in the rust-src component.)
 - #77097 (Make [].as_[mut_]ptr_range() (unstably) const.)
 - #77106 (clarify that `changelog-seen = 1` goes to the beginning of config.toml)
 - #77120 (Add `--keep-stage-std` to `x.py` for keeping only standard library artifacts)
 - #77126 (Invalidate local LLVM cache less often)
 - #77146 (Install std for non-host targets)
 - #77155 (remove enum name from ImplSource variants)
 - #77176 (Removing erroneous semicolon in transmute documentation)
 - #77183 (Allow multiple allow_internal_unstable attributes)
 - #77189 (Remove extra space from vec drawing)

Failed merges:

r? `@ghost`

3 years agoAdd missing code examples on slice iter types
Guillaume Gomez [Tue, 22 Sep 2020 20:27:18 +0000 (22:27 +0200)]
Add missing code examples on slice iter types

3 years agoRename Iterator::get_unchecked
Matthew Jasper [Fri, 25 Sep 2020 18:48:24 +0000 (19:48 +0100)]
Rename Iterator::get_unchecked

It's possible for method resolution to pick this method over a lower
priority stable method,  causing compilation errors. Since this method
is permanently unstable, give it a name that is very unlikely to be used
in user code.

3 years agoImprove <vec::IntoIter>::get_unchecked` safety comment
Matthew Jasper [Fri, 25 Sep 2020 18:46:06 +0000 (19:46 +0100)]
Improve <vec::IntoIter>::get_unchecked` safety comment

3 years agoRollup merge of #77189 - pickfire:patch-5, r=Mark-Simulacrum
Jonas Schievink [Fri, 25 Sep 2020 17:42:54 +0000 (19:42 +0200)]
Rollup merge of #77189 - pickfire:patch-5, r=Mark-Simulacrum

Remove extra space from vec drawing

3 years agoRollup merge of #77183 - bugadani:issue-77088, r=varkor
Jonas Schievink [Fri, 25 Sep 2020 17:42:52 +0000 (19:42 +0200)]
Rollup merge of #77183 - bugadani:issue-77088, r=varkor

Allow multiple allow_internal_unstable attributes

Fixes #77088

3 years agoRollup merge of #77176 - austinkeeley:intrinsics-documentatation-error, r=jyn514
Jonas Schievink [Fri, 25 Sep 2020 17:42:50 +0000 (19:42 +0200)]
Rollup merge of #77176 - austinkeeley:intrinsics-documentatation-error, r=jyn514

Removing erroneous semicolon in transmute documentation

There is a semicolon in the example code that causes the expected value to not be returned.

3 years agoRollup merge of #77155 - lcnr:ImplSource, r=ecstatic-morse
Jonas Schievink [Fri, 25 Sep 2020 17:42:48 +0000 (19:42 +0200)]
Rollup merge of #77155 - lcnr:ImplSource, r=ecstatic-morse

remove enum name from ImplSource variants

This is quite a lot cleaner in my opinion.

3 years agoRollup merge of #77146 - Mark-Simulacrum:xpyinstall, r=alexcrichton
Jonas Schievink [Fri, 25 Sep 2020 17:42:46 +0000 (19:42 +0200)]
Rollup merge of #77146 - Mark-Simulacrum:xpyinstall, r=alexcrichton

Install std for non-host targets

It seems reasonable that when configuring various targets you'd expect all of them to get std installed, even if you're not building compiler toolchains for each of those.

cc #76990

r? @alexcrichton

3 years agoRollup merge of #77126 - Mark-Simulacrum:llvm-less-often, r=alexcrichton
Jonas Schievink [Fri, 25 Sep 2020 17:42:44 +0000 (19:42 +0200)]
Rollup merge of #77126 - Mark-Simulacrum:llvm-less-often, r=alexcrichton

Invalidate local LLVM cache less often

This avoids a download of LLVM after every rebase. The downside to this is that if we land some patch affecting LLVM built in CI that breaks this option, but that PR does not update the LLVM submodule, we'll likely not notice until the next update -- but this seems unlikely to happen in practice and I am not personally worried about it.

r? @alexcrichton

3 years agoRollup merge of #77120 - ecstatic-morse:keep-stage-std, r=Mark-Simulacrum
Jonas Schievink [Fri, 25 Sep 2020 17:42:43 +0000 (19:42 +0200)]
Rollup merge of #77120 - ecstatic-morse:keep-stage-std, r=Mark-Simulacrum

Add `--keep-stage-std` to `x.py` for keeping only standard library artifacts

Unlike `--keep-stage 0`, `--keep-stage-std 0` will allow the stage 0 compiler artifacts (i.e., stage1/bin/rustc) to be rebuilt if it has changed. This allows contributors to iterate on later stages of the compiler in tandem with the standard library without needing to to rebuild the entire compiler. I often run into this when working on const-checking, since I may need to add a feature gate or make a small tweak to the standard library.

3 years agoRollup merge of #77106 - matthiaskrgr:changelog_seen, r=Mark-Simulacrum
Jonas Schievink [Fri, 25 Sep 2020 17:42:41 +0000 (19:42 +0200)]
Rollup merge of #77106 - matthiaskrgr:changelog_seen, r=Mark-Simulacrum

clarify that `changelog-seen = 1` goes to the beginning of config.toml

Fixes #77105

3 years agoRollup merge of #77097 - fusion-engineering-forks:slice-ptr-range-const-fn, r=oli-obk
Jonas Schievink [Fri, 25 Sep 2020 17:42:39 +0000 (19:42 +0200)]
Rollup merge of #77097 - fusion-engineering-forks:slice-ptr-range-const-fn, r=oli-obk

Make [].as_[mut_]ptr_range() (unstably) const.

Gated behind `const_ptr_offset`, as suggested by https://github.com/rust-lang/rust/issues/65807#issuecomment-697229404

This also marks `[].as_mut_ptr()` as const, because it's used by `as_mut_ptr_range`. I gated it behind the same feature, because I figured it's not worth adding a separate tracking issue for const `as_mut_ptr`.

3 years agoRollup merge of #77086 - ehuss:src-libunwind, r=Mark-Simulacrum
Jonas Schievink [Fri, 25 Sep 2020 17:42:37 +0000 (19:42 +0200)]
Rollup merge of #77086 - ehuss:src-libunwind, r=Mark-Simulacrum

Include libunwind in the rust-src component.

Some targets, such as musl, need the libunwind source to build the unwind crate (referenced [here](https://github.com/rust-lang/rust/blob/0da58007451a154da2480160429e1604a1f5f0ec/library/unwind/build.rs#L142)).

Fixes rust-lang/wg-cargo-std-aware#59

3 years agoRollup merge of #77073 - lcnr:ty-trait-param, r=matthewjasper
Jonas Schievink [Fri, 25 Sep 2020 17:42:35 +0000 (19:42 +0200)]
Rollup merge of #77073 - lcnr:ty-trait-param, r=matthewjasper

dead_code: look at trait impls even if they don't contain items

fixes #70225

3 years agoRollup merge of #77066 - jonas-schievink:dest-prop-borrow, r=oli-obk
Jonas Schievink [Fri, 25 Sep 2020 17:42:33 +0000 (19:42 +0200)]
Rollup merge of #77066 - jonas-schievink:dest-prop-borrow, r=oli-obk

Fix dest prop miscompilation around references

Closes https://github.com/rust-lang/rust/issues/77002

3 years agoRollup merge of #77005 - ssomers:btree_cleanup_3, r=Mark-Simulacrum
Jonas Schievink [Fri, 25 Sep 2020 17:42:31 +0000 (19:42 +0200)]
Rollup merge of #77005 - ssomers:btree_cleanup_3, r=Mark-Simulacrum

BtreeMap: refactoring around edges

Parts chipped off a more daring effort, that the btree benchmarks judge to be performance-neutral.

r? @Mark-Simulacrum

3 years agoRollup merge of #76973 - lzutao:unstably-const-assume, r=oli-obk
Jonas Schievink [Fri, 25 Sep 2020 17:42:29 +0000 (19:42 +0200)]
Rollup merge of #76973 - lzutao:unstably-const-assume, r=oli-obk

Unstably allow assume intrinsic in const contexts

Not sure much about this usage because there are concerns
about [blocking  optimization][1] and [slowing down LLVM][2] when using `assme` intrinsic
in inline functions.
But since Oli suggested in https://github.com/rust-lang/rust/issues/76960#issuecomment-695772221,
here we are.

[1]: https://github.com/rust-lang/rust/pull/54995#issuecomment-429302709
[2]: https://github.com/rust-lang/rust/issues/49572#issuecomment-589615423

3 years agoRollup merge of #76932 - fusion-engineering-forks:condvar-promise, r=sfackler
Jonas Schievink [Fri, 25 Sep 2020 17:42:28 +0000 (19:42 +0200)]
Rollup merge of #76932 - fusion-engineering-forks:condvar-promise, r=sfackler

Relax promises about condition variable.

For quite a while now, there have been plans to at some point use parking_lot or some other more efficient implementation of mutexes and condition variables. Right now, Mutex and CondVar both Box the 'real' mutex/condvar inside, to give it a stable address. This was done because implementations like pthread and Windows critical sections may not be moved. More efficient implementations based on futexes, WaitOnAddress, Windows SRW locks, parking_lot, etc. may be moved (while not borrowed), so wouldn't need boxing.

However, not boxing them (which would be great goal to achieve), breaks a promise std currently makes about CondVar. CondVar promises to panic when used with different mutexes, to ensure consistent behaviour on all platforms. To this check, a mutex is considered 'the same' if the address of the 'real mutex' in the Box is the same. This address doesn't change when moving a `std::mutex::Mutex` object, effectively giving it an identity that survives moves of the Mutex object. If we ever switch to a non-boxed version, they no longer carry such an identity, and this check can no longer be made.

Four options:
1. Always box mutexes.
2. Add a `MutexId` similar to `ThreadId`. Making mutexes bigger, and making it hard to ever have a `const fn new` for them.
3. Making the requirement of CondVar stricter: panic if the Mutex object itself moved.
4. Making the promise of CondVar weaker: don't promise to panic.

1, 2, and 3 seem like bad options. This PR updates the documentation for 4.

3 years agoUse proper issue for `const_fn_floating_point_arithmetic`
Dylan MacKenzie [Wed, 23 Sep 2020 20:08:20 +0000 (13:08 -0700)]
Use proper issue for `const_fn_floating_point_arithmetic`

3 years agoMove const fn floating point test out of `min_const_fn`
Dylan MacKenzie [Wed, 23 Sep 2020 19:38:21 +0000 (12:38 -0700)]
Move const fn floating point test out of `min_const_fn`

3 years agoBless tests
Dylan MacKenzie [Wed, 23 Sep 2020 18:58:41 +0000 (11:58 -0700)]
Bless tests

3 years agoAdd new feature gate to standard library
Dylan MacKenzie [Wed, 23 Sep 2020 18:58:22 +0000 (11:58 -0700)]
Add new feature gate to standard library

3 years agoPut floating point arithmetic behind its own feature gate
Dylan MacKenzie [Wed, 23 Sep 2020 18:54:11 +0000 (11:54 -0700)]
Put floating point arithmetic behind its own feature gate

This refactors handling of `Rvalue::{Unary,Binary}Op` in the
const-checker. Now we `span_bug` if there's an unexpected type in a
primitive operation. This also allows unary negation on
`char` values through the const-checker because it makes the code a bit
cleaner. `char` does not actually support these operations, and if it
did, we could evaluate them at compile-time.

3 years agoAdd `const_fn_floating_point_arithmetic`
Dylan MacKenzie [Wed, 23 Sep 2020 18:53:58 +0000 (11:53 -0700)]
Add `const_fn_floating_point_arithmetic`

3 years agoAuto merge of #77157 - tmiasko:simplify-cfg-dup, r=jonas-schievink
bors [Fri, 25 Sep 2020 17:27:52 +0000 (17:27 +0000)]
Auto merge of #77157 - tmiasko:simplify-cfg-dup, r=jonas-schievink

Remove duplicated SimplifyCfg pass

3 years agoRemove extra space from vec drawing
Ivan Tham [Fri, 25 Sep 2020 15:20:22 +0000 (23:20 +0800)]
Remove extra space from vec drawing

3 years agoAuto merge of #73453 - erikdesjardins:tuplayout, r=eddyb
bors [Fri, 25 Sep 2020 14:42:20 +0000 (14:42 +0000)]
Auto merge of #73453 - erikdesjardins:tuplayout, r=eddyb

Ignore ZST offsets when deciding whether to use Scalar/ScalarPair layout

This is important because Scalar/ScalarPair layout previously would not be used if any ZST had nonzero offset.
For example, before this change, only `((), u128)` would be laid out like `u128`, not `(u128, ())`.

Fixes #63244

3 years agoRust vec bench import specific rand::RngCore
Ivan Tham [Fri, 25 Sep 2020 14:19:28 +0000 (22:19 +0800)]
Rust vec bench import specific rand::RngCore

3 years agoAllow multiple allow_internal_unstable attributes
Dániel Buga [Fri, 25 Sep 2020 12:40:16 +0000 (14:40 +0200)]
Allow multiple allow_internal_unstable attributes

Co-authored-by: varkor <github@varkor.com>
3 years agoPatch compilation test helpers for sgx platform
Raoul Strackx [Tue, 31 Mar 2020 09:28:01 +0000 (11:28 +0200)]
Patch compilation test helpers for sgx platform

3 years agocleaning up code
Raoul Strackx [Fri, 25 Sep 2020 13:13:55 +0000 (15:13 +0200)]
cleaning up code

3 years agoBuilding libunwind with new CMakeLists.
Raoul Strackx [Fri, 27 Mar 2020 15:46:52 +0000 (16:46 +0100)]
Building libunwind with new CMakeLists.

The old CMakeLists file of libunwind used the C compiler to compile assembly files. This caused such code not to be hardened.

3 years agoAdding checks for module level assembly
Raoul Strackx [Fri, 27 Mar 2020 14:48:10 +0000 (15:48 +0100)]
Adding checks for module level assembly

3 years agoLVI hardening tests for cmake
Raoul Strackx [Fri, 27 Mar 2020 13:19:07 +0000 (14:19 +0100)]
LVI hardening tests for cmake

3 years agotesting c++ code (cc crate)
Raoul Strackx [Fri, 27 Mar 2020 10:24:17 +0000 (11:24 +0100)]
testing c++ code (cc crate)

3 years agotest hardening C inline assembly code (cc crate)
Raoul Strackx [Thu, 26 Mar 2020 14:05:43 +0000 (15:05 +0100)]
test hardening C inline assembly code (cc crate)

3 years agostarted using cc crate
Raoul Strackx [Thu, 26 Mar 2020 12:57:37 +0000 (13:57 +0100)]
started using cc crate

3 years agoLVI test std lib
Raoul Strackx [Thu, 26 Mar 2020 09:51:14 +0000 (10:51 +0100)]
LVI test std lib

3 years agoAdding checks for assembly files in libunwind
Raoul Strackx [Wed, 25 Mar 2020 14:28:34 +0000 (15:28 +0100)]
Adding checks for assembly files in libunwind

3 years agoskeleton check module level assembly
Raoul Strackx [Fri, 20 Mar 2020 09:51:18 +0000 (10:51 +0100)]
skeleton check module level assembly

3 years agorust inline assembly lvi hardening test
Raoul Strackx [Thu, 19 Mar 2020 15:40:33 +0000 (16:40 +0100)]
rust inline assembly lvi hardening test

3 years agoAuto merge of #77152 - vandenheuvel:update_chalk_further, r=jackh726
bors [Fri, 25 Sep 2020 12:22:05 +0000 (12:22 +0000)]
Auto merge of #77152 - vandenheuvel:update_chalk_further, r=jackh726

Update chalk to 0.28.0

3 years agoLink dynamic and static late_link_args before generic ones
Mateusz Mikuła [Fri, 25 Sep 2020 11:33:25 +0000 (13:33 +0200)]
Link dynamic and static late_link_args before generic ones

3 years agoAuto merge of #77041 - lcnr:const-eval-perf, r=ecstatic-morse
bors [Fri, 25 Sep 2020 10:14:47 +0000 (10:14 +0000)]
Auto merge of #77041 - lcnr:const-eval-perf, r=ecstatic-morse

perf: move cold path of `process_obligations` into a separate function

cc #76575

This probably won't matter too much in the long run once #69218 is merged so we may not want to merge this.

r? `@ecstatic-morse`

3 years agoBTreeMap: various tweaks
Stein Somers [Sun, 9 Aug 2020 10:25:20 +0000 (12:25 +0200)]
BTreeMap: various tweaks

3 years agoBTreeMap: introduce edge methods similar to those of keys and values
Stein Somers [Sun, 9 Aug 2020 10:25:20 +0000 (12:25 +0200)]
BTreeMap: introduce edge methods similar to those of keys and values

3 years agoBTreeMap: refactor correct_childrens_parent_links
Stein Somers [Sun, 9 Aug 2020 10:25:20 +0000 (12:25 +0200)]
BTreeMap: refactor correct_childrens_parent_links

3 years agoAuto merge of #77144 - flip1995:clippyup, r=Manishearth
bors [Fri, 25 Sep 2020 06:23:55 +0000 (06:23 +0000)]
Auto merge of #77144 - flip1995:clippyup, r=Manishearth

Update Clippy

Bi-weekly Clippy update.

This includes a `Cargo.lock` update (d445493479711389f4dea3a0f433041077ba2088), so probably needs `rollup=never`.

r? `@Manishearth`

3 years agoAuto merge of #76844 - simonvandel:fix-76803, r=wesleywiser
bors [Fri, 25 Sep 2020 04:17:03 +0000 (04:17 +0000)]
Auto merge of #76844 - simonvandel:fix-76803, r=wesleywiser

Fix #76803 miscompilation

Fixes #76803
Seems like it was an oversight that the discriminant value being set was not compared to the target value from the SwitchInt, as a comment says this is a requirement for the optimization to be sound.

r? `@wesleywiser` since you are probably familiar with the optimization and made #76837 to workaround the bug

3 years agoRemoving erroneous semicolon
Austin Keeley [Fri, 25 Sep 2020 04:03:59 +0000 (00:03 -0400)]
Removing erroneous semicolon

3 years agoAuto merge of #77172 - jonas-schievink:rollup-a041rou, r=jonas-schievink
bors [Fri, 25 Sep 2020 01:56:06 +0000 (01:56 +0000)]
Auto merge of #77172 - jonas-schievink:rollup-a041rou, r=jonas-schievink

Rollup of 15 pull requests

Successful merges:

 - #75438 (Use adaptive SVG favicon for rustdoc like other rust sites)
 - #76304 (Make delegation methods of `std::net::IpAddr` unstably const)
 - #76724 (Allow a unique name to be assigned to dataflow graphviz output)
 - #76978 (Documented From impls in std/sync/mpsc/mod.rs)
 - #77044 (Liballoc bench vec use mem take not replace)
 - #77050 (Typo fix: "satsify" -> "satisfy")
 - #77074 (add array::from_ref)
 - #77078 (Don't use an if guard to check equality with a constant)
 - #77079 (Use `Self` in docs when possible)
 - #77081 (Merge two almost identical match arms)
 - #77121 (Updated html_root_url for compiler crates)
 - #77136 (Suggest `const_mut_refs`, not `const_fn` for mutable references in `const fn`)
 - #77160 (Suggest `const_fn_transmute`, not `const_fn`)
 - #77164 (Remove workaround for deref issue that no longer exists.)
 - #77165 (Followup to #76673)

Failed merges:

r? `@ghost`

3 years agoRollup merge of #77165 - simonvandel:do-not-fire-on-drop-and-replace, r=oli-obk
Jonas Schievink [Fri, 25 Sep 2020 00:29:52 +0000 (02:29 +0200)]
Rollup merge of #77165 - simonvandel:do-not-fire-on-drop-and-replace, r=oli-obk

Followup to #76673

Resolves https://github.com/rust-lang/rust/pull/76673#discussion_r494426303
r? @tmiasko

3 years agoRollup merge of #77164 - fusion-engineering-forks:no-more-funny-underscores, r=Mark...
Jonas Schievink [Fri, 25 Sep 2020 00:29:51 +0000 (02:29 +0200)]
Rollup merge of #77164 - fusion-engineering-forks:no-more-funny-underscores, r=Mark-Simulacrum

Remove workaround for deref issue that no longer exists.

The double underscores were used to work around issue #12808, which was solved in 2016.

3 years agoRollup merge of #77160 - ecstatic-morse:const-fn-transmute-suggestion, r=oli-obk
Jonas Schievink [Fri, 25 Sep 2020 00:29:49 +0000 (02:29 +0200)]
Rollup merge of #77160 - ecstatic-morse:const-fn-transmute-suggestion, r=oli-obk

Suggest `const_fn_transmute`, not `const_fn`

More fallout from #76850 in the vein of #77134. The fix is the same. I looked through the structured errors file and didn't see any more of this kind of diagnostics bug.

r? @oli-obk

3 years agoRollup merge of #77136 - ecstatic-morse:issue-77134, r=oli-obk
Jonas Schievink [Fri, 25 Sep 2020 00:29:47 +0000 (02:29 +0200)]
Rollup merge of #77136 - ecstatic-morse:issue-77134, r=oli-obk

Suggest `const_mut_refs`, not `const_fn` for mutable references in `const fn`

Resolves #77134.

Prior to #76850, most uses of `&mut` in `const fn` ~~required~~ involved two feature gates, `const_mut_refs` and `const_fn`. The first allowed all mutable borrows of locals. The second allowed only locals, arguments and return values whose types contained `&mut`. I switched the second check to the `const_mut_refs` gate. However, I forgot update the error message with the new suggestion.

Alternatively, we could revert to having two different feature gates for this. OP's code never borrows anything mutably, so it didn't need `const_mut_refs` in the past, only `const_fn`. I'd prefer to keep everything under a single gate, however.

r? @oli-obk

3 years agoRollup merge of #77121 - duckymirror:html-root-url, r=jyn514
Jonas Schievink [Fri, 25 Sep 2020 00:29:45 +0000 (02:29 +0200)]
Rollup merge of #77121 - duckymirror:html-root-url, r=jyn514

Updated html_root_url for compiler crates

Closes #77103

r? @jyn514

3 years agoRollup merge of #77081 - LingMan:patch-1, r=jonas-schievink
Jonas Schievink [Fri, 25 Sep 2020 00:29:44 +0000 (02:29 +0200)]
Rollup merge of #77081 - LingMan:patch-1, r=jonas-schievink

Merge two almost identical match arms

3 years agoRollup merge of #77079 - poliorcetics:more-self-in-docs, r=jyn514
Jonas Schievink [Fri, 25 Sep 2020 00:29:42 +0000 (02:29 +0200)]
Rollup merge of #77079 - poliorcetics:more-self-in-docs, r=jyn514

Use `Self` in docs when possible

Fixes #76542.

I used `rg '\s*//[!/]\s+fn [\w_]+\(&?self, ' .` in `library/` to find instances, I found some with that and some by manually checking.

@rustbot modify labels: C-enhancement T-doc

3 years agoRollup merge of #77078 - LingMan:patch-2, r=jonas-schievink
Jonas Schievink [Fri, 25 Sep 2020 00:29:40 +0000 (02:29 +0200)]
Rollup merge of #77078 - LingMan:patch-2, r=jonas-schievink

Don't use an if guard to check equality with a constant

Match on it directly instead

3 years agoRollup merge of #77074 - lcnr:array-from-ref, r=SimonSapin
Jonas Schievink [Fri, 25 Sep 2020 00:29:39 +0000 (02:29 +0200)]
Rollup merge of #77074 - lcnr:array-from-ref, r=SimonSapin

add array::from_ref

mirrors the methods in `std::slice` with the same name.

I guess this method previously didn't exist as there was close to no reason to create an array of size `1`.
This will change due to const generics in the near future.

3 years agoRollup merge of #77050 - follower:patch-1, r=oli-obk
Jonas Schievink [Fri, 25 Sep 2020 00:29:37 +0000 (02:29 +0200)]
Rollup merge of #77050 - follower:patch-1, r=oli-obk

Typo fix: "satsify" -> "satisfy"

3 years agoRollup merge of #77044 - pickfire:patch-4, r=jyn514
Jonas Schievink [Fri, 25 Sep 2020 00:29:35 +0000 (02:29 +0200)]
Rollup merge of #77044 - pickfire:patch-4, r=jyn514

Liballoc bench vec use mem take not replace

3 years agoRollup merge of #76978 - duckymirror:mpsc-from-doc, r=jyn514
Jonas Schievink [Fri, 25 Sep 2020 00:29:34 +0000 (02:29 +0200)]
Rollup merge of #76978 - duckymirror:mpsc-from-doc, r=jyn514

Documented From impls in std/sync/mpsc/mod.rs

This is for #51430.

r? @steveklabnik

3 years agoRollup merge of #76724 - ecstatic-morse:dataflow-pass-names, r=lcnr
Jonas Schievink [Fri, 25 Sep 2020 00:29:31 +0000 (02:29 +0200)]
Rollup merge of #76724 - ecstatic-morse:dataflow-pass-names, r=lcnr

Allow a unique name to be assigned to dataflow graphviz output

Previously, if the same analysis were invoked multiple times in a single compilation session, the graphviz output for later runs would overwrite that of previous runs. Allow callers to add a unique identifier to each run so this can be avoided.

3 years agoRollup merge of #76304 - CDirkx:const-ip, r=ecstatic-morse
Jonas Schievink [Fri, 25 Sep 2020 00:29:30 +0000 (02:29 +0200)]
Rollup merge of #76304 - CDirkx:const-ip, r=ecstatic-morse

Make delegation methods of `std::net::IpAddr` unstably const

Make the following methods of `std::net::IpAddr` unstable const under the `const_ip` feature:
 - `is_unspecified`
 - `is_loopback`
 - `is_global`
 - `is_multicast`

Also adds a test for these methods in a const context.

Possible because these methods delegate to the inner `Ipv4Addr` or `Ipv6Addr`, which were made const ([PR#76205](https://github.com/rust-lang/rust/pull/76142) and [PR#76206](https://github.com/rust-lang/rust/pull/76206)), and the recent stabilization of const control flow.

Part of #76205

r? @ecstatic-morse

3 years agoRollup merge of #75438 - Cldfire:rustdoc/use-adaptive-svg-favicon, r=GuillaumeGomez
Jonas Schievink [Fri, 25 Sep 2020 00:29:22 +0000 (02:29 +0200)]
Rollup merge of #75438 - Cldfire:rustdoc/use-adaptive-svg-favicon, r=GuillaumeGomez

Use adaptive SVG favicon for rustdoc like other rust sites

Use the theme-adaptive SVG favicon that was recently introduced [for the Rust site](https://github.com/rust-lang/www.rust-lang.org/pull/1185) (and others).

(This PR is simply copied from the PR linked above, so see that for rationale.)

Closes #72165.

Before, Firefox on Linux:

![image](https://user-images.githubusercontent.com/13814214/89971811-34c0a900-dc2a-11ea-9aa6-a4aa9d66bed4.png)

After, Firefox on Linux (`prefers-color-scheme` set to `dark` by setting `ui.systemUsesDarkTheme` to a number value of `1` in `about:config`):

![image](https://user-images.githubusercontent.com/13814214/89971842-515ce100-dc2a-11ea-92e8-c374aaaf6031.png)

3 years agoAuto merge of #77014 - tmiasko:arena, r=Mark-Simulacrum
bors [Thu, 24 Sep 2020 23:51:45 +0000 (23:51 +0000)]
Auto merge of #77014 - tmiasko:arena, r=Mark-Simulacrum

DroplessArena: Allocate objects from the end of memory chunk

Allocating from the end of memory chunk simplifies the alignment code
and reduces the number of checked arithmetic operations.

3 years agoFix FIXME in core::num test: Check sign of zero in min/max tests.
Mara Bos [Thu, 24 Sep 2020 20:29:32 +0000 (22:29 +0200)]
Fix FIXME in core::num test: Check sign of zero in min/max tests.

3 years agoperf: split progress_obligations with inline(never)
Bastian Kauschke [Thu, 24 Sep 2020 17:52:49 +0000 (19:52 +0200)]
perf: split progress_obligations with inline(never)

3 years agonit
Bastian Kauschke [Thu, 24 Sep 2020 20:03:39 +0000 (22:03 +0200)]
nit

3 years agothe two hardest things in programming, names and...
Bastian Kauschke [Thu, 24 Sep 2020 20:01:46 +0000 (22:01 +0200)]
the two hardest things in programming, names and...

3 years agoupdate Miri
Ralf Jung [Thu, 24 Sep 2020 19:53:07 +0000 (21:53 +0200)]
update Miri

3 years agoBless tests
Dylan MacKenzie [Thu, 24 Sep 2020 18:12:28 +0000 (11:12 -0700)]
Bless tests

3 years agoSuggest `const_fn_transmute` instead of `const_fn`
Dylan MacKenzie [Thu, 24 Sep 2020 18:11:53 +0000 (11:11 -0700)]
Suggest `const_fn_transmute` instead of `const_fn`

3 years agoResolve https://github.com/rust-lang/rust/pull/76673#discussion_r494426303
Simon Vandel Sillesen [Thu, 24 Sep 2020 19:02:53 +0000 (21:02 +0200)]
Resolve https://github.com/rust-lang/rust/pull/76673#discussion_r494426303

3 years agoUpgrade chalk to 0.28.0
Bram van den Heuvel [Thu, 24 Sep 2020 15:37:55 +0000 (17:37 +0200)]
Upgrade chalk to 0.28.0

3 years agoRemove workaround for deref issue that no longer exists.
Mara Bos [Thu, 24 Sep 2020 18:50:09 +0000 (20:50 +0200)]
Remove workaround for deref issue that no longer exists.

The double underscores were used to work around issue #12808, which was
solved in 2016.

3 years agoCall ReentrantMutex::init() in stdout().
Mara Bos [Thu, 24 Sep 2020 17:25:21 +0000 (19:25 +0200)]
Call ReentrantMutex::init() in stdout().

3 years agoAuto merge of #76918 - ishitatsuyuki:match-fastpath, r=oli-obk
bors [Thu, 24 Sep 2020 17:22:56 +0000 (17:22 +0000)]
Auto merge of #76918 - ishitatsuyuki:match-fastpath, r=oli-obk

Add fast path for match checking

This adds a fast path that would reduce the complexity to linear on matches consisting of only variant patterns (i.e. enum matches). (Also see: #7462) Unfortunately, I was too lazy to add a similar fast path for constants (mostly for integer matches), ideally that could be added another day.

TBH, I'm not confident with the performance claims due to the fact that enums tends to be small and FxHashMap could add a lot of overhead.

r? `@Mark-Simulacrum`

needs perf

3 years agoremove enum name from ImplSource variants
Bastian Kauschke [Thu, 24 Sep 2020 17:22:36 +0000 (19:22 +0200)]
remove enum name from ImplSource variants

3 years agoRemove TrustedLen requirement from BuilderMethods::switch
est31 [Thu, 24 Sep 2020 17:10:34 +0000 (19:10 +0200)]
Remove TrustedLen requirement from BuilderMethods::switch

The main use case of TrustedLen is allowing APIs to specialize on it,
but no use of it uses that specialization. Instead, only the .len()
function provided by ExactSizeIterator is used, which is already
required to be accurate.

Thus, the TrustedLen requirement on BuilderMethods::switch is redundant.

3 years agoUpdate chalk to 0.27.0
Bram van den Heuvel [Thu, 24 Sep 2020 14:59:21 +0000 (16:59 +0200)]
Update chalk to 0.27.0