Commit Graph

94487 Commits

Author SHA1 Message Date
Igor Matuszewski
630d5f355f Don't suggest using \r in raw strings 2019-06-10 17:32:15 +02:00
Igor Matuszewski
63dc7da703 Use char byte calculation using existing iterator 2019-06-09 15:44:57 +02:00
Igor Matuszewski
735ac057bb Actually translate CRLF in raw byte strings and unify unescape impl 2019-06-09 15:14:55 +02:00
Igor Matuszewski
3c1d352dc4 Add a doc comment for scan_raw_string 2019-06-09 14:20:29 +02:00
Igor Matuszewski
8cd51fff82 Add test for raw byte CRLF translation 2019-06-09 14:15:31 +02:00
Igor Matuszewski
d4632744fa Translate CRLF -> LF in raw (byte) strings 2019-06-09 00:33:21 +02:00
Igor Matuszewski
49d62e8d5a Prohibit bare CRs in raw byte strings 2019-06-08 22:58:53 +02:00
Igor Matuszewski
cab7e7fe76 Validate and transcribe raw strings via unescape module 2019-06-08 22:58:53 +02:00
Igor Matuszewski
08ede49dcb Remove redundant, commented out code
It was commented out as part of
8a8e497ae7.
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.
2019-06-08 20:05:02 +02:00
Igor Matuszewski
b8e3533b73 Separate a scan_raw_string (similar raw_byte variant) 2019-06-08 20:05:02 +02:00
Igor Matuszewski
5b17a5e30a Clean up minor bits 2019-06-08 20:05:02 +02:00
bors
c1c60d292e Auto merge of #61209 - matthewjasper:const-tuple-constructors, r=oli-obk
Make tuple constructors real const fns

Mir construction special cases `Ctor(...)` to be lowered as `Ctor { 0: ... }`, which means this doesn't come up much in practice, but it seems inconsistent not to allow this.

r? @oli-obk
2019-06-07 09:41:06 +00:00
bors
ca1bcfdde3 Auto merge of #61541 - petrochenkov:tsp, r=oli-obk
syntax: Keep token span as a part of `Token`

In the world with proc macros and edition hygiene `Token` without a span is not self-contained.
In practice this means that tokens and spans are always stored and passed somewhere along with each other.
This PR combines them into a single struct by doing the next renaming/replacement:

- `Token` -> `TokenKind`
- `TokenAndSpan` -> `Token`
- `(Token, Span)` -> `Token`

Some later commits (fb6e2fe8fd and 1cdee86940) remove duplicate spans in `token::Ident` and `token::Lifetime`.
Those spans were supposed to be identical to token spans, but could easily go out of sync, as was noticed in https://github.com/rust-lang/rust/pull/60965#discussion_r285398523.
The `(Token, Span)` -> `Token` change is a soft pre-requisite for this de-duplication since it allows to avoid some larger churn (passing spans to most of functions classifying identifiers).
2019-06-07 06:52:09 +00:00
bors
c5295ac64a Auto merge of #61408 - varkor:fmin-fmax-llvm-intrinsics, r=alexcrichton
Use LLVM intrinsics for floating-point min/max

Resurrection of https://github.com/rust-lang/rust/pull/46926, now that the optimisation issues are fixed. I've confirmed locally that https://github.com/rust-lang/rust/pull/61384 solves the issues.

I'm not sure if we're allowed to move the `min`/`max` methods from libcore to libstd: I can't quite tell what the status is from https://github.com/rust-lang/rust/issues/50145. However, this is necessary to use the intrinsics.

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

r? @SimonSapin
cc @rkruppe @nikic
2019-06-07 01:42:15 +00:00
bors
5eeb567a27 Auto merge of #61601 - Centril:rollup-uegbsns, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #61376 (Add Bound::cloned())
 - #61554 (Change visit api)
 - #61559 (Make visitors iterate)
 - #61585 (Update .mailmap with my name)
 - #61591 (Update .mailmap)

Failed merges:

