Commit Graph

123324 Commits

Author SHA1 Message Date
Thom Chiovoloni
13e380d798 Benchmark the unaligned case for is_ascii, and add missing SAFETY 2020-07-05 14:51:05 -07:00
Thom Chiovoloni
e1d4db6055 Add benchmark for slice is_ascii using align_to 2020-07-05 14:33:27 -07:00
Eduard-Mihai Burtescu
f07100afc8 Use for<'tcx> fn pointers in Providers, instead of having Providers<'tcx>. 2020-07-05 23:00:14 +03:00
Eduard-Mihai Burtescu
f25811e34b Replace early-bound normalization hack with per-query key/value type aliases. 2020-07-05 22:58:46 +03:00
bors
2753fab7ce Auto merge of #73879 - ecstatic-morse:discr-switch-uninit, r=oli-obk
Handle inactive enum variants in `MaybeUninitializedPlaces`

Resolves the first part of #69715.

This is the equivalent of #68528 but for `MaybeUninitializedPlaces`. Because we now notify drop elaboration that inactive enum variants might be uninitialized, some drops get marked as ["open" that were previously "static"](e0e5d82e16/src/librustc_mir/transform/elaborate_drops.rs (L191)). Unlike in #69715, this isn't strictly better: An "open" drop expands to more MIR than a simple call to the drop shim. However, because drop elaboration considers each field of an "open" drop separately, it can sometimes eliminate unnecessary drops of moved-from or unit-like enum variants. This is the case for `Option::unwrap`, which is reflected in the `mir-opt` test.

cc @eddyb
r? @oli-obk
2020-07-05 18:01:47 +00:00
Kristofer Rye
2f314268b8
rustdoc: Restore underline text decoration on hover for FQN in header
This causes the components of FQN's to behave similarly to other links
in the contents of rustdoc-styled pages.

I (and I hope others at least in part) have found the prior design to be
somewhat confusing, as it is not clear (upon hovering) that the various
parts of the FQN are actually links that the user can navigate to.

In short, this patch makes links in the FQN have an underline when the
user hovers over them, more clearly indicating that they can be used for
navigation.

Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
2020-07-05 12:25:26 -05:00
Thom Chiovoloni
63e2e2e326 Avoid vec! allocation in is_ascii_slice_* benches 2020-07-05 10:23:50 -07:00
Thom Chiovoloni
980d8e1a0b Optimize is_ascii for &str and &[u8] 2020-07-05 10:23:50 -07:00
Ralf Jung
5f5c98bd8a add (unchecked) indexing methods to raw pointers and NonNull 2020-07-05 19:15:30 +02:00
Ralf Jung
90580c7b0e make unchecked slice indexing helper methods use raw pointers 2020-07-05 19:05:55 +02:00
Ralf Jung
3b1d5e6d79 call the mut version as_mut_ptr and also add an as_ptr-like method to NonNull slices 2020-07-05 18:41:29 +02:00
Ralf Jung
c478b5473d add as_ptr method to raw slices 2020-07-05 18:41:29 +02:00
Ralf Jung
9cb1ffdd4f variant_count: avoid incorrect dummy implementation 2020-07-05 18:12:21 +02:00
Ralf Jung
319c7f77de fmt 2020-07-05 16:01:18 +02:00
Mark Rousskov
3503247c11 Shrink ParamEnv to 16 bytes 2020-07-05 09:51:42 -04:00
Mark Rousskov
8512d2efde Avoid deconstructing pointer for hashing 2020-07-05 09:51:42 -04:00
Mark Rousskov
aae1215f7f Shrink ParamEnv to 16 bytes 2020-07-05 09:51:42 -04:00
Ralf Jung
751b594cc8 const validation: add test for uninit bool 2020-07-05 13:48:06 +02:00
Ralf Jung
c3fc4f0420 catch errors more locally around read_discriminant 2020-07-05 13:40:27 +02:00
Ralf Jung
54d95ed25a catch InvalidUninitBytes during validation 2020-07-05 12:52:35 +02:00
Bastian Kauschke
016e9f8157 expected found &T -> T 2020-07-05 11:38:39 +02:00
Tomasz Miąsko
bcef848a69 Explain effects of debugging options from config.toml
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
2020-07-05 11:37:39 +02:00
Ivan Tham
bc0d619325
Fix spacing in Iterator fold doc 2020-07-05 15:23:42 +08:00
Eric Huss
310c97b6ba Fix caching issue when building tools. 2020-07-04 14:46:04 -07:00
Nadrieril
3cb31b6699 Fix #71977 2020-07-04 21:21:07 +01:00
Yuki Okushi
b93ecc1dac
Address code reviews 2020-07-05 03:43:43 +09:00
Oliver Scherer
ee8dd4e3cc Fix const prop ICE
we used to erase the local just before we tried to read it for diagnostics
2020-07-04 19:30:45 +02:00
Yuki Okushi
dcbe85abad
Explain exhaustive matching on {usize,isize} maximum values 2020-07-05 02:10:57 +09:00
Oliver Scherer
394b8cdfb7 Match on Symbol instead of &str for type-checking intrinsics. 2020-07-04 18:37:52 +02:00
Oliver Scherer
66fb778acc Make rustc_peek a safe intrinsic 2020-07-04 18:30:54 +02:00
Bastian Kauschke
f5305c3d16
nit
Co-authored-by: varkor <github@varkor.com>
2020-07-04 16:20:27 +02:00
Bastian Kauschke
dbcabc248c instantiate_opaque_types LocalDefId 2020-07-04 14:37:03 +02:00
Bastian Kauschke
20d6941be7 ConstCx to LocalDefId 2020-07-04 14:02:41 +02:00
Tomasz Miąsko
8900502a88 Remove unnecessary release from Arc::try_unwrap
The thread that recovers the unique access to Arc inner value (e.g., drop
when ref-count strong reaches zero, successful try_unwrap), ensures that
other operations on Arc inner value happened before by synchronizing
with release operations performed when decrementing the reference counter.

