]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #61673 - RalfJung:miri-no-hard-float, r=eddyb,oli-obk
bors [Tue, 11 Jun 2019 08:15:12 +0000 (08:15 +0000)]
Auto merge of #61673 - RalfJung:miri-no-hard-float, r=eddyb,oli-obk

Miri: convert to/from apfloat instead of host floats

Cc @oli-obk @eddyb

5 years agoAuto merge of #61492 - RalfJung:const-qualif-comments, r=eddyb
bors [Tue, 11 Jun 2019 05:24:41 +0000 (05:24 +0000)]
Auto merge of #61492 - RalfJung:const-qualif-comments, r=eddyb

Const qualification comments

I extracted some const-qualif knowledge from @eddyb. This is my attempt to turn that into comments.

Cc @oli-obk  @eddyb

5 years agoAuto merge of #61052 - jsgf:emit-save-analysis-notifications, r=alexcrichton
bors [Tue, 11 Jun 2019 02:25:39 +0000 (02:25 +0000)]
Auto merge of #61052 - jsgf:emit-save-analysis-notifications, r=alexcrichton

Emit save analysis notifications

Addresses issue https://github.com/rust-lang/rust/issues/61047

5 years agoAuto merge of #60793 - Xanewok:raw-string-cleanup, r=petrochenkov
bors [Mon, 10 Jun 2019 23:32:12 +0000 (23:32 +0000)]
Auto merge of #60793 - Xanewok:raw-string-cleanup, r=petrochenkov

lexer: Disallow bare CR in raw byte strings

Handles bare CR ~but doesn't translate `\r\n` to `\n` yet in raw strings yet~ and translates CRLF to LF in raw strings.

As a side-note I think it'd be good to change the `unescape_` to return plain iterators to reduce some boilerplate (e.g. `has_error` could benefit from collecting `Result<T>` and aborting early on errors) but will do that separately, unless I missed something here that prevents it.

@matklad @petrochenkov thoughts?

5 years agoAuto merge of #61694 - Xanewok:update-rls, r=kennytm
bors [Mon, 10 Jun 2019 18:24:43 +0000 (18:24 +0000)]
Auto merge of #61694 - Xanewok:update-rls, r=kennytm

Update RLS

This includes https://github.com/rust-lang/rls/pull/1482 which should finally fix the spurious tests RLS in Rust CI (test-pass -> test-fail).

r? @oli-obk
cc @ehuss

5 years agoEmit artifact notifications for save-analysis output
Jeremy Fitzhardinge [Wed, 22 May 2019 17:37:33 +0000 (10:37 -0700)]
Emit artifact notifications for save-analysis output

Issue: https://github.com/rust-lang/rust/issues/61047

5 years agoDon't suggest using \r in raw strings
Igor Matuszewski [Mon, 10 Jun 2019 15:32:15 +0000 (17:32 +0200)]
Don't suggest using \r in raw strings

5 years agoAuto merge of #61716 - Centril:rollup-nxwf5ol, r=Centril
bors [Mon, 10 Jun 2019 11:15:07 +0000 (11:15 +0000)]
Auto merge of #61716 - Centril:rollup-nxwf5ol, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #59600 (Replaced linear token counting macros with optimized implementation)
 - #61501 (get rid of real_intrinsics module)
 - #61570 (Fix issues with const argument inference)
 - #61683 (Haiku: the maximum stack size is 16 MB)
 - #61697 (submodules: update clippy from 71be6f62 to c0dbd34b)

Failed merges:

r? @ghost

5 years agoRollup merge of #61697 - matthiaskrgr:submodule_upd, r=Manishearth
Mazdak Farrokhzad [Mon, 10 Jun 2019 11:14:32 +0000 (13:14 +0200)]
Rollup merge of #61697 - matthiaskrgr:submodule_upd, r=Manishearth

submodules: update clippy from 71be6f62 to c0dbd34b

Changes:
````
travis: disable rls integration test.
rustup https://github.com/rust-lang/rust/pull/61669/
Add OUTER_EXPN_INFO lint
````

Should fix clippy toolstate

5 years agoRollup merge of #61683 - nielx:haiku-stack-limit, r=nagisa
Mazdak Farrokhzad [Mon, 10 Jun 2019 11:14:31 +0000 (13:14 +0200)]
Rollup merge of #61683 - nielx:haiku-stack-limit, r=nagisa

