Commit graph

39232 commits

Author SHA1 Message Date
Manish Goregaokar 24086987f9 Rollup merge of #22736 - nikomatsakis:issue-22382, r=eddyb
Apply borrowck to fns that appear in const declarations.
Fixes #22382.

r? @eddyb
2015-02-25 03:21:43 +05:30
Manish Goregaokar c51c377982 Rollup merge of #22539 - oli-obk:style_nitpicks, r=Manishearth
I tried to follow [the style guide][1] as much as possible. This is just from some random readings of the code, so no guarantees on completeness, even in the edited files.

[1]: http://aturon.github.io/style/README.html
2015-02-25 03:21:37 +05:30
Manish Goregaokar a429bf6a24 Rollup merge of #22458 - steveklabnik:try_in_error_chapter, r=alexcrichton
Fixes #22342
2015-02-25 03:21:30 +05:30
Manish Goregaokar 80ac3a8c5b Rollup merge of #22772 - tbu-:pr_panic_fail, r=alexcrichton 2015-02-25 03:21:24 +05:30
Manish Goregaokar 216be122a0 Rollup merge of #22770 - vhbit:ios-rand-send, r=alexcrichton
"body": null,
2015-02-25 03:21:17 +05:30
Manish Goregaokar 1913e79bd9 Rollup merge of #22758 - ejjeong:aarch64-linux-android, r=alexcrichton
This commit has already been merged in #21774,
but i think it has been accidently overriden by #22584 and #22480.
r? @alexcrichton
2015-02-25 03:21:11 +05:30
Manish Goregaokar 4ff8b8aa8f Rollup merge of #22752 - ipetkov:unsafe-lint-fix, r=alexcrichton
This allows selectively disabling the lint for individual methods or traits.
2015-02-25 03:21:05 +05:30
Manish Goregaokar ad73cb0e18 Rollup merge of #22747 - krdln:fix-parsing-minus, r=alexcrichton
Makes Rust less amusing by fixing [#22745](https://github.com/rust-lang/rust/issues/22745)
2015-02-25 03:20:58 +05:30
Manish Goregaokar 5af3d660de Rollup merge of #22739 - tbu-:pr_error_net, r=alexcrichton
This affects the `set_non_blocking` function which cannot fail for Unix or
Windows, given correct parameters. Additionally, the short UDP write error case
has been removed as there is no such thing as \"short UDP writes\", instead, the
operating system will error out if the application tries to send a packet
larger than the MTU of the network path.
2015-02-25 03:20:51 +05:30
Manish Goregaokar 0e36a27ec3 Rollup merge of #22623 - petrochenkov:optest, r=alexcrichton
Tests often use `vec![1, 2, 3]` instead of shorter and faster `[1, 2, 3]`.
This patch removes a lot of unnecessary `vec!`s. Hopefully, the tests will compile and run a bit faster.
2015-02-25 03:20:42 +05:30
Niko Matsakis 1ef3598ed9 Merge conflicts due to eddyb's UFCS branch 2015-02-24 16:27:23 -05:00
Niko Matsakis abdb42ba64 Remove two uses of old [] notation 2015-02-24 16:27:23 -05:00
Niko Matsakis eb77fe9e06 Merge conflict: port default impls code 2015-02-24 16:27:23 -05:00
Niko Matsakis 31e09f740a Add handy switch -Z treat-err-as-bug -- it often happens that I am
compiling something I expect to succeed, and this lets me get
stacktraces and also abort compilation faster.
2015-02-24 16:27:23 -05:00
Niko Matsakis cf73e36ab0 Rework trait-bound-conversion so be based on the AST and rework collect
to pass in the appropriate ast::generics etc
2015-02-24 16:27:23 -05:00
Niko Matsakis 36d04711b7 Remove bounds struct from TypeParameterDef. Bounds information is now
exclusively stored in the where clauses.
2015-02-24 16:27:22 -05:00
Niko Matsakis 3c782b742b Rework the get_type_parameter_bounds impl to use a trait object
and act more generically.
2015-02-24 16:27:22 -05:00
Niko Matsakis 0d9e473be9 Comprehence cycle detection in collect. In some cases, the cycles we
report are not *necessary* cycles, but we'll work on refactoring them
over time. This overlaps with the cycle detection that astconv already
does: I left that code in because it gives a more targeted error
message, though perhaps less helpful in that it doesn't give the full
details of the cycle.
2015-02-24 16:27:22 -05:00
Niko Matsakis 15ef2c2e6b Convert astconv to request bounds through the AstConv interface
rather than poking through the `TypeParameterDef` directly.
2015-02-24 16:27:22 -05:00
Niko Matsakis e033a231ab Change collect to implement AstConv on a ItemCtxt rather than a
global context. Have this `ItemCtxt` carry a (currently unused) pointer
to the in-scope generics.
2015-02-24 16:27:22 -05:00
bors ad04cce61c Auto merge of #22530 - rprichard:master, r=dotdash
Fixes #22525

I wasn't sure if I should reuse `write::get_llvm_opt_level` or not.  It returns an `llvm::CodeGenOptLevel`, which is the Rust binding for `CodeGenOpt::Level`. `lto.rs` is passing an optlevel to LLVM's `PassManagerBuilder`, which takes an unsigned int.  `PassManagerBuilder`'s optlevel uses essentially the same enumeration (i.e. 0-3 with 2 as default), but it's implicit.
2015-02-24 20:57:31 +00:00
Vadim Petrochenkov c11807d32a Fix broken tests 2015-02-24 23:42:09 +03:00
Vadim Petrochenkov 2807a1ce02 Use arrays instead of vectors in tests 2015-02-24 21:15:45 +03:00
bors 0bd15657d9 Auto merge of #22172 - eddyb:almost-there, r=nikomatsakis
Adds `<module::Type>::method` support and makes `module::Type::method` a shorthand for it.
This is most of #16293, except that chaining multiple associated types is not yet supported.
It also fixes #22563 as `impl`s are no longer treated as modules in resolve.

Unfortunately, this is still a *[breaking-change]*:
* If you used a global path to a primitive type, i.e. `::bool`, `::i32` etc. - that was a bug I had to fix.
Solution: remove the leading `::`.
* If you passed explicit `impl`-side type parameters to an inherent method, e.g.:
```rust
struct Foo<T>(T);
impl<A, B> Foo<(A, B)> {
    fn pair(a: A, b: B) -> Foo<(A, B)> { Foo((a, b)) }
}
Foo::<A, B>::pair(a, b)
// Now that is sugar for:
<Foo<A, B>>::pair(a, b)
// Which isn't valid because `Foo` has only one type parameter.
// Solution: replace with:
Foo::<(A, B)>::pair(a, b)
// And, if possible, remove the explicit type param entirely:
Foo::pair(a, b)
```
* If you used the `QPath`-related `AstBuilder` methods @hugwijst added in #21943.
The methods still exist, but `QPath` was replaced by `QSelf`, with the actual path stored separately.
Solution: unpack the pair returned by `cx.qpath` to get the two arguments for `cx.expr_qpath`.
2015-02-24 17:56:09 +00:00
Steve Klabnik f31ea22bff Mention try macro in error chapter
Fixes #22342
2015-02-24 12:31:46 -05:00
Tobias Bucher 0fc1a7da93 Improve readability of an error check in set_non_blocking 2015-02-24 18:03:01 +01:00
Tobias Bucher 54b11066bb Revert a wrong replace of "fail" to "panic" 2015-02-24 17:02:26 +01:00
bors c9ace059e7 Auto merge of #22749 - kballard:process-stdio-constructors, r=alexcrichton
There are no tests for this because testing inherit/null is tricky.
Probably why there weren't tests for it to begin with.
2015-02-24 15:01:28 +00:00
Valerii Hiora 01385a237f iOS: Sync/Send fallout 2015-02-24 16:46:44 +02:00
Felix S. Klock II 92bc3ea467 Avoid cat_expr note when already in error state.
Also, to ensure we do not let the dropck get skipped, ICE if cat_expr
errors when *not* in error state.

This is not known to be a breaking change (i.e. I do not know of a
current case that causes the new ICE to be exercised).
2015-02-24 15:22:37 +01:00
Seo Sanghyeon f7aafcced8 Fix duplicate methods in rustdoc 2015-02-24 23:05:44 +09:00
Oliver Schneider 0bea550a2a style nitpicks 2015-02-24 14:14:48 +01:00
Eduard Burtescu 0c6d1f3b3d syntax: update pretty-printer for the <T>::method shorthand. 2015-02-24 14:16:03 +02:00
Eduard Burtescu 72d5f39be7 Fix fallout from rebasing. 2015-02-24 14:16:02 +02:00
Eduard Burtescu 8501c9dee5 rustc_typeck: unify the impl type with the UFCS path prefix type. 2015-02-24 14:16:02 +02:00
Eduard Burtescu f0efa2d843 Update trans/save's span hacks for fully qualified UFCS paths. 2015-02-24 14:16:02 +02:00
Eduard Burtescu 9ac073604c Fix fallout from allowing impls outside of the type's definition module. 2015-02-24 14:16:02 +02:00
Eduard Burtescu 866a5ee299 Fix fallout from correct stability handling in UFCS. 2015-02-24 14:16:02 +02:00
Eduard Burtescu 923616e188 Fix @nikomatsakis' nits in typeck. 2015-02-24 14:16:02 +02:00
Eduard Burtescu 09ad993a25 tests: add two new run-pass tests for method behavior after UFCS. 2015-02-24 14:16:02 +02:00
Eduard Burtescu d31b9ebef5 Implement <T>::method UFCS expression syntax. 2015-02-24 14:16:02 +02:00
Eduard Burtescu fdfb532d78 tests: remove warnings from and rename const-polymorphic-paths to ufcs-polymorphic-paths. 2015-02-24 14:16:02 +02:00
Eduard Burtescu 5a6a9ed792 rustc: combine partial_def_map and last_private_map into def_map. 2015-02-24 14:16:02 +02:00
Eduard Burtescu 06f362aeb3 rustc_resolve: don't handle impl items as if they were modules. 2015-02-24 14:16:01 +02:00
Eduard Burtescu 6700166442 core: fix typo that wasn't caught by the hacky previous implementation. 2015-02-24 14:16:01 +02:00
Eduard Burtescu fe4f9b8e3a Use partial path resolutions in expressions for UFCS desugaring. 2015-02-24 14:16:01 +02:00
Eduard Burtescu 7a3054f55c rustc_resolve: remove the distinction between DefStaticMethod and DefMethod. 2015-02-24 14:14:17 +02:00
Eduard Burtescu 0f49254b31 rustc: use partially resolved definitions to replace the T::A hack. 2015-02-24 14:14:17 +02:00
Eduard Burtescu 5809f8ae74 rustc_resolve: use the visitor model more, remove redundant repeated lookups. 2015-02-24 14:14:16 +02:00
Eduard Burtescu ffb8092ccf syntax: use a single Path for Trait::Item in QPath. 2015-02-24 14:14:16 +02:00