When try_unwrap succeeds, the current thread recovers the unique access
to Arc inner value, so release is unnecessary.
2020-07-04 11:40:27 +02:00
Bastian Kauschke
7a3081baaf add lazy_normalization_consts feature gate 2020-07-04 10:50:14 +02:00
bors
0cd7ff7ddf Auto merge of #72978 - matklad:ship-rust-analyzer, r=Mark-Simulacrum
ship rust analyzer

This successfully  builds rust-analyzer as a part of rust repo. I haven't yet added required changes to dist.rs -- seems like I just have to copy-paste quite a bit of code I don't really understand :-)
2020-07-04 04:54:27 +00:00
JarredAllen
c8f700ea69 Fixed compile errors 2020-07-03 21:22:23 -07:00
bors
dbf3ae7c3b Auto merge of #74019 - Manishearth:rollup-2st3jsk, r=Manishearth
Rollup of 12 pull requests

Successful merges:

 - #73140 (Fallback to xml.etree.ElementTree)
 - #73670 (Add `format_args_capture` feature)
 - #73693 (Use exhaustive match in const_prop.rs)
 - #73845 (Use &raw in A|Rc::as_ptr)
 - #73861 (Create E0768)
 - #73881 (Standardize bibliographic citations in rustc API docs)
 - #73925 (Improve comments from #72617, as suggested by RalfJung)
 - #73949 ([mir-opt] Fix mis-optimization and other issues with the SimplifyArmIdentity pass)
 - #73984 (Edit docs for rustc_data_structures::graph::scc)
 - #73985 (Fix "getting started" link)
 - #73997 (fix typo)
 - #73999 (Bump mingw-check CI image from Ubuntu 16.04 to 18.04.)

Failed merges:

 - #74000 (add `lazy_normalization_consts` feature gate)

r? @ghost
2020-07-04 01:09:09 +00:00
Manish Goregaokar
d69a8468fa
Rollup merge of #73999 - eddyb:svv-prereq, r=Mark-Simulacrum
Bump mingw-check CI image from Ubuntu 16.04 to 18.04.

I chose 18.04 because we use it for other builders, and it's enough to get a version of MinGW that can build `libssh2-sys`.