Haiku: the maximum stack size is 16 MB

This keeps the compiler from crashing every time it is invoked. No functional change on other platforms.

This patch is similar to the limitation that is in the [librustdoc/lib.rs](https://github.com/rust-lang/rust/blob/57e13e0325c1d41161a31de1f8520538ec2c575c/src/librustdoc/lib.rs#L89).

5 years agoRollup merge of #61570 - varkor:infer-const-arg, r=eddyb
Mazdak Farrokhzad [Mon, 10 Jun 2019 11:14:29 +0000 (13:14 +0200)]
Rollup merge of #61570 - varkor:infer-const-arg, r=eddyb

Fix issues with const argument inference

Fixes https://github.com/rust-lang/rust/issues/60724.
Fixes https://github.com/rust-lang/rust/issues/61346.

r? @eddyb

5 years agoRollup merge of #61501 - RalfJung:intrinsics, r=rkruppe
Mazdak Farrokhzad [Mon, 10 Jun 2019 11:14:28 +0000 (13:14 +0200)]
Rollup merge of #61501 - RalfJung:intrinsics, r=rkruppe

get rid of real_intrinsics module

instead import intrinsics locally in their wrapper functions.

(These functions are wrapper functions as a preparation to fixing https://github.com/rust-lang/rust/issues/53871.)

5 years agoRollup merge of #59600 - tobia:master, r=pnkfelix
Mazdak Farrokhzad [Mon, 10 Jun 2019 11:14:26 +0000 (13:14 +0200)]
Rollup merge of #59600 - tobia:master, r=pnkfelix

Replaced linear token counting macros with optimized implementation

There are currently two distinct token-counting macros in the source. Both implement the trivial algorithm, with linear complexity. They may or may not be adequate for their use case, but considering that other people are probably going to copy and paste them whenever they need a token-counting macro, I replaced them with an optimized implementation with logarithmic complexity.

5 years agocomments
Ralf Jung [Thu, 6 Jun 2019 10:52:01 +0000 (12:52 +0200)]
comments

5 years agoconst-correctness might be confusing for C++ people
Ralf Jung [Thu, 6 Jun 2019 10:50:05 +0000 (12:50 +0200)]
const-correctness might be confusing for C++ people

5 years agoavoid 'const-context' terminology
Ralf Jung [Thu, 6 Jun 2019 09:47:52 +0000 (11:47 +0200)]
avoid 'const-context' terminology

5 years agoreplace some mode comparisons by more readable function call, rename some Mode, and...
Ralf Jung [Mon, 3 Jun 2019 15:41:16 +0000 (17:41 +0200)]
replace some mode comparisons by more readable function call, rename some Mode, and more comments

5 years agosome more comments for const_qualif
Ralf Jung [Mon, 3 Jun 2019 15:34:41 +0000 (17:34 +0200)]
some more comments for const_qualif

5 years agoAuto merge of #61506 - imbrem:mir_body_renaming, r=eddyb
bors [Mon, 10 Jun 2019 08:07:22 +0000 (08:07 +0000)]
Auto merge of #61506 - imbrem:mir_body_renaming, r=eddyb

Changed usages of `mir` in librustc::mir and librustc_mir to `body`

Work on part 2 of #60229

5 years agoHaiku: the maximum stack size is 16 MB
Niels Sascha Reedijk [Sun, 27 Jan 2019 08:25:25 +0000 (09:25 +0100)]
Haiku: the maximum stack size is 16 MB

When one tries to create a thread with a requested stack size larger
than 16 MB, the call will fail and the compiler will bail out. Therefore
we should limit the size of the thread stack to 16 MB on Haiku.

5 years agoAuto merge of #61608 - Aaron1011:feature/weird-expr-yield, r=Centril
bors [Mon, 10 Jun 2019 05:17:12 +0000 (05:17 +0000)]
Auto merge of #61608 - Aaron1011:feature/weird-expr-yield, r=Centril

Add nested 'yield' expression to weird expressions test

5 years agoAuto merge of #61706 - petrhosek:bootstrap-cp-r, r=Mark-Simulacrum
bors [Mon, 10 Jun 2019 02:35:29 +0000 (02:35 +0000)]
Auto merge of #61706 - petrhosek:bootstrap-cp-r, r=Mark-Simulacrum

Use Build::read_dir instead of fs::read_dir in Build::cp_r

Build::read_dir does better error handling when the directory doesn't
exist; it actually prints the name of the directory rather than just
printing the underlying error "No such file or directory" which on
its own isn't very useful.

5 years agoUse Build::read_dir instead of fs::read_dir in Build::cp_r
Petr Hosek [Sun, 9 Jun 2019 23:57:17 +0000 (16:57 -0700)]
Use Build::read_dir instead of fs::read_dir in Build::cp_r

Build::read_dir does better error handling when the directory doesn't
exist; it actually prints the name of the directory rather than just
printing the underlying error "No such file or directory" which on
its own isn't very useful.

5 years agoAuto merge of #61229 - Centril:stabilize-repr_align_enum, r=nagisa
bors [Sun, 9 Jun 2019 23:50:04 +0000 (23:50 +0000)]
Auto merge of #61229 - Centril:stabilize-repr_align_enum, r=nagisa

Stabilize #![feature(repr_align_enum)] in Rust 1.37.0

On an `enum` item, you may now write:

```rust
#[repr(align(X))]
enum Foo {
    // ...
}
```

This has equivalent effects to first defining:

```rust
#[repr(align(X))]
struct AlignX<T>(T);
```

and then using `AlignX<Foo>` in `Foo`'s stead.

r? @nagisa

5 years agoChanged usages of `mir` in librustc::mir and librustc_mir to `body`
Jad Ghalayini [Mon, 3 Jun 2019 22:26:48 +0000 (18:26 -0400)]
Changed usages of `mir` in librustc::mir and librustc_mir to `body`

5 years agosubmodules: update clippy from 71be6f62 to c0dbd34b
Matthias Krüger [Sun, 9 Jun 2019 19:37:26 +0000 (21:37 +0200)]
submodules: update clippy from 71be6f62 to c0dbd34b

Changes:
````
travis: disable rls integration test.
rustup https://github.com/rust-lang/rust/pull/61669/
Add OUTER_EXPN_INFO lint
````

5 years agoAuto merge of #61691 - RalfJung:miri-slow, r=Centril
bors [Sun, 9 Jun 2019 17:47:48 +0000 (17:47 +0000)]
Auto merge of #61691 - RalfJung:miri-slow, r=Centril

Miri: disable a slow test

5 years agoUpdate RLS
Igor Matuszewski [Sun, 9 Jun 2019 14:14:52 +0000 (16:14 +0200)]
Update RLS

This includes https://github.com/rust-lang/rls/pull/1482 which should
finally fix the spurious tests in Rust CI (test-pass -> test-fail).

5 years agoUse char byte calculation using existing iterator
Igor Matuszewski [Sun, 9 Jun 2019 13:44:18 +0000 (15:44 +0200)]
Use char byte calculation using existing iterator

5 years agoActually translate CRLF in raw byte strings and unify unescape impl
Igor Matuszewski [Sun, 9 Jun 2019 12:43:31 +0000 (14:43 +0200)]
Actually translate CRLF in raw byte strings and unify unescape impl

5 years agoAdd a doc comment for scan_raw_string
Igor Matuszewski [Sun, 9 Jun 2019 12:20:29 +0000 (14:20 +0200)]
Add a doc comment for scan_raw_string

5 years agoAdd test for raw byte CRLF translation
Igor Matuszewski [Sun, 9 Jun 2019 12:15:31 +0000 (14:15 +0200)]
Add test for raw byte CRLF translation

5 years agoMiri: disable a slow test
Ralf Jung [Sun, 9 Jun 2019 11:58:32 +0000 (13:58 +0200)]
Miri: disable a slow test

5 years agoforgot about multivariant enum casts
Ralf Jung [Sun, 9 Jun 2019 11:53:44 +0000 (13:53 +0200)]
forgot about multivariant enum casts

5 years agomake floating point casts nicer with generics
Ralf Jung [Sun, 9 Jun 2019 10:31:19 +0000 (12:31 +0200)]
make floating point casts nicer with generics

5 years agoApply suggestions from code review
Ralf Jung [Sun, 9 Jun 2019 09:35:41 +0000 (11:35 +0200)]
Apply suggestions from code review

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
5 years agoAuto merge of #61677 - napen123:string-examples, r=sfackler
bors [Sun, 9 Jun 2019 07:48:10 +0000 (07:48 +0000)]
Auto merge of #61677 - napen123:string-examples, r=sfackler

Add examples for make_ascii_{uppercase, lowercase}

As the title says, this adds simple usage examples for make_ascii_uppercase and make_ascii_lowercase.

5 years agoAuto merge of #60932 - Centril:macro-at-most-once-2015, r=mark-i-m
bors [Sun, 9 Jun 2019 05:00:22 +0000 (05:00 +0000)]
Auto merge of #60932 - Centril:macro-at-most-once-2015, r=mark-i-m

Support ? Kleene macro operator in 2015

Closes https://github.com/rust-lang/rust/issues/56668.

See that issue for rationale and discussion.

Crater will be needed (done in https://github.com/rust-lang/rust/pull/60932#issuecomment-494188577, zero regressions) and then, if all goes well, FCP (in https://github.com/rust-lang/rust/pull/60932#issuecomment-494189802).

5 years agopacify tidy.
Mazdak Farrokhzad [Fri, 7 Jun 2019 23:39:29 +0000 (01:39 +0200)]
pacify tidy.

5 years agoFix typo in comment.
Mazdak Farrokhzad [Wed, 22 May 2019 03:58:29 +0000 (05:58 +0200)]
Fix typo in comment.

5 years agoFix inaccurate comments in '?' Kleene operator tests.
Mazdak Farrokhzad [Wed, 22 May 2019 03:52:47 +0000 (05:52 +0200)]
Fix inaccurate comments in '?' Kleene operator tests.

5 years agoSome more cleanup in libsyntax::ext::tt::quoted
Mazdak Farrokhzad [Wed, 22 May 2019 00:43:46 +0000 (02:43 +0200)]
Some more cleanup in libsyntax::ext::tt::quoted

5 years agoCleanups in parse_sep_and_kleene_op.
Mazdak Farrokhzad [Wed, 22 May 2019 00:38:19 +0000 (02:38 +0200)]
Cleanups in parse_sep_and_kleene_op.

5 years agoUpdate tests since ? macro op is supported on 2015.
Mazdak Farrokhzad [Sat, 18 May 2019 06:24:56 +0000 (08:24 +0200)]
Update tests since ? macro op is supported on 2015.

5 years agoSupport ? Kleene operator in 2015.
Mazdak Farrokhzad [Sat, 18 May 2019 06:23:52 +0000 (08:23 +0200)]
Support ? Kleene operator in 2015.

5 years agoAuto merge of #61653 - oli-obk:visit_place_recursion, r=spastorino
bors [Sun, 9 Jun 2019 02:07:44 +0000 (02:07 +0000)]
Auto merge of #61653 - oli-obk:visit_place_recursion, r=spastorino

get rid of visit_place recursion

r? @spastorino

this is groundwork for https://github.com/rust-lang/rust/pull/60913, since after that PR we won't be able to implement `visit_place` in a recursive manner without heavy cloning everywhere.

cc @eddyb this touches const qualif

5 years agoAdd examples for make_ascii_{uppercase, lowercase}
Napen123 [Sun, 9 Jun 2019 00:28:29 +0000 (18:28 -0600)]
Add examples for make_ascii_{uppercase, lowercase}

5 years agoAuto merge of #61672 - Centril:rollup-jxo89ir, r=Centril
bors [Sat, 8 Jun 2019 23:17:06 +0000 (23:17 +0000)]
Auto merge of #61672 - Centril:rollup-jxo89ir, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #61646 (Remove useless allocations in macro_rules follow logic.)
 - #61658 (remove useless ident() functions in const tests)
 - #61660 (Minimize use of `#![feature(custom_attribute)]`)
 - #61666 (Add test for trait ICE)
 - #61669 ( syntax: Remove `Deref` impl from `Token`)
 - #61670 (Update RLS)

Failed merges:

r? @ghost

5 years agomake unary float negation slightly nicer
Ralf Jung [Sat, 8 Jun 2019 22:51:47 +0000 (00:51 +0200)]
make unary float negation slightly nicer

5 years agotrait-ize binary_float_op
Ralf Jung [Sat, 8 Jun 2019 22:41:20 +0000 (00:41 +0200)]
trait-ize binary_float_op

5 years agoTranslate CRLF -> LF in raw (byte) strings
Igor Matuszewski [Sat, 8 Jun 2019 22:33:21 +0000 (00:33 +0200)]
Translate CRLF -> LF in raw (byte) strings

5 years agoRollup merge of #61670 - Xanewok:update-rls, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:39 +0000 (00:20 +0200)]
Rollup merge of #61670 - Xanewok:update-rls, r=oli-obk

Update RLS

This bumps the version to 1.37 and also doesn't build clippy by default (should reduce toolstate breakages, see https://github.com/rust-lang/rust/issues/59761#issuecomment-498616465 for more details)

r? @oli-obk

5 years agoRollup merge of #61669 - petrochenkov:tokderef2, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:38 +0000 (00:20 +0200)]
Rollup merge of #61669 - petrochenkov:tokderef2, r=oli-obk

 syntax: Remove `Deref` impl from `Token`

Follow up to https://github.com/rust-lang/rust/pull/61541

r? @oli-obk

5 years agoRollup merge of #61666 - JohnTitor:add-test-for-ice, r=Centril
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:36 +0000 (00:20 +0200)]
Rollup merge of #61666 - JohnTitor:add-test-for-ice, r=Centril

Add test for trait ICE

Closes #55266

5 years agoRollup merge of #61660 - petrochenkov:nocusta, r=Centril
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:35 +0000 (00:20 +0200)]
Rollup merge of #61660 - petrochenkov:nocusta, r=Centril

Minimize use of `#![feature(custom_attribute)]`

Some preparations before resurrecting https://github.com/rust-lang/rust/pull/57921.

5 years agoRollup merge of #61658 - RalfJung:const-tests, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:34 +0000 (00:20 +0200)]
Rollup merge of #61658 - RalfJung:const-tests, r=oli-obk

remove useless ident() functions in const tests

and replace the useful ones by black_box (with a comment)

r? @oli-obk

5 years agoRollup merge of #61646 - L117:master, r=Centril
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:32 +0000 (00:20 +0200)]
Rollup merge of #61646 - L117:master, r=Centril

