Commit Graph

73290 Commits

Author SHA1 Message Date
varkor
087bffa78c Remove RangeInclusive::sum 2018-01-04 12:36:43 +00:00
Michael Woerister
30d921fb1e Span Encoding: Replace if with debug_assertion() and add some comments. 2018-01-04 13:13:32 +01:00
Michael Woerister
4aa48a3241 Map invalid Spans to DUMMY_SP during crate metadata encoding.
This mirrors what we for stabilizing the incr. comp. cache and is
necessary for reproducible builds.
2018-01-04 11:26:47 +01:00
bors
4cd918c4ca Auto merge of #47147 - projektir:to_ptr_cast, r=eddyb
Force appropriate extension when converting from int to ptr #43291

Fixes #43291.

Looking for feedback if I've missed something and/or need to add more tests.

@eddyb @retep998 @nagisa @oli-obk
2018-01-04 09:54:15 +00:00
Sebastian Dröge
b69c124255 Fix potential overflow in TrustedRandomAccess impl for slice::{Chunks,ChunksMut} 2018-01-04 11:34:05 +02:00
Michael Woerister
238ed47d29 Generate code for const- and inline-fns if -Clink-dead-code is specified. 2018-01-04 10:12:20 +01:00
Björn Steinbrink
7e522b2f0e Simplify LLVMRustModuleCost() 2018-01-04 08:57:14 +01:00
Björn Steinbrink
493c29d35a Remove unused function LLVMRustGetValueContext()
Refs #46437
2018-01-04 08:57:14 +01:00
Björn Steinbrink
d7bbd3042c Remove outdated LLVMRustBuildLandingPad() wrapper
The function was added as a wrapper to handle compatibility with older
LLVM versions that we no longer support, so it can be removed.

Refs #46437
2018-01-04 08:57:14 +01:00
bors
78f24d86b8 Auto merge of #47124 - estebank:loan-paths, r=nikomatsakis
Reword reason for move note

On move errors, when encountering an enum variant, be more ambiguous and do not refer to the type on the cause note, to avoid referring to `(maybe as std::prelude::v1::Some).0`, and instead refer to `the value`.

Sidesteps part of the problem with #41962:

```
error[E0382]: use of partially moved value: `maybe`
 --> file.rs:5:30
  |
5 |         if let Some(thing) = maybe {
  |                     -----    ^^^^^ value used here after move
  |                     |
  |                     value moved here
  = note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `(maybe as std::prelude::v1::Some).0`
 --> file.rs:5:21
  |
5 |         if let Some(thing) = maybe {
  |                     ^^^^^ value moved here in previous iteration of loop
  = note: move occurs because the value has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait

error: aborting due to 2 previous errors
```

Previous discussion: #44360

r? @arielb1
2018-01-04 05:52:39 +00:00
Esteban Küber
87242f3cc7 Provide suggestion when trying to use method on numeric literal 2018-01-03 21:46:43 -08:00
bors
608aae904b Auto merge of #47132 - cramertj:impl-trait-camel-case, r=nikomatsakis
Limit style lint to non-synthetic generic params

Fix https://github.com/rust-lang/rust/issues/46959

r? @nikomatsakis
2018-01-04 03:12:39 +00:00
varkor
29e6b1034b Add max and sum specialisations for Range 2018-01-04 01:51:18 +00:00
Eduard-Mihai Burtescu
210ac01792 rustc: use {U,I}size instead of {U,I}s shorthands. 2018-01-04 03:12:04 +02:00
varkor
3d9c36fbf5 Add min specialisation for RangeFrom and last for RangeInclusive 2018-01-04 00:58:41 +00:00
Eduard-Mihai Burtescu
9599066dcb rustc: remove misleading Ty::is_uint method. 2018-01-04 02:32:39 +02:00
varkor
680ebf7b16 Add min and max specialisations for RangeInclusive 2018-01-04 00:17:36 +00:00
Esteban Küber
a4d46b3d87 Tweak to mir borrow in a loop diagnostic 2018-01-03 14:13:32 -08:00
Esteban Küber
e027f5a99e Add mir test, review comments 2018-01-03 13:55:40 -08:00
bors
0a3761e63e Auto merge of #46984 - arielb1:pre-statement-effect, r=nikomatsakis
NLL fixes

