Commit Graph

49569 Commits

Author SHA1 Message Date
bors
dfaddb732c Auto merge of #27807 - pczarn:arena-internals, r=bluss
Fixes #18037 "TypedArena cannot handle zero-sized types".
Closes #17931 "improve chunk allocation scheme used by Arena / TypedArena".
Closes #22847 "TypedArena should implement Send". - N.B. Arena cannot implement Send, since it may contain non-Send values.
Closes #18471 "`Arena::alloc_copy_inner` (at least) should be renamed and made public." - Added `Arena::alloc_bytes`.
Closes #18261 "support clearing TypedArena with the chunks preserved". - Only the largest chunk is preserved.
2016-01-11 08:32:46 +00:00
bors
69e1f57dfb Auto merge of #30295 - jseyfried:fix_extern_crate_duplicate, r=nrc
Fix a bug allowing an item and an external crate to collide so long as the external crate is declared after the item. For example,
```rust
mod core { pub fn f() {} } // This would be an error if it followed the `extern crate`
extern crate core; // This declaration is shadowed by the preceding module

fn main() { core::f(); }
```
This is a [breaking-change], but it looks unlikely to cause breakage in practice, and any breakage can be fixed by removing colliding `extern crate` declarations, which are shadowed and hence unused.
2016-01-11 06:40:58 +00:00
Steven Fackler
416267fb19 Derive Hash for Duration 2016-01-10 20:01:07 -08:00
Brian Anderson
bcf20a7cb1 doc: Add descriptions to links in the index
These are the same descriptions as on the website.
2016-01-10 22:30:09 +00:00
Florian Hahn
e61d21fe3d Cancel parse_ty error in Parser::parse_generic_values_after_lt 2016-01-10 22:59:23 +01:00
Sergey Veselkov
8cc149dbc1 Fix link in getting-started.md 2016-01-11 00:13:54 +03:00
Guillaume Gomez
216e72f8d9 Remove unneeded #[lang = "iterator"] 2016-01-10 16:54:04 +01:00
Steve Klabnik
b2e670a7f3 Rollup merge of #30789 - D101101:patch-1, r=steveklabnik 2016-01-09 14:04:20 -05:00
Steve Klabnik
c0983cd67e Rollup merge of #30771 - tsion:mir-text-terminator-fix, r=eddyb
This just removes the `Some()` that appeared around terminators in MIR text output after https://github.com/rust-lang/rust/pull/30481 (cc @nagisa). The graphviz is already fixed.

r? @eddyb
2016-01-09 14:04:20 -05:00
Steve Klabnik
1345d188b7 Rollup merge of #30766 - steveklabnik:gh28810, r=steveklabnik
Doing so is considered weaker writing. Thanks @Charlotteis!

Fixes #28810
2016-01-09 14:04:20 -05:00
Steve Klabnik
6ba952020f Remove many instances of 'just'
Doing so is considered weaker writing. Thanks @Charlotteis!

