92895 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
77c5f557cc
Rollup merge of #60183 - tmandry:chalk-builtin-copy-clone, r=scalexm
Chalkify: Add builtin Copy/Clone

r? @nikomatsakis
2019-04-26 03:50:17 +02:00
Mazdak Farrokhzad
8bdb91d9ff
Rollup merge of #60165 - Nemo157:pin-into-inner, r=cramertj
Add Pin::{into_inner,into_inner_unchecked}

These functions are useful for unsafe code that needs to temporarily pull smart pointers out of the `Pin`, e.g. [the change that inspired them](b4361780fa (diff-1a4e0ba4d1b539412ca576411ec6c7c2R258)) is taking a `Pin<Box<dyn Future>>`, turning it into a `*mut dyn Future` via `Box::into_raw(unsafe { Pin::into_inner_unchecked(pin) })` then later dropping this via `drop(Pin::from(Box::from_raw(ptr)))`. This can be accomplished today via `{ let ptr = unsafe { Pin::get_unchecked_mut(pin.as_mut()) } as *mut dyn Future; mem::forget(pin); ptr }`, but this is far more complicated and loses out on the symmetry of using `Box::into_raw` and `Box::from_raw`.

I'll extend the documentation on what guarantees `into_inner_unchecked` needs to uphold once I get some feedback on whether this API is wanted or not.

r? @withoutboats
2019-04-26 03:50:16 +02:00
Mazdak Farrokhzad
878a7d6ea5
Rollup merge of #60134 - GuillaumeGomez:fix-index-page, r=Manishearth
Fix index-page generation

Fixes #60096.

The minifier was minifying crates name in `searchIndex` key position, which was a bit problematic for multiple reasons.

r? @rust-lang/rustdoc
2019-04-26 03:50:14 +02:00
Mazdak Farrokhzad
09a7051d28
Rollup merge of #59940 - GuillaumeGomez:rustdoc-test, r=ollie27
Set cfg(test) when rustdoc is running with --test option

