Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #62452

Merged
merged 22 commits into from
Jul 7, 2019
Merged

Rollup of 5 pull requests #62452

merged 22 commits into from
Jul 7, 2019

Commits on Apr 18, 2019

  1. Clean up unicode.py script

    pawroman committed Apr 18, 2019
    Configuration menu
    Copy the full SHA
    89feb6d View commit details
    Browse the repository at this point in the history
  2. More cleanups for unicode.py

    pawroman committed Apr 18, 2019
    Configuration menu
    Copy the full SHA
    a580421 View commit details
    Browse the repository at this point in the history
  3. Fix tidy errors

    pawroman committed Apr 18, 2019
    Configuration menu
    Copy the full SHA
    edbc27d View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2019

  1. Configuration menu
    Copy the full SHA
    2c9c978 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2019

  1. Apply suggestions from code review

    Co-Authored-By: varkor <github@varkor.com>
    pawroman and varkor authored Jun 10, 2019
    Configuration menu
    Copy the full SHA
    60ccf89 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2019

  1. Make the Weak::{into,as}_raw methods

    Because Weak doesn't Deref, so there's no reason for them to be only
    associated methods.
    vorner committed Jun 15, 2019
    Configuration menu
    Copy the full SHA
    49fbd76 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2019

  1. Configuration menu
    Copy the full SHA
    2b47a08 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2019

  1. Configuration menu
    Copy the full SHA
    05c1e92 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2019

  1. Configuration menu
    Copy the full SHA
    42c3d37 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7646d49 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    15042a3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    22d6d8a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ab112ca View commit details
    Browse the repository at this point in the history
  6. Fix tidy issues

    petrochenkov committed Jul 6, 2019
    Configuration menu
    Copy the full SHA
    987be89 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    920a17a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3274507 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    7a2a17a View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#60081 - pawroman:cleanup_unicode_script, r=…

    …varkor
    
    Refactor unicode.py script
    
    Hi, I noticed that the `unicode.py` script used some deprecated escapes in regular expressions. E.g. `\d`, `\w`, `\.` will be illegal in the future without "raw strings". This is now fixed. I have also cleaned up the script quite a bit.
    
    ## Escape deprecation
    
    OK (note the `r`):
    `re.compile(r"\d")`
    
    Deprecated (from Python 3.6 onwards, see [here][link1] and [here][link2]):
    `re.compile("\d")`.
    
    [link1]: https://docs.python.org/3.6/whatsnew/3.6.html#deprecated-python-behavior
    [link2]: https://bugs.python.org/issue27364
    
    This was evident running the script using Python 3.7 like so:
    
    ```
    $ python3 -Wall unicode.py
    unicode.py:227: DeprecationWarning: invalid escape sequence \w
      re1 = re.compile("^ *([0-9A-F]+) *; *(\w+)")
    unicode.py:228: DeprecationWarning: invalid escape sequence \.
      re2 = re.compile("^ *([0-9A-F]+)\.\.([0-9A-F]+) *; *(\w+)")
    unicode.py:453: DeprecationWarning: invalid escape sequence \d
      pattern = "for Version (\d+)\.(\d+)\.(\d+) of the Unicode"
    ```
    
    The documentation states that
    > A backslash-character pair that is not a valid escape sequence now generates a DeprecationWarning. Although this will eventually become a SyntaxError, that will not be for several Python releases.
    
    ## Testing
    
    To test my changes, I had to add support for choosing the Unicode version to use. The script will default to latest release (which is 12.0.0 at the moment, repo has 11.0.0 checked in).
    
    The script generates the exact same output for version 11.0.0 with Python 2.7 and 3.7 and no longer generates any deprecation warnings:
    
    ```
    $ python3 -Wall unicode.py -v 11.0.0
    Using Unicode version: 11.0.0
    Regenerated tables.rs.
    $ git diff tables.rs
    $ python2 -Wall unicode.py -v 11.0.0
    Using Unicode version: 11.0.0
    Regenerated tables.rs.
    $ git diff tables.rs
    $ python2 --version
    Python 2.7.16
    $ python3 --version
    Python 3.7.3
    ```
    
    ## Extra functionality
    
    Furthermore, the script will check and download the latest Unicode version by default (without the `-v` argument). The `--help` is below:
    
    ```
    $ ./unicode.py --help
    usage: unicode.py [-h] [-v VERSION]
    
    Regenerate Unicode tables (tables.rs).
    
    optional arguments:
      -h, --help            show this help message and exit
      -v VERSION, --version VERSION
                            Unicode version to use (if not specified, defaults to
                            latest available final release).
    ```
    
    ## Cleanups
    
    I have cleaned up the code quite a bit, with Python best practices and code style in mind. I'm happy to provide more details and rationale for all my changes if the reviewers so desire.
    
    One externally visible change is that the Unicode data will now be downloaded into `src/libcore/unicode/downloaded` directory suffixed by Unicode version:
    
    ```
    $ pwd
    .../rust/src/libcore/unicode
    $ exa -T downloaded/
    downloaded
    ├── 11.0.0
    │  ├── DerivedCoreProperties.txt
    │  ├── DerivedNormalizationProps.txt
    │  ├── PropList.txt
    │  ├── ReadMe.txt
    │  ├── Scripts.txt
    │  ├── SpecialCasing.txt
    │  └── UnicodeData.txt
    └── 12.0.0
       ├── DerivedCoreProperties.txt
       ├── DerivedNormalizationProps.txt
       ├── PropList.txt
       ├── ReadMe.txt
       ├── Scripts.txt
       ├── SpecialCasing.txt
       └── UnicodeData.txt
    ```
    Centril authored Jul 6, 2019
    Configuration menu
    Copy the full SHA
    327c54e View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#61862 - vorner:weak-into-raw-methods, r=sfa…

    …ckler
    
    Make the Weak::{into,as}_raw methods
    
    Because Weak doesn't Deref, so there's no reason for them to be only
    associated methods.
    
    As kindly pointed out here rust-lang#60766 (comment) by @chpio.
    Centril authored Jul 6, 2019
    Configuration menu
    Copy the full SHA
    296e825 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#62243 - petrochenkov:macrodoc, r=eddyb

    Improve documentation for built-in macros
    
    This is the `libcore` part of rust-lang#62086.
    Right now the only effect is improved documentation.
    
    The changes in the last few commits are required to make the `libcore` change compile successfully.
    Centril authored Jul 6, 2019
    Configuration menu
    Copy the full SHA
    154726c View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#62422 - lzutao:remove-some-mem-uinit, r=ale…

    …xcrichton
    
    Remove some uses of mem::uninitialized
    
    cc rust-lang#62397
    r? @RalfJung
    Centril authored Jul 6, 2019
    Configuration menu
    Copy the full SHA
    30e4a87 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#62436 - fakenine:normalize_use_of_backticks…

    …_compiler_messages_1, r=Centril
    
    normalize use of backticks/lowercase in compiler messages for librustc_mir
    
    normalize use of backticks/lowercase in compiler messages for librustc_mir
    
    rust-lang#60532
    
    r? @alexreg
    Centril authored Jul 6, 2019
    Configuration menu
    Copy the full SHA
    7ef02dc View commit details
    Browse the repository at this point in the history