First, introduce pre-statement effects to dataflow to fix #46875. Edge dataflow effects might make that redundant, but I'm not sure of the best way to integrate them with liveness etc., and if this is a hack, this is one of the cleanest hacks I've seen.

And I want a small fix to avoid the torrent of bug reports.

Second, fix linking of projections to fix #46974

r? @pnkfelix
2018-01-03 21:06:21 +00:00
Stjepan Glavina
6076cf6f4e Remove T: Ord bound from BTreeSet::{is_empty, len} 2018-01-03 20:00:11 +01:00
Ed Schouten
05949b09a8 Explain why local-exec is used by CloudABI. 2018-01-03 18:32:41 +01:00
Steve Klabnik
50989cd98d
This is an unstable feature 2018-01-03 12:05:57 -05:00
bors
d96cc6e286 Auto merge of #47127 - EdSchouten:cloudabi-tests, r=kennytm
First cut at getting some part of the test suite working for CloudABI

I am currently working on creating a Docker container for automated CI for CloudABI. Here are some of the trivial changes that need to land to make tests pass.
2018-01-03 17:00:24 +00:00
Steve Klabnik
47e18e0db7
This isn't in Rust 1.23 2018-01-03 11:58:42 -05:00
Vadim Petrochenkov
ef2b131144 Add docs for crate_in_paths, extern_in_paths and extern_absolute_paths into the unstable book 2018-01-03 19:18:02 +03:00
Marco A L Barbosa
00b5413087 ci: use musl shared script in dist-i586-gnu-i686-musl 2018-01-03 13:49:13 -02:00
Marco A L Barbosa
10a759130e ci: use musl shared script in dist-various-1 (for arm targets)
Update libunwind to 39. This is necessary to build the arm targets
2018-01-03 13:49:13 -02:00
Marco A L Barbosa
ca0499d736 ci: use musl shared script in dist-x86_64-musl 2018-01-03 13:49:13 -02:00
Vadim Petrochenkov
32db83b16e Support extern in paths 2018-01-03 18:09:20 +03:00
Sam
28dd4d974e Restore working debuginfo tests by trimming comments from non-header directive lines 2018-01-03 15:03:00 +00:00
Ed Schouten
3ca407e24b Restore a FIXME that was removed by one of my previous changes.
Requested by: kennytm
2018-01-03 15:40:37 +01:00
Sebastian Dröge
3f29e2b495 Fix compilation of TrustedRandomAccess impl for slice::Chunks
https://github.com/rust-lang/rust/pull/47113 renamed the private size
field to chunk_size for consistency.
2018-01-03 15:05:18 +02:00
Sebastian Dröge
a56a3fc85f Add unit test for zipping slice::{Chunks, ChunksMut, Windows} iterators
For testing if the TrustedRandomAccess implementation works.
2018-01-03 15:05:18 +02:00
Sebastian Dröge
48f2f71185 Implement TrustedRandomAccess for slice::{Chunks, ChunksMut, Windows} 2018-01-03 15:05:18 +02:00
bors
8d1a30289e Auto merge of #46913 - Eh2406:master, r=eddyb
CStore switch FxHashMap to IndexVec

This is a first attempt to fix #46876.
2018-01-03 12:59:52 +00:00
bors
b107f720e5 Auto merge of #47151 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

- Successful merges: #47104, #47107, #47113, #47117, #47118, #47121, #47125, #47134, #47145
- Failed merges:
2018-01-03 10:07:39 +00:00
kennytm
b416119472 Rollup merge of #47145 - frewsxcv:frewsxcv-linewriter-error, r=QuietMisdreavus
Document when LineWriter flushes; document errors for into_inner.

Fixes https://github.com/rust-lang/rust/issues/42468.
2018-01-03 16:58:04 +08:00
kennytm
08501bd983 Rollup merge of #47134 - Sogomn:master, r=QuietMisdreavus
Defocus search bar in rustdoc pages

