Commit Graph

109529 Commits

Author SHA1 Message Date
Stein Somers
0405db3a34 BTreeMap/BTreeSet: implement and test drain_filter 2020-03-29 16:05:53 +02:00
Stein Somers
a6cae3d5cf Add benchmarks of drain_filter-like behaviour 2020-03-29 16:05:53 +02:00
Amanieu d'Antras
4a4314e3e7 Update LLVM submodule 2020-03-29 11:12:55 +01:00
Mazdak Farrokhzad
59a69708e1 reduce rustc_attr usage in places 2020-03-29 12:01:11 +02:00
Tim Diekmann
c49f28005d Fix links for AllocInit methods 2020-03-29 12:00:51 +02:00
Tim Diekmann
fcd7092ae1 Revert "Fix links for AllocInit methods"
This reverts commit d241db2d4e.
2020-03-29 11:57:25 +02:00
bors
8ab82b87af Auto merge of #70525 - Centril:rollup-vj3esv3, r=Centril
Rollup of 3 pull requests

Successful merges:

 - #68692 (impl From<[T; N]> for Vec<T>)
 - #70101 (Add copy bound to atomic & numeric intrinsics)
 - #70506 (BTreeMap testing: introduce symbolic constants and use height consistently)

Failed merges:

r? @ghost
2020-03-29 09:50:52 +00:00
Mazdak Farrokhzad
f31e56309a
Rollup merge of #70506 - ssomers:btreemap_testing_consts, r=RalfJung
BTreeMap testing: introduce symbolic constants and use height consistently

Doesn't change what or how much is tested, except for some exact integer types, just for convenience and because `node::CAPACITY` is a usize.

r? @RalfJung
2020-03-29 11:50:13 +02:00
Mazdak Farrokhzad
873bf46dc1
Rollup merge of #70101 - tmiasko:intrinsics-copy, r=eddyb
Add copy bound to atomic & numeric intrinsics
2020-03-29 11:50:12 +02:00
Mazdak Farrokhzad
c51fcb5f38
Rollup merge of #68692 - jyn514:vec-from-array, r=LukasKalbertodt
impl From<[T; N]> for Vec<T>

Closes https://github.com/rust-lang/rust/issues/67963
2020-03-29 11:50:10 +02:00
bors
8045865873 Auto merge of #70370 - petrochenkov:nosmatch, r=Centril
Remove attribute `#[structural_match]` and any references to it

