Commit Graph

94529 Commits

Author SHA1 Message Date
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
Alex Crichton
7d1f762c80 ci: Disable LLVM/debug assertions for asmjs builder
This shaves of 50 minutes of cycle time on Azure and will likely also
save a significant chunk of time on Travis. The assertions here aren't
really buying us much over other builders with assertions already
enabled, so let's disable them for this builder.

cc #61185
2019-06-06 07:58:39 -07:00
Laurențiu Nicola
2bcdee3f1e Update .mailmap with my name 2019-06-06 16:37:23 +03:00
Wesley Wiser
dee05ab2cc [const-prop] Handle Rvalue::Len 2019-06-06 08:31:54 -04:00
Wesley Wiser
1e50e01bb7 [const-prop] Handle ProjectionElem::Deref 2019-06-06 08:31:54 -04:00
Wesley Wiser
9f4d94b908 [const-prop] Handle Rvalue::Ref 2019-06-06 08:31:54 -04:00
Wesley Wiser
529b94ea6a [const-prop] Fix ICE when casting function pointers
This fixes an ICE when building libcore with `-Z mir-opt-level=3`.
2019-06-06 08:31:28 -04: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
bors
daf1ed0e98 Auto merge of #61373 - tmandry:emit-storagedead-along-unwind, r=eddyb
Emit StorageDead along unwind paths for generators

Completion of the work done in #60840. That PR made a change to implicitly consider a local `StorageDead` after Drop, but that was incorrect for DropAndReplace (see also #61060 which tried to fix this in a different way).

This finally enables the optimization implemented in #60187.

r? @eddyb
cc @Zoxc @cramertj @RalfJung
2019-06-06 06:36:12 +00:00
Chris Gregory
c1bc8f11cb
Remove dereference
Co-Authored-By: Steven Fackler <sfackler@gmail.com>
2019-06-05 21:23:45 -07:00
Chris Gregory
4a88614c4f Take self by value (Self is Copy here) 2019-06-05 21:11:09 -07:00
bors
740668dbd9 Auto merge of #57428 - alexreg:associated_type_bounds, r=nikomatsakis,Centril
Implementation of RFC 2289 (associated_type_bounds)

This PR implements the [`asociated_type_bounds` feature](https://github.com/rust-lang/rfcs/blob/master/text/2289-associated-type-bounds.md).

Associated type bounds are implemented in:
   - function/method arguments and return types
   - structs, enums, unions
   - associated items in traits
   - type aliases
   - type parameter defaults
   - trait objects
   - let bindings

CC @nikomatsakis @centril
2019-06-06 03:56:22 +00:00
Santiago Pastorino
0cfaa28bc5 Make LocalAnalizer visitor iterate instead of recurse 2019-06-06 05:17:26 +02:00
Santiago Pastorino
2bdaccbbcf Make UnsafetyChecker visitor iterate instead of recurse 2019-06-06 05:17:19 +02:00
Alexander Regueiro
ee890331f6 Reblessed tests with NLL compare mode on. 2019-06-06 03:29:02 +01:00
Chris Gregory
408895d5b3 Escape needs_drop in the needs_drop documentation 2019-06-05 18:22:31 -07:00
Chris Gregory
94ea5dc597 Escape HashMap with backticks in needs_drop docs 2019-06-05 18:21:17 -07:00
bors
1bec46c9a5 Auto merge of #59331 - varkor:TypeVariableOrigin-refactor, r=eddyb
Refactor `TypeVariableOrigin`

Removes some unused variants and extracts the common `Span` field.

As suggested in https://github.com/rust-lang/rust/pull/59008#discussion_r265031209.

r? @eddyb
2019-06-06 01:04:14 +00:00
Mark Rousskov
bea2e55efa 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).
2019-06-05 17:57:58 -06:00
Tyler Mandry
7718b14301 Test StorageDead statements explicitly 2019-06-05 15:10:19 -07:00