Commit Graph

60166 Commits

Author SHA1 Message Date
Mark Simulacrum
b01b6e1d56 Fix errors introduced during rebase 2017-01-04 11:47:43 -07:00
Mark Simulacrum
21f86ba1bc Simplify handling of dropping structs. 2017-01-04 11:38:11 -07:00
Mark Simulacrum
7dadd14d6c Pull out downcasting into caller of iter_variant
Renames iter_variant to iter_variant_fields to more clearly communicate
the purpose of the function.
2017-01-04 11:38:11 -07:00
Mark Simulacrum
d25fc9ec5f Remove extraneous setting of builder positions. 2017-01-04 11:38:11 -07:00
Mark Simulacrum
ca328e1bb4 Simplify code further 2017-01-04 11:38:11 -07:00
Mark Simulacrum
c3fe2590f5 Inline and remove Builder::entry_block 2017-01-04 11:38:10 -07:00
Mark Simulacrum
ba37c91831 Fix style nit 2017-01-04 11:38:10 -07:00
Mark Simulacrum
901984e1d1 Builder.build_new_block -> Builder.build_sibling_block 2017-01-04 11:38:10 -07:00
Mark Simulacrum
81e8137b0d Inline trans_switch to simplify code 2017-01-04 11:38:10 -07:00
Mark Simulacrum
426c558c5a Move trans_field_ptr and struct_field_ptr to mir/lvalue 2017-01-04 11:38:09 -07:00
Mark Simulacrum
982b8f4f49 Move trans_const to mir::constant 2017-01-04 11:37:44 -07:00
Mark Simulacrum
ea0ebe41c7 Change trans_field_ptr to utilize LvalueTy to determine discriminant. 2017-01-04 11:37:42 -07:00
Mark Simulacrum
8038489357 Use LvalueRef instead of MaybeSizedValue 2017-01-04 11:35:33 -07:00
Mark Simulacrum
4c9995a3f9 Simpliy block creation in MirContext 2017-01-04 11:34:27 -07:00
Mark Simulacrum
37dd9f6c7b Add Builder::sess and Builder::tcx methods 2017-01-04 11:34:26 -07:00
Mark Simulacrum
f67e7d6b4a Add method, new_block, to MirContext for block construction.
This makes a slow transition to block construction happening only from
MirContext easier.
2017-01-04 11:34:00 -07:00
Mark Simulacrum
937e8da349 Purge FunctionContext 2017-01-04 11:33:59 -07:00
Mark Simulacrum
1be170b01a Replace BlockAndBuilder with Builder. 2017-01-04 11:33:31 -07:00
bors
d40d01bd0e Auto merge of #38670 - dotdash:transmute_align, r=eddyb
Fix transmute::<T, U> where T requires a bigger alignment than U

For transmute::<T, U> we simply pointercast the destination from a U
pointer to a T pointer, without providing any alignment information,
thus LLVM assumes that the destination is aligned to hold a value of
type T, which is not necessarily true. This can lead to LLVM emitting
machine instructions that assume said alignment, and thus cause aborts.

To fix this, we need to provide the actual alignment to store_operand()
and in turn to store() so they can set the proper alignment information
on the stores and LLVM can emit the proper machine instructions.

Fixes #32947
2017-01-04 14:26:17 +00:00
bors
9c0e373f91 Auto merge of #38773 - sanxiyn:rustdoc-ice, r=steveklabnik
Avoid rustdoc ICE when an unstable feature is used

Fix #36159.
2017-01-04 09:24:24 +00:00
bors
e06ce71d0b Auto merge of #38552 - eddyb:bad-blocks, r=arielb1
Don't leak the compiler's internal representation of scopes in error messages.

Fixes #37884 (actually fixes #27942, which was made worse by #37412) by handling more node types.
Ideally we'd turn the unknown node type situations into ICEs and fix them as they show up in errors.
But we might want to backport this patch so I was less aggressive.
2017-01-04 06:29:14 +00:00
bors
01677eeef2 Auto merge of #38707 - redox-os:master, r=brson
Add socket timeout and ttl support in `sys::redox`

This adds support for `read_timeout`, `write_timeout`, and `ttl` on `TcpStream`, `TcpListener`, and `UdpSocket` in the `sys::redox` module.

The DNS lookup has been set to use a 5 second timeout by default.
2017-01-04 04:28:15 +00:00
Eduard-Mihai Burtescu
987f52f4f5 Update for changes to TraitItem on master. 2017-01-04 05:48:18 +02:00
Eduard-Mihai Burtescu
bb04da4822 Don't leak the compiler's internal representation of scopes in error messages. 2017-01-04 05:48:18 +02:00
bors
a68622c899 Auto merge of #38809 - alexcrichton:rustbuild-fresh, r=brson
rustbuild: Fix a few rebuilding issues

