Commit Graph

95843 Commits

Author SHA1 Message Date
Zack M. Davis
6de8e39e26 in which the non_ascii_idents lint appears (RFC 2457)
RFC 2457 declares: "A `non_ascii_idents` lint is added to the
compiler. This lint is allow by default."
2019-07-06 17:23:17 -07:00
Zack M. Davis
6bb60ef6f2 name the trait in ambiguous-associated-items fully qualified suggestion
We have the trait at this point, so we can name it in the error
message, rather than using "Trait" as a (potentially confusing)
placeholder.

Thanks to Yuki "@JohnTitor" Okushi for pointing out where to look (in
the same file) for a closely related issue for ambiguous associated
types (as opposed to items; that was #59225, except that one won't be
quite as easy to resolve, because we actually don't have the trait
`DefId` at that point).
2019-07-06 16:47:43 -07:00
Vadim Petrochenkov
36a5aa8325 Address review comments 2019-07-07 01:18:29 +03:00
bors
b0bd5f236d Auto merge of #62452 - Centril:rollup-5jww3h7, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #60081 (Refactor unicode.py script)
 - #61862 (Make the Weak::{into,as}_raw methods)
 - #62243 (Improve documentation for built-in macros)
 - #62422 (Remove some uses of mem::uninitialized)
 - #62436 (normalize use of backticks/lowercase in compiler messages for librustc_mir)

Failed merges:

r? @ghost
2019-07-06 21:47:45 +00:00
Mazdak Farrokhzad
7ef02dcf67
Rollup merge of #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

https://github.com/rust-lang/rust/issues/60532

r? @alexreg
2019-07-06 22:14:39 +02:00
Mazdak Farrokhzad
30e4a874cb
Rollup merge of #62422 - lzutao:remove-some-mem-uinit, r=alexcrichton
Remove some uses of mem::uninitialized

cc #62397
r? @RalfJung
2019-07-06 22:14:38 +02:00
Mazdak Farrokhzad
154726cf7d
Rollup merge of #62243 - petrochenkov:macrodoc, r=eddyb
Improve documentation for built-in macros

This is the `libcore` part of https://github.com/rust-lang/rust/pull/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.
2019-07-06 22:14:36 +02:00
Mazdak Farrokhzad
296e825afa
Rollup merge of #61862 - vorner:weak-into-raw-methods, r=sfackler
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 https://github.com/rust-lang/rust/pull/60766#issuecomment-501706422 by @chpio.
2019-07-06 22:14:35 +02:00
Mazdak Farrokhzad
327c54ed02
Rollup merge of #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
```
2019-07-06 22:14:33 +02:00
Samy Kacimi
7a2a17af09
normalize use of backticks/lowercase in compiler messages for librustc_mir
https://github.com/rust-lang/rust/issues/60532

r? @alexreg
2019-07-06 20:40:40 +02:00
bors
dfd52ba6ac Auto merge of #59772 - andrehjr:add-rustc-guide-to-toolstate, r=mark-i-m
Add rustc guide to toolstate

Closes #59597
2019-07-06 18:19:01 +00:00
Vadim Petrochenkov
327450797d resolve: Reserve cfg/cfg_attr/derive only in attribute sub-namespace 2019-07-06 18:36:35 +03:00
André Luis Leal Cardoso Junior
b5cd962be8 Don't return an error from linkcheck when it's not supported' 2019-07-06 11:05:22 -03:00
André Luis Leal Cardoso Junior
43cb7d08e4 Ignore unused variable for non-linux builds 2019-07-06 11:05:22 -03:00
Mark Mansi
f0e45bfe81 fix macos build 2019-07-06 11:05:22 -03:00
Mark Mansi
1de42ff95a cfg: linkcheck only on x86-64 linux 2019-07-06 11:05:22 -03:00
André Luis Leal Cardoso Junior
7fbc6a9ba3 add missing libssl-dev dependency to docker images on travis 2019-07-06 11:05:22 -03:00
André Luis Leal Cardoso Junior
9ca5dee0ad Add 'Apache-2.0 OR MIT' license variation to tidy/tools check 2019-07-06 11:05:22 -03:00
André Luis Leal Cardoso Junior
a55fa18a52 Move installing of deps to the docker container, instead of installing on the host machine on travis 2019-07-06 11:05:22 -03:00
André Luis Leal Cardoso Junior
f80697215f Add linkcheck command to rustbook tool 2019-07-06 11:05:22 -03:00
André Luis Leal Cardoso Junior
d8a6ccfb4a Track rustc-guide on toolstate 2019-07-06 11:05:22 -03:00
André Luis Leal Cardoso Junior
83877773da add ./x.py test src/doc/rustc-guide 2019-07-06 11:05:22 -03:00
Vadim Petrochenkov
920a17a60c privacy: Only opaque macros leak private things 2019-07-06 16:59:08 +03:00
Vadim Petrochenkov
987be89db3 Fix tidy issues 2019-07-06 16:59:08 +03:00
Vadim Petrochenkov
ab112cab03 Improve documentation for built-in macros 2019-07-06 16:59:08 +03:00
Vadim Petrochenkov
22d6d8ac76 #[rustc_transparent_macro] -> #[rustc_macro_transparency = ...] 2019-07-06 16:59:08 +03:00
Vadim Petrochenkov
15042a3c1c #[rustc_doc_only_macro] -> #[rustc_builtin_macro] 2019-07-06 16:59:08 +03:00
Vadim Petrochenkov
b11757e0d5 rustbuild: Cleanup global lint settings 2019-07-06 13:48:54 +03:00
bors
254f201495 Auto merge of #61988 - Centril:there-is-only-loop, r=matthewjasper
[let_chains, 3/6] And then there was only Loop

Here we remove `hir::ExprKind::While`.
Instead, we desugar: `'label: while $cond $body` into:

