Commit Graph

61928 Commits

Author SHA1 Message Date
Corey Farwell
84ad515793 Rollup merge of #39707 - durka:parsimonious-span-note, r=jonathandturner
change span_notes to notes in E0368/E0369

Fixes #39650.

All the uses of `span_note` in these errors were reusing the same span as the original error, which causes unnecessary repetition.

For an example, see the changes to [src/test/ui/span/issue-39018.stderr](https://github.com/rust-lang/rust/pull/39707/files?diff=unified#diff-46336f62958fdb34233db414cb9914a1R4).

r? @jonathandturner
2017-02-09 19:43:26 -05:00
Corey Farwell
3199b2478a Rollup merge of #39705 - tspiteri:name-trait-fn-params, r=aturon
name anonymous fn parameters in libcore traits

This follows the discussion in rust-lang/rfcs#1685. The patch gives names to anonymous parameters in libcore traits. It would have two benefits I can think of: firstly it would provide names to tools that can use the names from the traits, and secondly core/std can serve as an example when writing traits; this change helps by not encouraging the use of anonymous parameters.
2017-02-09 19:43:25 -05:00
Corey Farwell
af1ddb9ec5 Rollup merge of #39700 - msopena:master, r=est31
Adding compile fail test for const_indexing feature

First attempt at contributing to rust. Picked up an easy feature to test.

Issue #39059
r? @est31
2017-02-09 19:43:24 -05:00
Corey Farwell
ae5d8fc929 Rollup merge of #39693 - durka:patch-36, r=petrochenkov
driver: restore partially deleted comment

Fixes #39689. Comment was lost in commit 811b8747 (#31916 @nagisa).
2017-02-09 19:43:23 -05:00
Corey Farwell
ed7f3c4635 Rollup merge of #39674 - jseyfried:fix_token_tree_parsing_ICE, r=nrc
parser: fix ICE when parsing token trees after an error

Fixes #39388, fixes #39616.
r? @nrc
2017-02-09 19:43:21 -05:00
Corey Farwell
41653fd26a Rollup merge of #39587 - Keruspe:master, r=alexcrichton
rustbuild: support setting verbosity in config.toml

Most if not all the configuration is settable trhough config.toml but the verbosity isn't yet.

This avoids having to pass -v to x.py on each command if you want verbosity to be always on.
2017-02-09 19:43:20 -05:00
Brian Anderson
e491f39914 Update 1.15.1 relnotes 2017-02-10 00:30:02 +00:00
Alex Burka
9fffd14171 change span_notes to notes in E0368/E0369 2017-02-09 22:45:42 +00:00
Jethro Beekman
ba82a76db9 Update set operations documentation
Reminding people of set terminology.
2017-02-09 14:16:16 -08:00
bors
24a70eb598 Auto merge of #39694 - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests

- Successful merges: #39604, #39619, #39670, #39678, #39682, #39683
- Failed merges:
2017-02-09 21:58:10 +00:00
Trevor Spiteri
e626a6807c name anonymous fn parameters in libcore traits 2017-02-09 22:31:21 +01:00
Sean Griffin
b3937ea862 Explicitly mention that Vec::reserve is based on len not capacity
I spent a good chunk of time tracking down a buffer overrun bug that
resulted from me mistakenly thinking that `reserve` was based on the
current capacity not the current length. It would be helpful if this
were called out explicitly in the docs.
2017-02-09 13:58:48 -05:00
Mario
ec4a3cc371 Adding compile fail test for const_indexing feature 2017-02-09 19:39:46 +01:00
Michael Howell
bc4ad1a2c9 Add the short type to inline links, too 2017-02-09 11:02:01 -07:00
Michael Howell
fce944d4e7 Add the item type to the tooltip
See:
https://users.rust-lang.org/t/seeking-opinions-from-colorblind-rustaceans-coloring-in-rustdoc-code-blocks
2017-02-09 10:38:29 -07:00
Corey Farwell
55c17a5994 Rollup merge of #39683 - solson:fix-unaligned-load-librustc_metadata, r=bluss
Fix unaligned load in librustc_metadata::index.

The derived `Clone` impl contains UB and will be unsafe when we fix https://github.com/rust-lang/rust/issues/27060. See [this comment](https://github.com/rust-lang/rust/issues/27060#issuecomment-278617096) for more context.

r? @bluss
2017-02-09 12:14:24 -05:00
Corey Farwell
7e2b2f30cd Rollup merge of #39682 - solson:fix-unaligned-read, r=eddyb
Fix unsafe unaligned loads in test.

r? @eddyb
cc @Aatch @nikomatsakis

The `#[derive(PartialEq, Debug)]` impls on a packed struct contain undefined behaviour. Both generated impls take references to unaligned fields, which will fail to compile once we correctly treat that as unsafe (see https://github.com/rust-lang/rust/issues/27060).

This UB was found by running the test under [Miri](https://github.com/solson/miri/) which rejects these unsafe unaligned loads. 😄

Here's a simpler example:

```rust
struct Packed {
    a: u8,
    b: u64,
}
```

It expands to:

```rust
    fn fmt(&self, __arg_0: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        match *self {
            Packed { a: ref __self_0_0, b: ref __self_0_1 } => { // BAD: these patterns are unsafe
                let mut builder = __arg_0.debug_struct("Packed");
                let _ = builder.field("a", &&(*__self_0_0));
                let _ = builder.field("b", &&(*__self_0_1));
                builder.finish()
            }
        }
    }
```

and

```rust
    fn eq(&self, __arg_0: &Packed) -> bool {
        match *__arg_0 {
            Packed { a: ref __self_1_0, b: ref __self_1_1 } => // BAD: these patterns are unsafe
            match *self {
                Packed { a: ref __self_0_0, b: ref __self_0_1 } => // BAD: these patterns are unsafe
                true && (*__self_0_0) == (*__self_1_0) &&
                    (*__self_0_1) == (*__self_1_1),
            },
        }
    }
```
2017-02-09 12:14:23 -05:00
Corey Farwell
7bd0da7e89 Rollup merge of #39678 - vadimcn:top-level-expn, r=michaelwoerister
Exclude top-level macro expansions from source location override.

It occurred to me that a simple heuristic can address the issue #36382: any macros that expand into items (including `include!()`) don't need to be stepped over because there's not code to step through above a function scope level.

r? @michaelwoerister
2017-02-09 12:14:22 -05:00
Corey Farwell
711b95f6b1 Rollup merge of #39670 - JanZerebecki:fix-mailmap-gifnksm, r=steveklabnik
Fix mailmap for @gifnksm

cc rust-lang-nursery/thanks#71
2017-02-09 12:14:21 -05:00
Corey Farwell
3eaca413fe Rollup merge of #39619 - michaelwoerister:rename-crate-metadata, r=alexcrichton
Choose different name for metadata obj-file to avoid clashes with user-chosen names.

Fixes #39585 and probably https://github.com/rust-lang/rust/issues/39508.
Incremental compilation assigns different names to obj-files than regular compilation. If a crate is called "metadata" this can lead to a clash between the root module's obj-file and the obj-file containing crate-metadata. This PR assigns a name to the metadata obj-file that cannot clash with other obj-file because it contains a `.` which is not allowed in a Rust module identifier.

r? @alexcrichton

cc @nikomatsakis
2017-02-09 12:14:19 -05:00
Corey Farwell
a05cc5ca9d Rollup merge of #39604 - est31:i128_tests, r=alexcrichton
Unignore u128 test for stage 0,1

Even more SNAP cleanup.

Follow-up of #39519.

Sorry, I didn't check twice.
2017-02-09 12:14:18 -05:00
bors
4053276354 Auto merge of #38109 - tromey:main-subprogram, r=michaelwoerister
Emit DW_AT_main_subprogram

This changes rustc to emit DW_AT_main_subprogram on the "main" program.
This lets gdb suitably stop at the user's main in response to
"start" (rather than the library's main, which is what happens
currently).

Fixes #32620
r? michaelwoerister
2017-02-09 17:09:50 +00:00
Alex Burka
ca9c7ae61b driver: restore partially deleted comment 2017-02-09 12:07:58 -05:00
Oliver Schneider
c7f9811aba removed unused struct 2017-02-09 17:58:26 +01:00
Oliver Schneider
1095082eea remove wrong packed struct test 2017-02-09 17:55:39 +01:00
Andrew Cann
347bc77c2c Use global recursion limit when evaluating inhabitedness 2017-02-10 00:52:51 +08:00
bors
e7fc53b8f0 Auto merge of #39686 - frewsxcv:rollup, r=frewsxcv
Rollup of 5 pull requests

- Successful merges: #39595, #39601, #39602, #39615, #39647
- Failed merges:
2017-02-09 14:25:04 +00:00
Corey Farwell
116bdacf6b Rollup merge of #39647 - japaric:sparc, r=alexcrichton
build std for sparc64-unknown-linux-gnu

r? @alexcrichton

panicking / unwinding is broken (#39646) but with std available at least people
will be able to debug that issue on real hardware
2017-02-09 08:47:36 -05:00
Corey Farwell
8f65d7543b Rollup merge of #39615 - phungleson:corefloat, r=alexcrichton
Improve format float

* Move float into mod float like in test
* Add more tests for f64 f32, lower exp, upper exp, which can come if handy in the future if we want refactor further
* Use `assert_eq` for clearer error messages
2017-02-09 08:47:35 -05:00
Corey Farwell
e32e2d47d0 Rollup merge of #39602 - estebank:fix-39544, r=eddyb
Fix ICE when accessing mutably an immutable enum

Fix #39544.
2017-02-09 08:47:34 -05:00
Corey Farwell
f447c2b443 Rollup merge of #39601 - dumbbell:update-liblibc-to-include-aarch64-unknown-freebsd, r=alexcrichton
liblibc: Update to include `aarch64-unknown-freebsd` support
2017-02-09 08:47:33 -05:00
Corey Farwell
15decb86b2 Rollup merge of #39595 - camlorn:structured_repr, r=eddyb
Make reprs use a structured representation instead of a slice

This is needed for `-z reorder-fields`.  The old design uses a slice taken from HIR, plus a cache that lazily parses.  The new design stores it directly in the `AdtDef` as a `ReprOptions`.  We're doing this now because we need to be able to add reprs that don't necessarily exist in HIR for `-z reorder-fields`, but it needs to happen anyway.

`lookup_repr_hints` should be mostly deprecated.  I want to remove it from `layout` before closing this, unless people think that should be a separate PR.  The `[WIP]` is because of this.  The problem with closing this as-is is that the code here isn't actually testable until some parts of the compiler start using it.

r? @eddyb
2017-02-09 08:47:32 -05:00
bors
1129ce51a6 Auto merge of #39265 - est31:master, r=petrochenkov
Stabilize static lifetime in statics

Stabilize the "static_in_const" feature. Blockers before this PR can be merged:

* [x] The [FCP with inclination to stabilize](https://github.com/rust-lang/rust/issues/35897#issuecomment-270441437) needs to be over. FCP lasts roughly three weeks, so will be over at Jan 25, aka this thursday.
* [x] Documentation needs to be added (#37928)

Closes #35897.
2017-02-09 11:42:49 +00:00
Scott Olson
5eaa7c2d7d Fix unaligned load in librustc_metadata::index. 2017-02-09 03:38:52 -08:00
Scott Olson
2589f4a751 Fix indentation in test. 2017-02-09 03:10:33 -08:00
Scott Olson
b8b898093c Avoid unsafe unaligned loads in test. 2017-02-09 03:09:36 -08:00
Andrew Cann
2bb9c5875d Add recursion limit to inhabitedness check
Fixes #39489.
Add test aswell.
2017-02-09 17:34:45 +08:00
Marc-Antoine Perennou
ec73ef9dc8 Merge branch 'master' of git://github.com/rust-lang/rust
* 'master' of git://github.com/rust-lang/rust: (70 commits)
  sanitizer-dylib: only run where std for x86_64-linux is available
  travis: Fix build order of dist-x86-linux
  fix the sanitizer-dylib test on non x86_64 linux hosts
  dist-x86-linux: install newer kernel headers
  enable sanitizers on build job that tests x86_64 linux
  enable sanitizers on x86_64-linux releases
  use helper function in the rebuild logic of the rustc_*san crates
  build/test the sanitizers only when --enable-sanitizers is used
  sanitizer support
  Add missing urls on join_paths
  Add test for #27433
  Add more examples, get everything passing at last.
  Remove some leftover makefiles.
  Add more test for rustdoc --test
  Rename manifest_version to manifest-version
  reference: clarify #[cfg] section
  Bump stable release date
  rustbuild: Clean build/dist on `make clean`
  Add missing urls for current_dir
  review nits
  ...
2017-02-09 10:11:36 +01:00
bors
b0e46f03d8 Auto merge of #39586 - arielb1:packed-values, r=eddyb
emit "align 1" metadata on loads/stores of packed structs

According to the LLVM reference:
> A value of 0 or an omitted align argument means that the operation has
the ABI alignment for the target.

So loads/stores of fields of packed structs need to have their align set
to 1. Implement that by tracking the alignment of `LvalueRef`s.

Fixes #39376.

r? @eddyb
2017-02-09 09:02:43 +00:00
Andrew Cann
18be42c5d7 Fix tests 2017-02-09 16:36:20 +08:00
Andrew Cann
5429305e5d Add test for #39485 2017-02-09 15:43:25 +08:00
Andrew Cann
d87644cc0f Small inference fix
As per comment: https://github.com/rust-lang/rust/issues/39297#issuecomment-276810343
2017-02-09 15:43:25 +08:00
Alex Burka
b4993ec863 suggest doubling recursion limit in more situations 2017-02-09 06:40:23 +00:00
Vadim Chugunov
d113b39fbf Exclude top-level macro expansions from source location override. 2017-02-08 22:10:33 -08:00
bors
fd2f8a4536 Auto merge of #39677 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests

- Successful merges: #37928, #38699, #39589, #39598, #39599, #39641, #39649, #39653, #39671
- Failed merges:
2017-02-09 05:58:29 +00:00
Corey Farwell
1e3e904101 Rollup merge of #39671 - alexcrichton:change-order, r=brson
travis: Fix build order of dist-x86-linux

I just tried to build this container locally but it looks like connecting to
ftp.gnu.org requires SNI, so let's build curl/OpenSSL first to ensure that we've
got an SNI-capable client to download gcc/binutils with.
2017-02-08 23:55:51 -05:00
Corey Farwell
44fdf5bcd7 Rollup merge of #39653 - JanZerebecki:test-issue-27433, r=alexcrichton
Add test for #27433
2017-02-08 23:55:50 -05:00
Corey Farwell
4f8adb6831 Rollup merge of #39649 - GuillaumeGomez:join_paths-url, r=frewsxcv
Add missing urls on join_paths

r? @frewsxcv
2017-02-08 23:55:49 -05:00
Corey Farwell
ab7e51b2f7 Rollup merge of #39641 - Ms2ger:purge-mk, r=alexcrichton
Remove some leftover makefiles.
2017-02-08 23:55:48 -05:00
Corey Farwell
9f2795f7bd Rollup merge of #39599 - alexcrichton:cargo-tarball-name, r=brson
Fix a manifest-generation bug on beta

Right now all Cargo release tarballs are 'nightly', they're not on the standard
channels yet.
2017-02-08 23:55:47 -05:00