Did a bit of investigation and found a few small unrelated issues, but this should help clean up a lot of errors we've been seeing locally.
2017-01-04 01:51:06 +00:00
bors
468227129d Auto merge of #38066 - bluss:string-slice-error, r=sfackler
Use more specific panic message for &str slicing errors

Separate out of bounds errors from character boundary errors, and print
more details for character boundary errors.

It reports the first error it finds in:

1. begin out of bounds
2. end out of bounds
3. begin <= end violated
3. begin not char boundary
5. end not char boundary.

Example:

    &"abcαβγ"[..4]

    thread 'str::test_slice_fail_boundary_1' panicked at 'byte index 4 is not
    a char boundary; it is inside 'α' (bytes 3..5) of `abcαβγ`'

Fixes #38052
2017-01-03 23:51:42 +00:00
Jeremy Soller
c6858a1429 Revert cargo.lock 2017-01-03 15:47:14 -07:00
Jeremy Soller
537b3aa3fd Remove -lc, -lm from the target spec - the cross compiler will link those 2017-01-03 15:42:41 -07:00
Alex Crichton
3ab778b4af rustbuild: Update where we look for mtime changes
Recent versions of Cargo lift less output up into the "main" directory, so let's
look more inside the `deps` folder for changes to propagate differences.

Closes #38744
Closes #38746
2017-01-03 14:17:02 -08:00
Alex Crichton
753dff63c6 rustbuild: Allow create_sysroot in stage0
Despite what the comment says, we actually need to do this. We're not cleaning
out the stage0 compiler's sysroot, but rather just our own sysroot that we
assembled previously.
2017-01-03 14:07:30 -08:00
bors
8f62c29200 Auto merge of #38473 - zackmdavis:issue_kebab, r=sanxiyn
prefer hyphens in test files named after issue numbers

We have a lot of tests with filenames honoring particular issues by
number. Typically, these are called issue-${issue_no}.rs (note the
hyphen):

```
$ find . -regextype posix-egrep -regex '.*/issue-[0-9]*.rs' | wc
   1289    1289   35935
```

We also had a much smaller number of files that are like this, but don't
have a hyphen in between the substring `issue` and the number:

```
$ find . -regextype posix-egrep -regex '.*/issue[0-9]*.rs'
./debuginfo/issue14411.rs
./debuginfo/issue12886.rs
./debuginfo/issue13213.rs
./debuginfo/issue22656.rs
./debuginfo/issue7712.rs
./compile-fail/issue32829.rs
./run-pass/issue24353.rs
./run-pass/issue34796.rs
./run-pass/issue18173.rs
./run-pass/issue22346.rs
./run-pass/auxiliary/issue13507.rs
./run-pass/issue26127.rs
./run-pass/issue22008.rs
./run-pass/issue34569.rs
./run-pass/issue29927.rs
./run-pass/issue36260.rs
```

Some would argue that the inconsistency is æsthetically displeasing,
hence this trivial patch. (Note that run-pass/auxiliary/issue13507.rs
has an excuse; it's `use`d in run-pass/issue-13507-2.rs; the matter of
there being two different compile-fail tests with different name
conventions for issue no. 32829 is also neglected here for the sake of
keeping this trivial cleanup patch as trivial as possible for ease of
review.)
2017-01-03 09:42:22 +00:00
bors
7766b509b3 Auto merge of #38791 - dylanmckay:foreign-item-dc, r=eddyb
Don't warn about dead foreign items if the 'allow(dead_code)' attribute is present

This functionality was missing, and should have existed previously.

Fixes #38780
2017-01-03 07:41:43 +00:00
bors
1659d65e03 Auto merge of #38782 - clarcharr:stupid, r=GuillaumeGomez
Reword 'stupid' and 'crazy' in docs.

These terms are not very descriptive and are better reworded as something else.
2017-01-03 02:21:00 +00:00
Dylan McKay
09178e455e Don't warn about dead foreign items if the 'allow(dead_code)' attribute is present
This functionality was missing, and should have existed previously.

Fixes #38780
2017-01-03 14:54:15 +13:00
Clar Charr
8ffc3e7790 Reword 'stupid' and 'crazy' in docs. 2017-01-02 16:29:19 -05:00
bors
d3a2efa14b Auto merge of #38543 - philipc:unsized-debuginfo, r=michaelwoerister
Fix debuginfo for unsized struct members

