Commit Graph

51589 Commits

Author SHA1 Message Date
Niko Matsakis
43aed96d0d add assertion and comment about mutability 2016-03-18 18:40:22 -04:00
bors
02954ae0a8 Auto merge of #31977 - bluss:partial-eq-save, r=brson
derive: Avoid emitting provided PartialEq, PartialOrd methods for c-like enums

derive: Avoid emitting provided PartialEq, PartialOrd method for c-like enums

`ne` is completely symmetrical with the method `eq`, and we can save
rust code size and compilation time here if we only emit one of them
when possible.

One case where it's easy to recognize is when it's a C-like enum. Most
other cases can not omit ne, because any value field may have a custom
PartialEq implementation.
2016-03-18 14:36:49 -07:00
Niko Matsakis
25988b645d elide noop coercions 2016-03-18 17:19:52 -04:00
Niko Matsakis
bca07b5ebb make suggestion stuff not swallow errors
The older code would sometimes swallow errors or fail to produce a
suggestion. The newer code does not. However, just printing everything
would produce a bunch of new and kind of annoying errors, so continue
to swallow `T: 'a` errors so long as there are other things to show.
2016-03-18 16:38:52 -04:00
Niko Matsakis
5abacd36f0 add comment clarifying what edges are needed 2016-03-18 16:38:29 -04:00
Niko Matsakis
7f8d24590f fix coercion behavior for nested references 2016-03-18 16:38:29 -04:00
Niko Matsakis
cdaee4aba7 pick off some easy cases for LUB/GLB in regions
the goal here is to minimize creating variables
2016-03-18 16:38:29 -04:00
Niko Matsakis
ad6ca084e7 don't create region vars in LUB coercions
instead, extract the target region out of the autoderef loop
2016-03-18 16:38:29 -04:00
Niko Matsakis
00c9420160 rename unify to unify_and_identity 2016-03-18 16:38:29 -04:00
Niko Matsakis
1922041e7f change coercion to use target region if not LUB 2016-03-18 16:38:29 -04:00
Alex Burka
9d0748f7eb cfail test for #31886 2016-03-18 15:03:55 -04:00
Alex Burka
ee4b607dfb derive: assume enum repr defaults to isize
It was originally intended to be i32, but it isn't.

Fixes #31886.
2016-03-18 15:03:54 -04:00
bors
fc9e1d0f55 Auto merge of #32309 - aturon:overlap-warning, r=nikomatsakis
Change inherent overlap error to a warning for now, to ease the breakage

Closes #32247

r? @nikomatsakis
2016-03-18 11:30:30 -07:00
Aaron Turon
e477703bbf Change inherent overlap error to a warning for now, to ease the breakage. 2016-03-18 09:48:30 -07:00
Ulrik Sverdrup
2dbac1fb8e Add intrinsics for float arithmetic with fast flag enabled
`fast` a.k.a UnsafeAlgebra is the flag for enabling all "unsafe"
(according to llvm) float optimizations.

See LangRef for more information http://llvm.org/docs/LangRef.html#fast-math-flags

Providing these operations with less precise associativity rules (for
example) is useful to numerical applications.

For example, the summation loop:

    let sum = 0.;
    for element in data {
        sum += *element;
    }

Using the default floating point semantics, this loop expresses the
floats must be added in a sequence, one after another. This constraint
is usually completely unintended, and it means that no autovectorization
is possible.
2016-03-18 17:31:41 +01:00
Steven Fackler
797d520d2b Fix tidy 2016-03-18 09:30:36 -07:00
bors
24bb607e7d Auto merge of #32282 - sfackler:panic-hook, r=alexcrichton
Adjustments to the panic hook API

Rename `set_handler` and `take_handler` to `set_hook` and `take_hook` since we're not actually "handling" (i.e. fixing) anything.

Also alter `set_hook` to take a `Box<Fn(&PanicInfo) + 'static + Sync + Send>` rather than a parameterized closure since there's otherwise no easy way to re-register a hook that came from `take_hook`.

cc #30449

r? @aturon
2016-03-18 09:21:43 -07:00
Steven Fackler
b3ade68f27 Add a since to deprecations 2016-03-18 09:13:55 -07:00
Kevin Brothaler
8f99ad2a2a Update of the book; Error handling, section on custom error types: we should also show the changes to the cause method. 2016-03-18 11:40:45 -04:00
Tang Chenglong
2318e9fbe2 docs: Make some tiny modification about spelling 2016-03-18 23:29:12 +08:00
Björn Steinbrink
9e1d65975c Update LLVM to include a backport to restore AA performance
cc #31435
2016-03-18 15:51:17 +01:00
Guillaume Gomez
3aac461d40 Add doc examples 2016-03-18 15:47:33 +01:00
bors
235d77457d Auto merge of #32080 - eddyb:transcendent, r=nikomatsakis
Refactor call & function handling in trans, enable MIR bootstrap.

Non-Rust and Rust ABIs were combined into a common codepath, which means:
* The ugly `__rust_abi` "clown shoes" shim for C->Rust FFI is gone, fixes #10116.
* Methods, *including virtual ones* support non-Rust ABIs, closes #30235.
* Non-Rust ABIs also pass fat pointers in two arguments; the result should be identical.
* Zero-sized types are never passed as arguments; again, behavior shouldn't change.

