]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoerror correction for missing or mismatched closing brackets
Nick Cameron [Fri, 29 Jan 2016 04:49:59 +0000 (17:49 +1300)]
error correction for missing or mismatched closing brackets

8 years agorefactoring: inline some function in the parser
Nick Cameron [Fri, 29 Jan 2016 01:57:58 +0000 (14:57 +1300)]
refactoring: inline some function in the parser

8 years agoAuto merge of #31642 - rkruppe:rm-regex-script, r=alexcrichton
bors [Sun, 14 Feb 2016 18:00:53 +0000 (18:00 +0000)]
Auto merge of #31642 - rkruppe:rm-regex-script, r=alexcrichton

This file was probably forgotten when libregex moved out of tree. The rust-lang-nursery/regex repo has a nigh-identical file in its script/ folder.

8 years agoAuto merge of #31651 - eddyb:fix-26978, r=arielb1
bors [Sun, 14 Feb 2016 16:18:48 +0000 (16:18 +0000)]
Auto merge of #31651 - eddyb:fix-26978, r=arielb1

Handles `str` being an expression's expected type, which was missing from #20083.
Fixes #26978.

8 years agoDo not expect blocks to have type str.
Eduard Burtescu [Sun, 14 Feb 2016 13:38:48 +0000 (15:38 +0200)]
Do not expect blocks to have type str.

8 years agoAuto merge of #31626 - mitaa:rdoc-srch-escape, r=alexcrichton
bors [Sun, 14 Feb 2016 12:13:58 +0000 (12:13 +0000)]
Auto merge of #31626 - mitaa:rdoc-srch-escape, r=alexcrichton

Maybe they should be Markdown rendered instead, though that doesn't really seem to work all that well.

fixes #31059

r? @alexcrichton

8 years agoAuto merge of #31614 - mitaa:rdoc_locitem_extmac, r=alexcrichton
bors [Sun, 14 Feb 2016 10:10:50 +0000 (10:10 +0000)]
Auto merge of #31614 - mitaa:rdoc_locitem_extmac, r=alexcrichton

fixes #26606

r? @alexcrichton

8 years agoAuto merge of #31391 - frewsxcv:test, r=alexcrichton
bors [Sun, 14 Feb 2016 08:25:39 +0000 (08:25 +0000)]
Auto merge of #31391 - frewsxcv:test, r=alexcrichton

Part of #31185

8 years agoAuto merge of #31581 - petrochenkov:patrefact, r=Manishearth
bors [Sun, 14 Feb 2016 06:18:10 +0000 (06:18 +0000)]
Auto merge of #31581 - petrochenkov:patrefact, r=Manishearth

cc https://github.com/rust-lang/rust/pull/31487#issuecomment-182945101
plugin-[breaking-change]

The first commit renames `ast::Pat_` to `ast::PatKind` and uses its variants in enum qualified form. I've also taken the opportunity and renamed `PatKind::Region` into `PatKind::Ref`.