This is a prereq for #73902, where `libssh2-sys` shows up as an indirect dependency of `x.py check src/tools/semverver` (through `src/tools/cargo`, which we don't currently `x.py check` because it's not in-tree). See also https://github.com/rust-lang/rust/pull/73902#issuecomment-652414502.

r? @Mark-Simulacrum cc @mati865
2020-07-03 17:17:10 -07:00
Manish Goregaokar
e005c97255
Rollup merge of #73997 - rust-lang:lcnr-patch-1, r=jonas-schievink
fix typo

r? @Dylan-DPC
2020-07-03 17:17:09 -07:00
Manish Goregaokar
e4c505b879
Rollup merge of #73985 - e00E:fix-getting-started-link, r=jonas-schievink
Fix "getting started" link

The previous link is 404.
2020-07-03 17:17:07 -07:00
Manish Goregaokar
70c4b2ff60
Rollup merge of #73984 - pierwill:pierwill-tarjan, r=jonas-schievink
Edit docs for rustc_data_structures::graph::scc

- Add newline to provide concise module summary
- Add wikipedia link
- Italicize O notation
2020-07-03 17:17:05 -07:00
Manish Goregaokar
60cad20b41
Rollup merge of #73949 - wesleywiser:simplify_try_fixes, r=oli-obk
[mir-opt] Fix mis-optimization and other issues with the SimplifyArmIdentity pass

This does not yet attempt re-enabling the pass, but it does resolve a number of issues with the pass.

r? @oli-obk

I believe this closes #73223.
2020-07-03 17:17:03 -07:00
Manish Goregaokar
9d0ca3806f
Rollup merge of #73925 - eduardosm:improve-pr72617-comments, r=RalfJung
Improve comments from #72617, as suggested by RalfJung

r? @RalfJung
2020-07-03 17:17:01 -07:00
Manish Goregaokar
d46de1052d
Rollup merge of #73881 - pierwill:pierwill-citations, r=jonas-schievink
Standardize bibliographic citations in rustc API docs

See #73877.
2020-07-03 17:16:59 -07:00
Manish Goregaokar
6339abd338
Rollup merge of #73861 - GuillaumeGomez:create-e0767, r=Dylan-DPC
Create E0768

r? @Dylan-DPC
2020-07-03 17:16:58 -07:00
Manish Goregaokar
9a659c54e5
Rollup merge of #73845 - CAD97:weak-as-unsized-ptr, r=RalfJung
Use &raw in A|Rc::as_ptr

This PR uses `&raw` for offsetting `*mut [A]RcInner<T> -> *mut T`.

Additionally, this updates the implementation of `Weak::as_ptr` to support unsized `T`, though it does not yet relax the bounds of `Weak::as_ptr`/`into_raw`/`from_raw` to accept unsized `T`.
2020-07-03 17:16:56 -07:00
Manish Goregaokar
50dcefca78
Rollup merge of #73693 - wesleywiser:const_prop_exhaustive_match, r=oli-obk
Use exhaustive match in const_prop.rs

Addresses a comment left by @RalfJung on #73613

r? @RalfJung
2020-07-03 17:16:54 -07:00
Manish Goregaokar
4a8d9ea80f
Rollup merge of #73670 - davidhewitt:format-args-capture, r=varkor
Add `format_args_capture` feature

This is the initial implementation PR for [RFC 2795](https://github.com/rust-lang/rfcs/pull/2795).

Note that, as dicussed in the tracking issue (#67984), the feature gate has been called `format_args_capture`.

Next up I guess I need to add documentation for this feature. I've not written any docs before for rustc / std so I would appreciate suggestions on where I should add docs.
2020-07-03 17:16:52 -07:00
Manish Goregaokar
df8f551e79
Rollup merge of #73140 - tmiasko:element-tree, r=GuillaumeGomez
Fallback to xml.etree.ElementTree

The xml.etree.cElementTree has been deprecated since Python 3.3
and removed in Python 3.9 https://bugs.python.org/issue36543.
2020-07-03 17:16:50 -07:00