Commit graph

128128 commits

Author SHA1 Message Date
Dylan MacKenzie
0f594698aa Bless tests 2020-09-24 12:07:58 -07:00
Dylan MacKenzie
ebf024bba8 Suggest const_fn_transmute instead of const_fn 2020-09-24 12:07:41 -07:00
Simon Vandel Sillesen
7dec440340 Resolve https://github.com/rust-lang/rust/pull/76673#discussion_r494426303 2020-09-24 21:02:53 +02:00
Bram van den Heuvel
51c781f613 Upgrade chalk to 0.28.0 2020-09-24 20:54:33 +02:00
Mara Bos
13dc237037 Remove workaround for deref issue that no longer exists.
The double underscores were used to work around issue #12808, which was
solved in 2016.
2020-09-24 20:50:09 +02:00
bors
e599b53e67 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
2020-09-24 17:22:56 +00:00
Bastian Kauschke
1857184cd1 remove enum name from ImplSource variants 2020-09-24 19:22:36 +02:00
Bram van den Heuvel
5f67571e34 Update chalk to 0.27.0 2020-09-24 19:10:01 +02:00
Bram van den Heuvel
61b2a6f5e5 Update chalk to 0.26.0 2020-09-24 19:10:01 +02:00
Bram van den Heuvel
ed784023e5 Update chalk to 0.25.0 2020-09-24 19:10:01 +02:00
Bram van den Heuvel
cb660c6ab5 Update chalk to 0.24.0 2020-09-24 19:10:01 +02:00
Bram van den Heuvel
52eeff6fbe Update chalk to 0.23.0 2020-09-24 19:10:00 +02:00
Bram van den Heuvel
b832a97a51 Update chalk to 0.22.0 2020-09-24 19:10:00 +02:00
bors
87d262acb5 Auto merge of #77006 - oli-obk:🐌_const_queries, r=Mark-Simulacrum
Cache `eval_to_allocation_raw` on disk

https://github.com/rust-lang/rust/pull/74949#issuecomment-695833161 regressed the performance on these queries, this PR gets the perf back.
2020-09-24 15:12:17 +00:00
Oliver Scherer
40629ef827 Always cache const eval queries 2020-09-24 17:09:09 +02:00
Lzu Tao
382d7243a7 move test to intergrated test in library/core 2020-09-24 14:46:57 +00:00
Mark Rousskov
4de836e214 Install std for non-host targets 2020-09-24 09:37:23 -04:00
bors
893fadd11a Auto merge of #76820 - jyn514:query-comments, r=davidtwco
Preserve doc-comments when generating queries

Closes https://github.com/rust-lang/rust/issues/76812
2020-09-24 13:01:46 +00:00
flip1995
d445493479
Update Cargo.lock 2020-09-24 14:51:13 +02:00
flip1995
f1f1e0ba8e
Merge commit 'e636b88aa180e8cab9e28802aac90adbc984234d' into clippyup 2020-09-24 14:49:22 +02:00
bors
3a4da87f58 Auto merge of #77049 - lcnr:const-eval-function-signature, r=oli-obk
const_evaluatable_checked: extend predicate collection

We now walk the hir instead of using `ty` so that we get better spans here, While I am still not completely sure if that's
what we want in the end, it does seem a lot closer to the final goal than the previous version.

We also look into type aliases (and use a `TypeVisitor` here), about which I am not completely sure, but we will see how well this works.

We also look into fn decls, so the following should work now.
```rust
fn test<T>() -> [u8; std::mem::size_of::<T>()] {
    [0; std::mem::size_of::<T>()]
}
```
Additionally, we visit the optional trait and self type of impls.

r? `@oli-obk`
2020-09-24 10:29:14 +00:00
bors
86b4172305 Auto merge of #77028 - andjo403:mini, r=matthewjasper
Move MiniSet to data_structures

remove the need for T to be copy from MiniSet as was done for MiniMap

MiniMap and MiniSet was added by https://github.com/rust-lang/rust/pull/72412