r? @ghost
2019-06-06 20:46:15 +00:00
Mazdak Farrokhzad
9e97970fe2
Rollup merge of #61591 - christianpoveda:patch-1, r=jonas-schievink
Update .mailmap
2019-06-06 22:39:14 +02:00
Mazdak Farrokhzad
61f5042633
Rollup merge of #61585 - lnicola:mailmap, r=Mark-Simulacrum
Update .mailmap with my name
2019-06-06 22:39:13 +02:00
Mazdak Farrokhzad
3fd632aa7e
Rollup merge of #61559 - spastorino:make-visitors-iterate, r=oli-obk
Make visitors iterate

r? @oli-obk

The second commit is not completely equivalent, unsure if the code is wrong or not. Tests pass though, otherwise we would need to iterate in the opposite direction as it happened in other parts of the code.
2019-06-06 22:39:12 +02:00
Mazdak Farrokhzad
4c74056867
Rollup merge of #61554 - spastorino:change_visit_api, r=oli-obk
Change visit api

r? @oli-obk

In the [first commit](37386d366a) of this PR, I'm changing `visit_place` to be the function that traverses the `Place` and have only that responsibility. Then there are two other functions `visit_place_base` and `visit_projection` which are the ones in charge of visiting the base and the projection. Visitor implementors can implement any of those.

In the [second commit](e786f631b8) we can already see some things that confuses me, which I think this division will make more clear. The old code, first checked if the place was a base, did something with it and then called `super_place` [here](e786f631b8 (diff-d583e4efe1a72516e274158e53223633L678)). `super_place` checks again if it's a base [here](https://github.com/rust-lang/rust/blob/master/src/librustc/mir/visit.rs#L679-L684) and in case is a local, visits the local and stuff like that. That's not very obvious on the code, and if I'm not wrong it's not needed. In this PR or we have [this](e786f631b8 (diff-d583e4efe1a72516e274158e53223633R673)) as I did or we can just do `- => self.super_place_base(...)` and that will be obvious that I'm letting the default implementation process the base.
2019-06-06 22:39:10 +02:00
Mazdak Farrokhzad
654854fdb5
Rollup merge of #61376 - czipperz:bound-cloned, r=sfackler
Add Bound::cloned()

Suggested by #61356
2019-06-06 22:39:09 +02:00
varkor
0e5edc9f16 Add intrinsics for floating-point min and max 2019-06-06 21:27:23 +01:00
varkor
a31848350b Update compiler_builtins 2019-06-06 21:27:07 +01:00
Christian Poveda
6ba6183b1d
Update .mailmap 2019-06-06 11:52:07 -05:00
Matthew Jasper
bcf8365675 Make sure constructors functions are type checked correctly 2019-06-06 17:20:06 +01:00
Matthew Jasper
0d75ab2293 Make constructors actually be const functions 2019-06-06 17:20:06 +01:00
Matthew Jasper
6c9a018b60 Don't run MIR passes on constructor shims 2019-06-06 16:10:37 +01:00
Laurențiu Nicola
2bcdee3f1e Update .mailmap with my name 2019-06-06 16:37:23 +03:00
bors
8b36867093 Auto merge of #61583 - Centril:rollup-ug2cbfd, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #61556 (librustc_errors: Rename AnnotateRs -> AnnotateSnippet)
 - #61557 (rustbuild: Include `rustfmt` in deduplicated dependencies)
 - #61571 (Escape HashMap with backticks in needs_drop docs)
 - #61582 (submodules: update clippy from 20da8f45 to 71be6f62)

Failed merges:

r? @ghost
2019-06-06 12:13:54 +00:00
Mazdak Farrokhzad
97a2acd0a0
Rollup merge of #61582 - matthiaskrgr:submodule_upd, r=oli-obk
submodules: update clippy from 20da8f45 to 71be6f62

Changes:
````
rustup https://github.com/rust-lang/rust/pull/57428/
Remove `to_string()`s from CompilerLintFunctions
Fix comment grammar
Fix .map(..).unwrap_or_else(..) bad suggestion
add suggestions for print/write with newline lint
````
Fixes https://github.com/rust-lang/rust/issues/61578
r? @oli-obk
2019-06-06 13:19:28 +02:00
Mazdak Farrokhzad
5f410fe079
Rollup merge of #61571 - czipperz:needs_drop-doc-escape-HashMap, r=Mark-Simulacrum
Escape HashMap with backticks in needs_drop docs
2019-06-06 13:19:26 +02:00
Mazdak Farrokhzad
face682c82
Rollup merge of #61557 - alexcrichton:build-less, r=pietroalbini
rustbuild: Include `rustfmt` in deduplicated dependencies