Following a [discussion on twitter](https://twitter.com/burntsushi5/status/1117091914199785473), I proposed this change. What do you think about it?

r? @QuietMisdreavus

cc @BurntSushi
2019-04-26 03:50:13 +02:00
Mazdak Farrokhzad
294e89d5fa
Rollup merge of #59734 - GuillaumeGomez:improve-rustdoc-failure, r=ollie27
Prevent failure in case no space left on device in rustdoc

Fixes #59703.

r? @QuietMisdreavus
2019-04-26 03:50:11 +02:00
Nicholas Nethercote
91d5b764ea Remove some unused return values. 2019-04-26 09:48:52 +10:00
Nicholas Nethercote
68f5101cd5 Remove unused DiagnosticOutput::Emitter variant. 2019-04-26 09:48:52 +10:00
varkor
6d7c7940b5 Add comment explaining restriction 2019-04-25 23:29:58 +01:00
varkor
8f78736fee Fix error code description 2019-04-25 23:19:36 +01:00
varkor
7261bd88ac Update existing usages 2019-04-25 22:05:04 +01:00
varkor
2c20c44c92 Split CommonTypes into CommonTypes and CommonLifetimes 2019-04-25 22:04:51 +01:00
Tyler Mandry
0a26789af9 Make -Z allow-features work for stdlib features 2019-04-25 14:03:45 -07:00
varkor
8c3068784c Fix false position on style.rs itself 2019-04-25 21:54:09 +01:00
varkor
b759c2d714 Advise the user on how to suppress the file length tidy error 2019-04-25 21:39:09 +01:00
varkor
aa388f1d11 ignore-tidy-filelength on all files with greater than 3000 lines 2019-04-25 21:39:09 +01:00
varkor
949658345c Add a tidy test for line count 2019-04-25 21:38:47 +01:00
John Kåre Alsaker
d2ff829433 Update variances_of 2019-04-25 22:29:29 +02:00
bors
3991285f55 Auto merge of #59111 - gilescope:generator-better-errors, r=nikomatsakis
Improved error message when type must be bound due to generator.

Fixes #58930.

Keen to get some feedback - is this as minimal as we can get it or is there an existing visitor I could repurpose?
2019-04-25 20:27:16 +00:00
Esteban Küber
6b190d6de5 Do not ICE when checking types against foreign fn 2019-04-25 13:16:21 -07:00
varkor
908a6399bc Add a test for const parameters with type parameters as types 2019-04-25 21:12:17 +01:00
varkor
102f7a8b26 Make sure const params with type params don't cause errors without a feature gate 2019-04-25 21:12:03 +01:00
varkor
976b3d1d9e Prevent const parameters having type parameters as types 2019-04-25 21:11:46 +01:00
varkor
f024196dd5 Fix indexing issue for const parameter invariance 2019-04-25 20:16:11 +01:00
Tyler Mandry
9ef2c30a1a Preserve visibility scopes in stored generator locals
Unfortunately, this didn't have quite the effect I was hoping for.
Locals still appear visible at every point in the function, regardless
of scopes. I suspect all the rewriting of the MIR we do for the
generator transform makes these scopes less useful.

I didn't observe any regressions in behavior, but it's possible that
this change is wrong without additional changes to the MIR.
2019-04-25 10:28:09 -07:00
Tyler Mandry
b8f6de4aca Generalize discriminant info calls for generators and ADTs 2019-04-25 10:28:09 -07:00
Tyler Mandry
f772c39bf9 Include generator locals as field names in debuginfo 2019-04-25 10:28:09 -07:00
Tyler Mandry
6e2e17d115 Make generator object debuginfo easier to read 2019-04-25 10:28:09 -07:00
Tyler Mandry
961ba95e5a Describe generator variants in debuginfo 2019-04-25 10:28:09 -07:00
Tyler Mandry
5a7af5480c Support variantful generators
This allows generators to overlap fields using variants.
2019-04-25 10:28:09 -07:00
bors
c32171bd5e Auto merge of #60192 - t-rapp:tr-saturating-funcs, r=alexcrichton
Implement saturating_abs() and saturating_neg() functions for signed integer types

Similar to wrapping_abs() / wrapping_neg() functions but saturating at the numeric bounds instead of wrapping around. Complements the existing set of functions with saturation mechanics.

cc #59983
2019-04-25 17:26:20 +00:00
Tyler Mandry
4de2d8a869 Give GeneratorLayout a list of fields for each variant
But don't really use it yet.
2019-04-25 10:23:15 -07:00
Tyler Mandry
70c1b6c530 Define generator discriminant type in only one place 2019-04-25 10:12:57 -07:00
Tyler Mandry
9e06f25200 Test debuginfo of different var liveness in generators 2019-04-25 10:12:57 -07:00
Tyler Mandry
52e4407d46 Update comment for liveness_of_locals 2019-04-25 10:12:57 -07:00
Ralf Jung
16ad9777b8 when testing Miri, compile libstd for Miri 2019-04-25 18:47:36 +02:00
John Kåre Alsaker
53269c7f6e Update trait queries 2019-04-25 18:23:36 +02:00
John Kåre Alsaker
b164a2da63 Update trait_impls_of 2019-04-25 18:23:35 +02:00
John Kåre Alsaker
1fe0d4e383 Update mir_const_qualif 2019-04-25 18:23:34 +02:00
John Kåre Alsaker
d56d2fbaea Update rvalue_promotable_map 2019-04-25 18:23:33 +02:00
John Kåre Alsaker
b8b4ad597a Update region_scope_tree 2019-04-25 18:23:32 +02:00
Alex Crichton
955f283e11 rustc: Flag metadata compatible with multiple CGUs
It looks like the `OutputType::Metadata` kind in the compiler was
misclassified in #38571 long ago by accident as incompatible with
codegen units and a single output file. This means that if you emit both
a linkable artifact and metadata it silently turns off multiple codegen
units unintentionally!

This commit corrects the situation to ensure that if `--emit metadata`
is used it doesn't implicitly disable multiple codegen units. This will
ensure we don't accidentally regress compiler performance when striving
to implement pipelined compilation!
2019-04-25 09:06:38 -07:00
Giles Cope
66e41bc675 Improved error message when type must be bound due to generator.
Error now mentions type var name and span is highlighted.
2019-04-25 16:42:59 +01:00
Tobias Rapp
c7d47c8cf4 Add tests for saturating_abs() and saturating_neg functions 2019-04-25 17:04:17 +02:00
Tobias Rapp
8234ac32bd Add saturating_abs() and saturating_neg() functions to signed integer types
Similar to wrapping_abs() / wrapping_neg() functions but saturating at
the numeric bounds instead of wrapping around. Complements the existing
set of functions with saturation mechanics.
2019-04-25 17:04:11 +02:00
bors
bd31c392f2 Auto merge of #60257 - matthiaskrgr:submodule_upd, r=oli-obk
submodules: update clippy from 9897442f to 8c0e038f

Should fix clippy/rls toolstate breakage

Changes:
````
Rustup for https://github.com/rust-lang/rust/pull/59042
Update pulldown_cmark to 0.5
Only run AppVeyor on r+, try and the master branch
Remove approx_constant known problems
Suppress let_and_return if let has attributes
Add test for or_fun_call macro suggestion
UI test cleanup: Extract needless_range_loop tests
Change "if types change" to "if you later change the type"
````

r? @oli-obk
2019-04-25 14:10:19 +00:00
gnzlbg
d37f3fc1ec Add feature-gate for f16c target feature 2019-04-25 15:44:22 +02:00
Santiago Pastorino
72cda98e48 Implement Debug for Place using Place::iterate 2019-04-25 14:45:59 +02:00
Guillaume Gomez
6aa5a5df96 Improvement comment explanations 2019-04-25 13:20:43 +02:00
Matthias Krüger
f9945f58e2 submodules: update clippy from 9897442f to 8c0e038f
Changes:
````
Rustup for https://github.com/rust-lang/rust/pull/59042
Update pulldown_cmark to 0.5
Only run AppVeyor on r+, try and the master branch
Remove approx_constant known problems
Suppress let_and_return if let has attributes
Add test for or_fun_call macro suggestion
UI test cleanup: Extract needless_range_loop tests
Change "if types change" to "if you later change the type"
````
2019-04-25 13:18:44 +02:00
Mazdak Farrokhzad
4bd36ab64c Introduce hir::ExprKind::Use and employ in for loop desugaring.
Here, ExprKind::Use(P<Expr>) tweaks the drop order to act the
same way as '{ let _tmp = expr; _tmp }' does.
2019-04-25 11:51:53 +02:00