Remove useless allocations in macro_rules follow logic.

Closes  #61543

5 years agooffer ways to directly construct a Scalar from unsigned integers
Ralf Jung [Sat, 8 Jun 2019 21:53:10 +0000 (23:53 +0200)]
offer ways to directly construct a Scalar from unsigned integers

5 years agoScalar: only convert to/from soft-float types, not to/from hard-floats
Ralf Jung [Sat, 8 Jun 2019 21:30:33 +0000 (23:30 +0200)]
Scalar: only convert to/from soft-float types, not to/from hard-floats

5 years agoDon't use "base place" for different concepts
Oliver Scherer [Sat, 8 Jun 2019 21:24:37 +0000 (23:24 +0200)]
Don't use "base place" for different concepts

5 years agoDeduplicate some code
Oliver Scherer [Sat, 8 Jun 2019 21:23:10 +0000 (23:23 +0200)]
Deduplicate some code

5 years agoAddress review comments
Vadim Petrochenkov [Sat, 8 Jun 2019 20:55:09 +0000 (23:55 +0300)]
Address review comments

5 years agoProhibit bare CRs in raw byte strings
Igor Matuszewski [Mon, 13 May 2019 18:21:44 +0000 (20:21 +0200)]
Prohibit bare CRs in raw byte strings

