Commit Graph

51556 Commits

Author SHA1 Message Date
Daniel J Rollins
234371216e Use last path segment for uncalled method note if span_to_segment fails
PR: #32053
2016-03-19 22:06:45 +05:30
Daniel J Rollins
fa0efa69c5 Add test for issue 29124 2016-03-19 22:06:45 +05:30
Daniel J Rollins
5e3b36c100 Fix code review actions in PR #32053
Split `fileline_note` into a `file_line note` and `span_suggestion` as per
@Manishearth's suggestions.

Change nested `match`es to `if let`s.
2016-03-19 22:06:45 +05:30
Daniel J Rollins
2dd5776b11 Add note if method is called on a function object
Fixes issue #29124.

If method is called on a function type a note is generated to suggest
that the developer may have forgotten to call it.

e.g.

fn main() {
    let mut guess = String::new();
    std::io::stdin.read_line(&mut guess);
}

will generate the note:

note: called method on function type. did you mean `std::io::stdin().read_line(..)`?
2016-03-19 22:06:41 +05:30
Amanieu d'Antras
421fed188c Change compare_exchange to return a Result<T, T> 2016-03-19 11:44:38 +00:00
bors
7c66a89849 Auto merge of #32351 - eddyb:rollup, r=eddyb
Rollup of 14 pull requests

- Successful merges: #32265, #32269, #32271, #32288, #32308, #32316, #32319, #32321, #32327, #32329, #32332, #32337, #32342, #32347
- Failed merges:
2016-03-19 04:42:02 -07:00
Eduard-Mihai Burtescu
5bf1e58bc0 Rollup merge of #32347 - Amanieu:volatile_fat_ptr, r=eddyb
Fix volatile stores of fat pointers

This was previously causing an LLVM assertion.

r? @eddyb
2016-03-19 12:30:02 +02:00
Eduard-Mihai Burtescu
835d2a952c Rollup merge of #32342 - petevine:patch-1, r=alexcrichton
Use explicit -march flags in the i586 mk file

`-march` should definitely go last, after the environment `$C(XX)FLAGS`, or it's going to remain brittle.

This should fix cross-compilation issues on x86_64 (possibly x86 too on some newer distros) - it was far too assuming of me to expect you really had to want i586 using your own flags.
2016-03-19 12:30:02 +02:00
Eduard-Mihai Burtescu
4a67405ba9 Rollup merge of #32337 - dotdash:llvm-aa-perf, r=alexcrichton
Update LLVM to include a backport to restore AA performance

cc #31435
r? @alexcrichton
2016-03-19 12:30:02 +02:00
Eduard-Mihai Burtescu
34bd8f3a20 Rollup merge of #32332 - jonas-schievink:issue32323, r=arielb1
liveness: substitute bound regions with free ones before normalizing the return type

Fixes #32323

r? @arielb1
2016-03-19 12:30:01 +02:00
Eduard-Mihai Burtescu
b29e299c18 Rollup merge of #32329 - sfackler:assert-recover-safe-pub, r=aturon
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.

r? @aturon
2016-03-19 12:30:01 +02:00
Eduard-Mihai Burtescu
d5dceba8fa Rollup merge of #32327 - toddlucas:master, r=apasel422
Minor phrasing adjustment to book references-and-borrowing
2016-03-19 12:30:01 +02:00
Eduard-Mihai Burtescu
9413d904ff Rollup merge of #32321 - alexcrichton:cross-to-netbsd, r=japaric
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-19 12:30:01 +02:00
Eduard-Mihai Burtescu
472fe10652 Rollup merge of #32319 - benaryorg:patch-3, r=alexcrichton
documentation fix in RELEASES.md

f32 should probably be denoted as 0.0 as it might improve readability.
2016-03-19 12:30:01 +02:00
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
b854149a48 Auto merge of #32304 - pravic:fix-variadic-ffi-test, r=alexcrichton
test: Fix missing call of function pointer

Also an unused variable warning was here.
2016-03-19 01:53:11 -07: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
Amanieu d'Antras
135d24dd03 Fix volatile stores of fat pointers 2016-03-19 02:24:37 +00: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
Corey Farwell
985cddf518 Use enum for message kind in compiletest harness. 2016-03-18 19:04:29 -04:00
petevine
2ab1f0a850 Use explicit -march flags in the i586 mk file
`-march` should definitely go last, after the environment C(XX)FLAGS, or it's back to square one.
This fixes cross-compilation issues on x86_64.
2016-03-19 00:04:27 +01:00
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