Commit Graph

30013 Commits

Author SHA1 Message Date
John Clements b8c5e46505 working on hygiene 2014-06-27 21:41:10 -07:00
John Clements e880c42920 more loops to be ignored by pretty-rpass 2014-06-25 19:15:34 -07:00
John Clements d8d48e4aae work around 15189 in test cases 2014-06-25 17:08:47 -07:00
John Clements eead9e6190 make macros hygienic 2014-06-25 14:36:16 -07:00
John Clements 43c7bbe735 added compile-fail test for 15167 2014-06-25 14:36:15 -07:00
John Clements 1e329bf050 don't expand subexprs of for loop, just re-expand whole thing.
Fixes #15167
2014-06-25 14:36:05 -07:00
John Clements d2adb7cf81 remove misleading and unnecessary underscores 2014-06-25 14:16:13 -07:00
John Clements 26b5347310 remove unneccessary pubs, shorten names 2014-06-25 14:16:12 -07:00
John Clements 8402793774 remove unneeded visit_ty methods 2014-06-25 14:16:12 -07:00
John Clements bc837fdadf add unit test for match var hygiene 2014-06-25 14:16:12 -07:00
John Clements 19e1d834ff enrich and rename crate_idents test case 2014-06-25 14:16:12 -07:00
John Clements 9215d7e5b7 comments only 2014-06-25 14:16:12 -07:00
John Clements bcdcaea572 revive old commented-out test cases as ignored test cases for hygiene 2014-06-25 14:15:40 -07:00
John Clements c8558f2300 tidy macro just a bit 2014-06-25 14:14:27 -07:00
bors 7a93beef7f auto merge of #15160 : alexcrichton/rust/remove-f128, r=brson
The f128 type has very little support in the compiler and the feature is
basically unusable today. Supporting half-baked features in the compiler can be
detrimental to the long-term development of the compiler, and hence this feature
is being removed.
2014-06-25 04:31:19 +00:00
bors 91be86af09 auto merge of #15163 : alexcrichton/rust/rollup, r=alexcrichton 2014-06-25 02:02:00 +00:00
Alex Crichton cdccecb24f Test fixes from the rollup
Closes #14482 (std: Bring back half of Add on String)
Closes #15026 (librustc: Remove the fallback to `int` from typechecking.)
Closes #15119 (Add more description to c_str::unwrap().)
Closes #15120 (Add tests for #12470 and #14285)
Closes #15122 (Remove the cheat sheet.)
Closes #15126 (rustc: Always include the morestack library)
Closes #15127 (Improve ambiguous pronoun.)
Closes #15130 (Fix #15129)
Closes #15131 (Add the Guide, add warning to tutorial.)
Closes #15134 (Xfailed tests for hygiene, etc.)
Closes #15135 (core: Add stability attributes to Clone)
Closes #15136 (Some minor improvements to core::bool)
Closes #15137 (std: Add stability attributes to primitive numeric modules)
Closes #15141 (Fix grammar in tutorial)
Closes #15143 (Remove few FIXMEs)
Closes #15145 (Avoid unnecessary temporary on assignments)
Closes #15147 (Small improvements for metaprogramming)
Closes #15153 (librustc: Check function argument patterns for legality of by-move)
Closes #15154 (test: Add a test for regions, traits, and variance.)
Closes #15159 (rustc: Don't register syntax crates twice)
Closes #13816 (Stabilize version output for rustc and rustdoc)
2014-06-24 18:57:01 -07:00
Robert Buonpastore d6a4c431f4 Stabilize version output for rustc and rustdoc 2014-06-24 17:24:34 -07:00
Alex Crichton fb296b8011 rustc: Don't register syntax crates twice
We only need to register them once, and once they're registered twice warnings
will start being spewed or worse may happen!

Closes #14330
2014-06-24 17:24:19 -07:00
Patrick Walton 86dda1b6f3 test: Add a test for regions, traits, and variance.
Closes #12470.
2014-06-24 17:23:44 -07:00
Patrick Walton 75146fd59c librustc: Check function argument patterns for legality of by-move
bindings.

This will break code that incorrectly did things like:

    fn f(a @ box b: Box<String>) {}

Fix such code to not rely on undefined behavior.

Closes #12534.

[breaking-change]
2014-06-24 17:23:41 -07:00
Keegan McAllister 5ccf056a02 Make parse_expr_res public 2014-06-24 17:23:21 -07:00
Keegan McAllister 26b2fa052f Allow splicing more things in quotes 2014-06-24 17:23:21 -07:00
Keegan McAllister 4e26e2d8ca Use macros to implement syntax::ext::quote::ToSource
This code deserves a bigger refactor, but here's a local improvement.
2014-06-24 17:23:21 -07:00
Björn Steinbrink a0ec902e23 Avoid unnecessary temporary on assignments
We only need the temporary when the type needs to be dropped, for other
types, we can use trans_into to directly place the value into the
destination.
2014-06-24 17:23:19 -07:00
Piotr Jawniak e4e3550ff6 Remove few FIXMEs
This commit removes FIXMEs of few closed issues.

Closes #13992
2014-06-24 17:23:16 -07:00
Michael Zhou 58078005cf Fix grammar in tutorial
"as this document" should be "than this document"
2014-06-24 17:23:12 -07:00
Brian Anderson 808b848eaf std: Add stability attributes to primitive numeric modules
The following are unstable:

- core::int, i8, i16, i32, i64
- core::uint, u8, u16, u32, u64
- core::int::{BITS, BYTES, MIN, MAX}, etc.
- std::int, i8, i16, i32, i64
- std::uint, u8, u16, u32, u64

The following are experimental:
- std::from_str::FromStr and impls - may need to return Result instead of Option
- std::int::parse_bytes, etc. - ditto
- std::num::FromStrRadix and impls - ditto
- std::num::from_str_radix - ditto