5 years agoValidate and transcribe raw strings via unescape module
Igor Matuszewski [Mon, 13 May 2019 17:52:55 +0000 (19:52 +0200)]
Validate and transcribe raw strings via unescape module

5 years agoMove some run-pass attribute tests to ui
Vadim Petrochenkov [Sat, 8 Jun 2019 14:42:58 +0000 (17:42 +0300)]
Move some run-pass attribute tests to ui

5 years agoRemove some more `#![feature(custom_attribute)]`s
Vadim Petrochenkov [Sat, 8 Jun 2019 14:35:54 +0000 (17:35 +0300)]
Remove some more `#![feature(custom_attribute)]`s

5 years agoIntroduce `#[rustc_dummy]` attribute and use it in tests
Vadim Petrochenkov [Sat, 8 Jun 2019 08:36:43 +0000 (11:36 +0300)]
Introduce `#[rustc_dummy]` attribute and use it in tests

Unlike other built-in attributes, this attribute accepts any input

5 years agoTurn `#[allocator]` into a built-in attribute and rename it to `#[rustc_allocator]`
Vadim Petrochenkov [Sat, 8 Jun 2019 08:36:30 +0000 (11:36 +0300)]
Turn `#[allocator]` into a built-in attribute and rename it to `#[rustc_allocator]`

