Commit Graph

58033 Commits

Author SHA1 Message Date
Felix S. Klock II e185cd5190 Fix bug in test for E0199 and add test for E0198.
In particular, as far as I can tell from the error diagnostics, the
former test for E0199 was actually a test for E0198, and there was no
test for E0198.

(I am assuming that one of my previous changes to the `unsafe impl`
checking fixed a latent bug in how these two cases were
differentiated.)
2016-10-12 18:23:23 +02:00
Felix S. Klock II 9a649c328c Require destructors using `#[may_dangle]` to use `unsafe impl`. 2016-10-12 18:23:20 +02:00
Felix S. Klock II 97e4143558 Fix ICE by injecting bitcasts if types mismatch when building invokes or calls. 2016-10-12 17:36:50 +02:00
arthurprs c435821d16 Cache conscious hashmap table 2016-10-12 17:07:09 +02:00
bors acb50e3481 Auto merge of #36737 - srinivasreddy:check, r=nrc
Run rustfmt on librustc_typeck/check/ folder
2016-10-12 05:29:09 -07:00
Tobias Bucher 744aecf793 Remove unnecessary `unsafe` block 2016-10-12 13:06:55 +02:00
Tim Neumann 7badc32005 normalize tuple pair types 2016-10-12 12:20:10 +02:00
bors a29c49f5cc Auto merge of #37095 - petrochenkov:metactor, r=alexcrichton
Temporary fix for metadata decoding for struct constructors

Same as https://github.com/rust-lang/rust/pull/37078, but for nightly.
Ideally, metadata lookup functions should "just work" for constructor ids, but this fixes the issue as well.

Fixes https://github.com/rust-lang/rust/issues/37026
r? @alexcrichton
2016-10-11 23:36:29 -07:00
Adam Perry 70569b3d2d Using a type alias of Slice<Kind<'tcx>> to intern Substs<'tcx>.
Fixing now incorrect Hash impl for TransItem.
Using as_ptr() rather than a pointer cast for string formatting.
Fixing Borrow and Lift impls for Substs.
Move usages of tcx.mk_substs to Substs::new iterator-based version.
2016-10-11 22:12:13 -07:00
est31 6a89b8fd0a rustdoc: color the question mark operator
The idea was proposed by eddyb in: https://github.com/rust-lang/rust/issues/31436#issuecomment-247426582
2016-10-12 05:39:57 +02:00
bors 0b2c356420 Auto merge of #37090 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 9 pull requests

