Commit Graph

64158 Commits

Author SHA1 Message Date
Nathan Froyd
b1858447d3 fix confusion about parts required for float formatting
The documentation for flt2dec doesn't match up with the actual
implementation, so fix the documentation to align with reality.
Presumably due to the mismatch, the formatting code for floats in
std::fmt can use correspondingly shorter arrays in some places, so fix
those places up as well.

Fixes #41304.
2017-05-09 12:58:50 -04:00
steveklabnik
2f6744c5fc Improve docs on Arc<T> and Send/Sync
This is something I always forget, so let's actually
explain in the docs.
2017-05-09 12:49:58 -04:00
steveklabnik
23382e614a Add more ways to create a PathBuf to docs
The best way to do this wasn't in the documentation, and the ways that
were there needed some extra text to elaborate.

Fixes #40159
2017-05-09 12:43:49 -04:00
bors
644fc403dd Auto merge of #41814 - gamazeps:thread-struct-doc, r=steveklabnik
[Doc] improve `thread::Thread` and `thread::Builder` documentations

Part of #29378

- Adds information about the stack_size when using `Builder`. This might be considered too low level, but I assume that if someone wants to create their own builder instead of using `thread::spawn` they may be interested in that info.
- Updates the `thread::Thread` structure doc, mostly by explaining how to get one, the previous example was removed because it was not related to `thread::Thread`, but rather to `thread::Builder::name`.
  Not much is present there, mostly because this API is not often used (the only method that seems useful is `unpark`, which is documented in #41809).
2017-05-09 16:31:07 +00:00
Jon Gjengset
1617eee277
Bump cargo for rust-lang/cargo#4000
Also relies on rust-lang/cargo#4010
2017-05-09 12:15:13 -04:00
Felix Raimundo
656efcd3ab Address review comments 2017-05-09 16:57:03 +02:00
Felix Raimundo
323a774c2f Address review comments 2017-05-09 16:52:26 +02:00
bors
f3fc547194 Auto merge of #41709 - michaelwoerister:close-metadata-ich-holes, r=nikomatsakis
incr.comp.: Hash more pieces of crate metadata to detect changes there.

This PR adds incr. comp. hashes for non-`Entry` pieces of data in crate metadata.

The first part of it I like: `EntryBuilder` is refactored into the more generally applicable `IsolatedEncoder` which provides means of encoding something into metadata while also feeding the encoded data into an incr. comp. hash. We already did this for `Entry`, now we are doing it for various other pieces of data too, like the set of exported symbols and so on. The hashes generated there are persisted together with the per-`Entry` hashes and are also used for dep-graph dirtying the same way.

The second part of the PR I'm not entirely happy with: In order to make sure that we don't forget registering a read to the new `DepNodes` introduced here, I added the `Tracked<T>` struct. This struct wraps a value and requires a `DepNode` when accessing the wrapped value. This makes it harder to overlook adding read edges in the right places and works just fine.
However, crate metadata is already used in places where there is no `tcx` yet or even in places where no `cnum` has been assigned -- this makes it harder to apply this feature consistently or implement it ergonomically. The result is not too bad but there's a bit more code churn and a bit more opportunity to get something wrong than I would have liked. On the other hand, wrapping things in `Tracked<T>` already has revealed some bugs, so there's definitely some value in it.

This is still a work in progress:
- [x] I need to write some test cases.
- [x] Accessing the CodeMap should really be dependency tracked too, especially with the new path-remapping feature.

cc @nikomatsakis
2017-05-09 11:55:37 +00:00
Felix Raimundo
9db31206f5 Add a link to thread::Builder in thread::spawn 2017-05-09 13:27:22 +02:00
Felix Raimundo
c655348f26 Add more examples to thread::spawn
Part of #29378
2017-05-09 13:20:04 +02:00
Michael Woerister
115602b1be Add INVALID_CRATE CrateNum constant. 2017-05-09 12:46:43 +02:00
bors
c2d53dce7e Auto merge of #41777 - nikomatsakis:issue-41697-mir-dump-cycle, r=arielb1
dump-mir was causing cycles by invoking item-path-str at bad times

Workaround for now, but probably a better fix is to opt **in** to using the types for impls (if we do that at all; maybe filename/line is better).

Fixes #41697
2017-05-09 09:27:50 +00:00
bors
bedd7da3d2 Auto merge of #41846 - frewsxcv:rollup, r=frewsxcv
Rollup of 8 pull requests

- Successful merges: #41293, #41520, #41827, #41828, #41833, #41836, #41838, #41842
- Failed merges:
2017-05-09 03:36:12 +00:00
Corey Farwell
f21209f442 Rollup merge of #41842 - Migi:patch-1, r=eddyb
Fix typo in subst.rs

Changed "unknwon" to "unknown".
2017-05-08 22:34:53 -04:00
Corey Farwell
2f0deec98b Rollup merge of #41838 - z1mvader:fix_fn_args_coerce_closure, r=nikomatsakis
Fixed argument inference for closures when coercing into 'fn'

This fixes https://github.com/rust-lang/rust/issues/41755. The tests  `compile-fail/closure-no-fn.rs` and `compile-fail/issue-40000.rs` were modified. A new test `run-pass/closure_to_fn_coercion-expected-types.rs` was added

r? @nikomatsakis
2017-05-08 22:34:52 -04:00
Corey Farwell
7f30703155 Rollup merge of #41836 - jz0425:master, r=frewsxcv
@bors: r+ 38fe8d2 rollup

1) changed "long way into" to "long way toward"
2) changed "developer lives" to "developers' lives"
3) removed the "either... or..." format from second paragraph because there are more than 2 options
4) Minor revisions to paragraphs 3-6 to make them more consistent in format and to fix minor grammar issues.
2017-05-08 22:34:51 -04:00
Corey Farwell
0a59fc1156 Rollup merge of #41833 - nrc:update, r=nagisa
Update save-analysis deps and RLS submodule
2017-05-08 22:34:50 -04:00
Corey Farwell
f4c4334472 Rollup merge of #41828 - arielb1:lvalue-ops, r=eddyb
try to fix lvalue ops for real