5 years agoRemove unused `#![feature(custom_attribute)]`s
Vadim Petrochenkov [Sat, 8 Jun 2019 08:35:30 +0000 (11:35 +0300)]
Remove unused `#![feature(custom_attribute)]`s

5 years agoAuto merge of #61529 - ehuss:update-books, r=GuillaumeGomez
bors [Sat, 8 Jun 2019 20:25:09 +0000 (20:25 +0000)]
Auto merge of #61529 - ehuss:update-books, r=GuillaumeGomez

Update books

## reference

2 commits in 862b669c395822bb0938781d74f860e5762ad4fb..f8ae436d936f6f4891d3c1bbb1af5865eb8aeadb
2019-05-04 23:41:35 -0700 to 2019-05-31 14:59:12 +0200
- Document that literals with any suffixes are valid as tokens (rust-lang-nursery/reference#612)
- Fix example code of derive macro (rust-lang-nursery/reference#611)

## book

2 commits in 29fe982990e43b9367be0ff47abc82fb2123fd03..62a8c6f25fbd981c80a046f3b04be9684749af3b
2019-05-15 17:48:40 -0400 to 2019-05-28 15:48:23 -0400
- Remove snapshots checked in layout
- Remove snapshots that I've approved in layout

## rust-by-example

5 commits in 811c697b232c611ed754d279ed20643a0c4096f6..18566f4dedc3ef5bf61f5f85685d5966db99cc11
2019-04-28 18:56:42 -0300 to 2019-05-30 19:23:24 -0300
- Fixed wording in the `Seconds` struct description. (rust-lang/rust-by-example#1195)
- Fix usage of the word "elision" (rust-lang/rust-by-example#1191)
- Reword "Flow Control" to "Flow of Control" (rust-lang/rust-by-example#1190)
- Copy edits to chapter 1 (rust-lang/rust-by-example#1189)
- Fix typo in a mod/visibility.md (rust-lang/rust-by-example#1188)

## rustc-guide

9 commits in 3cb727b62b953d59b4360d39aa68b6dc8f157655..3ac9cfc9c9ab2e366feebf18718112737f572352
2019-05-07 09:53:32 -0500 to 2019-06-02 19:36:58 -0500
- Update information about debuginfo configuration
- fix long line
- Fixed misspelling
- Add more info subsection with links to forge and rustc api docs (rust-lang/rustc-guide#324)
- Renamed the file and title of the diagnostics chapter.
- Added rustc phases diagram and explanation
- Mention running tests for subdirectories
- Fixed links broken by merging chalks rules and solve
- Add documentation about profile-guided optimization.

## embedded-book

1 commits in 9858872bd1b7dbba5ec27dc30d34eba00acd7ef9..f0c75b75f9c18537b78f5d17c1015247e9a49c86
2019-05-02 18:56:54 +0000 to 2019-06-03 10:49:02 +0000
- Qemu md changes  (rust-embedded/book#193)

5 years agoUpdate RLS
Igor Matuszewski [Sat, 8 Jun 2019 20:15:22 +0000 (22:15 +0200)]
Update RLS

5 years agosyntax: Move some `Token` methods around
Vadim Petrochenkov [Sat, 8 Jun 2019 19:38:39 +0000 (22:38 +0300)]
syntax: Move some `Token` methods around

5 years agosyntax: Remove `Deref` impl from `Token`
Vadim Petrochenkov [Sat, 8 Jun 2019 19:38:23 +0000 (22:38 +0300)]
syntax: Remove `Deref` impl from `Token`

5 years agosyntax: Move most of the `TokenKind` methods to `Token`
Vadim Petrochenkov [Sat, 8 Jun 2019 16:45:12 +0000 (19:45 +0300)]
syntax: Move most of the `TokenKind` methods to `Token`

5 years agoextra paranoid mode
Ralf Jung [Sat, 8 Jun 2019 18:35:59 +0000 (20:35 +0200)]
extra paranoid mode

5 years agoRemove redundant, commented out code
Igor Matuszewski [Mon, 13 May 2019 10:07:43 +0000 (12:07 +0200)]
Remove redundant, commented out code

It was commented out as part of
https://github.com/rust-lang/rust/commit/8a8e497ae786ffc032c1e68fc23da0edcf6fa5e3.
Done probably by accident, since the code in question was moved to a
match arm, along with newly introduced logic to detect bare CRs in raw
strings.

5 years agoSeparate a `scan_raw_string` (similar `raw_byte` variant)
Igor Matuszewski [Mon, 13 May 2019 09:42:12 +0000 (11:42 +0200)]
Separate a `scan_raw_string` (similar `raw_byte` variant)

5 years agoClean up minor bits
Igor Matuszewski [Mon, 13 May 2019 09:41:24 +0000 (11:41 +0200)]
Clean up minor bits

5 years agoAdd test for ICE
Yuki Okushi [Sat, 8 Jun 2019 18:04:56 +0000 (03:04 +0900)]
Add test for ICE

5 years agoAuto merge of #61655 - RalfJung:checktools, r=kennytm
bors [Sat, 8 Jun 2019 17:44:12 +0000 (17:44 +0000)]
Auto merge of #61655 - RalfJung:checktools, r=kennytm

checktools: unify grepping the TOOLSTATE file

The file was grepped twice but in a different way. This unifies the code to make sure it is consistent. Or were these deliberately not doing the same thing? That seems strange though.

I wouldn't know how to test these changes.

5 years agosyntax: Keep full `Token`s for `macro_rules` separators
Vadim Petrochenkov [Sat, 8 Jun 2019 17:20:00 +0000 (20:20 +0300)]
syntax: Keep full `Token`s for `macro_rules` separators

5 years agoblack-box the fn ptr, not the result
Ralf Jung [Sat, 8 Jun 2019 16:13:16 +0000 (18:13 +0200)]
black-box the fn ptr, not the result

5 years agoAuto merge of #61625 - RalfJung:eval-interp, r=oli-obk
bors [Sat, 8 Jun 2019 13:02:49 +0000 (13:02 +0000)]
Auto merge of #61625 - RalfJung:eval-interp, r=oli-obk

Rename remaining "Eval" to "Interp"

Renaming done by sed.

r? @oli-obk

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

5 years agoremove useless ident() functions in const tests and replace the useful ones by black_...
Ralf Jung [Sat, 8 Jun 2019 10:30:52 +0000 (12:30 +0200)]
remove useless ident() functions in const tests and replace the useful ones by black_box (with a comment)

5 years agoAuto merge of #61620 - SimonSapin:as_cell, r=RalfJung
bors [Sat, 8 Jun 2019 10:15:31 +0000 (10:15 +0000)]
Auto merge of #61620 - SimonSapin:as_cell, r=RalfJung

Stabilize Cell::from_mut and as_slice_of_cells

FCP: https://github.com/rust-lang/rust/issues/43038#issuecomment-499900463

5 years agofix rebase fallout
Ralf Jung [Sat, 8 Jun 2019 09:40:55 +0000 (11:40 +0200)]
fix rebase fallout

5 years agorename EvalSnapshot -> InterpSnapshot
Ralf Jung [Fri, 7 Jun 2019 17:01:49 +0000 (19:01 +0200)]
rename EvalSnapshot -> InterpSnapshot

5 years agorename EvalResult -> InterpResult and EvalError -> InterpErrorInfo
Ralf Jung [Fri, 7 Jun 2019 16:56:27 +0000 (18:56 +0200)]
rename EvalResult -> InterpResult and EvalError -> InterpErrorInfo

5 years agochecktools: unify grepping the TOOLSTATE file
Ralf Jung [Sat, 8 Jun 2019 09:32:25 +0000 (11:32 +0200)]
checktools: unify grepping the TOOLSTATE file

5 years agoDo not recursively visit `visit_place`
Oliver Scherer [Sat, 8 Jun 2019 08:24:53 +0000 (10:24 +0200)]
Do not recursively visit `visit_place`

5 years agoAuto merge of #61635 - ecstatic-morse:const-signum, r=oli-obk
bors [Sat, 8 Jun 2019 07:20:57 +0000 (07:20 +0000)]
Auto merge of #61635 - ecstatic-morse:const-signum, r=oli-obk

Make `i*::signum` a `const fn`.

Ticks a box in #53718.

This uses a well-known branchless implementation of `signum`: `(n > 0) as i32 - (n < 0) as i32`.

Here's a [playground](https://play.rust-lang.org/?version=nightly&mode=release&edition=2018&gist=747cf191c4974bf66c9d75e509ae6e6e) comparing the two techniques. On x86 in release mode, the branchless implementation is able to replace a `mov` and `cmov` with a `sar` and `add`, so this should be a bit faster as well.

~~This is marked as a draft since I think I'll need to add `#[rustc_const_unstable]` somewhere. Perhaps the reviewer can point me in the right direction.~~

5 years agoAuto merge of #61649 - Centril:rollup-b4nx9k9, r=Centril
bors [Sat, 8 Jun 2019 01:34:53 +0000 (01:34 +0000)]
Auto merge of #61649 - Centril:rollup-b4nx9k9, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #61223 (Document tuple's Ord behavior as sequential)
 - #61615 (syntax: Treat error literals in more principled way)
 - #61616 (parser: Remove `Deref` impl from `Parser`)
 - #61621 (Clarify when we run steps with ONLY_HOSTS)
 - #61627 (Add regression test for #61452.)
 - #61641 (Revert "Make LocalAnalizer visitor iterate instead of recurse")
 - #61647 (Use stable wrappers in f32/f64::signum)

Failed merges:

r? @ghost

5 years agoRollup merge of #61647 - JohnTitor:use-stable-func, r=Centril
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:34:02 +0000 (03:34 +0200)]
Rollup merge of #61647 - JohnTitor:use-stable-func, r=Centril

Use stable wrappers in f32/f64::signum

Fixes #61638

r? @Centril

5 years agoRollup merge of #61641 - spastorino:revert-to-recursion-on-local-analyzer, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:34:00 +0000 (03:34 +0200)]
Rollup merge of #61641 - spastorino:revert-to-recursion-on-local-analyzer, r=oli-obk

Revert "Make LocalAnalizer visitor iterate instead of recurse"

This reverts commit 0cfaa28bc5edda198571fca9410cbc9f71b8d17a.

r? @oli-obk

5 years agoRollup merge of #61627 - davidtwco:ice-async-fn-lint, r=alexcrichton
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:59 +0000 (03:33 +0200)]
Rollup merge of #61627 - davidtwco:ice-async-fn-lint, r=alexcrichton

Add regression test for #61452.

Fixes #61452.

Turns out this ICE had already been fixed, so this PR only adds a regression test.

5 years agoRollup merge of #61621 - Mark-Simulacrum:bootstrap-run-only-hosts, r=alexcrichton
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:58 +0000 (03:33 +0200)]
Rollup merge of #61621 - Mark-Simulacrum:bootstrap-run-only-hosts, r=alexcrichton

Clarify when we run steps with ONLY_HOSTS

Just some simple cleanup, no behavior changes.

r? @alexcrichton

5 years agoRollup merge of #61616 - petrochenkov:parsderef, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:57 +0000 (03:33 +0200)]
Rollup merge of #61616 - petrochenkov:parsderef, r=oli-obk

parser: Remove `Deref` impl from `Parser`

Follow up to https://github.com/rust-lang/rust/pull/61541

You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess.
Not sure.
Probably still better than people using both and being confused about the definition point of `span`.

r? @oli-obk @estebank

5 years agoRollup merge of #61615 - petrochenkov:errlit, r=matklad
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:55 +0000 (03:33 +0200)]
Rollup merge of #61615 - petrochenkov:errlit, r=matklad

syntax: Treat error literals in more principled way

Free them from their character literal origins.

I actually tried to remove `LitKind::Err` entirely (by converting it into `ExprKind::Err` immediately), and it caused no diagnostic regressions in the test suite.
However, I'd still want to use error literals as general purpose error tokens some day, so I kept them.

The downside of having `LitKind::Err` in addition to `ExprKind::Err` is that every time you want to do something with `ExprKind::Err` you need to make sure that `ExprKind::Lit(LitKind::Err)` is treated in the same way.
Fortunately, this usually happens automatically because both literals and errors are "leaf" expressions, however this PR does fix a couple of inconsistencies between them.

Addresses https://github.com/rust-lang/rust/pull/60679#discussion_r282640663 in a way

5 years agoRollup merge of #61223 - czipperz:tuple-ord-document-ordering, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:54 +0000 (03:33 +0200)]
Rollup merge of #61223 - czipperz:tuple-ord-document-ordering, r=oli-obk

Document tuple's Ord behavior as sequential

Partially closing #50727

5 years agoAdd `const`-ness tests for `i32::signum`
Dylan MacKenzie [Fri, 7 Jun 2019 23:23:33 +0000 (16:23 -0700)]
Add `const`-ness tests for `i32::signum`