- Successful merges: #36679, #36699, #36997, #37040, #37060, #37065, #37072, #37073, #37081
- Failed merges:
2016-10-11 13:29:02 -07:00
Vadim Petrochenkov f5827d08d9 Temporary fix for metadata decoding for struct constructors 2016-10-11 23:04:29 +03:00
Nick Cameron 79b5177378 Review changes 2016-10-12 08:40:23 +13:00
Nick Cameron 14c62f91b7 Deprecate `Reflect`
[tracking issue](https://github.com/rust-lang/rust/issues/27749)
2016-10-12 08:40:22 +13:00
Nick Cameron a94f5934cd Stabilise attributes on statements.
Note that attributes on expressions are still unstable and are behind the `stmt_expr_attributes` flag.

cc [Tracking issue](https://github.com/rust-lang/rust/issues/15701)
2016-10-12 08:40:22 +13:00
Nick Cameron 9bc6d26092 Stabilise `?`
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-10-12 08:40:22 +13:00
Florian Hartwig 63ee8d0bbc Specialize Vec::extend to Vec::extend_from_slice 2016-10-11 19:45:09 +02:00
Alex Crichton f2adb70408 std: Update liblibc submodule
This fixes compilation on the s390x target
2016-10-11 10:10:10 -07:00
Alex Crichton 62861f8797 configure: Fix gcc detection for LLVM
We have a case where 32-bit compilation accidentally requested clang when gcc
was the only one available.
2016-10-11 10:08:07 -07:00
Guillaume Gomez 30164c21fa Rollup merge of #37081 - p512:master, r=sfackler
Changed 0 into '0'

Right now `0` is an undefined production rule.
[Documentation following the grammar specification](https://doc.rust-lang.org/nightly/std/fmt/#sign0) strongly suggests `'0'` is meant as it is used as a character literal.

r? @steveklabnik
2016-10-11 17:51:27 +02:00
Guillaume Gomez 5c29a914a9 Rollup merge of #37073 - GuillaumeGomez:string_url, r=steveklabnik
Add missing urls on String module

r? @steveklabnik
2016-10-11 17:51:27 +02:00
Guillaume Gomez bfbd0a5e49 Rollup merge of #37072 - michaelwoerister:enable-trait-ich-tests, r=nikomatsakis
ICH: Enable some cases in trait definition hashing.

Enable some test cases originally written by @eulerdisk. The tests can be enabled now because @MathieuBordere has fixed the underlying problem in #36974.

r? @nikomatsakis
2016-10-11 17:51:27 +02:00
Guillaume Gomez ffa9bbf7cd Rollup merge of #37065 - nnethercote:opt-mk_printer, r=nikomatsakis
Merge `Printer::token` and `Printer::size`.

Logically, it's a vector of pairs, so might as well represent it that
way.

The commit also changes `scan_stack` so that it is initialized with the
default size, instead of the excessive `55 * linewidth` size, which it
usually doesn't get even close to reaching.
2016-10-11 17:51:26 +02:00
Guillaume Gomez ac94bde803 Rollup merge of #37060 - jfirebaugh:E0303, r=jonathandturner
Update E0303 to new error format

Fixes #35790

r? @jonathandturner
2016-10-11 17:51:26 +02:00
Guillaume Gomez 0ff115c507 Rollup merge of #37040 - flodiebold:hash-tests, r=michaelwoerister
Incr. comp. hash tests for consts and statics

Hi,

These two commits fix #37000 and #37001.

r? @michaelwoerister
2016-10-11 17:51:26 +02:00
Guillaume Gomez 97e9eac8bf Rollup merge of #36997 - KillTheMule:patch-1, r=steveklabnik
Book: Be very explicit of lifetimes being descriptive

... not prescriptive. Pointed out in https://users.rust-lang.org/t/what-if-i-get-lifetimes-wrong/7535/4, which was a revelation to me and made me think this should be more clear in the book. I'm not sure if I got this entirely right or if the wording is good, but I figured a PR is more helpful than a simple issue.

r? @steveklabnik

Small Note: There's also https://github.com/rust-lang/book, should I have sent the PR there? It doesn't coincide with the online book though, so I figured it's better of here.
2016-10-11 17:51:26 +02:00
Guillaume Gomez 0b7fe4d67c Rollup merge of #36699 - bluss:repeat-str, r=alexcrichton
Add method str::repeat(self, usize) -> String

It is relatively simple to repeat a string n times:
`(0..n).map(|_| s).collect::<String>()`. It becomes slightly more
complicated to do it “right” (sizing the allocation up front), which
warrants a method that does it for us.

This method is useful in writing testcases, or when generating text.
`format!()` can be used to repeat single characters, but not repeating
strings like this.
2016-10-11 17:51:26 +02:00
Guillaume Gomez 6717dba276 Rollup merge of #36679 - QuietMisdreavus:rustdoc-line-breaks, r=steveklabnik
rustdoc: print non-self arguments of bare functions and struct methods on their own line

This change alters the formatting rustdoc uses when it creates function and struct method documentation. For bare functions, each argument is printed on its own line. For struct methods, non-self arguments are printed on their own line. In both cases, no line breaks are introduced if there are no arguments, and for struct methods, no line breaks are introduced if there is only a single self argument. This should aid readability of long function signatures and allow for greater comprehension of these functions.

I've run rustdoc with these changes on my crate egg-mode and its set of dependencies and put the result [on my server](https://shiva.icesoldier.me/doc-custom/egg_mode/). Of note, here are a few shortcut links that highlight the changes:

* [Bare function with a long signature](https://shiva.icesoldier.me/doc-custom/egg_mode/place/fn.reverse_geocode.html)
* [Struct methods, with single self argument and with self and non-self arguments](https://shiva.icesoldier.me/doc-custom/egg_mode/tweet/struct.Timeline.html#method.reset)
* [Bare functions with no arguments](https://shiva.icesoldier.me/doc-custom/rand/fn.thread_rng.html) and [struct methods with no arguments](https://shiva.icesoldier.me/doc-custom/hyper/client/struct.Client.html#method.new) are left unchanged.

This PR consists of two commits: one for bare functions and one for struct methods.
2016-10-11 17:51:25 +02:00
Guillaume Gomez b5bedfcd3f Add missing urls in io module 2016-10-11 17:48:14 +02:00
bors 304d0c8d85 Auto merge of #36871 - petrochenkov:pdderr, r=nikomatsakis
Turn compatibility lint `match_of_unit_variant_via_paren_dotdot` into a hard error

The lint was introduced 10 months ago and made deny-by-default 7 months ago.
In case someone is still using it, https://github.com/rust-lang/rust/pull/36868 contains a stable replacement.

r? @nikomatsakis
2016-10-11 07:39:09 -07:00
Felix S. Klock II 7d2d5bcbcf Code for enforcing `#[may_dangle]` attribute. 2016-10-11 16:34:31 +02:00
Felix S. Klock II e8ccc68254 Thread `pure_wrt_drop` field through lifetime and type parameters. 2016-10-11 16:08:37 +02:00
Felix S. Klock II 4bb68be681 Add feature gate for `dropck_eyepatch` feature (RFC 1327). 2016-10-11 16:08:36 +02:00
Simon Sapin 401f1c45db Merge two `impl<T> Vec<T>` blocks.
The show up separately in rustdoc.

This is a separate commit to keep the previous one’s diff shorter.
2016-10-11 14:40:05 +02:00
Simon Sapin be34bac1ab Add Vec::dedup_by and Vec::dedup_by_key 2016-10-11 14:39:14 +02:00
bors e33562078f Auto merge of #36983 - alexcrichton:configure-multiple-musl, r=brson
configure: Add options for separate musl roots

This allows using the `./configure` script to enable rustbuild to compile
multiple musl targets at once. We'll hopefully use this soon on our bots to
produce a bunch of targets.
2016-10-11 04:26:56 -07:00
Tobias Bucher 2eda01ee43 Fix Android compilation `io::Error` -> `io::ErrorKind` 2016-10-11 12:16:35 +02:00
bors 1e4c8b1a81 Auto merge of #36825 - sbwtw:master, r=alexcrichton
add println!() macro with out any arguments

lets add println!() to write "\n".
like java https://docs.oracle.com/javase/7/docs/api/java/io/PrintStream.html#println()
2016-10-11 01:17:03 -07:00
Jeffrey Seyfried 829bd8c9b9 Add test. 2016-10-11 05:14:10 +00:00
Jeffrey Seyfried a4c0daab6d Remove `LegacyBindingKind::MacroUse`. 2016-10-11 05:14:10 +00:00
Jeffrey Seyfried 111caef9a3 Clean up the scopes of expanded `#[macro_use]` imports. 2016-10-11 05:14:08 +00:00
Jeffrey Seyfried 31e0e12e69 Add support for undetermined macro invocations. 2016-10-11 03:41:48 +00:00
Jeffrey Seyfried d5281ef681 Merge branch 'persistent_macro_scopes' into cleanup_expanded_macro_use_scopes 2016-10-11 03:41:18 +00:00
Jeffrey Seyfried 6808b0a2b7 Check for shadowing errors after all invocations have been expanded. 2016-10-11 03:28:54 +00:00
Wesley Wiser 5e91c073f2 Move IdxSetBuf and BitSlice to rustc_data_structures
Resolves a FIXME
2016-10-10 20:26:26 -04:00
bors ead9212c33 Auto merge of #36707 - achanda:ip_type, r=alexcrichton
Add two functions to check type of given address

The is_v4 function returns true if the given IP is v4. The is_v6
function returns true if the IP is v6.
2016-10-10 17:18:01 -07:00
Corey Farwell 0038430192 Simplify `str` and `Path` comparison. 2016-10-10 19:46:18 -04:00
Corey Farwell 7c7a5949fe Return early to avoid excessive indentation.` 2016-10-10 19:40:05 -04:00
Corey Farwell a8e257091b Use `Cow` instead of `String` to avoid unnecessary allocations. 2016-10-10 19:35:22 -04:00
Corey Farwell 3a15475d36 Convert `String` generating functions into `&str` constants. 2016-10-10 19:28:16 -04:00