think that this can be used in https://github.com/rust-lang/rust/pull/68828
2020-09-24 08:14:30 +00:00
Bastian Kauschke
21edd10dc5 update tests 2020-09-24 09:07:20 +02:00
Bastian Kauschke
3f9015b22d visit impl self ty + trait 2020-09-24 09:04:26 +02:00
Bastian Kauschke
b8402d6a6e assign the correct DefId in nominal_obligations 2020-09-24 09:04:23 +02:00
Bastian Kauschke
f8d3f401df walk hir to get const evaluatable predicates 2020-09-24 09:03:50 +02:00
Bastian Kauschke
ac1d0d8b28 fmt, use IndexSet directly instead of UniquePredicates 2020-09-24 09:03:14 +02:00
Bastian Kauschke
e1f408e6c8 const_evaluatable_checked: collect predicates from fn_sig 2020-09-24 09:03:07 +02:00
bors
5562bb6d74 Auto merge of #76748 - tmiasko:no-op-jumps, r=matthewjasper
Fix underflow when calculating the number of no-op jumps folded

When removing unwinds to no-op blocks and folding jumps to no-op blocks,
remove the unwind target first. Otherwise we cannot determine if target
has been already folded or not.

Previous implementation incorrectly assumed that all resume targets had
been folded already, occasionally resulting in an underflow:

```
remove_noop_landing_pads: removed 18446744073709551613 jumps and 3 landing pads
```
2020-09-24 05:57:06 +00:00
Dylan MacKenzie
e5e5e64ff1 Bless tests 2020-09-23 21:05:59 -07:00
Dylan MacKenzie
a320ef751b Suggest const_mut_refs for mutable references in const fn 2020-09-23 21:04:07 -07:00
bors
78a089487b Auto merge of #74430 - Manishearth:stabilize-intra-doc, r=Manishearth
Stabilize intra-doc links

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