Hopefully this is the last PR needed.

Fixes #41726.
Fixes #41742.
Fixes #41774.
2017-05-08 22:34:50 -04:00
Corey Farwell
933df894a6 Rollup merge of #41827 - qnighy:allow-bare-cr-in-nondoc-comment, r=estebank
Allow bare CR in ////-style comment.

Fixes #40624 in a way that bare CR is allowed in all non-doc comments.
2017-05-08 22:34:49 -04:00
Corey Farwell
1940c31c92 Rollup merge of #41520 - estebank:trace-macro, r=nikomatsakis
Use diagnostics for trace_macro instead of println

When using `trace_macro`, use `span_label`s instead of `println`:

```rust
note: trace_macro
  --> $DIR/trace-macro.rs:14:5
   |
14 |     println!("Hello, World!");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expands to `println! { "Hello, World!" }`
   = note: expands to `print! { concat ! ( "Hello, World!" , "\n" ) }`
```

Fix #22597.
2017-05-08 22:34:47 -04:00
Corey Farwell
c104db4801 Rollup merge of #41293 - est31:floating_literal_match, r=nikomatsakis
Implement the illegal_floating_point_literal_pattern compat lint

Adds a future-compatibility lint for the [breaking-change] introduced by issue #41620 . cc issue #41255 .
2017-05-08 22:34:46 -04:00
Jing Zhao
9b8f9b7cf8 Update rustc-ux-guidelines.md
"A `note` to emitted to" changed to "A `note` is emitted to"
2017-05-08 18:15:23 -07:00
Migi
dfd584997b Fix typo in subst.rs 2017-05-09 01:32:46 +02:00
bors
f1140a3317 Auto merge of #41515 - eddyb:non-static-assoc-const, r=nikomatsakis
rustc: treat const bodies like fn bodies in middle::region.

Allows `T::ASSOC_CONST` to be used without a `T: 'static` bound.

cc @rust-lang/compiler @rust-lang/lang
2017-05-08 23:02:30 +00:00
Christian Poveda
82e0736391 massive refactor 2017-05-08 16:39:47 -05:00
Christian Poveda
78b27373dc added test 2017-05-08 16:34:29 -05:00
Christian Poveda
8aaae945ea first part of issue-40000.rs is now passing 2017-05-08 16:17:26 -05:00
Christian Poveda
170c4340f6 dividied closure-no-fn.rs into three different tests 2017-05-08 16:04:49 -05:00
Jing Zhao
576266927a Grammar fixes to rustc-ux-guidelines.md
1) changed "long way into" to "long way toward"
2) changed "developer lives" to "developers' lives"
3) removed the "either... or..." format from second paragraph because there are more than 2 options
4) Minor revisions to paragraphs 3-6 to make them more consistent in format and to fix minor grammar issues.
2017-05-08 13:33:54 -07:00
Niko Matsakis
cadf187347 dump-mir was causing cycles by invoking item-path-str at bad times
Workaround for now, but probably a better fix is to opt **in** to using
the types for impls (if we do that at all; maybe filename/line is
better).
2017-05-08 15:59:02 -04:00
Christian Poveda
f096c8d174 inferring expected types of closure arguments when coercing to a fn 2017-05-08 14:56:33 -05:00
achernyak
dfb740f83c removed unnecessary if 2017-05-08 14:30:30 -05:00
Nick Cameron
7bed5437fa Update save-analysis deps and RLS submodule 2017-05-09 07:15:48 +12:00
bors
20de961226 Auto merge of #41824 - Mark-Simulacrum:undo-yacc-removal, r=nagisa
Readd LALR grammar