The following are deprecated:
- std::num::ToStrRadix and imples - Wrapper around fmt::radix. Wrong name (Str vs String)

See https://github.com/rust-lang/rust/wiki/Meeting-API-review-2014-06-23#uint
2014-06-24 17:23:05 -07:00
Brian Anderson 250e2362de Move core::bool tests to run-pass
These are closer to language tests than library.
2014-06-24 17:22:59 -07:00
Brian Anderson 4203dcb351 core: Remove bool::to_bit
This is an unused one-liner.
2014-06-24 17:22:59 -07:00
Brian Anderson adbd5d7a42 core: Add stability attributes to Clone
The following are tagged 'unstable'

- core::clone
- Clone
- Clone::clone
- impl Clone for Arc
- impl Clone for arc::Weak
- impl Clone for Rc
- impl Clone for rc::Weak
- impl Clone for Vec
- impl Clone for Cell
- impl Clone for RefCell
- impl Clone for small tuples

The following are tagged 'experimental'

- Clone::clone_from - may not provide enough utility
- impls for various extern "Rust" fns - may not handle lifetimes correctly

See https://github.com/rust-lang/rust/wiki/Meeting-API-review-2014-06-23#clone
2014-06-24 17:22:57 -07:00
John Clements 1ea2efece1 added xfailed test for issue 9737 2014-06-24 17:22:54 -07:00
John Clements a4a0c69209 added xfailed tests for two other flavors of var hygiene 2014-06-24 17:22:54 -07:00
Steve Klabnik 3ed78f5b6b Add the Guide, add warning to tutorial.
In line with what @brson, @cmr, @nikomatsakis and I discussed this morning, my
redux of the tutorial will be implemented as the Guide. This way, I can work in
small iterations, rather than dropping a huge PR, which is hard to review.  In
addition, the community can observe my work as I'm doing it.

This adds a note in line with [this comment][reddit] that clarifies the state
of the tutorial, and the community's involvement with it.

[reddit]: http://www.reddit.com/r/rust/comments/28bew8/rusts_documentation_is_about_to_drastically/ci9c98k
2014-06-24 17:22:50 -07:00
Jakub Wieczorek c484c2d1f8 Fix #15129
Add support for unit literals to const_eval.
2014-06-24 17:22:48 -07:00
Steve Klabnik 85effb9f3e Improve ambiguous pronoun.
Fixes #14806
2014-06-24 17:22:45 -07:00
Alex Crichton b18c4cfef0 rustc: Always include the morestack library
It was previously assumed that the object file generated by LLVM would always
require the __morestack function, but that assumption appears to be incorrect,
as outlined in #15108. This commit forcibly tells the linker to include the
entire archive, regardless of whether it's currently necessary or not.

Closes #15108
2014-06-24 17:22:41 -07:00
Steve Klabnik e16a87513a Remove the cheat sheet.
Rust by Example is far better.

Fixes #14380.
2014-06-24 17:22:39 -07:00
Edward Wang bf61bb6b7f Add tests for #12470 and #14285
The #14869 removed `TraitStore` from `ty_trait` and represented trait
reference as regular `ty_rptr`. An old bug of the missing constraint
upon lifetime parameter of trait reference then is fixed as a side
effect. Adds tests for affected bugs and closes them.

Closes #12470.
Closes #14285.
2014-06-24 17:19:19 -07:00
Steve Klabnik d58412bfa1 Add more description to c_str::unwrap().
It's unclear what you are supposed to do with this memory.
Let's make that more clear.
2014-06-24 17:19:17 -07:00
Niko Matsakis 9e3d0b002a librustc: Remove the fallback to int from typechecking.
This breaks a fair amount of code. The typical patterns are:

* `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`;

* `println!("{}", 3)`: change to `println!("{}", 3i)`;

* `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`.

RFC #30. Closes #6023.

[breaking-change]
2014-06-24 17:18:48 -07:00
Alex Crichton f7f95c8f5a std: Bring back half of Add on String
This adds an implementation of Add for String where the rhs is <S: Str>. The
other half of adding strings is where the lhs is <S: Str>, but coherence and
the libcore separation currently prevent that.
2014-06-24 17:17:09 -07:00
Alex Crichton 3d308fe65b Remove the quad_precision_float feature gate
The f128 type has very little support in the compiler and the feature is
basically unusable today. Supporting half-baked features in the compiler can be
detrimental to the long-term development of the compiler, and hence this feature
is being removed.
2014-06-24 16:36:12 -07:00
bors 05ca9f747d auto merge of #15024 : kmcallister/rust/lint, r=alexcrichton
This is a rebase of #14804 with two new commits on top to implement and test lint plugins.

r? @alexcrichton @huonw: Can you take a look at the new commits, and also weigh in about any issues from the old PR that you feel are still unresolved? I'm leaving the old branch alone to preserve discussion history.
2014-06-24 22:06:48 +00:00
bors 87f3741fdf auto merge of #15118 : stepancheg/rust/concat, r=alexcrichton
(And in other extensions implemented with `get_exprs_from_tts` function).
2014-06-24 19:36:47 +00:00
Keegan McAllister 7e694e7115 More upstream lint changes 2014-06-24 11:36:28 -07:00
Keegan McAllister 7dc724bf88 Test lint plugins 2014-06-24 11:36:28 -07:00
Keegan McAllister 2f274d11ba Implement lint plugins 2014-06-24 11:36:28 -07:00
Keegan McAllister 51d438e568 Incorporate upstream changes to old lint code 2014-06-24 11:36:28 -07:00
Keegan McAllister e67e6e678d List builtin lints one per line for better diffs 2014-06-24 11:36:28 -07:00