Currently `rustfmt` is excluded from the "don't build dependencies
twice" check but it's currently building dependencies twice! Namely big
dependencies like `rustc-ap-syntax` are built once for rustfmt and once
for the RLS. This commit includes `rustfmt` in these checks and then
fixes the resulting feature mismatches for winapi.
2019-06-06 13:19:25 +02:00
Mazdak Farrokhzad
59690f4395
Rollup merge of #61556 - phansch:emitter_cleanup, r=estebank
librustc_errors: Rename AnnotateRs -> AnnotateSnippet

The proper name of the library is `annotate-snippet`, not `annotate-rs`,
this PR should get rid of any confusing `AnnotateRs` names.

1. Renames `annotate_rs_emitter.rs` to
   `annotate_snippet_emitter_writer.rs` so that the difference between the
   `Emitter` trait and the implementers is more clear.
2. Renames `AnnotateRsEmitterWriter` to `AnnotateSnippetEmitterWriter`
3. Renames `HumanReadableErrorType::AnnotateRs` to `HumanReadableErrorType::AnnotateSnippet`
2019-06-06 13:19:23 +02:00
Vadim Petrochenkov
3a31f0634b Address review comments 2019-06-06 14:04:33 +03:00
Vadim Petrochenkov
ff40e37b98 Some code cleanup and tidy/test fixes 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
738e14565d syntax: Use Token in visitors and fix a mut visitor test 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
67ce3f4589 syntax: Switch function parameter order in TokenTree::token 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
350a34f85c syntax: Use Token in some more places 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
f745e5f9b6 syntax: Remove duplicate span from token::Ident 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
4c5d773b4d syntax: Remove duplicate span from token::Lifetime 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
5e693531ff syntax: Add some helper methods to Token 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
aa6fba98ae syntax: Use Token in Parser 2019-06-06 14:04:02 +03:00
Vadim Petrochenkov
c0c57acd7b syntax: Use Token in StringReader and TokenTreesReader 2019-06-06 14:03:15 +03:00
Vadim Petrochenkov
e0127dbf81 syntax: Use Token in TokenTree::Token 2019-06-06 14:03:15 +03:00
Vadim Petrochenkov
a3425edb46 syntax: Rename TokenAndSpan into Token 2019-06-06 14:03:15 +03:00
Vadim Petrochenkov
99b27d749c syntax: Rename Token into TokenKind 2019-06-06 14:03:14 +03:00
Vadim Petrochenkov
eac3846b65 Always use token kinds through token module rather than Token type 2019-06-06 14:01:57 +03:00
Matthias Krüger
d68f0e1ef6 submodules: update clippy from 20da8f45 to 71be6f62
Changes:
````
rustup https://github.com/rust-lang/rust/pull/57428/
Remove `to_string()`s from CompilerLintFunctions
Fix comment grammar
Fix .map(..).unwrap_or_else(..) bad suggestion
add suggestions for print/write with newline lint
````
2019-06-06 12:56:26 +02:00
Santiago Pastorino
67197e264a Implement only visit_place_base for monomorphize/collector 2019-06-06 12:50:23 +02:00
Santiago Pastorino
cc527464bb Make visit_place traverse place and have visit_place_base and visit_projection doing the real work 2019-06-06 12:35:56 +02:00
bors
51dc52b9fe Auto merge of #61494 - Mark-Simulacrum:move-to-cfg-bootstrap, r=alexcrichton
Utilize cfg(bootstrap) over cfg(stage0)

Also removes stage1, stage2 cfgs being passed to rustc to ensure that
stage1 and stage2 are only differentiated as a group (i.e., only through
not bootstrap).

Fixes #53582

r? @alexcrichton
2019-06-06 09:27:47 +00:00