rust-lang/rfcs#2265
2018-01-03 16:58:03 +08:00
kennytm
bf3fd1744c Rollup merge of #47125 - daboross:patch-3, r=estebank
Mention SliceConcatExt's stability in its docs

Just saw someone in IRC mention there being no stable way to join string slices! It isn't entirely clear from the rust documentation that `SliceConcatExt` is usable. While this is mentioned in https://doc.rust-lang.org/std/prelude/, the trait has nothing to indicate that it's currently usable if found via a documentation search.

The wording on this could probably be improved, but I'm hoping its better than nothing.
2018-01-03 16:58:02 +08:00
kennytm
8bfb420d63 Rollup merge of #47121 - frewsxcv:frewsxcv-vec, r=kennytm
Fix panic condition docs for Vec::insert.

Fixes https://github.com/rust-lang/rust/issues/47065.
2018-01-03 16:58:01 +08:00
kennytm
2182f1431c Rollup merge of #47118 - hdhoang:patch-2, r=BurntSushi
memchr: fix variable name in docstrings

upstream BurntSushi/rust-memchr#24

r=BurntSushi
2018-01-03 16:58:00 +08:00
kennytm
d6cf5a56ac Rollup merge of #47117 - tinaun:no_more_dups, r=frewsxcv
[unstable book] remove duplicate entries

if a unstable feature is a language feature, it shouldn't also have a library feature stub generated
2018-01-03 16:57:58 +08:00
kennytm
219e72c908 Rollup merge of #47113 - sdroege:chunks-size-field, r=dtolnay
Minor cleanup for slice::Chunks and ChunksMut

This only renames the `size` field to `chunk_size` in one of them for consistency, and changes an assertion to check for != 0 instead of > 0.
2018-01-03 16:57:57 +08:00
kennytm
dd0b70e3fe Rollup merge of #47107 - mark-i-m:patch-1, r=steveklabnik
Fix typo

I am assuming that there was once something else you could do and somebody forgot to remove "either". Is that correct?
2018-01-03 16:57:56 +08:00
kennytm
f7932ef1d5 Rollup merge of #47104 - matthewjasper:dont-panic-on-generic-drop, r=estebank
Delay panic from incoherent drop implementation

Closes #41974
2018-01-03 16:57:55 +08:00
Sergio Benitez
ab365be140 Add 'Span.parent()' and 'Span.source()' to proc_macro API. 2018-01-03 00:20:33 -08:00
David Tolnay
000e907c1f
Span::resolved_at and Span::located_at to combine behavior of two spans
Proc macro spans serve two mostly unrelated purposes: controlling name
resolution and controlling error messages. It can be useful to mix the
name resolution behavior of one span with the line/column error message
locations of a different span.

In particular, consider the case of a trait brought into scope within
the def_site of a custom derive. I want to invoke trait methods on the
fields of the user's struct. If the field type does not implement the
right trait, I want the error message to underline the corresponding
struct field.

Generating the method call with the def_site span is not ideal -- it
compiles and runs but error messages sadly always point to the derive
attribute like we saw with Macros 1.1.

```
  |
4 | #[derive(HeapSize)]
  |          ^^^^^^^^
```

Generating the method call with the same span as the struct field's
ident or type is not correct -- it shows the right underlines but fails
to resolve to the trait in scope at the def_site.

```
  |
7 |     bad: std:🧵:Thread,
  |     ^^^^^^^^^^^^^^^^^^^^^^^^
```

The correct span for the method call is one that combines the def_site's
name resolution with the struct field's line/column.

```
field.span.resolved_at(Span::def_site())

// equivalently
Span::def_site().located_at(field.span)
```

Adding both because which one is more natural will depend on context.
2018-01-02 23:43:52 -08:00
David Tolnay
2b9add2c16
Return None from Span::join if in different files 2018-01-02 23:37:36 -08:00
bors
b8934399a8 Auto merge of #47088 - clarcharr:cleanup_unicode_py, r=alexcrichton
Move static code outside of unciode.py.

This script in libstd_unicode is a mess and also contains code that shouldn't be output by a script, and instead just put in modules. So, this change does that.
2018-01-03 06:24:23 +00:00