Commit Graph

101186 Commits

Author SHA1 Message Date
Tyler Mandry
fdef437372
Rollup merge of #65201 - tmiasko:no-bindings, r=rkruppe
Disable Go and OCaml bindings when building LLVM

Instead of instaling OCaml bindings in a location where installation
will not fail, don't build them in the first place.
2019-10-18 13:48:13 -07:00
Tyler Mandry
d2bea3c95d
Rollup merge of #65197 - spastorino:place-mut-visitor-adjusts2, r=oli-obk
Prepare `MutVisitor`s to handle interned projections

The following are all the files where mir's `MutVisitor` is implemented. The `-` there stands for no changes, `visit_place` wasn't making any change on `Place`s. `x` stands for this file was changed to make `visit_place` do whatever it was doing with the base but avoid modifying the projection, instead just create a new one and assign to it.

```
[-] src/librustc_mir/transform/no_landing_pads.rs
[x] src/librustc_mir/transform/promote_consts.rs
[x] src/librustc_mir/transform/generator.rs
[x] src/librustc_mir/transform/erase_regions.rs
[-] src/librustc_mir/transform/instcombine.rs
[x] src/librustc_mir/transform/inline.rs
[x] src/librustc_mir/transform/simplify.rs
[x] src/librustc_mir/util/def_use.rs
[-] src/librustc_mir/transform/const_prop.rs
[-] src/librustc_mir/transform/cleanup_post_borrowck.rs
[x] src/librustc_mir/borrow_check/nll/renumber.rs
[-] src/librustc_mir/transform/copy_prop.rs
```

There is some code repetition, just created the PR so we can start discussing it.

/cc @oli-obk @nikomatsakis
2019-10-18 13:48:11 -07:00
Tyler Mandry
7167a59241
Rollup merge of #65016 - lzutao:inline-mem-constfn, r=oli-obk
Always inline `mem::{size_of,align_of}` in debug builds

Those two are const fn and do not have any arguments. Inlining
helps reducing generated code size in debug builds.

See also #64996.
2019-10-18 13:48:10 -07:00
Esteban Küber
2b76c8b95f review comments 2019-10-18 13:00:14 -07:00
BO41
1c85b45117
Apply suggested wording
to better describe the situation
2019-10-18 16:55:08 +00:00
Esteban Küber
bd813bf1ac review comment: span bug label 2019-10-18 08:38:08 -07:00
Esteban Küber
865c4bcff6 review comments: help wording 2019-10-18 08:36:46 -07:00
Santiago Pastorino
48349960e6
Use Cow to handle modifications of projection in preparation for interning 2019-10-18 10:06:13 -04:00
Yves Dorfsman
52c771377f Added doc on keyword break 2019-10-18 06:55:51 -06:00
Lucas Henry
95d98af806 Added text after error messages 2019-10-18 13:21:39 +02:00
Wesley Wiser
4d89031e80 [const-prop] Handle MIR Rvalue::Discriminant 2019-10-18 06:29:57 -04:00
Wesley Wiser
a2e3ed5c05 [const-prop] Handle MIR Rvalue::Aggregates 2019-10-18 06:29:57 -04:00
Wesley Wiser
c8f7e18ceb [const-prop] Handle MIR Rvalue::Repeat 2019-10-18 06:29:56 -04:00
bors
518deda77f Auto merge of #64925 - ehuss:document-json, r=Mark-Simulacrum
Document JSON message output.

This documents the JSON messages in the rustc book.
2019-10-18 10:15:26 +00:00
Yuki Okushi
9617014aa6 Clarify diagnostics when using ~ as a unary op 2019-10-18 18:15:16 +09:00
Shotaro Yamada
23cb1d520b Avoid realloc in CString::new 2019-10-18 16:10:13 +09:00
Tobias Rapp
769e75b40c Fix left/right shift typo in wrapping rotate docs
This makes the note similar to the one found on rotate functions for
primitive types like i32/u32.
2019-10-18 08:46:30 +02:00
Nicholas Nethercote
d343ee839b Remove Hash impls for DefPath, DisambiguatedDefPathData, and DefKey.
They aren't used.
2019-10-18 16:36:17 +11:00
Igor Aleksanov
a06b205177 Add public re-exports for benches 2019-10-18 08:32:44 +03:00
Nicholas Nethercote
0879f63074 Remove Copy and Clone impls for LocalInternedString.
They aren't used.
2019-10-18 16:05:14 +11:00
Esteban Küber
f65a492afc Point at enclosing function without self receiver 2019-10-17 20:26:21 -07:00
oxalica
2ee45c9da2
Fix cast of stx_btime.tv_nsec 2019-10-18 10:32:27 +08:00
oxalica
15cb3e08e3
Fix cfgs for current libc 2019-10-18 10:32:27 +08:00
oxalica
43f398be6d
Prefer statx on linux if available 2019-10-18 10:32:27 +08:00
Nicholas Nethercote
3532863a96 Change how Symbol::Debug works.
Currently, `Symbol::Debug` and `Symbol::Display` produce the same
output; neither wraps the symbol in double quotes.