A small remaining part of https://github.com/rust-lang/rust/issues/63438.
2020-03-29 06:33:42 +00:00
Russell Cohen
629e97a5a0 Improve error messages for raw strings (#60762)
This diff improves error messages around raw strings in a few ways:
- Catch extra trailing `#` in the parser. This can't be handled in the lexer because we could be in a macro that actually expects another # (see test)
- Refactor & unify error handling in the lexer between ByteStrings and RawByteStrings
- Detect potentially intended terminators (longest sequence of "#*" is suggested)
2020-03-29 00:43:43 -04:00
Tim Diekmann
d241db2d4e Fix links for AllocInit methods 2020-03-29 03:16:23 +01:00
bors
150322f86d Auto merge of #70518 - Dylan-DPC:rollup-n2gkh3a, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #69937 (ASCII methods on OsStr)
 - #70235 (Validate git setup before accessing functionality)
 - #70503 (rename Scalar::{ptr_null -> null_ptr} and add "machine_" prefix like elsewhere)
 - #70508 (Miri: use more specialized Scalar::from_ constructors where appropriate)
 - #70510 (fix TryEnterCriticalSection return type)

Failed merges:

r? @ghost
2020-03-29 00:56:47 +00:00
Tim Diekmann
4309f6d9a1 Minor doc fixes in AllocInit::init 2020-03-29 01:52:21 +01:00
Tim Diekmann
3ade8ae660 Implement init and init_offset on AllocInit and mark it unsafe 2020-03-29 01:47:05 +01:00
Dylan DPC
be8d896a4e
Rollup merge of #70510 - RalfJung:bool-vs-boolean, r=Mark-Simulacrum
fix TryEnterCriticalSection return type

Source: https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-tryentercriticalsection
Fixes https://github.com/rust-lang/rust/issues/70504
2020-03-29 01:32:23 +01:00
Dylan DPC
acc1dc2906
Rollup merge of #70508 - RalfJung:scalar-from, r=eddyb
Miri: use more specialized Scalar::from_ constructors where appropriate
2020-03-29 01:32:22 +01:00
Dylan DPC
96e2934886
Rollup merge of #70503 - RalfJung:null, r=varkor
rename Scalar::{ptr_null -> null_ptr} and add "machine_" prefix like elsewhere

"NULL pointer" is just much more common terminology than "pointer-null".
Also I forgot two methods when renaming all the `Scalar` things to `(to|from)_machine_(u|i)size`.
2020-03-29 01:32:21 +01:00
Dylan DPC
a0d6eedfad
Rollup merge of #70235 - dillona:70182-check-before-using-git, r=Mark-Simulacrum
Validate git setup before accessing functionality

Closes #70182
2020-03-29 01:32:19 +01:00
Dylan DPC
d584f5a386
Rollup merge of #69937 - TyPR124:osstr_ascii, r=dtolnay
ASCII methods on OsStr

Would close #69566

I don't know enough about encodings to know if this is a valid change, however the comment on the issue suggests it could be.

This does two things:

1. Makes ASCII methods available on OsStr

2. Makes it possible to obtain a `&mut OsStr`. This is necessary to actually use `OsStr::make_ascii_*case` methods since they modify the underlying value. As far as I can tell, the only way to modify a `&mut OsStr` is via the methods I just added.

My original hope was to have these methods on `OsStrExt` for Windows, since the standard library already assumes `make_ascii_uppercase` is valid in Windows (see the change I made to windows/process.rs). If it is found these are not valid changes on non-Windows platforms, I can move the methods to the ext trait instead.
2020-03-29 01:32:17 +01:00
TyPR124
271d43b158 add tracking issue 2020-03-28 19:23:49 -04:00
TyPR124
ca4b40348e move doc links for consistency 2020-03-28 18:35:20 -04:00
TyPR124
3781a1a2ac remove unnecessary comments 2020-03-28 18:34:49 -04:00
TyPR124
235700fea0 use make_ascii_uppercase in windows/process.rs 2020-03-28 18:34:49 -04:00
TyPR124
cc584d5166 ascii methods on osstr 2020-03-28 18:34:48 -04:00
Stein Somers
e92d740b35 BTreeMap testing: introduce symbolic constants and refer to height consistently. 2020-03-28 23:30:43 +01:00
Dylan MacKenzie
4d1194c31a Ensure output dir for dataflow results exists 2020-03-28 14:09:34 -07:00
Dylan MacKenzie
c8004027ba Dump graphviz dataflow results with flag 2020-03-28 14:09:12 -07:00
Dylan MacKenzie
edbd7c8602 dump_enabled takes a DefId instead of MirSource 2020-03-28 14:07:07 -07:00
Dylan MacKenzie
4d099e6308 Add -Z dump-mir-dataflow 2020-03-28 14:05:59 -07:00
bors
77621317d6 Auto merge of #66938 - GuillaumeGomez:lint-for-no-crate-level-doc, r=Dylan-DPC
Add lint when no doc is present at the crate-level

Follow-up of #66267.

r? @kinnison
2020-03-28 20:11:01 +00:00
Ralf Jung
38c8ba33ef fix TryEnterCriticalSection return type 2020-03-28 21:10:11 +01:00
Tim Diekmann
bf6a46db31 Make fields in MemoryBlock public 2020-03-28 20:22:07 +01:00
Ralf Jung
bd9e046496 refmt 2020-03-28 19:51:54 +01:00
Ralf Jung
1f53fdc82c get rid of useless back-and-forth cast 2020-03-28 19:40:58 +01:00
Ralf Jung
1a0e69d34f use more specialized Scalar::from_ constructors where appropriate 2020-03-28 19:29:46 +01:00
bors
c52cee172f Auto merge of #70499 - Dylan-DPC:rollup-f9je1l8, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #70418 (Add long error explanation for E0703)
 - #70448 (Create output dir in rustdoc markdown render)
 - #70486 (Shrink Unicode tables (even more))
 - #70493 (Fix rustdoc.css CSS tab-size property)
 - #70495 (Replace last mention of IRC with Discord)

Failed merges:

r? @ghost
2020-03-28 17:15:32 +00:00
Ralf Jung
01dbaeda32 use machine_ prefix for target usize/isize 2020-03-28 17:51:11 +01:00
Ralf Jung
8bad4844b2 rename Scalar::{ptr_null -> null_ptr} 2020-03-28 16:57:33 +01:00
Dylan DPC
e3ccd5ba49
Rollup merge of #70495 - bkaestner:master, r=Mark-Simulacrum
Replace last mention of IRC with Discord

Mozilla's IRC service was shut down in March 2020. The official instant messaging variant has been Discord for a while, and most of the links were already replaced by #61524.

This was the last line that came up with `irc.mozilla.org` or any combination of "irc.*#[a-z]+" in a `git grep`:

    git grep -i -E "irc.*#[a-z]+"

As there is only one other link directly to Rust's discord, I used the same Markdown link `[rust-discord]` as in `bootstrap/README.md` to stay consistent. This might come in handy if the chat platform changes at a later point again.
2020-03-28 15:22:03 +01:00
Dylan DPC
f6111930d2
Rollup merge of #70493 - 0xd4d:rustdoc-tab-size, r=GuillaumeGomez
Fix rustdoc.css CSS tab-size property

This fixes the CSS tab size property names which are called `tab-size` / `-moz-tab-size` and not `tab-width`

Old issue https://github.com/rust-lang/rust/issues/49155 and related PR https://github.com/rust-lang/rust/pull/50947

tab-size: https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size
2020-03-28 15:22:01 +01:00
Dylan DPC
7f1e6261bf
Rollup merge of #70486 - Mark-Simulacrum:unicode-shrink, r=dtolnay
Shrink Unicode tables (even more)

This shrinks the Unicode tables further, building upon the wins in #68232 (the previous counts differ due to an interim Unicode version update, see #69929.

The new data structure is slower by around 3x, on the benchmark of looking up every Unicode scalar value in each data set sequentially in every data set included. Note that for ASCII, the exposed functions on `char` optimize with direct branches, so ASCII will retain the same performance regardless of internal optimizations (or the reverse). Also, note that the size reduction due to the skip list (from where the performance losses come) is around 40%, and, as a result, I believe the performance loss is acceptable, as the routines are still quite fast. Anywhere where this is hot, should probably be using a custom data structure anyway (e.g., a raw bitset) or something optimized for frequently seen values, etc.

This PR updates both the bitset data structure, and introduces a new data structure similar to a skip list. For more details, see the [main.rs] of the table generator, which describes both. The commits mostly work individually and document size wins.

As before, this is tested on all valid chars to have the same results as nightly (and the canonical Unicode data sets), happily, no bugs were found.

[main.rs]: https://github.com/rust-lang/rust/blob/fb4a715e18b/src/tools/unicode-table-generator/src/main.rs

Set             | Previous |  New  |  % of old  | Codepoints | Ranges |
----------------|---------:|------:|-----------:|-----------:|-------:|
Alphabetic      |     3055 |  1599 |        52% |     132875 |    695 |
Case Ignorable  |     2136 |   949 |        44% |       2413 |    410 |
Cased           |      934 |   359 |        38% |       4286 |    141 |
Cc              |       43 |     9 |        20% |         65 |      2 |
Grapheme Extend |     1774 |   813 |        46% |       1979 |    344 |
Lowercase       |      985 |   867 |        88% |       2344 |    652 |
N               |     1266 |   419 |        33% |       1781 |    133 |
Uppercase       |      934 |   777 |        83% |       1911 |    643 |
White_Space     |      140 |    37 |        26% |         25 |     10 |
----------------|----------|-------|------------|------------|--------|
Total           |    11267 |  5829 |        51% |     -      |   -    |
2020-03-28 15:22:00 +01:00
Dylan DPC
bbd3634f5f
Rollup merge of #70448 - TimotheeGerber:rustdoc-create-output-dir, r=GuillaumeGomez
Create output dir in rustdoc markdown render

`rustdoc` command on a standalone markdown document fails because the output directory (which default to `doc/`) is not created, even when specified with the `--output` argument.

This PR adds the creation of the output directory before the file creation to avoid an unexpected error which is unclear.

I am not sure about the returned error code. I did not find a table explaining them. So I simply put the same error code that is returned when `File::create` fails because they are both related to file-system errors.

Resolve #70431
2020-03-28 15:21:58 +01:00
Dylan DPC
1f13089bef
Rollup merge of #70418 - PankajChaudhary5:master, r=Dylan-DPC
Add long error explanation for E0703

Add long explanation for the E0703 error code
Part of #61137

r? @GuillaumeGomez
2020-03-28 15:21:57 +01:00
bors
e768d6f0bc Auto merge of #70485 - matthiaskrgr:submodule_upd, r=Dylan-DPC
submodules: update clippy from 1ff81c1b to 70b93aab

Changes:
````
remove redundant import
rustup https://github.com/rust-lang/rust/pull/68404
rustup https://github.com/rust-lang/rust/pull/69644
rustup https://github.com/rust-lang/rust/pull/70344
Move verbose_file_reads to restriction
move redundant_pub_crate to nursery
readme: explain how to run only a single lint on a codebase
Remove dependency on `matches` crate
Move useless_transmute to nursery
nursery group -> style
Update for PR feedback
Auto merge of #5314 - ehuss:remove-git2, r=flip1995
Lint for `pub(crate)` items that are not crate visible due to the visibility of the module that contains them
````

Fixes #70456
2020-03-28 14:15:27 +00:00
Benjamin Kästner
dc8a9854d2 Replace last mention of IRC with Discord
Mozilla's IRC service was shut down in March 2020. The official
instant messaging variant has been Discord for a while, and most of
the links were already replaced by #61524.

This was the last line that came up with `irc.mozilla.org` or any
combination of "irc.*#[a-z]+" in a `git grep`:

    git grep -i -E "irc.*#[a-z]+"

As there is only one other link directly to Rust's discord, I used the
same Markdown link `[rust-discord]` as in `bootstrap/README.md` to
stay consistent. This might come in handy if the chat platform changes
at a later point again.

As an aside: for those interested in the use of IRC, Mozilla's [wiki]
still offers a lot of in-depth knowledge.

 [wiki]: https://wiki.mozilla.org/IRC
2020-03-28 12:38:52 +01:00
bors
b9d5ee5676 Auto merge of #70261 - Centril:angle-args-partition, r=varkor
Move arg/constraint partition check to validation & improve recovery

- In the first commit, we move the check rejecting e.g., `<'a, Item = u8, String>` from the parser into AST validation.
- We then use this to improve the code for parsing generic arguments.
- And we add recovery for e.g., `<Item = >` (missing), `<Item = 42>` (constant), and `<Item = 'a>` (lifetime).

This is also preparatory work for supporting https://github.com/rust-lang/rust/issues/70256.

r? @varkor
2020-03-28 11:13:09 +00:00
0xd4d
6d886aff35
Fix rustdoc.css CSS tab-size property 2020-03-28 11:49:12 +01:00
bors
b76238a3ee Auto merge of #70095 - jsgf:link-native, r=nagisa
Implement -Zlink-native-libraries

This implements a flag `-Zlink-native-libraries=yes/no`. If set to true/yes, or unspecified, then
native libraries referenced via `#[link]` attributes will be put on the linker line (ie, unchanged
behaviour).

If `-Zlink-native-libraries=no` is specified then rustc will not add the native libraries to the link
line. The assumption is that the outer build system driving the build already knows about the native
libraries and will specify them to the linker directly (for example via `-Clink-arg=`).

Addresses issue #70093
2020-03-28 08:16:47 +00:00