Reverts a portion of #41705. Please let me know if I missed anything.

r? @nagisa
2017-05-08 15:49:03 +00:00
Mark Simulacrum
6ebbe0ef50 Re-add LALR grammar. 2017-05-08 09:47:05 -06:00
Ariel Ben-Yehuda
052d071bb2 try to fix lvalue ops for real
Hopefully this is the last PR needed.

Fixes #41726.
Fixes #41742.
Fixes #41774.
2017-05-08 17:05:03 +03:00
Masaki Hara
0e8e45c740
Allow bare CR in ////-style comment. 2017-05-08 22:29:24 +09:00
Guillaume Gomez
95a94e3d3d Add markdown-[before|after]-content options 2017-05-08 14:25:01 +02:00
bors
198917bb4f Auto merge of #41745 - oli-obk:diagnostics, r=jonathandturner
Remove need for &format!(...) or &&"" dances in `span_label` calls

These were always a thorn in my eye. Note that this will monomorphize to two impls, one for `String` and one for `&str`. But I think that cost is worth the ergonomics at the call sites that can be seen throughout this PR.
2017-05-08 12:00:22 +00:00
Oliver Schneider
dd87eabd83 Remove need for &format!(...) or &&"" dances in span_label calls 2017-05-08 12:56:15 +02:00
Michael Woerister
6a5e2a5a9e incr.comp.: Hash more pieces of crate metadata to detect changes there. 2017-05-08 12:31:26 +02:00
bors
70198a0a44 Auto merge of #41818 - michaelwu:hvx-v60, r=nagisa
Add support for Hexagon v60 HVX intrinsics

HVX is a SIMD coprocessor available on newer hexagon cores. It can be configured for 512 or 1024 bit registers, and some instructions use pairs of registers. It only does integer operations, but it probably has every integer operation you'd want for 8/16/32 bit elements.

There are a lot of intrinsics. The generator outputs 582 of them. I probably got some wrong. I did some scripting to make sure that every llvm intrinsic name exists, but intrinsic names provided for programs have only been compared by eye to Qualcomm's own names. 64/128 is also appended to the names to select between 512/1024 bit. The C intrinsics don't do this, but they only expose one set, selected at compile time.

The json specifying the intrinsics required a bit of duplication since I didn't see an easy way to specify combinations of signed/unsigned types (eg. u(8-16) and s(16-32)). I also didn't see an easy way to specify variants of instructions like saturating or rounding.

Basic multiplication and load/store tested on the hexagon simulator.
2017-05-08 05:29:24 +00:00
achernyak
1f532bfed5 is_exported_symbol 2017-05-07 21:05:31 -05:00
bors
9956e81c19 Auto merge of #41729 - ubsan:master, r=nrc
Delete features which are easily removed, in libsyntax
2017-05-07 22:59:30 +00:00
Dennis Schridde
cf05cd8abf bootstrap: Output name of failed config in case of errors 2017-05-07 23:20:28 +02:00
Felix Raimundo
03c9510525 Fix typos in thread::park documentation. 2017-05-07 21:50:44 +02:00
Michael Wu
cc4efd1370 Add support for Hexagon v60 HVX intrinsics 2017-05-07 15:07:36 -04:00
bors
d985625b3c Auto merge of #41811 - gamazeps:thread-panicking-doc, r=frewsxcv
[DOC] Improve `thread::panicking` documentaion.

Part of #29378

Takes care of: `panicking` could use some more advice on when to use this.

I mays have done a poor choice of introducing `Mutex`s.

r? @steveklabnik
2017-05-07 18:58:14 +00:00
Felix Raimundo
c9e5eab6ff Update the thread::Thread documentation.
- Copied the module documentation to `Thread`.
- Removed the example because it did not use any method of Thread.
2017-05-07 19:31:20 +02:00
Felix Raimundo
ddb9e50b45 Add stack size doc to thread::spawn.
Part of #29378
2017-05-07 19:31:17 +02:00