```rust
'label: loop {
    match DropTemps($cond) {
        true => $body,
        _ => break,
    }
}
```

Per https://github.com/rust-lang/rust/issues/53667#issuecomment-471583239.
This is a follow up to https://github.com/rust-lang/rust/pull/59288 which did the same for `if` expressions.

r? @matthewjasper
2019-07-06 06:15:44 +00:00
Mazdak Farrokhzad
9b1d513e47 --bless --compare-mode=nll 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
075e381b91 Bless mir-opt/while-storage.rs. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
b32beb88cd Cleanup liveness comment. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
b9e7e3175a while_{let_}loops/change_{break,continue}: typeck_tables_of clean. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
26144fe869 Lowering: Fuse ExprKind::While logic + Cleanup. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
547735457f Make WhileTrue into an EarlyLintPass lint. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
f01562af33 Make sure while-exprs require 'cond: bool' exactly. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
ebcc966ac1 Adjust incremental test while_loops.rs 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
7d1cd41be3 while desugars to loop so 'a: while break 'a {} in ctfe doesn't work yet. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
4edfa6d4c9 Enforce 'cond: bool' in while-expr + improve reachability diags. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
e7b544ee83 min_const_fn: change error message due to changed desugaring. 2019-07-06 06:43:58 +02:00
Mazdak Farrokhzad
f8b32dfb27 Remove ExprKind::While from HIR. 2019-07-06 06:43:58 +02:00
Lzu Tao
7646d4935b Remove use of mem::uninitialized in code_gen crate 2019-07-06 03:27:05 +00:00
Lzu Tao
42c3d37145 Remove use of mem::uninitialized in libterm crate 2019-07-06 03:27:05 +00:00
bors
b820c76174 Auto merge of #62428 - Centril:rollup-2udow5e, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #62151 (Update linked OpenSSL version)
 - #62245 (Miri engine: support extra function (pointer) values)
 - #62257 (forward read_c_str method from Memory to Alloc)
 - #62264 (Fix perf regression from Miri Machine trait changes)
 - #62296 (request at least ptr-size alignment from posix_memalign)
 - #62329 (Remove support for 1-token lookahead from the lexer)
 - #62377 (Add test for ICE #62375)

Failed merges:

r? @ghost
2019-07-06 02:58:36 +00:00
Mazdak Farrokhzad
46edb516df
Rollup merge of #62377 - wesleywiser:fix_62375, r=alexcrichton
Add test for ICE #62375

Fixes #62375
2019-07-06 02:38:02 +02:00
Mazdak Farrokhzad
952ee77871
Rollup merge of #62329 - matklad:no-peeking, r=petrochenkov
Remove support for 1-token lookahead from the lexer

`StringReader` maintained `peek_token` and `peek_span_src_raw` for look ahead.

`peek_token` was used only by rustdoc syntax coloring. After moving peeking logic into highlighter, I was able to remove `peek_token` from the lexer. I tried to use `iter::Peekable`, but that wasn't as pretty as I hoped, due to buffered fatal errors. So I went with hand-rolled peeking.

After that I've noticed that the only peeking behavior left was for raw tokens to test tt jointness. I've rewritten it in terms of trivia tokens, and not just spans.

After that it became possible to simplify the awkward constructor of the lexer, which could return `Err` if the first peeked token contained error.
2019-07-06 02:38:01 +02:00
Mazdak Farrokhzad
3c4a6c8606
Rollup merge of #62296 - RalfJung:memalign, r=alexcrichton
request at least ptr-size alignment from posix_memalign

Fixes https://github.com/rust-lang/rust/issues/62251
2019-07-06 02:37:59 +02:00
Mazdak Farrokhzad
0383be8577
Rollup merge of #62264 - RalfJung:inline-forcing, r=zackmdavis
Fix perf regression from Miri Machine trait changes

Maybe this fixes the perf regression that https://github.com/rust-lang/rust/pull/62003 seemingly introduced?

Cc @nnethercote
2019-07-06 02:37:58 +02:00
Mazdak Farrokhzad
947d7cf16d
Rollup merge of #62257 - RalfJung:miri-c-str, r=estebank
forward read_c_str method from Memory to Alloc

This is more convenient to call when one starts with a `Scalar` (which is the common case).

`read_c_str` is only used in Miri.
2019-07-06 02:37:56 +02:00
Mazdak Farrokhzad
182248a466
Rollup merge of #62245 - RalfJung:miri-extra-fn, r=eddyb,zackmdavis
Miri engine: support extra function (pointer) values

We want to add basic support for `dlsym` in Miri (needed to run the latest version of `getrandom`). For that to work, `dlsym` needs to return *something* that can be stored in a function pointer and later called.

So we add a new `ExtraFnVal` type to the `Machine` trait, and enable Miri's memory to associate allocation IDs with such values, so that `create_fn_alloc` and `get_fn` can work on *both* `Instance` (this is used for "normal" function pointers) and `ExtraFnVal`.

Cc @oli-obk
2019-07-06 02:37:54 +02:00