The second commit splits `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::UnitStruct`.
So, pattern kinds now correspond to their struct/variant kinds - `Struct`, `TupleStruct` and `UnitStruct`.
@nikomatsakis @nrc @arielb1 Are you okay with this naming scheme?
An alternative possible naming scheme is `PatKind::StructVariant`, `PatKind::TupleVariant`, `PatKind::UnitVariant` (it's probably closer to the common use, but I like it less).

I intend to apply these changes to HIR later, they should not necessarily go in the same nightly with https://github.com/rust-lang/rust/pull/31487
r? @Manishearth

8 years agoAdd LLVM ModulePass regression test using run-make.
Corey Farwell [Tue, 2 Feb 2016 04:46:02 +0000 (23:46 -0500)]
Add LLVM ModulePass regression test using run-make.

Part of #31185

8 years agoAuto merge of #31551 - alexcrichton:deprecate-std-os-raw, r=brson
bors [Sun, 14 Feb 2016 02:17:38 +0000 (02:17 +0000)]
Auto merge of #31551 - alexcrichton:deprecate-std-os-raw, r=brson

This commit is an implementation of [RFC 1415][rfc] which deprecates all types
in the `std::os::*::raw` modules.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1415-trim-std-os.md

Many of the types in these modules don't actually have a canonical platform
representation, for example the definition of `stat` on 32-bit Linux will change
depending on whether C code is compiled with LFS support or not. Unfortunately
the current types in `std::os::*::raw` are billed as "compatible with C", which
in light of this means it isn't really possible.

To make matters worse, platforms like Android sometimes define these types as
*smaller* than the way they're actually represented in the `stat` structure
itself. This means that when methods like `DirEntry::ino` are called on Android
the result may be truncated as we're tied to returning a `ino_t` type, not the
underlying type.

The commit here incorporates two backwards-compatible components:

* Deprecate all `raw` types that aren't in `std::os::raw`
* Expand the `std::os::*::fs::MetadataExt` trait on all platforms for method
  accessors of all fields. The fields now returned widened types which are the
  same across platforms (consistency across platforms is not required, however,
  it's just convenient).

and two also backwards-incompatible components:

* Change the definition of all `std::os::*::raw` type aliases to
  correspond to the newly widened types that are being returned on each
  platform.
* Change the definition of `std::os::*::raw::stat` on Linux to match the LFS
  definitions rather than the standard ones.

The breaking changes here will specifically break code that assumes that `libc`
and `std` agree on the definition of `std::os::*::raw` types, or that the `std`
types are faithful representations of the types in C. An [audit] has been
performed of crates.io to determine the fallout which was determined two be
minimal, with the two found cases of breakage having been fixed now.

[audit]: https://github.com/rust-lang/rfcs/pull/1415#issuecomment-180645582

---

Ok, so after all that, we're finally able to support LFS on Linux! This commit
then simultaneously starts using `stat64` and friends on Linux to ensure that we
can open >4GB files on 32-bit Linux. Yay!

Closes #28978
Closes #30050
Closes #31549

8 years agoAuto merge of #31643 - Manishearth:rollup, r=Manishearth
bors [Sat, 13 Feb 2016 23:37:10 +0000 (23:37 +0000)]
Auto merge of #31643 - Manishearth:rollup, r=Manishearth

- Successful merges: #31535, #31537, #31542, #31559, #31563, #31582, #31584, #31585, #31589, #31607, #31609, #31610, #31612, #31629, #31635, #31637, #31638
- Failed merges:

8 years agoRollup merge of #31638 - rkruppe:rm-tex, r=alexcrichton
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31638 - rkruppe:rm-tex, r=alexcrichton

This file is unused since #27789

8 years agoRollup merge of #31637 - rkruppe:ignore-pdb, r=alexcrichton
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31637 - rkruppe:ignore-pdb, r=alexcrichton

8 years agoRollup merge of #31635 - semarie:grep-e, r=alexcrichton
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31635 - semarie:grep-e, r=alexcrichton

The BSD grep for "basic regex" don't support \| as alternate operator (at least under OpenBSD).

Use multiple -e arguments for expressing alternative. I have checked it under Linux (Debian).

8 years agoRollup merge of #31629 - petevine:master, r=alexcrichton
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31629 - petevine:master, r=alexcrichton

This PR should make it easier to create a baseline x86 compiler  as well as make cross-compilation possible through a separate set of rlibs.

Plus, a few Linux distributions (e.g. Debian) have voiced interest in having this target available.

8 years agoRollup merge of #31612 - raindev:grammar, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31612 - raindev:grammar, r=steveklabnik

I feel sorry for bothering you with such a literally one character changes. If it is counter productive feel free to point it out in the comments, that would be totally understandable. I could try to pack such a changes together in one PR to make them less distractive.

r? @steveklabnik

8 years agoRollup merge of #31610 - Manishearth:doc-clarify-txrx, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:10 +0000 (03:59 +0530)]
Rollup merge of #31610 - Manishearth:doc-clarify-txrx, r=steveklabnik

Not everyone knows this convention. We could just rename the variables in the
example, but since this notation is commonly used it's a good opportunity to
introduce it.

r? @steveklabnik

8 years agoRollup merge of #31609 - erickt:nit, r=sfackler
Manish Goregaokar [Sat, 13 Feb 2016 22:29:10 +0000 (03:59 +0530)]
Rollup merge of #31609 - erickt:nit, r=sfackler

8 years agoRollup merge of #31589 - reem:remove-unnecessary-poison-bounds, r=sfackler
Manish Goregaokar [Sat, 13 Feb 2016 22:29:10 +0000 (03:59 +0530)]
Rollup merge of #31589 - reem:remove-unnecessary-poison-bounds, r=sfackler

None

8 years agoRollup merge of #31585 - tshepang:over-explanation, r=brson
Manish Goregaokar [Sat, 13 Feb 2016 22:29:10 +0000 (03:59 +0530)]
Rollup merge of #31585 - tshepang:over-explanation, r=brson

…o read

8 years agoRollup merge of #31584 - tshepang:shorten, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:10 +0000 (03:59 +0530)]
Rollup merge of #31584 - tshepang:shorten, r=steveklabnik

8 years agoRollup merge of #31582 - tshepang:missing-words, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:09 +0000 (03:59 +0530)]
Rollup merge of #31582 - tshepang:missing-words, r=steveklabnik

8 years agoRollup merge of #31563 - SDX2000:docfixes1, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:09 +0000 (03:59 +0530)]
Rollup merge of #31563 - SDX2000:docfixes1, r=steveklabnik

This is a minor change. Please see title. IMO this is important since this is the first instance when we talk about allocating a vector. Not saying that it is allocated on the stack here leaves room for speculation and this might put off some people (they might not even read the later sections which go into more detail about this).

8 years agoRollup merge of #31559 - scottrobertwhittaker:fix-typo, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:09 +0000 (03:59 +0530)]
Rollup merge of #31559 - scottrobertwhittaker:fix-typo, r=steveklabnik

"destructors" was misspelled.

r? @steveklabnik

8 years agoRollup merge of #31542 - nodakai:concat_idents-desc, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:09 +0000 (03:59 +0530)]
Rollup merge of #31542 - nodakai:concat_idents-desc, r=steveklabnik

Just a small documentation change.

It would be great if anyone could check my English.

8 years agoRollup merge of #31537 - ollie27:book_doc_example, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:09 +0000 (03:59 +0530)]
Rollup merge of #31537 - ollie27:book_doc_example, r=steveklabnik

The code sections shouldn't be inside a ```text block.

r? @steveklabnik

8 years agoRollup merge of #31535 - Ketsuban:more-detail-in-wrapping-shift-documentation, r...
Manish Goregaokar [Sat, 13 Feb 2016 22:29:09 +0000 (03:59 +0530)]
Rollup merge of #31535 - Ketsuban:more-detail-in-wrapping-shift-documentation, r=steveklabnik

`wrapping_shl` and `wrapping_shr` are easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for.

If it's deemed useful to add a symmetrical mention to the documentation for the `rotate_left` and `rotate_right` methods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.

8 years agostd: Deprecate all std::os::*::raw types
Alex Crichton [Fri, 5 Feb 2016 01:16:47 +0000 (17:16 -0800)]
std: Deprecate all std::os::*::raw types

This commit is an implementation of [RFC 1415][rfc] which deprecates all types
in the `std::os::*::raw` modules.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1415-trim-std-os.md

Many of the types in these modules don't actually have a canonical platform
representation, for example the definition of `stat` on 32-bit Linux will change
depending on whether C code is compiled with LFS support or not. Unfortunately
the current types in `std::os::*::raw` are billed as "compatible with C", which
in light of this means it isn't really possible.

To make matters worse, platforms like Android sometimes define these types as
*smaller* than the way they're actually represented in the `stat` structure
itself. This means that when methods like `DirEntry::ino` are called on Android
the result may be truncated as we're tied to returning a `ino_t` type, not the
underlying type.

The commit here incorporates two backwards-compatible components:

* Deprecate all `raw` types that aren't in `std::os::raw`
* Expand the `std::os::*::fs::MetadataExt` trait on all platforms for method
  accessors of all fields. The fields now returned widened types which are the
  same across platforms (consistency across platforms is not required, however,
  it's just convenient).

and two also backwards-incompatible components:

* Change the definition of all `std::os::*::raw` type aliases to
  correspond to the newly widened types that are being returned on each
  platform.
* Change the definition of `std::os::*::raw::stat` on Linux to match the LFS
  definitions rather than the standard ones.

The breaking changes here will specifically break code that assumes that `libc`
and `std` agree on the definition of `std::os::*::raw` types, or that the `std`
types are faithful representations of the types in C. An [audit] has been
performed of crates.io to determine the fallout which was determined two be
minimal, with the two found cases of breakage having been fixed now.

[audit]: https://github.com/rust-lang/rfcs/pull/1415#issuecomment-180645582

---

Ok, so after all that, we're finally able to support LFS on Linux! This commit
then simultaneously starts using `stat64` and friends on Linux to ensure that we
can open >4GB files on 32-bit Linux. Yay!

Closes #28978
Closes #30050
Closes #31549

8 years agoRemove a regex-related script
Robin Kruppe [Sat, 13 Feb 2016 21:55:01 +0000 (22:55 +0100)]
Remove a regex-related script

This file was probably forgotten when libregex moved out of tree. The rust-lang-nursery/regex repo has a nigh-identical file in its script/ folder.

8 years agoAuto merge of #31602 - mitaa:rdoc_doc_shorter, r=alexcrichton
bors [Sat, 13 Feb 2016 21:43:28 +0000 (21:43 +0000)]
Auto merge of #31602 - mitaa:rdoc_doc_shorter, r=alexcrichton

fixes #25787
fixes #30366

r? @alexcrichton

8 years agoAuto merge of #31596 - mitaa:rdoc_assoc_item, r=alexcrichton
bors [Sat, 13 Feb 2016 19:28:09 +0000 (19:28 +0000)]
Auto merge of #31596 - mitaa:rdoc_assoc_item, r=alexcrichton

8 years agoRemove the last remaining .tex file
Robin Kruppe [Sat, 13 Feb 2016 19:27:57 +0000 (20:27 +0100)]
Remove the last remaining .tex file

8 years agoAdd *.pdb to .gitignore
Robin Kruppe [Sat, 13 Feb 2016 19:23:19 +0000 (20:23 +0100)]
Add *.pdb to .gitignore

8 years agouse a compatible syntax for grep GNU/BSD
Sébastien Marie [Sat, 13 Feb 2016 19:03:08 +0000 (20:03 +0100)]
use a compatible syntax for grep GNU/BSD

The BSD grep for "basic regex" don't support \| as alternate operator.
Use multiple -e arguments for expressing alternative.

8 years agoAuto merge of #31591 - alexcrichton:make-clean-with-rustbuild, r=brson
bors [Sat, 13 Feb 2016 17:05:50 +0000 (17:05 +0000)]
Auto merge of #31591 - alexcrichton:make-clean-with-rustbuild, r=brson

At the same time also touch up the job management on Windows to be a little more resilient to failure.

8 years agoAdd a new i586 Linux target
petevine [Sat, 13 Feb 2016 16:03:00 +0000 (17:03 +0100)]
Add a new i586 Linux target

8 years agoAuto merge of #31588 - soltanmm:layer, r=nikomatsakis
bors [Sat, 13 Feb 2016 15:25:23 +0000 (15:25 +0000)]
Auto merge of #31588 - soltanmm:layer, r=nikomatsakis

<sup>**context:** moving back to a layered approach to type checking.</sup>

It looks like they'd not ended up tightly coupled in the time one was owned by the other. Every instance outside of `FnCtxt.inh` was from an `InferCtxt` created and dropped in the same function body.

This conflicts slightly with #30652, but there too it looks like the `FulfillmentContext` is from an `InferCtxt` that is created and dropped within the same function body (across one call to a module-private function).

That said, I heard that the PR that originally moved `FulfillmentContext` into `InferCtxt` was big, which leaves me concerned that I'm missing something.

r? @nikomatsakis

8 years agoAuto merge of #31579 - ollie27:msvc_link, r=alexcrichton
bors [Sat, 13 Feb 2016 13:44:02 +0000 (13:44 +0000)]
Auto merge of #31579 - ollie27:msvc_link, r=alexcrichton

/LARGEADDRESSAWARE is already enabled for i686-pc-windows-gnu so we should probably be consistent.
https://msdn.microsoft.com/en-us/library/wz223b1z.aspx

/SAFESEH is a good thing to enable by default.
https://msdn.microsoft.com/en-us/library/9a89h429.aspx

8 years agoSplit ast::PatKind::Enum into tuple struct and path patterns
Vadim Petrochenkov [Sat, 13 Feb 2016 12:51:27 +0000 (15:51 +0300)]
Split ast::PatKind::Enum into tuple struct and path patterns

8 years agoAuto merge of #31570 - tomaka:ignore-emscripten, r=brson
bors [Sat, 13 Feb 2016 12:03:38 +0000 (12:03 +0000)]
Auto merge of #31570 - tomaka:ignore-emscripten, r=brson

Ignores 82 rpass tests that use threads.
I took care to only ignore tests that call `thread::spawn`. Some tests, for example `issue-16597`, also do fail because of lack of threads support, but for other reasons.

With this PR, we're down to 49 failures.

r? @brson

8 years agoRename ast::Pat_ and its variants
Vadim Petrochenkov [Thu, 11 Feb 2016 18:16:33 +0000 (21:16 +0300)]
Rename ast::Pat_ and its variants

8 years agoEscape search-index item descriptions
mitaa [Sat, 13 Feb 2016 10:27:53 +0000 (11:27 +0100)]
Escape search-index item descriptions

The item descriptions are included verbatim in search results
causing certain character sequences to misbehave.

8 years agoAuto merge of #31564 - durka:lang-item-icemelt, r=nikomatsakis
bors [Sat, 13 Feb 2016 10:23:49 +0000 (10:23 +0000)]
Auto merge of #31564 - durka:lang-item-icemelt, r=nikomatsakis

This changes three ICEs to fatal errors.

I've grepped for `lang_item.*expect` and `\.expect.*lang` and didn't come up with any more. But, there could be more ICEs lurking.

I wasn't sure about a test because there already _is_ a cfail test for missing lang items, but it only checks one.

Relevant to (already closed) #31477 #31480 #31558.
cc @lilred

8 years agoAuto merge of #31562 - llogiq:lint_post, r=Manishearth
bors [Sat, 13 Feb 2016 08:27:42 +0000 (08:27 +0000)]
Auto merge of #31562 - llogiq:lint_post, r=Manishearth

This fixes #31512 for me.

A bit of explanation: I want to have `check_block_post(&mut self, &Context, &Block)` and `check_crate_post(&mut self, &Context, &Crate)` methods in both early and late lint passes. Ideally we'd have _post methods for all operations that walk, but this'll do for now.

@Manishearth r?

8 years agoAuto merge of #31557 - retep998:house-directory, r=alexcrichton
bors [Sat, 13 Feb 2016 06:47:29 +0000 (06:47 +0000)]
Auto merge of #31557 - retep998:house-directory, r=alexcrichton

This is the simple solution. I know @nodakai was working on a more complex solution that overhauled the `fill_utf16_buf` stuff.

r? @alexcrichton

8 years agoAuto merge of #31358 - japaric:print-targets, r=alexcrichton
bors [Sat, 13 Feb 2016 03:21:49 +0000 (03:21 +0000)]
Auto merge of #31358 - japaric:print-targets, r=alexcrichton

that prints a list of all the triples supported by the `--target` flag

r? @alexcrichton

8 years agoAuto merge of #31524 - jonas-schievink:autoderef, r=steveklabnik
bors [Sat, 13 Feb 2016 00:16:03 +0000 (00:16 +0000)]
Auto merge of #31524 - jonas-schievink:autoderef, r=steveklabnik

8 years agoOmit src-links for items from extern macros
mitaa [Fri, 12 Feb 2016 20:08:02 +0000 (21:08 +0100)]
Omit src-links for items from extern macros

If the span of a local item points into an external macro
its source-file will be bogus.

8 years agoRemove unnecessary article
Andrew Barchuk [Fri, 12 Feb 2016 19:40:02 +0000 (21:40 +0200)]
Remove unnecessary article

8 years agoClarify what tx/rx mean in concurrency docs
Manish Goregaokar [Fri, 12 Feb 2016 19:27:52 +0000 (00:57 +0530)]
Clarify what tx/rx mean in concurrency docs

8 years agosyntax: Replace unstable `vec.as_slice().get()` with `vec.get()`
Erick Tryzelaar [Fri, 12 Feb 2016 18:59:26 +0000 (10:59 -0800)]
syntax: Replace unstable `vec.as_slice().get()` with `vec.get()`

8 years agobootstrap: Be resilient to job object failures
Alex Crichton [Fri, 12 Feb 2016 04:46:47 +0000 (20:46 -0800)]
bootstrap: Be resilient to job object failures

The build bots already use job objects, and they don't support nested job
objects, and we shouldn't entirely bail out in this case anyway!

8 years agoAutoderef in librustc
Jonas Schievink [Tue, 9 Feb 2016 21:00:20 +0000 (22:00 +0100)]
Autoderef in librustc

8 years agoAutoderef in librustc_borrowck
Jonas Schievink [Tue, 9 Feb 2016 20:42:39 +0000 (21:42 +0100)]
Autoderef in librustc_borrowck

8 years agoAutoderef in librustc_lint
Jonas Schievink [Tue, 9 Feb 2016 20:39:09 +0000 (21:39 +0100)]
Autoderef in librustc_lint

8 years agoAutoderef in librustc_metadata
Jonas Schievink [Tue, 9 Feb 2016 20:37:21 +0000 (21:37 +0100)]
Autoderef in librustc_metadata

8 years agoAutoderef in librustc_mir
Jonas Schievink [Tue, 9 Feb 2016 20:32:51 +0000 (21:32 +0100)]
Autoderef in librustc_mir

8 years agoAutoderef in librustc_passes
Jonas Schievink [Tue, 9 Feb 2016 20:30:52 +0000 (21:30 +0100)]
Autoderef in librustc_passes

8 years agoAutoderef in librustc_plugin
Jonas Schievink [Tue, 9 Feb 2016 20:29:57 +0000 (21:29 +0100)]
Autoderef in librustc_plugin

8 years agoAutoderef in librustc_privacy
Jonas Schievink [Tue, 9 Feb 2016 20:28:53 +0000 (21:28 +0100)]
Autoderef in librustc_privacy

8 years agoAutoderef in librustc_resolve
Jonas Schievink [Tue, 9 Feb 2016 20:27:42 +0000 (21:27 +0100)]
Autoderef in librustc_resolve

8 years agoAutoderef in librustc_trans
Jonas Schievink [Tue, 9 Feb 2016 20:24:11 +0000 (21:24 +0100)]
Autoderef in librustc_trans

8 years agoAutoderef in librustc_typeck
Jonas Schievink [Tue, 9 Feb 2016 20:09:37 +0000 (21:09 +0100)]
Autoderef in librustc_typeck

8 years agoUse more autoderef in libsyntax
Jonas Schievink [Mon, 8 Feb 2016 22:55:55 +0000 (23:55 +0100)]
Use more autoderef in libsyntax

8 years agoUse more autoderef in libsyntax_ext
Jonas Schievink [Mon, 8 Feb 2016 22:55:48 +0000 (23:55 +0100)]
Use more autoderef in libsyntax_ext

8 years agoUse more autoderef in rustc_driver
Jonas Schievink [Mon, 8 Feb 2016 22:42:39 +0000 (23:42 +0100)]
Use more autoderef in rustc_driver

8 years agoMake more use of autoderef in librustc_front
Jonas Schievink [Mon, 8 Feb 2016 21:50:21 +0000 (22:50 +0100)]
Make more use of autoderef in librustc_front

8 years agoAuto merge of #30726 - GuillaumeGomez:compile-fail, r=brson
bors [Fri, 12 Feb 2016 18:25:08 +0000 (18:25 +0000)]
Auto merge of #30726 - GuillaumeGomez:compile-fail, r=brson

r? @brson
cc @alexcrichton

I still need to add error code explanation test with this, but I can't figure out a way to generate the `.md` files in order to test example source codes.

Will fix #27328.

8 years agofix double check_item
llogiq [Fri, 12 Feb 2016 17:21:43 +0000 (18:21 +0100)]
fix double check_item

8 years agoAuto merge of #31550 - Stebalien:fix-color, r=nrc
bors [Fri, 12 Feb 2016 16:42:03 +0000 (16:42 +0000)]
Auto merge of #31550 - Stebalien:fix-color, r=nrc

Fixes #31546

8 years agorustc: add a `--print target-list` command
Jorge Aparicio [Fri, 12 Feb 2016 15:11:58 +0000 (10:11 -0500)]
rustc: add a `--print target-list` command

8 years agoAuto merge of #31583 - petrochenkov:indi_ast, r=Manishearth
bors [Fri, 12 Feb 2016 14:56:20 +0000 (14:56 +0000)]
Auto merge of #31583 - petrochenkov:indi_ast, r=Manishearth

cc #31487
plugin-[breaking-change]

The AST part of https://github.com/rust-lang/rust/pull/30087

r? @Manishearth

8 years agoShorten docstrings after Markdown rendering
mitaa [Fri, 12 Feb 2016 12:45:07 +0000 (13:45 +0100)]
Shorten docstrings after Markdown rendering

8 years agoAuto merge of #31541 - tomaka:more-emscripten, r=brson
bors [Fri, 12 Feb 2016 12:51:12 +0000 (12:51 +0000)]
Auto merge of #31541 - tomaka:more-emscripten, r=brson

r? @brson

8 years agoFix associated item identifiers
mitaa [Fri, 12 Feb 2016 08:43:33 +0000 (09:43 +0100)]
Fix associated item identifiers

Search results use the mapping found in `ItemType::to_static_str` for
the identifier, which could not be found on the page in the case of
associated items.

8 years agoFix inherent-associated-const search result links
mitaa [Fri, 12 Feb 2016 08:34:00 +0000 (09:34 +0100)]
Fix inherent-associated-const search result links

Normal constants have their own page while associated constants are
embedded within their parent-items page.

8 years agoAuto merge of #31368 - JohanLorenzo:dont-strip-if-test-build, r=alexcrichton
bors [Fri, 12 Feb 2016 05:53:18 +0000 (05:53 +0000)]
Auto merge of #31368 - JohanLorenzo:dont-strip-if-test-build, r=alexcrichton

Tools which rely on DWARF for generating code coverage report, don't generate accurate numbers on test builds. For instance, [this sample main](https://github.com/JohanLorenzo/rust-testing-example/blob/757bdbf3887f43db9771c20cb72dfc32aa8f4321/src/main.rs) returns [100% coverage](https://coveralls.io/builds/4940156/source?filename=main.rs) when [kcov](https://github.com/SimonKagstrom/kcov/) runs.

With @pnkfelix 's great help, we could narrow down the issue: The linker strips unused function during phase 6. Here's a patch which stops stripping when someone calls `rustc --test $ARGS`. @pnkfelix wasn't sure if we should add a new flag, or just use --test. What do you think @alexcrichton ?

Also, I'm not too sure: where is the best place to add a test for this addition?

Thanks for the help!

8 years agobootstrap: Add a --clean flag
Alex Crichton [Fri, 12 Feb 2016 04:44:03 +0000 (20:44 -0800)]
bootstrap: Add a --clean flag

Also add a `clean` target for the makefiles to blow away everything related to
the build. Note that this specifically does not tamper with:

* the LLVM build directory
* the directory of the bootstrap system
* the cached downloads of cargo/rustc

8 years agoAuto merge of #30830 - arcnmx:static-extern, r=alexcrichton
bors [Fri, 12 Feb 2016 02:16:13 +0000 (02:16 +0000)]
Auto merge of #30830 - arcnmx:static-extern, r=alexcrichton

See #29676

r? @alexcrichton

8 years agoRemove unnecessary bounds on Error and Display implementations for TryLockError and...
Jonathan Reem [Fri, 12 Feb 2016 01:24:57 +0000 (17:24 -0800)]
Remove unnecessary bounds on Error and Display implementations for TryLockError and PoisonError.

8 years agodoc: skipping (obvious) details here is worth making this more nice to read
Tshepang Lekhonkhobe [Thu, 11 Feb 2016 21:35:30 +0000 (23:35 +0200)]
doc: skipping (obvious) details here is worth making this more nice to read

8 years agoAuto merge of #31123 - alexcrichton:who-doesnt-want-two-build-systems, r=brson
bors [Fri, 12 Feb 2016 00:19:13 +0000 (00:19 +0000)]
Auto merge of #31123 - alexcrichton:who-doesnt-want-two-build-systems, r=brson

This series of commits adds the initial implementation of a new build system for
the compiler and standard library based on Cargo. The high-level architecture
now looks like:

1. The `./configure` script is run with `--enable-rustbuild` and other standard
   configuration options.
2. A `Makefile` is generate which proxies commands to the new build system.
3. The new build system has a Python script entry point which manages
   downloading both a Rust and Cargo nightly. This initial script also manages
   building the build system itself (which is written in Rust).
4. The build system, written in rust and called `bootstrap`, architects how to
   call `cargo` and manages building all native libraries and such.

One might reasonably ask "why rewrite the build system?", which is a good
question! The Rust project has used Makefiles for as long as I can remember at
least, and while ugly and difficult to use are undeniably robust as they contain
years worth of tweaking and tuning for working on as many platforms in as many
situation as possible. The rationale behind this PR, however is:

* The makefiles are impenetrable to all but a few people on this
  planet. This means that contributions to the build system are almost
  nonexistent, and furthermore if a build system change is needed it's
  incredibly difficult to figure out how to do so. This hindrance prevents us
  from doing some "perhaps fancier" things we may wish to do in make.

* Our build system, while portable, is unfortunately not infinitely portable
  everywhere.  For example the recently-introduced MSVC target is quite unlikely
  to have `make` installed by default (e.g. it requires building inside of an
  MSYS2 shell currently). Conversely, the portability of make comes at a cost of
  crazy and weird hacks to work around all sorts of versions of software
  everywhere, especially when it comes to the configure script and makefiles.
  By rewriting this logic in one of the most robust platforms there is, Rust,
  we get to assuage all of these worries for free!

* There's a standard tool to build Rust crates, Cargo, but the standard library
  and compiler don't use it. This means that they cannot benefit easily from the
  crates.io ecosystem, nor can the ecosystem benefit from a standard way to
  build this repository itself. Moving to Cargo should help assuage both of
  these needs. This has the added benefit of making the compiler more
  approachable for newbies as working on the compiler will just happen to be
  working on a large Cargo project, all the same standard tools and tricks will
  apply.

* There's a huge amount of portability information in the main distribution, for
  example around cross compiling, compiling on new OSes, etc. Pushing this logic
  into standard crates (like `gcc`) enables the community to immediately benefit
  from new build logic.

Despite these benefits, it's going to be a long road to actually replace our
current build system. This PR is just the beginning and doesn't implement the
full suite of functionality as the current one, but there are many more to
follow! The current implementation strategy hopes to look like:

1. Land a second build system in-tree that can be itereated on an and
   contributed to. This will not be used just yet in terms of gating new commits
   to the repo.
2. Over time, bring the second build system to feature parity with the old build
   system, start setting up CI for both build systems.
3. At some point in the future, switch the default to the new build system, but
   keep the old one around.
4. At some further point in the future, delete the entire old build system.

---

Alright, so with all that out of the way, here's some more info on this PR
itself. The inital build system here is contained in the `src/bootstrap`
directory and just adds the necessary minimum bits to bootstrap the compiler
itself. There is currently no support for building documentation, running tests,
or installing, but the implemented support is:

* Compiling LLVM with `cmake` instead of `./configure` + `make`. The LLVM
  project is removing their autotools build system, so we'd have to make this
  transition eventually anyway.

* Compiling compiler-rt with `cmake` as well (for the same rationale as above).

* Adding `Cargo.toml` to map out the dependency graph to all crates, and also
  adding `build.rs` files where appropriate. For example `alloc_jemalloc` has a
  script to build jemalloc, `flate` has a script to build `miniz.c`, `std` will
  build `libbacktrace`, etc.

* Orchestrating all the calls to `cargo` to build the standard distribution,
  following the normal bootstrapping process. This also tracks dependencies
  between steps to ensure cross-compilation targets happen as well.

* Configuration is intended to eventually be done through a `config.toml` file,
  so support is implemented for this. The most likely vector of configuration
  for now, however, is likely through `config.mk` (what `./configure` emits), so
  the build system currently parses this information.

There's still quite a few steps left to do, and I'll open up some follow-up
issues (as well as a tracking issue) for this migration, but hopefully this is a
great start to get going! This PR is currently tested on all the
Windows/Linux/OSX triples for x86\_64 and x86, but more portability is always
welcome!

---

Future functionality left to implement

* [ ] Re-verify that multi-host builds work
* [ ] Verify android build works
* [ ] Verify iOS build work (mostly compiler-rt)
* [ ] Verify sha256 and ideally gpg of downloaded nightly compiler and nightly rustc
* [ ] Implement testing -- this is a huge bullet point with lots of sub-bullets
* [ ] Build and generate documentation (plus the various tools we have in-tree)
* [ ] Move various src/etc scripts into Rust -- not sure how this interacts with `make` build system
* [ ] Implement `make install` - like testing this is also quite massive
* [x] Deduplicate version information with makefiles

8 years agoAuto merge of #31545 - dotdash:no_noalias, r=alexcrichton
bors [Thu, 11 Feb 2016 22:22:54 +0000 (22:22 +0000)]
Auto merge of #31545 - dotdash:no_noalias, r=alexcrichton

LLVM's memory dependence analysis doesn't properly account for calls
that could unwind and thus effectively act as a branching point. This
can lead to stores that are only visible when the call unwinds being
removed, possibly leading to calls to drop() functions with b0rked
memory contents.

As there is no fix for this in LLVM yet and we want to keep
compatibility to current LLVM versions anyways, we have to workaround
this bug by omitting the noalias attribute on &mut function arguments.
Benchmarks suggest that the performance loss by this change is very
small.

Thanks to @RalfJung for pushing me towards not removing too many
noalias annotations and @alexcrichton for helping out with the test for
this bug.

Fixes #29485

8 years agodoc: assert_eq on 2 boolean values is redundant
Tshepang Lekhonkhobe [Thu, 11 Feb 2016 21:05:00 +0000 (23:05 +0200)]
doc: assert_eq on 2 boolean values is redundant

8 years agodoc: add missing words
Tshepang Lekhonkhobe [Thu, 11 Feb 2016 20:59:34 +0000 (22:59 +0200)]
doc: add missing words

8 years agoRemove some unnecessary indirection from AST structures
Vadim Petrochenkov [Thu, 11 Feb 2016 20:33:09 +0000 (23:33 +0300)]
Remove some unnecessary indirection from AST structures

8 years agorustc_back: Fix disabling jemalloc
Alex Crichton [Fri, 22 Jan 2016 02:37:46 +0000 (18:37 -0800)]
rustc_back: Fix disabling jemalloc

When building with Cargo we need to detect `feature = "jemalloc"` to enable
jemalloc, so propagate this same change to the build system to pass the right
`--cfg` argument.

8 years agoconfigure: Add an option to use the cargo build system
Alex Crichton [Fri, 22 Jan 2016 01:05:04 +0000 (17:05 -0800)]
configure: Add an option to use the cargo build system

This commit adds a `--enable-rustbuild` option to the configure script which
will copy a different `Makefile.in` into place to intercept all `make`
invocations.

Currently this makefile only has one target, but it's expected to be filled out
quite a bit over time!

8 years agorustc_llvm: Tweak how initialization is performed
Alex Crichton [Thu, 21 Jan 2016 23:39:22 +0000 (15:39 -0800)]
rustc_llvm: Tweak how initialization is performed

Refactor a bit to have less repetition and #[cfg] and try to bury it all inside
of a macro.

8 years agorustbook: Make `main` a public function
Alex Crichton [Thu, 21 Jan 2016 23:37:15 +0000 (15:37 -0800)]
rustbook: Make `main` a public function

This will allow it to be used as a crate in a Cargo-based build

8 years agobootstrap: Add directives to not double-link libs
Alex Crichton [Thu, 21 Jan 2016 23:36:25 +0000 (15:36 -0800)]
bootstrap: Add directives to not double-link libs

Have all Cargo-built crates pass `--cfg cargobuild` and then add appropriate
`#[cfg]` definitions to all crates to avoid linking anything if this is passed.
This should help allow libstd to compile with both the makefiles and with Cargo.

8 years agobootstrap: Add build scripts for crates
Alex Crichton [Thu, 21 Jan 2016 23:21:13 +0000 (15:21 -0800)]
bootstrap: Add build scripts for crates

This commits adds build scripts to the necessary Rust crates for all the native
dependencies. This is currently a duplication of the support found in mk/rt.mk
and is my best effort at representing the logic twice, but there may be some
unfortunate-and-inevitable divergence.

As a summary:

* alloc_jemalloc - build script to compile jemallocal
* flate - build script to compile miniz.c
* rustc_llvm - build script to run llvm-config and learn about how to link it.
  Note that this crucially (and will not ever) compile LLVM as that would take
  far too long.
* rustdoc - build script to compile hoedown
* std - script to determine lots of libraries/linkages as well as compile
  libbacktrace

8 years agobootstrap: Add a bunch of Cargo.toml files
Alex Crichton [Thu, 21 Jan 2016 23:19:23 +0000 (15:19 -0800)]
bootstrap: Add a bunch of Cargo.toml files

These describe the structure of all our crate dependencies.

8 years agoAuto merge of #31083 - SimonSapin:set_port, r=alexcrichton
bors [Thu, 11 Feb 2016 18:44:52 +0000 (18:44 +0000)]
Auto merge of #31083 - SimonSapin:set_port, r=alexcrichton

As demonstrated in the `resolve_socket_addr` change, this is less awkward than re-creating a new address from the other parts.

If this is to be accepted, pleas open a tracking issue (I can’t set the appropriate tags) and I’ll update the PR with the tracking issue number.

8 years agoconfigure: Remove default NDK path value
Alex Crichton [Fri, 15 Jan 2016 00:19:41 +0000 (16:19 -0800)]
configure: Remove default NDK path value

This likely isn't always valid, and subverts auto-detection.

8 years agobootstrap: Read configuration from config.mk
Alex Crichton [Fri, 20 Nov 2015 00:55:21 +0000 (16:55 -0800)]
bootstrap: Read configuration from config.mk

During the transition period where we're still using ./configure and makefiles,
read some extra configuration from `config.mk` if it's present. This means that
the bootstrap build should be configured the same as the original ./configure
invocation.

Eventually this will all be removed in favor of only storing information in
`config.toml` (e.g. the configure script will generate config.toml), but for now
this should suffice.

8 years agoAdd a Cargo-based build system
Alex Crichton [Thu, 19 Nov 2015 23:20:12 +0000 (15:20 -0800)]
Add a Cargo-based build system

This commit is the start of a series of commits which start to replace the
makefiles with a Cargo-based build system. The aim is not to remove the
makefiles entirely just yet but rather just replace the portions that invoke the
compiler to do the bootstrap. This commit specifically adds enough support to
perform the bootstrap (and all the cross compilation within) along with
generating documentation.

More commits will follow up in this series to actually wire up the makefiles to
call this build system, so stay tuned!

8 years agoFix usage of GetUserProfileDirectoryW in env::home_dir
Peter Atashian [Thu, 11 Feb 2016 18:12:56 +0000 (13:12 -0500)]
Fix usage of GetUserProfileDirectoryW in env::home_dir

Signed-off-by: Peter Atashian <retep998@gmail.com>
8 years agoPass through diagnostic handler instead
arcnmx [Fri, 15 Jan 2016 19:43:14 +0000 (14:43 -0500)]
Pass through diagnostic handler instead