The member was given the size of a fat pointer, which caused
llvm to emit DWARF attributes for a 128-bit bitfield.
2017-01-02 20:17:01 +00:00
bors
9953e76ca4 Auto merge of #38760 - est31:ignorecfg, r=sanxiyn
Fix pre-cfg_attr notation in comment

Commit aa3b1261b1 has changed notation
in the test from `#[ignore(cfg(ignorecfg))]` to `#[cfg_attr(ignorecfg, ignore)]`,
but missed to change the comment in the accompanying Makefile.
2017-01-02 18:10:37 +00:00
bors
df61658c8a Auto merge of #38766 - eddyb:less-fake-hir, r=arielb1
Stop creating fake HIR pattern nodes.

This replaces all the HIR patterns `rustc_const_eval` creates with the more appropriate HAIR equivalent.

The only place left that creates HIR nodes is the "explicit lifetimes in function signature" suggestion, which only creates type nodes while rebuilding the signature, but that is only in case of an error.

cc @arielb1
2017-01-02 13:51:43 +00:00
Seo Sanghyeon
631955888e Avoid rustdoc ICE when an unstable feature is used 2017-01-02 20:32:58 +09:00
bors
07191e2b11 Auto merge of #38548 - GuillaumeGomez:thread_struct_docs, r=frewsxcv
Add missing example for Thread struct

r? @frewsxcv
2017-01-01 22:45:02 +00:00
bors
917e5baae7 Auto merge of #38765 - xen0n:i-dont-like-red-bots-2, r=alexcrichton
rustbuild: fix dist-analysis with full bootstrap disabled

Really fixes #38734, per discussion in #38752 which was solving the underlying problem the wrong way.

This just mirrors the [similar logic] in documentation building as suggested, that just takes the stage1 compiler artifacts instead in case of non-full-bootstrap builds. Actually copying the artifacts around seems to be unnecessary.

r? @alexcrichton

[similar logic]: 7b659cfdbc/src/bootstrap/doc.rs (L140-L144)
2017-01-01 20:43:21 +00:00
Eduard-Mihai Burtescu
c6e130e89b rustc_const_eval: convert constants to Pattern instead of hir::Pat. 2017-01-01 22:17:18 +02:00
Wang Xuerui
24c7340e3e
rustbuild: fix dist-analysis with full bootstrap disabled 2017-01-02 04:12:49 +08:00
est31
2dc2284808 Fix pre-cfg_attr notation in comment
Commit aa3b1261b1 has changed notation
in the test from `#[ignore(cfg(ignorecfg))]` to `#[cfg_attr(ignorecfg, ignore)]`,
but missed to change the comment in the accompanying Makefile.
2017-01-01 20:34:23 +01:00
Eduard-Mihai Burtescu
c001b0940c rustc_const_eval: build Pattern instead of hir::Pat for pretty-printing. 2017-01-01 20:57:21 +02:00
bors
4947adaa8c Auto merge of #38692 - estebank:remove-try-from-pprust, r=petrochenkov
Use `?` instead of `try!` macro in `print::pprust`
2017-01-01 18:42:34 +00:00
bors
7b659cfdbc Auto merge of #38753 - philipc:debuginfo-union, r=petrochenkov
Add pretty printing of unions in debuggers

Fixes #37479
2017-01-01 16:41:29 +00:00
bors
ac5cd3bd43 Auto merge of #38745 - CannedYerins:llvm-code-style, r=rkruppe
Improve naming style in rustllvm.

As per the LLVM style guide, use CamelCase for all locals and classes,
and camelCase for all non-FFI functions.
Also, make names of variables of commonly used types more consistent.

Fixes #38688.

r? @rkruppe
2017-01-01 11:58:02 +00:00
bors
e1279a0b30 Auto merge of #38726 - japaric:sparc64, r=sanxiyn
sparc64-linux support

This is built on top of #38656 and depends on rust-lang/libc#483

Hello world works.

The libc-test test suite passes.

`panic!` doesn't fully work:

```
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Illegal instruction (core dumped)
```

Backtraces don't work either, probably related to the previous point:

```
$ export RUST_BACKTRACE=1
$ qemu-sparc64-static ./panic
thread 'main' panicked at 'explicit panic', panic.rs:1
stack backtrace:
Illegal instruction (core dumped)
```

r? @alexcrichton

@jakllsch Does panicking / backtraces work on sparc64-netbsd?

cc @glaubitz
2017-01-01 09:56:18 +00:00
Philip Craig
1765a3fd30 Add pretty printing of unions in debuggers
Fixes #37479
2017-01-01 19:34:06 +10:00