Commit Graph

36232 Commits

Author SHA1 Message Date
Corey Richardson
53ece71585 Implement numeric fallback
Doesn't yet converge on a fixed point, but generally works. A better algorithm
will come with the implementation of default type parameter fallback.

If inference fails to determine an exact integral or floating point type, it
will set the type to i32 or f64, respectively.

Closes #16968
2015-01-01 17:12:15 -05:00
Niko Matsakis
77723d24a8 Implement an iterator for walking types rather than the old callback code. 2015-01-01 16:47:55 -05:00
Nick Cameron
2c92ddeda7 More fallout 2015-01-02 10:28:19 +13:00
Nick Cameron
13392d19ca Add tests 2015-01-02 10:28:19 +13:00
Nick Cameron
7e2b9ea235 Fallout - change array syntax to use ; 2015-01-02 10:28:19 +13:00
Nick Cameron
57a74eda88 Accept ranges with only a maximum value: ..expr 2015-01-02 10:28:19 +13:00
Nick Cameron
d45b5d2ed9 Disallow [_, ..n] syntax for fixed length arrays and repeating array constructors
Closes #19999

[breaking-change]

Use [_; n] instead.
2015-01-02 10:28:19 +13:00
Michael Woerister
7a11b9aac4 debuginfo: Fix an ICE related to local variables in unreachable code. 2015-01-01 18:43:48 +01:00
Jorge Aparicio
182db6e7f8 Add tests for assoc type issues that have been fixed
Closes #17732
Closes #18819
Closes #19479
Closes #19631
Closes #19632
Closes #19850
Closes #19883
Closes #20005
Closes #20009
Closes #20389
2015-01-01 11:51:45 -05:00
bors
39d7402666 auto merge of #20190 : cmr/rust/gate-macro-args, r=alexcrichton
Uses the same approach as https://github.com/rust-lang/rust/pull/17286 (and
subsequent changes making it more correct), where the visitor will skip any
pieces of the AST that are from "foreign code", where the spans don't line up,
indicating that that piece of code is due to a macro expansion.

If this breaks your code, read the error message to determine which feature
gate you should add to your crate.

Closes #18102

[breaking-change]
2015-01-01 15:51:08 +00:00
Corey Richardson
41da99dff4 Feature gate macro arguments
Uses the same approach as https://github.com/rust-lang/rust/pull/17286 (and
subsequent changes making it more correct), where the visitor will skip any
pieces of the AST that are from "foreign code", where the spans don't line up,
indicating that that piece of code is due to a macro expansion.

If this breaks your code, read the error message to determine which feature
gate you should add to your crate, and bask in the knowledge that your code
won't mysteriously break should you try to use the 1.0 release.

Closes #18102

[breaking-change]
2015-01-01 07:06:46 -05:00
dan@daramos.com
637f2c5ea4 Allow travis to use newer-faster infrastructure for building. http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/ 2015-01-01 02:00:29 -05:00
bors
c594959cdf auto merge of #19388 : nick29581/rust/rc-show, r=alexcrichto
r? @huonw or @alexcrichton

Apparently, we have previously rejected an RFC like this. However, since then we removed `{:?}` and so without this debugging gets really difficult as soon as there is a RefCell anywhere, so I believe there is more benefit to adding these impls than there was before. By using "try_borrow" we can avoid panicing in `Show` (I think).

@ huon in response to a comment in #19254: I noticed that `drop()` checks for the ptr being null, so I checked here too. Now I am checking for both, if you're confident I can change to only checking `strong()`.
2015-01-01 06:36:24 +00:00
dan@daramos.com
8aeefbbfdd Reimplement a minor optimization in String::from_utf8_lossy that avoids having to loop the slice from the begining. 2015-01-01 01:22:43 -05:00
Nick Cameron
f0976e2cf3 Reviewer change 2015-01-01 18:00:32 +13:00
Brian Anderson
b16111f8a9 mk: The doc directory is no longer included in the main package 2014-12-31 20:57:48 -08:00
Nick Cameron
c8c0391519 Add some impls of Show (RefCell, Weak, some resolve types) 2015-01-01 17:54:15 +13:00
bors
47b8479e73 auto merge of #20363 : japaric/rust/moar-uc, r=nmatsakis
The the last argument of the `ItemDecorator::expand` method has changed to `Box<FnMut>`. Syntax extensions will break.

[breaking-change]

---

This PR removes pretty much all the remaining uses of boxed closures from the libraries. There are still boxed closures under the `test` directory, but I think those should be removed or replaced with unboxed closures at the same time we remove boxed closures from the language.

In a few places I had to do some contortions (see the first commit for an example) to work around issue #19596. I have marked those workarounds with FIXMEs. In the future when `&mut F where F: FnMut` implements the `FnMut` trait, we should be able to remove those workarounds. I've take care to avoid placing the workaround functions in the public API.

Since `let f = || {}` always gets type checked as a boxed closure, I have explictly annotated those closures (with e.g. `|&:| {}`) to force the compiler to type check them as unboxed closures.

Instead of removing the type aliases (like `GetCrateDataCb`), I could have replaced them with newtypes. But this seemed like overcomplicating things for little to no gain.