Fixes #28810
2016-01-09 14:03:58 -05:00
Erick Tryzelaar
cd1f0b75f3 Fix a typo in rustc_mir::build::scope's documentation 2016-01-09 10:31:50 -08:00
Jörg Krause
035a0933f8 Fix arm-unknown-linux-gnueabi floating-point ABI
gnueabi indicates soft whereas gnueabihf indicates hard floating-point ABI.
2016-01-09 14:25:02 +01:00
Sergey Veselkov
31e39cd05c Remove unused link from enums.md 2016-01-09 12:17:44 +03:00
Niko Matsakis
b0f6a47a0f Minor rebase corrections 2016-01-08 21:00:24 -05:00
Niko Matsakis
83710b4471 permit coercions if [error] is found in either type 2016-01-08 20:20:02 -05:00
Ariel Ben-Yehuda
a3cbfa58be improve cast handling - this fixes test failures
the problem is that now "type_is_known_to_be_sized" now returns
false when called on a type with ty_err inside - this prevents
spurious errors (we may want to move the check to check::cast
anyway - see #12894).
2016-01-08 20:20:02 -05:00
Niko Matsakis
77756cb12a Change error scheme so that if projection fails we generate A::B instead of TyError 2016-01-08 20:20:02 -05:00
Niko Matsakis
64b720229c Remove ErrorCandidate in favor of just generating an ambiguous result 2016-01-08 20:20:02 -05:00
Niko Matsakis
b4f5ddba67 Make coherence more tolerant of error types.
Fixes #29857.
Fixes #30589.
2016-01-08 20:20:01 -05:00
bors
d70ab2bdf1 Auto merge of #30782 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #30584, #30747, #30755, #30758, #30760, #30769
- Failed merges: #30766
2016-01-08 22:42:10 +00:00
Steve Klabnik
926eb83e78 Rollup merge of #30769 - steveklabnik:gh30069, r=apasel422
Fixes #30069
2016-01-08 13:02:31 -05:00
Steve Klabnik
2908385fc7 Rollup merge of #30760 - jonastepe:nomicon_vec_insert_remove_len, r=apasel422
len needs to be prefixed by self for this to work. That is something which trips me up all the time. It's reassuring to see that happening to seasoned Rust programmers.
2016-01-08 13:02:31 -05:00
Steve Klabnik
3836578be2 Rollup merge of #30758 - birkenfeld:fix-30743, r=steveklabnik
(fixes #30743)

Not sure if the "Note" should be kept.
2016-01-08 13:02:31 -05:00
Steve Klabnik
0b5f7946d8 Rollup merge of #30755 - datagrok:master, r=steveklabnik
I'm working my way through TRPL beginning at "Syntax and Semantics" as was recommended in a previous version.

I'm expecting the chapter to incrementally build up my knowledge of the language section by section, assuming no prior Rust experience. So it was a bit of a speed-bump to encounter references and the vector type in a code example long before they had been defined and explained.

Another commit in this PR tries to make consistent what is a "chapter" of TRPL versus a "section." Just a nit-pick, but not thinking about that stuff keeps my focus on the important material.

My background: Python programmer since ~2000, with moderate exposure to C, C++, assembly, operating systems, and system architecture in university several years ago.

For your kind consideration, feel welcome to use or drop or rework any part of this.
2016-01-08 13:02:31 -05:00
Steve Klabnik
27df1ec010 Rollup merge of #30747 - nagisa:mir-reenable-test, r=nikomatsakis
Fixes #30674

The test seems to work fine and assertion passes. The test seems to also be generated from MIR (LLVM IR has footprint of MIR translator), thus I’m reenabling it.
2016-01-08 13:02:30 -05:00
Steve Klabnik
c518664ea5 Rollup merge of #30584 - GuillaumeGomez:new_handles, r=pnkfelix
Last part of #30413.

r? @pnkfelix
2016-01-08 13:02:30 -05:00
Dave Huseby
6780e3e237 Fixes #30628 by adding new snapshot for dragonfly bsd 2016-01-08 09:37:14 -08:00
Felix S. Klock II
fa027d1417 The lint warnings are not reported since we report the errors first and then exit.
I think that behavior is fine, so I am removing the expected warnings from these tests.
2016-01-08 16:19:13 +01:00
Michael Woerister
c8a547a638 Also store MIR of closures in crate metadata. 2016-01-08 09:45:26 -05:00
Simonas Kazlauskas
2f86c1605c Change destination accessor to return references
Previously it was returning a value, mostly for the two reasons:

* Cloning Lvalue is very cheap most of the time (i.e. when Lvalue is not a Projection);
* There’s users who want &mut lvalue and there’s users who want &lvalue. Returning a value allows
  to make either one easier when pattern matching (i.e. Some(ref dest) or Some(ref mut dest)).

However, I’m now convinced this is an invalid approach. Namely the users which want a mutable
reference may modify the Lvalue in-place, but the changes won’t be reflected in the final MIR,
since the Lvalue modified is merely a clone.

Instead, we have two accessors `destination` and `destination_mut` which return a reference to the
destination in desired mode.
2016-01-08 14:40:32 +02:00
Guillaume Gomez
c07876951b Add new help messages for E0425 2016-01-08 13:33:44 +01:00
Felix S. Klock II
40e2ac28e4 Added proper lint for the unit variant/struct warning. 2016-01-08 02:07:28 +01:00
Felix S. Klock II
a2960bc7c6 update test to reflect other sources of brokenness in it under new
macro future proofing rules.

(We may want to think about what this test was actually testing and
figure out a way to test it without running afoul of macro future
proofing.  I spent some time trying to do this, e.g. by inserting
parenthesis in the macro input pattern, but I could not quickly get it
working, so I took this tack instead.)
2016-01-08 00:36:09 +01:00
Simonas Kazlauskas
ea52d9ebda [MIR] Fix translation of ConstVal::{Struct, Tuple}
Fixes #30772
2016-01-08 01:15:59 +02:00
bors
64a8ffeffa Auto merge of #30757 - michaelwoerister:mir-visitor-cleanup, r=jroesch
After a call to `visit_def_id()` missing in `mir::visit::Visitor` but not `mir::visit::MutVisitor` has caused me a couple hours of error hunting, I decided I'd take the time to get rid of the code duplication between the two implementations.

cc @rust-lang/compiler
2016-01-07 22:54:22 +00:00
Scott Olson
8e293676ee Fix MIR text output for terminators since they were made optional. 2016-01-07 15:16:07 -06:00
bors
5c92010d3b Auto merge of #30748 - tsion:mir-tuple-fix, r=eddyb
r? @nikomatsakis

(Related issue about `debug_tuple` at https://github.com/rust-lang/rfcs/issues/1448.)

```rust

fn main() {
    let _x = ();
}
```

```diff
--- empty_tuple-old.mir	2016-01-06 16:04:24.206409186 -0600
+++ empty_tuple-new.mir	2016-01-06 14:26:17.324888585 -0600
@@ -1,13 +1,13 @@
 fn() -> () {
     let var0: (); // _x
     let mut tmp0: ();

     bb0: {
-        var0 = ;
+        var0 = ();
         Some(goto -> bb1);
     }

     bb1: {
         Some(return);
     }
 }
```
2016-01-07 21:04:36 +00:00
Felix S. Klock II
8aed830ee3 updated test to reflect loosening of check (for issue #30379). 2016-01-07 21:56:04 +01:00
Felix S. Klock II
d4039c5d40 extend warning cycle to cover matching unit-structs via S(..)
(this makes them handled like enum unit-variants.)
2016-01-07 21:56:04 +01:00
Pyfisch
c44e326614 fix broken float methods
closes #30657
2016-01-07 21:07:24 +01:00
Felix S. Klock II
c032e0c7a7 After RFC amendment 1384, FOLLOW(pat) includes |, so update tests accordingly. 2016-01-07 20:53:33 +01:00
Felix S. Klock II
3e4b7012d0 Updated future-proofing test, removed outdated test, and added
run-pass test for some new functionality.
2016-01-07 20:53:33 +01:00
Felix S. Klock II
3703ef5820 extending FOLLOW(NT) as specified in amendment.
See RFC amendment 1384:

  https://github.com/rust-lang/rfcs/pull/1384
2016-01-07 20:53:33 +01:00
Felix S. Klock II
076e64475a macro_rules: proper FIRST/FOLLOW computations for checking macro_rules validity.
See RFC amendment 1384 and tracking issue 30450:
  https://github.com/rust-lang/rfcs/pull/1384
  https://github.com/rust-lang/rust/issues/30450

Moved old check_matcher code into check_matcher_old

combined the two checks to enable a warning cycle (where we will
continue to error if the two checks agree to reject, accept if the new
check says accept, and warn if the old check accepts but the new check
rejects).
2016-01-07 20:53:33 +01:00
Michael F. Lamb
fcc356373b Remove extraneous [], replace accidental removed link to heap section 2016-01-07 11:44:03 -08:00
Steve Klabnik
05874de412 Link Nomicon in PhantomData's docs
Fixes #30069
2016-01-07 14:18:15 -05:00
Pyfisch
4057808365 fix trailing whitespace 2016-01-07 20:13:59 +01:00
Pyfisch
dce47681e2 f32: inline methods with special variant for msvc 2016-01-07 20:13:59 +01:00
Steve Klabnik
ce49e3225e Expand EO308 to mention try!
Fixes #28953
2016-01-07 14:09:20 -05:00