Thanks to the great work of `@jyn514` in getting the [cross-crate reexport issue](https://github.com/rust-lang/rust/issues/65983) in intra-rustdoc links fixed, I think we're now in a position to stabilize this feature.

The tracking issue currently has two unresolved issues:

 - <s>behavior around doc(hidden): This is fixed in https://github.com/rust-lang/rust/pull/73365, which is just waiting for CI and should land tomorrow. It's also a pretty niche bug so while I expect it to land soon I don't think we need to block stabilization on it anyway.</s>
 - Non-identifier primitive types like slices: This was not a part of the original RFC anyway, and is a pretty niche use case

The feature itself, sans https://github.com/rust-lang/rust/issues/65983, has been shipped on nightly for three years now, with people using it on docs.rs. https://github.com/rust-lang/rust/issues/65983 itself is not an overwhelmingly central bit of functionality; the reason we elected to block stabilization on it was that back in 2017 it was not possible to fix the issue without some major refactorings of resolve, and we did not want to stabilize something that had such a potentially unfixable bug.

Given that we've fixed it, I see no reason to delay stabilization on this long awaited feature. It's possible that the latest patches have problems, however we _have_ done crater runs of some of the crucial parts. Furthermore, that's what the release trains are for, we will have a solid three months to let it ride the trains before it actually hits the stable compiler.

r? `@rust-lang/rustdoc`
2020-09-24 03:42:53 +00:00
Jarek Samic
085679c841 Use theme-adaptive SVG favicon from other Rust sites 2020-09-23 21:31:27 -04:00
bors
7b240a1262 Auto merge of #77083 - KodrAus:revert/const-type-id, r=RalfJung
revert const_type_id stabilization

This reverts #72488, which is currently on beta and scheduled to stabilize in `1.47.0`, based on https://github.com/rust-lang/rust/pull/75923#issuecomment-696676511

It turns out we might not be quite ready to stabilize `TypeId` in const contexts before having a chance to rework its internals. Since `TypeId` is a bit of an oddity we want to be careful about how those internals are currently being relied on while making changes. That will be easier to do without having to also consider compile-time contexts.

r? `@eddyb`
2020-09-24 00:43:09 +00:00
Tomasz Miąsko
a09d607844 Remove duplicated SimplifyCfg pass 2020-09-24 00:00:00 +00:00
Dylan MacKenzie
16769eb19e Add entry to CHANGELOG for --keep-stage-std 2020-09-23 16:22:59 -07:00
Dylan MacKenzie
c0ddaed2bf Remove warning about possible future deprecation 2020-09-23 16:17:11 -07:00
Mark Rousskov
ef95430b9b Adjust support expectations for downloaded LLVMs 2020-09-23 19:05:11 -04:00
Mark Rousskov
df004df3a7 Re-download LLVM on submodule updates only 2020-09-23 19:03:52 -04:00
Ashley Mannix
0e2db57754 update tracking issue for const_type_id 2020-09-24 09:00:04 +10:00
bors
c35177582b Auto merge of #77102 - Dylan-DPC:rollup-2jfrg3u, r=Dylan-DPC
Rollup of 9 pull requests

Successful merges:

 - #76898 (Record `tcx.def_span` instead of `item.span` in crate metadata)
 - #76939 (emit errors during AbstractConst building)
 - #76965 (Add cfg(target_has_atomic_equal_alignment) and use it for Atomic::from_mut.)
 - #76993 (Changing the alloc() to accept &self instead of &mut self)
 - #76994 (fix small typo in docs and comments)
 - #77017 (Add missing examples on Vec iter types)
 - #77042 (Improve documentation for ToSocketAddrs)
 - #77047 (Miri: more informative deallocation error messages)
 - #77055 (Add #[track_caller] to more panicking Cell functions)

Failed merges:

r? `@ghost`
2020-09-23 22:34:44 +00:00
Dylan MacKenzie
bcbd2ccc8d Add keep-stage-std to x.py
This keeps only the `std` artifacts compiled by the given stage, not the
compiler. This is useful when working on the latter stages of the
compiler in tandem with the standard library, since you don't have to
rebuild the *entire* compiler when the standard library changes.
2020-09-23 14:25:23 -07:00
bors
8b4085359a Auto merge of #76673 - simonvandel:remove-unneeded-drops, r=oli-obk
MIR pass to remove unneeded drops on types not needing drop

This is heavily dependent on MIR inlining running to actually see the drop statement.

Do we want to special case replacing a call to std::mem::drop with a goto aswell?
2020-09-23 20:13:47 +00:00
Erik Hofmayer
764967a7e5 tidy 2020-09-23 22:08:30 +02:00
Bastian Kauschke
5b3016134f use array::from_ref for slices 2020-09-23 21:56:23 +02:00
Erik Hofmayer
138a2e5eaa /nightly/nightly-rustc 2020-09-23 21:51:56 +02:00
Christiaan Dirkx
947536fca0 Make delegation methods of std::net::IpAddr unstable 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, and the recent stabilization of const control flow.

Part of #76205
2020-09-23 21:33:39 +02:00
Erik Hofmayer
dd66ea2d3d Updated html_root_url for compiler crates 2020-09-23 21:14:43 +02:00
bors
e636b88aa1 Auto merge of #6044 - rschoon:rc-buffer, r=yaahc
Add `rc_buffer` lint for checking Rc<String> and friends

Fixes #2623

This is a bit different from the original PR attempting to implement this type of lint.   Rather than linting against converting into the unwanted types, this PR lints against declaring the unwanted type in a struct or function definition.

I'm reasonably happy with what I have here, although I used the fully qualified type names for the Path and OsString suggestions, and I'm not sure if I should have just used the short versions instead, even if they might not have been declared via use.

Also, I don't know if "buffer type" is the best way to put it or not.  Alternatively I could call it a "growable type" or "growable buffer type", but I was thinking of PathBuf when I started making the lint.

changelog: Add `rc_buffer` lint
2020-09-23 18:35:08 +00:00
Simon Vandel Sillesen
05f84c67a4 Ignore test on wasm as it does not unwind 2020-09-23 18:25:55 +02:00