Commit Graph

51459 Commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
cb9b1b26c0 Rollup merge of #32316 - tclfs:patch-3, r=steveklabnik
docs: `let` introduces a statement

I changes *expression* to *statement* to make more accurate, because in Rust, `let` introduces a declaration statement.
2016-03-19 12:30:01 +02:00
Eduard-Mihai Burtescu
5a5b5f1e9f Rollup merge of #32308 - bombless:patch-2, r=alexcrichton
Fix usability problem when browse document locally

You cannot use `history.replaceState` when you browse locally, it breaks the security policy of Chrome and perhaps other browsers.
Closes https://github.com/rust-lang/rust/issues/32307
Thank @crumblingstatue for the help!
2016-03-19 12:30:00 +02:00
Eduard-Mihai Burtescu
33c28b45c8 Rollup merge of #32288 - tclfs:patch-2, r=apasel422
docs: One typo

I think it's a mistake of spelling.
2016-03-19 12:30:00 +02:00
Eduard-Mihai Burtescu
e28a1b6cf5 Rollup merge of #32271 - frewsxcv:compiletest-ignored-help-note, r=nikomatsakis
Add comment about opt-in nature of compiletest note/help messages.

The opt-in functionality was proposed and discussed in
https://github.com/rust-lang/rust/issues/21195
2016-03-19 12:30:00 +02:00
Eduard-Mihai Burtescu
8be1d7d1a9 Rollup merge of #32269 - richo:impl-totokens-p-implitem, r=nikomatsakis
syntax: impl ToTokens for P<ast::ImplItem>

I'm working on updating zinc for latest rust, and it appears that I need this impl[0].

More generally, I realise that libsyntax is "Whatever the compiler team needs to build a compiler", but should I just open a PR fleshing this out for all types?

https://github.com/hackndev/zinc/blob/master/ioreg/src/builder/setter.rs#L194-L197
2016-03-19 12:30:00 +02:00
Eduard-Mihai Burtescu
8a13440486 Rollup merge of #32265 - tclfs:patch-1, r=alexcrichton
FreeBSD has already supported Cargo

Both Packages and Ports of FreeBSD have Cargo in present.
2016-03-19 12:30:00 +02:00
bors
b9a93fad92 Auto merge of #32256 - bluss:float-fast-math, r=alexcrichton
Add intrinsics for float arithmetic with `fast` flag enabled

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 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 that the
floats must be added in a sequence, one after another. This constraint
is usually completely unintended, and it means that no auto-vectorization
is possible.
2016-03-18 21:12:00 -07:00
bors
10bdd808b5 Auto merge of #32050 - achanda:from-slice-v4, r=alexcrichton
Add an impl for From trait

Converts a u8 slice to a Ipv4Addr
More discussion on this here: https://github.com/rust-lang/rfcs/pull/1498#issuecomment-191921655
2016-03-18 17:30:22 -07: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
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
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
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
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
Eduard Burtescu
181097da33 trans: Decide whether to load volatile_store's argument based on its ArgType. 2016-03-18 05:29:53 +02: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
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
Eduard Burtescu
d9277b163c trans: Make everything used from within at_start Builder-friendly. 2016-03-17 21:51:54 +02:00
Eduard Burtescu
82fad1dfc7 mir: Call set_operand_dropped in more places, specifically Unsize casts. 2016-03-17 21:51:54 +02:00
Eduard Burtescu
3e98220a1c mir: Translate intrinsics, via old trans where possible. 2016-03-17 21:51:54 +02:00
Eduard Burtescu
ee7687a5e5 mir: Reintroduce the temporary block after invokes, to handle critical edges. 2016-03-17 21:51:54 +02:00
Eduard Burtescu
41fc5f7c2a mir: Trigger closure instantiations when the closure value is created. 2016-03-17 21:51:54 +02:00
Eduard Burtescu
6c551b3766 trans: Load and cache cross-crate Mir instances in the shared context. 2016-03-17 21:51:54 +02:00
Eduard Burtescu
47cd05c8c1 mir: Don't shadow the "args" variable in Call translation. 2016-03-17 21:51:54 +02:00
Eduard Burtescu
9c6bfe4499 mir: Truncate bool to i1 for SwitchInt. 2016-03-17 21:51:54 +02:00
Eduard Burtescu
38638d37f7 trans: Take a &Builder in call_memcpy, like call_memset. 2016-03-17 21:51:54 +02:00
Eduard Burtescu
b63a5eed6e mir: Support RustCall ABI functions. 2016-03-17 21:51:53 +02:00
Eduard Burtescu
92e485874e mir: Load FatPtr constants instead of keeping them indirect. 2016-03-17 21:51:53 +02:00
Eduard Burtescu
eb43d95211 mir: Don't load the discriminant, it's already in immediate form. 2016-03-17 21:51:53 +02:00
Eduard Burtescu
d3a6d67fb8 mir: Don't use ConstVal when adjustments are involved, as they would be lost. 2016-03-17 21:51:53 +02:00
Eduard Burtescu
9cc5ee359a mir: Unsize ConstVal::ByteStr before comparing &[u8] against it. 2016-03-17 21:51:53 +02:00