This commit changes `Symbol::Debug` so it wraps the symbol in quotes.
This change brings `Symbol`'s behaviour in line with `String` and
`InternedString`. The change requires a couple of trivial test output
adjustments.
2019-10-18 13:26:03 +11:00
Nicholas Nethercote
d8fca9ee4e Use with in Symbol trait methods.
Instead of `as_str()`, which unnecessarily involves `LocalInternedString`.
2019-10-18 13:26:03 +11:00
Nicholas Nethercote
e4ec4a6da3 Change MetaItem::tokens() to MetaItem::token_trees_and_joints().
Likewise for `NestedMetaItem::tokens()`. Also, add
`MetaItemKind::token_trees_and_joints()`, which `MetaItemKind::tokens()`
now calls.

This avoids some unnecessary `TokenTree` to `TokenStream` conversions,
and removes the need for the clumsy
`TokenStream::append_to_tree_and_joint_vec()`.
2019-10-18 13:25:17 +11:00
Nicholas Nethercote
212ae58f36 Change Lit::tokens() to Lit::token_tree().
Because most of the call sites have an easier time working with a
`TokenTree` instead of a `TokenStream`.
2019-10-18 13:25:17 +11:00
Nicholas Nethercote
a6eef299d3 Make TokenStream::from_iter less general and more efficient.
The current code has this impl:
```
impl<T: Into<TokenStream>> iter::FromIterator<T> for TokenStream
```
If given an `IntoIterator<Item = TokenTree>`, it will convert each individual
`TokenTree` to a `TokenStream` (at the cost of two allocations: a `Vec`
and an `Lrc`). It will then merge those `TokenStream`s into a single
`TokenStream`. This is inefficient.

This commit changes the impl to this less general one:
```
impl iter::FromIterator<TokenTree> for TokenStream
```
It collects the `TokenTree`s into a single `Vec` first and then converts that
to a `TokenStream` by wrapping it in a single `Lrc`. The previous generality
was unnecessary; no other code needs changing.

This change speeds up several benchmarks by up to 4%.
2019-10-18 13:25:17 +11:00
Nicholas Nethercote
d0eaf60d5e Remove two no-op into() calls. 2019-10-18 13:25:17 +11:00
bors
da59656b3b Auto merge of #65533 - Manishearth:clippyup, r=Manishearth
Update clippy

None
2019-10-18 02:15:07 +00:00
Santiago Pastorino
d53fc9cae5
Add process_* place hooks to improve code reutilization 2019-10-17 22:06:56 -04:00
Santiago Pastorino
7fa3425ef6
Setup a different visit place set of methods for mutable and immutable visitors
In particular, use a blank visit_place for mutable visitor to be sure,
non modified visitors are not trying to mutating place.
2019-10-17 22:06:56 -04:00
Santiago Pastorino
4f2a11036d
Remove unneeded callback and just use the new_local value 2019-10-17 22:06:56 -04:00
Santiago Pastorino
2b2e35bfc3
Prepare def_use MutVisitor to have projections interned 2019-10-17 22:06:56 -04:00
Santiago Pastorino
39c9ed3ac1
Prepare erase_regions MutVisitor to have projections interned 2019-10-17 22:06:55 -04:00
Santiago Pastorino
0fc063f159
Prepare generator MutVisitor to have projections interned 2019-10-17 22:06:55 -04:00
Santiago Pastorino
e3e9951673
Prepare inline MutVisitor to have projections interned 2019-10-17 22:06:55 -04:00
Santiago Pastorino
bb7d6d1c70
Prepare renumber MutVisitor to have projections interned 2019-10-17 22:06:55 -04:00
Santiago Pastorino
591cc9aede
Prepare simplify MutVisitor to have projections interned 2019-10-17 22:06:55 -04:00
Santiago Pastorino
e069e9ccac
Prepare promote_consts MutVisitor to have projections interned 2019-10-17 22:06:55 -04:00
Santiago Pastorino
5de9cb0703
super_ty on MutVisitor is empty so avoid the call 2019-10-17 22:06:55 -04:00
Esteban Küber
11011013f2 Refer to "associated functions" instead of "static methods" 2019-10-17 19:03:36 -07:00
Esteban Küber
0585475efd Avoid ICE when checking Destination of break inside a closure 2019-10-17 18:18:29 -07:00
Eduard-Mihai Burtescu
cd9e4441eb rustc: arena-allocate the slice in ty::GenericsPredicate, not the whole struct. 2019-10-18 03:14:57 +03:00
Manish Goregaokar
ebf731c638 Update clippy 2019-10-17 16:59:10 -07:00
Mark Rousskov
6be0a7081a Update API to be more compatible with plugin needs
Move to using Box<dyn Fn() -> ...> so that we can let plugins register
state.

This also adds a callback that'll get called from plugin registration so
that Clippy and other tools can register lints without using the plugin
API. The plugin API still works, but this new API is more compatible
with drivers other than rustc.
2019-10-17 19:41:21 -04:00
Mark Rousskov
b761367d52 Fix test fallout 2019-10-17 19:41:21 -04:00
Mark Rousskov
dab3bd6cda Create lint store during plugin registration
Remove lint store from Session
2019-10-17 19:41:21 -04:00
Mark Rousskov
da56d1d201 Remove all borrows of lint store from Session from librustc
Access through tcx is fine -- by that point, the lint store is frozen,
but direct access through Session will go away in future commits, as
lint store is still mutable in early stages of Session, and will be
removed completely.
2019-10-17 19:41:21 -04:00