I think we should be able to remove the boxed closures from the languge after this PR lands. (I'm being optimistic here)

r? @alexcrichton or @aturon 
cc @nikomatsakis
2015-01-01 04:01:02 +00:00
Jorge Aparicio
10bbf69488 rustc_trans: replace EnterPatterns alias with an unboxed closure 2014-12-31 22:50:27 -05:00
Jorge Aparicio
c8cf3a307b rustc: replace pick alias with an unboxed closure 2014-12-31 22:50:27 -05:00
Jorge Aparicio
1d21dad1d2 rustc: replace GetCrateDataCb alias with an unboxed closure 2014-12-31 22:50:27 -05:00
Jorge Aparicio
63af3e6cd2 time: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
Jorge Aparicio
ab402c0744 syntax: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
Jorge Aparicio
12dd7781d6 std: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
Jorge Aparicio
fb14dad4d6 rustdoc: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
Jorge Aparicio
e9ddd825ba rustc_typeck: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
Jorge Aparicio
e47035b9a5 rustc_trans: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
Jorge Aparicio
1e4bbefae1 rustc_resolve: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
Jorge Aparicio
a49cdb8c36 rustc_driver: unbox closures used in let bindings 2014-12-31 22:50:27 -05:00
Jorge Aparicio
28ea99eaa6 rustc_borrowck: unbox closures used in let bindings 2014-12-31 22:50:26 -05:00
Jorge Aparicio
a6f3053208 rustc_back: unbox closures used in let bindings 2014-12-31 22:50:26 -05:00
Jorge Aparicio
06408b4dd3 rustc: unbox closures used in let bindings 2014-12-31 22:50:26 -05:00
Jorge Aparicio
16a4ba8fa5 getopts: unbox closures used in let bindings 2014-12-31 22:50:26 -05:00
Jorge Aparicio
ddb4e43fa5 core: unbox closures used in let bindings 2014-12-31 22:50:26 -05:00
Jorge Aparicio
bcc2120c21 rustc_borrowck: unbox closures used in function arguments 2014-12-31 22:50:26 -05:00
Jorge Aparicio
24b49228f0 rustc_trans: unbox closures used in function arguments 2014-12-31 22:50:26 -05:00
Jorge Aparicio
5de9f47e49 rustc: unbox closures used in function arguments 2014-12-31 22:50:26 -05:00
Jorge Aparicio
70ce68eed4 syntax: unbox closures used in function arguments 2014-12-31 22:50:26 -05:00
Jorge Aparicio
371f04d433 std: unbox closures used in function arguments 2014-12-31 22:50:25 -05:00
Corey Farwell
f9ce6f5ba4 Remove core::iter::MinMaxResult::* public reexport
Part of #19253

[breaking-change]
2014-12-31 19:28:01 -08:00
Nick Cameron
d06b7057cf Fix a bug with cross-crate trait impls
Closes #19056
2015-01-01 16:11:32 +13:00
bors
7d4f4876d6 auto merge of #20374 : nikomatsakis/rust/assoc-types, r=nikomatsakis
These mostly derive from problems that @japaric encountered.

r? @pcwalton
2015-01-01 01:20:56 +00:00
Jorge Aparicio
a17c2b60e1 collections: fix fallout 2014-12-31 19:14:44 -05:00
Jorge Aparicio
ea94a90488 unicode: unbox closures used in function arguments 2014-12-31 19:14:44 -05:00
Alex Crichton
a6f5b980cc rustc: Re-jigger -L and -l for MSYS compatibility
As discovered in #20376, the MSYS shell will silently rewrite arguemnts that
look like unix paths into their windows path counterparts for compatibility, but
the recently added `:kind` syntax added to the `-L` flag does not allow for this
form of rewriting. This means that the syntax can be difficult to use at an MSYS
prompt, as well as causing tests to fail when run manuall right now.

This commit takes the other option presented in the original issue to prefix the
path with `kind=` instead of suffixing it with `:kind`. For consistence, the
`-l` flag is also now migrating to `kind=name`.

This is a breaking change due to the *removal* of behavior with `-L`. All code
using `:kind` should now pass `kind=` for `-L` arguments. This is not currently,
but will become, a breaking change for `-l` flags. The old `name:kind` syntax is
still accepted, but all code should update to `kind=name`.

[breaking-change]
Closes #20376
2014-12-31 16:05:00 -08:00
Alexis Beingessner
8dbaa7105e stabilize more of collections 2014-12-31 18:54:08 -05:00
Alex Crichton
be11aa6d70 std: Second pass stabilization for thread_local
This commit performs a second pass over the `std::thread_local` module. Most of
the functionality remains explicitly unstable, but the specific actions taken
were:

* `thread_local` is now stable
* `thread_local!` is now stable
* `thread_local::Key` is now stable
* `thread_local::Key::with` is now stable
* `thread_local::Key::destroyed` is deprecated in favor of a more general
  `state` function
* `thread_local::Key::state` was added to query the three states that a key can
  be in: uninitialized, valid, or destroyed. This function, and the
  corresponding `State` enum, are both marked unstable as we may wish to expand
  it later on.
* `thread_local::scoped` is entirely unstable. There hasn't been a whole lot of
  usage of this module in the standard distribution, so it remains unstable at
  this time.

Note that while the structure `Key` is marked stable, it is currently forced to
expose all of its implementation details due to the use of
construction-via-macro. The use of construction-via-macro is currently required
in order to place the `#[thread_local]` attribute on static in a
platform-specific manner. These stability attributes were assigned assuming that
it will be acceptable to tweak the implementation of `Key` in the future.
2014-12-31 15:50:28 -08:00
David Creswick
714a2c678c fix "make install"
There seems to be a problem introduced by
8b3c67690c that causes "make install"
to fail when the build is not configured to skip doc building.
2014-12-31 17:33:47 -06:00
Niko Matsakis
004a567de3 Convert TODO to FIXME for now 2014-12-31 16:23:49 -05:00
Niko Matsakis
7ae1c6bc26 Remove a TODO now that we handle normalization-derived bounds properly. 2014-12-31 16:02:58 -05:00