Additionally, MIR support for calling intrinsics (through old trans) was implemented.
Alongside assorted fixes, it enabled MIR to launch 🚀 and do a *complete* bootstrap.
To try it yourself, `./configure --enable-orbit` *or* `make RUSTFLAGS="-Z orbit"`.
2016-03-18 06:54:58 -07:00
Eduard Burtescu
b12dcdef4f tests: Update run-make/issue-25581 to reflect how fat pointers are passed. 2016-03-18 15:54:27 +02:00
Eduard Burtescu
e177207b36 trans: Don't ignore zero-sized struct arguments on x86_64-pc-windows-gnu. 2016-03-18 14:28:11 +02:00
Jonas Schievink
fcaefcfdb0 liveness: substitute bound regions with free ones before normalizing the return type
Fixes #32323
2016-03-18 11:44:16 +01:00
bors
2de6ddd75e Auto merge of #32248 - dstu:master, r=alexcrichton
Expose the key of Entry variants for HashMap and BTreeMap.

This PR addresses [issue 1541](https://github.com/rust-lang/rfcs/issues/1541) by exposing the key of `HashMap` and `BTreeMap` entry variants. Basic tests are provided.
2016-03-18 02:46:35 -07:00
bors
a77d7bde60 Auto merge of #32207 - achanda:ipv6-doc, r=alexcrichton
Add is_documentation for IPv6

This function returns true if the given IPv6 is reserved for
documentation. Also, reject this block in the is_global check
2016-03-17 23:52:55 -07:00
Steven Fackler
74d00bde8e Make AssertRecoverSafe's field public
It's basically the very definition of a newtype, so we might as well
make things easy on people and let them construct and access it
directly.
2016-03-17 23:37:20 -07:00
Eduard Burtescu
181097da33 trans: Decide whether to load volatile_store's argument based on its ArgType. 2016-03-18 05:29:53 +02:00
Todd Lucas
667d1c67e2 Minor phrasing adjustment 2016-03-17 20:14:05 -07:00
Eduard Burtescu
d6689e5d1c Update the not-at-all-pretty pain-o-tron-4000+264 test. 2016-03-18 02:22:32 +02:00
Eduard Burtescu
9a8b80762b trans: Pass newtypes of immediates as their inner-most type again. 2016-03-18 01:01:47 +02:00
Piotr Czarnecki
6a1ccf8a86 fixup Cleaner Recover::replace 2016-03-17 23:11:22 +01:00
Alex Crichton
d7f80ca2c7 rustbuild: Fix cross to netbsd from Linux
Apparently the NetBSD compiler-rt builds into the linux directory as well.
I'm... detecting a trend!
2016-03-17 15:01:16 -07:00
Eduard Burtescu
02a141a550 mir: Don't memset allocas of types that do not require drop. 2016-03-17 22:48:07 +02:00
Eduard Burtescu
460e66457a mir: Store immediates used for indirect arguments in an alloca. 2016-03-17 22:48:07 +02:00
Eduard Burtescu
473f804491 Add #[rustc_no_mir] to make tests pass with -Z orbit. 2016-03-17 22:48:07 +02:00
Eduard Burtescu
080bd97781 compiletest: Add rustc-env for run-pass/super-fast-paren-parsing. 2016-03-17 22:48:07 +02:00
Eduard Burtescu
5f990fb4f0 mir: Don't forget to drop arguments. 2016-03-17 22:48:07 +02:00
Eduard Burtescu
cfd768e2e6 hir_map: Provide expression and statement attributes. 2016-03-17 22:48:07 +02:00
Eduard Burtescu
5739ed1f80 trans: Do not depend on having Expr's around for generic_simd_intrinsic. 2016-03-17 22:48:07 +02:00
Eduard Burtescu
7912f94b2d const_eval: Take just one set of substitutions in lookup_const_by_id. 2016-03-17 22:48:07 +02:00
Eduard Burtescu
5eeda543df mir: Use usize instead of u32 for indexing slices. 2016-03-17 21:51:55 +02:00
Eduard Burtescu
835e2bdf7d Add -Z orbit for forcing MIR for everything, unless #[rustc_no_mir] is used. 2016-03-17 21:51:55 +02:00
Eduard Burtescu
856185dbb2 hir, mir: Separate HIR expressions / MIR operands from InlineAsm. 2016-03-17 21:51:55 +02:00
Eduard Burtescu
415d95fbeb mir: Translate Rvalue::Slice without relying on tvec. 2016-03-17 21:51:55 +02:00
Eduard Burtescu
aca4f9396d mir: Get the right non-reference type for binding patterns. 2016-03-17 21:51:55 +02:00
Eduard Burtescu
cf4daf7889 mir: Don't lose sub-patterns inside slice patterns. 2016-03-17 21:51:55 +02:00
Eduard Burtescu
41499f4563 mir: Match against slices by calling PartialEq::eq. 2016-03-17 21:51:55 +02:00