]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agoAuto merge of #26662 - steveklabnik:gh26661, r=alexcrichton
bors [Tue, 30 Jun 2015 10:26:09 +0000 (10:26 +0000)]
Auto merge of #26662 - steveklabnik:gh26661, r=alexcrichton

This is his own mirror, so it shouldn't go down, unlike the previous one.

Fixes #26661

9 years agoAuto merge of #26670 - frewsxcv:regression-test-13902, r=alexcrichton
bors [Tue, 30 Jun 2015 08:04:11 +0000 (08:04 +0000)]
Auto merge of #26670 - frewsxcv:regression-test-13902, r=alexcrichton

Closes #13902

9 years agoAuto merge of #26668 - frewsxcv:regression-test-17756, r=alexcrichton
bors [Tue, 30 Jun 2015 03:18:45 +0000 (03:18 +0000)]
Auto merge of #26668 - frewsxcv:regression-test-17756, r=alexcrichton

Closes #17756

9 years agoAuto merge of #26667 - arielb1:audit-walk, r=eddyb
bors [Tue, 30 Jun 2015 01:45:46 +0000 (01:45 +0000)]
Auto merge of #26667 - arielb1:audit-walk, r=eddyb

This was originally motivated by checking for HRTB hygiene, but I found several other bugs on the way.

This does not fix the biggest user of ty_walk, which is dtorck - I would prefer to coordinate that with @pnkfelix.

r? @eddyb

9 years agoAdd regression test for #13902
Corey Farwell [Tue, 30 Jun 2015 00:28:21 +0000 (17:28 -0700)]
Add regression test for #13902

Closes #13902

9 years agoAuto merge of #26666 - huonw:unc-rec, r=alexcrichton
bors [Tue, 30 Jun 2015 00:14:32 +0000 (00:14 +0000)]
Auto merge of #26666 - huonw:unc-rec, r=alexcrichton

This fixes two false positives for the unconditional recursion lint, when functions use themselves (or almost-themselves) internally, without actually being recursive.

````rust
fn main() { let _ = main; }
```
```rust
trait Bar {
    fn method<T: Bar>(&self, x: &T) {
        x.method(x)
    }
}
```

9 years agoAdd regression test for #17756
Corey Farwell [Tue, 30 Jun 2015 00:10:53 +0000 (17:10 -0700)]
Add regression test for #17756

Closes #17756

9 years agoRemove now-useless code
Ariel Ben-Yehuda [Mon, 29 Jun 2015 23:31:07 +0000 (02:31 +0300)]
Remove now-useless code

9 years agoKill count_late_bound_regions
Ariel Ben-Yehuda [Mon, 29 Jun 2015 23:24:46 +0000 (02:24 +0300)]
Kill count_late_bound_regions

No, it didn't show up in my profiler. It still needs to die.

9 years agolint: default methods must be called on Self to unconditionally recur.
Huon Wilson [Mon, 29 Jun 2015 22:56:00 +0000 (15:56 -0700)]
lint: default methods must be called on Self to unconditionally recur.

This catches the case when a trait defines a default method that calls
itself, but on a type that isn't necessarily `Self`, e.g. there's no
reason that `T = Self` in the following, so the call isn't necessarily
recursive (`T` may override the call).

    trait Bar {
        fn method<T: Bar>(&self, x: &T) {
            x.method(x)
        }
    }

Fixes #26333.

9 years agolint: only consider actual calls as unconditional recursion.
Huon Wilson [Mon, 29 Jun 2015 21:51:56 +0000 (14:51 -0700)]
lint: only consider actual calls as unconditional recursion.

Specifically, just mentioning the function name as a value is fine, as
long as it isn't called, e.g. `fn main() { let _ = main; }`.

Closes #21705.

9 years agoRemove type_needs_unwind_cleanup
Ariel Ben-Yehuda [Mon, 29 Jun 2015 22:34:17 +0000 (01:34 +0300)]
Remove type_needs_unwind_cleanup

After the last @dinosaur went extinct, the check became redundant with
type_needs_drop, except for its bugginess.

Fixes #26655.

9 years agoFix lifetime elision region accounting
Ariel Ben-Yehuda [Mon, 29 Jun 2015 21:32:39 +0000 (00:32 +0300)]
Fix lifetime elision region accounting

This merges accumulate_regions_in_type with ty_fold::collect_regions.
Fixes #26638

9 years agoAuto merge of #26660 - steveklabnik:fix_up_pointers, r=alexcrichton
bors [Mon, 29 Jun 2015 22:22:54 +0000 (22:22 +0000)]
Auto merge of #26660 - steveklabnik:fix_up_pointers, r=alexcrichton

This is a bit outdated.

9 years agoUpdate link to Ousterhout
Steve Klabnik [Mon, 29 Jun 2015 19:31:27 +0000 (15:31 -0400)]
Update link to Ousterhout

This is his own mirror, so it shouldn't go down, unlike the previous one.

Fixes #26661

9 years agoAuto merge of #26659 - nagisa:cas-docs, r=alexcrichton
bors [Mon, 29 Jun 2015 20:50:41 +0000 (20:50 +0000)]
Auto merge of #26659 - nagisa:cas-docs, r=alexcrichton

Namely:

* Change parameter `old` to read `current` so it is clearer what the argument refers to (originally
   suggested `expected`, but shot down by Steve);
* Add some formatting and fix some mistakes like referring to the method as `swap` rather than
  `compare_and_swap`.

9 years agoRefine Atomic*::compare_and_swap documentation
Simonas Kazlauskas [Mon, 29 Jun 2015 18:44:40 +0000 (21:44 +0300)]
Refine Atomic*::compare_and_swap documentation

Namely:

* Change parameter `old` to read `current` so it is clearer what the argument refers to (originally
    suggested `expected`, but shot down by Steve);
* Add some formatting and fix some mistakes like referring to the method as `swap` rather than
  `compare_and_swap`.

9 years agoAuto merge of #26623 - Saser:master, r=steveklabnik
bors [Mon, 29 Jun 2015 19:19:31 +0000 (19:19 +0000)]
Auto merge of #26623 - Saser:master, r=steveklabnik

In Chapter 5.9 (References and Borrowing), there is an example [at the very end](https://doc.rust-lang.org/stable/book/references-and-borrowing.html#use-after-free) which shows that declaring a reference before declaring the variable that it points to results in a compilation error. The book does not really mention why this happens though -- in the sections before, it has described how different scopes affects the lifetime of resources, but there is no mention of how resources within the same scope work.

This confused me a little, so I asked on #rust and got the answer that the resources are destroyed in the reverse order that they are declared, but the book makes no mention of it (as far as I can find) -- except in Chapter 5.21 (Drop), where it says:

> When `x` goes out of scope at the end of `main()`, the code for `Drop` will run. `Drop` has one method, which is also called `drop()`. It takes a mutable reference to `self`.
>
> That’s it! The mechanics of `Drop` are very simple, but there are some subtleties. For example, values are dropped in the opposite order they are declared. [...]

---

I feel like Chapter 5.9 (References and Borrowing) is probably the best place to put this information (as I have done in my additions), since it deals with other types of referencing and borrowing. However, since English is not my native language, the wording of my additions perhaps are a little "off" -- any feedback on them is appreciated.

9 years agoChange removal notice for pointer guide.
Steve Klabnik [Mon, 29 Jun 2015 19:17:56 +0000 (15:17 -0400)]
Change removal notice for pointer guide.

This is a bit outdated.

9 years agoFix off-by-one error in default-type-parameter checking
Ariel Ben-Yehuda [Mon, 29 Jun 2015 18:07:09 +0000 (21:07 +0300)]
Fix off-by-one error in default-type-parameter checking

Fixes #18183

9 years agoAuto merge of #26530 - steveklabnik:gh26471, r=alexcrichton
bors [Mon, 29 Jun 2015 17:44:56 +0000 (17:44 +0000)]
Auto merge of #26530 - steveklabnik:gh26471, r=alexcrichton

Fixes #26471

r? @alexcrichton

9 years agoAuto merge of #26462 - brson:stdidx, r=steveklabnik
bors [Mon, 29 Jun 2015 15:46:35 +0000 (15:46 +0000)]
Auto merge of #26462 - brson:stdidx, r=steveklabnik

This is usually the link I want when I come to this page.

r? @steveklabnik

9 years agoHide the Rand trait from docs
Steve Klabnik [Mon, 29 Jun 2015 15:08:59 +0000 (08:08 -0700)]
Hide the Rand trait from docs

Fixes #26471

9 years agoAuto merge of #26649 - Manishearth:rollup, r=Manishearth
bors [Mon, 29 Jun 2015 08:29:54 +0000 (08:29 +0000)]
Auto merge of #26649 - Manishearth:rollup, r=Manishearth

- Successful merges: #26593, #26644, #26645
- Failed merges:

9 years agoRollup merge of #26645 - richo:makefile-typo, r=sfackler
Manish Goregaokar [Mon, 29 Jun 2015 08:29:34 +0000 (13:59 +0530)]
Rollup merge of #26645 - richo:makefile-typo, r=sfackler

9 years agoRollup merge of #26644 - pelmers:make_stage_tip, r=sfackler
Manish Goregaokar [Mon, 29 Jun 2015 08:29:33 +0000 (13:59 +0530)]
Rollup merge of #26644 - pelmers:make_stage_tip, r=sfackler

I keep forgetting the command to do partial stage1 compile, so I think it would be helpful to add it into `make tips`.

9 years agoRollup merge of #26593 - GuillaumeGomez:patch-2, r=Manishearth
Manish Goregaokar [Mon, 29 Jun 2015 08:29:33 +0000 (13:59 +0530)]
Rollup merge of #26593 - GuillaumeGomez:patch-2, r=Manishearth

Part of #24407.
cc @michaelsproul

9 years agoThe come back of the "a" eaten by the void
Guillaume Gomez [Mon, 29 Jun 2015 08:21:39 +0000 (10:21 +0200)]
The come back of the "a" eaten by the void

9 years agoAdd more details in error explanation
Guillaume Gomez [Mon, 29 Jun 2015 08:03:02 +0000 (10:03 +0200)]
Add more details in error explanation

9 years agoAdd E0110 error explanation
Guillaume Gomez [Sat, 27 Jun 2015 22:20:59 +0000 (00:20 +0200)]
Add E0110 error explanation

9 years agomk: Fix a typo in the tips
Richo Healey [Mon, 29 Jun 2015 02:05:09 +0000 (19:05 -0700)]
mk: Fix a typo in the tips

9 years agoAdd tip to do partial compile.
Peter Elmers [Mon, 29 Jun 2015 01:49:22 +0000 (18:49 -0700)]
Add tip to do partial compile.

9 years agoAuto merge of #26582 - jroesch:infer-ctxt-refactor, r=nikomatsakis
bors [Mon, 29 Jun 2015 00:03:37 +0000 (00:03 +0000)]
Auto merge of #26582 - jroesch:infer-ctxt-refactor, r=nikomatsakis

This branch begins the work of unifying our type checking contexts into a single piece of state. The goal is to eventually have a single context that we can pass around instead of the fractured situation we currently have. There are still several things that must be done before beginning to make tables item local:

- [ ] move FulfillmentContext into InferCtxt
- [ ] modify SelectionContext to only take a single context argument
- [ ] remove remaining typer impls
- [ ] remove the ClosureTyper + Typer trait
- [ ] do some renaming to make these things more applicable to their new roles

r? @nikomatsakis

As a side note there are a couple oddities that are temporary refactors that will be quickly cleaned up in a follow-up PR.

cc @eddyb @Aatch @arielb1 @nrc

9 years agoAuto merge of #26642 - remram44:doc-openoptions-missing-write, r=alexcrichton
bors [Sun, 28 Jun 2015 21:37:07 +0000 (21:37 +0000)]
Auto merge of #26642 - remram44:doc-openoptions-missing-write, r=alexcrichton

Setting append without write doesn't give you a writeable file. Showing it as an example in the docs is confusing at best ([reddit](https://www.reddit.com/r/rust/comments/3bbz8w/why_is_writing_a_file_not_working_for_me/))

Using truncate (O_TRUNC) on a read-only file is an error on POSIX systems ("unspecified"). Note however that using create (O_CREAT) with read-only flags is fine.

Related: #26103 (which IMHO is wrong; saying "append is different than write" when should simply be "append needs write". My vote is to make append imply write)

9 years agoAdd `.write(true)` to append and truncate examples
Remi Rampin [Sun, 28 Jun 2015 21:23:53 +0000 (17:23 -0400)]
Add `.write(true)` to append and truncate examples

Setting append without write doesn't give you a writeable file. Showing
it as an example in the docs is confusing at best.

Using truncate on a read-only file is an error on POSIX systems (note
however that using create with read-only flags is fine).

9 years agoFix librustc_driver/test.rs
Jared Roesch [Sun, 28 Jun 2015 21:08:50 +0000 (14:08 -0700)]
Fix librustc_driver/test.rs

9 years agoAuto merge of #26631 - richo:comment-updates, r=steveklabnik
bors [Sun, 28 Jun 2015 06:35:30 +0000 (06:35 +0000)]
Auto merge of #26631 - richo:comment-updates, r=steveklabnik

I've attempted to lurk these into a few PRs since they're tiny, but those PR's haven't landed so here they are.

r? @steveklabnik

9 years agoAuto merge of #26601 - alexcrichton:xp, r=brson
bors [Sun, 28 Jun 2015 03:57:07 +0000 (03:57 +0000)]
Auto merge of #26601 - alexcrichton:xp, r=brson

This series of commits (currently rebased on https://github.com/rust-lang/rust/pull/26569 to avoid conflicts) adds support for the standard library to run on Windows XP. The main motivation behind this PR is that to enable any Rust code in Firefox we need to support Windows XP.

This PR doesn't yet intend to be a move to make Windows XP an officially supported platform, but instead simply get Rust code running on it. APIs like condition variables and RWLocks will immediately panic currently on XP, and it's unclear if that story wants to change much. Additionally, we may bind APIs like IOCP which aren't available on XP and would be *very* difficult to provide a fallback implementation. Essentially this PR enables running Rust on XP, but you still have to be careful to avoid non-XP portions of the standard library.

The major components of this PR are:

* Support for a new `i686-pc-windows-msvc` triple. This primarily involves a lot of build system hackery, but there are also a number of floating point functions which had to get switched up a bit.
* All APIs not available on Windows are now accessed through our dynamic-detection mechanism
* Mutexes on Windows were rewritten to use SRWLOCK as an optimization but can fall back to CRITICAL_SECTION.

9 years agoAddress nits
Jared Roesch [Fri, 26 Jun 2015 19:23:41 +0000 (12:23 -0700)]
Address nits

9 years agostd: Fix Windows XP compatibility
Alex Crichton [Fri, 26 Jun 2015 16:30:35 +0000 (09:30 -0700)]
std: Fix Windows XP compatibility

This commit enables executables linked against the standard library to run on
Windows XP. There are two main components of this commit:

* APIs not available on XP are shimmed to have a fallback implementation and use
  runtime detection to determine if they are available.
* Mutexes on Windows were reimplemented to use critical sections on XP where
  rwlocks are not available.

The APIs which are not available on XP are:

* SetFileInformationByHandle - this is just used by `File::truncate` and that
  function just returns an error now.
* SetThreadStackGuarantee - this is used by the stack overflow support on
  windows, but if this isn't available then it's just ignored (it seems
  non-critical).
* All condition variable APIs are missing - the shims added for these apis
  simply always panic for now. We may eventually provide a fallback
  implementation, but for now the standard library does not rely on condition
  variables for normal use.
* RWLocks, like condition variables, are missing entirely. The same story for
  condition variables is taken here. These APIs are all now panicking stubs as
  the standard library doesn't rely on RWLocks for normal use.

Currently, as an optimization, we use SRWLOCKs for the standard `sync::Mutex`
implementation on Windows, which is indeed required for normal operation of the
standard library. To allow the standard library to run on XP, this commit
reimplements mutexes on Windows to use SRWLOCK instances *if available* and
otherwise a CriticalSection is used (with some checking for recursive
locking).

With all these changes put together, a 32-bit MSVC-built executable can run on
Windows XP and print "hello world"

Closes #12842
Closes #19992
Closes #24776

9 years agort: Update comment for new location of unwind
Richo Healey [Fri, 26 Jun 2015 17:52:53 +0000 (10:52 -0700)]
rt: Update comment for new location of unwind

9 years agorustc_driver: Fix incorrect comment
Richo Healey [Fri, 26 Jun 2015 17:32:27 +0000 (10:32 -0700)]
rustc_driver: Fix incorrect comment

9 years agoRemove ClosureTyper impl for FnCtxt
Jared Roesch [Fri, 26 Jun 2015 00:11:02 +0000 (17:11 -0700)]
Remove ClosureTyper impl for FnCtxt

9 years agoGround work for replacing the ClosureTyper trait
Jared Roesch [Thu, 25 Jun 2015 20:08:10 +0000 (13:08 -0700)]
Ground work for replacing the ClosureTyper trait

9 years agoBegin refactor type checking state
Jared Roesch [Wed, 24 Jun 2015 20:40:54 +0000 (13:40 -0700)]
Begin refactor type checking state

This first patch starts by moving around pieces of state related to
type checking. The goal is to slowly unify the type checking state
into a single typing context. This initial patch moves the
ParameterEnvironment into the InferCtxt and moves shared tables
from Inherited and ty::ctxt into their own struct Tables. This
is the foundational work to refactoring the type checker to
enable future evolution of the language and tooling.

9 years agostd: Avoid missing fns on i686-pc-windows-msvc
Alex Crichton [Thu, 25 Jun 2015 22:33:42 +0000 (15:33 -0700)]
std: Avoid missing fns on i686-pc-windows-msvc

It turns out that the 32-bit toolchain for MSVC has many of these functions as
`static inline` functions in header files so there's not actually a symbol for
Rust to call. All of the implementations just cast floats to their 64-bit
variants and then cast back to 32-bit at the end, so the standard library now
takes this strategy.

9 years agorustc_back: Learn about i686-pc-windows-msvc
Alex Crichton [Thu, 25 Jun 2015 22:32:10 +0000 (15:32 -0700)]
rustc_back: Learn about i686-pc-windows-msvc

This commit adds the i686-pc-windows-msvc triple to the compiler's repertoire of
triples to prepare for targeting 32-bit MSVC.

9 years agomk: Add support for i686-pc-windows-msvc
Alex Crichton [Thu, 25 Jun 2015 22:30:00 +0000 (15:30 -0700)]
mk: Add support for i686-pc-windows-msvc

This commit modifies the configure script and our makefiles to support building
32-bit MSVC targets. The MSVC toolchain is now parameterized over whether it can
produce a 32-bit or 64-bit binary. The configure script was updated to export
more variables at configure time, and the makefiles were rejiggered to
selectively reexport the relevant environment variables for the applicable
targets they're going to run for.

9 years agoAuto merge of #26621 - tshepang:missed-removal, r=steveklabnik
bors [Sat, 27 Jun 2015 17:40:59 +0000 (17:40 +0000)]
Auto merge of #26621 - tshepang:missed-removal, r=steveklabnik

Should have happened in 69abc12b0044d641e714bdd73a299cfa4136b7b8

9 years agoClarifying deallocation order of resources within same scope
Christian Persson [Sat, 27 Jun 2015 14:58:18 +0000 (16:58 +0200)]
Clarifying deallocation order of resources within same scope

9 years agoAuto merge of #26616 - Manishearth:rollup, r=Manishearth
bors [Sat, 27 Jun 2015 14:53:15 +0000 (14:53 +0000)]
Auto merge of #26616 - Manishearth:rollup, r=Manishearth

- Successful merges: #26565, #26584, #26596, #26603
- Failed merges:

9 years agostd: someone missed removing this doc and the annotations
Tshepang Lekhonkhobe [Sat, 27 Jun 2015 13:25:15 +0000 (15:25 +0200)]
std: someone missed removing this doc and the annotations

Should have happened in 69abc12b0044d641e714bdd73a299cfa4136b7b8

9 years agoAuto merge of #26609 - huonw:align, r=alexcrichton
bors [Sat, 27 Jun 2015 13:02:17 +0000 (13:02 +0000)]
Auto merge of #26609 - huonw:align, r=alexcrichton

These will first be deprecated in 1.2.0, not 1.1.0.

9 years agoAdd E0109 error explanation
Guillaume Gomez [Sat, 27 Jun 2015 12:23:53 +0000 (14:23 +0200)]
Add E0109 error explanation

9 years agoAuto merge of #26579 - Techern:start-12-doc, r=brson
bors [Sat, 27 Jun 2015 09:54:15 +0000 (09:54 +0000)]
Auto merge of #26579 - Techern:start-12-doc, r=brson

At the moment, it only mentions the fix to parallel codegen.

I was going to add more, but I have to go for a while - If this isn't reviewed when I get back, I'll remove it and resubmit it after filling in more :)

9 years agoRollup merge of #26603 - Gankro:ref, r=steveklabnik
Manish Goregaokar [Sat, 27 Jun 2015 08:48:47 +0000 (14:18 +0530)]
Rollup merge of #26603 - Gankro:ref, r=steveklabnik

Quick poll of basically the entire core team says this is ok.

9 years agoRollup merge of #26596 - richo:richo-cleanup-macros, r=alexcrichton
Manish Goregaokar [Sat, 27 Jun 2015 08:48:47 +0000 (14:18 +0530)]
Rollup merge of #26596 - richo:richo-cleanup-macros, r=alexcrichton

9 years agoRollup merge of #26584 - omasanori:fix-26537, r=alexcrichton
Manish Goregaokar [Sat, 27 Jun 2015 08:48:47 +0000 (14:18 +0530)]
Rollup merge of #26584 - omasanori:fix-26537, r=alexcrichton

Fix #26537.

9 years agoRollup merge of #26565 - Techern:ignore-kdevelop, r=brson
Manish Goregaokar [Sat, 27 Jun 2015 08:48:47 +0000 (14:18 +0530)]
Rollup merge of #26565 - Techern:ignore-kdevelop, r=brson

This is just a simple change to ignore KDevelop 4 (and pre-release versions of KDevelop 5) project files.

9 years agoAuto merge of #26575 - eddyb:tycx, r=nikomatsakis
bors [Sat, 27 Jun 2015 07:32:56 +0000 (07:32 +0000)]
Auto merge of #26575 - eddyb:tycx, r=nikomatsakis

Next step towards split local/global type contexts, after #26351.
cc @rust-lang/compiler @jroesch

9 years agoAuto merge of #26569 - alexcrichton:msvc-llvm-update, r=brson
bors [Sat, 27 Jun 2015 05:06:22 +0000 (05:06 +0000)]
Auto merge of #26569 - alexcrichton:msvc-llvm-update, r=brson

Now that LLVM has been updated, the only remaining roadblock to implementing
unwinding for MSVC is to fill out the runtime support in `std::rt::unwind::seh`.
This commit does precisely that, fixing up some other bits and pieces along the
way:

* The `seh` unwinding module now uses `RaiseException` to initiate a panic.
* The `rust_try.ll` file was rewritten for MSVC (as it's quite different) and is
  located at `rust_try_msvc_64.ll`, only included on MSVC builds for now.
* The personality function for all landing pads generated by LLVM is hard-wired
  to `__C_specific_handler` instead of the standard `rust_eh_personality` lang
  item. This is required to get LLVM to emit SEH unwinding information instead
  of DWARF unwinding information. This also means that on MSVC the
  `rust_eh_personality` function is entirely unused (but is defined as it's a
  lang item).

More details about how panicking works on SEH can be found in the
`rust_try_msvc_64.ll` or `seh.rs` files, but I'm always open to adding more
comments!

A key aspect of this PR is missing, however, which is that **unwinding is still
turned off by default for MSVC**. There is a [bug in llvm][llvm-bug] which
causes optimizations to inline enough landing pads that LLVM chokes. If the
compiler is optimized at `-O1` (where inlining isn't enabled) then it can
bootstrap with unwinding enabled, but when optimized at `-O2` (inlining is
enabled) then it hits a fatal LLVM error.

[llvm-bug]: https://llvm.org/bugs/show_bug.cgi?id=23884

9 years agoAuto merge of #26574 - brson:relnotes-fix, r=alexcrichton
bors [Sat, 27 Jun 2015 02:43:00 +0000 (02:43 +0000)]
Auto merge of #26574 - brson:relnotes-fix, r=alexcrichton

My bad!

9 years agoInitial documentation for 1.2.0, uploading to test markdown
Cruz Julian Bishop [Fri, 26 Jun 2015 23:16:11 +0000 (09:16 +1000)]
Initial documentation for 1.2.0, uploading to test markdown

9 years agoAuto merge of #26605 - Ms2ger:raw-doc, r=alexcrichton
bors [Fri, 26 Jun 2015 22:44:44 +0000 (22:44 +0000)]
Auto merge of #26605 - Ms2ger:raw-doc, r=alexcrichton

9 years agocore: fix deprecation since version of align_of_min.
Huon Wilson [Fri, 26 Jun 2015 22:00:31 +0000 (15:00 -0700)]
core: fix deprecation since version of align_of_min.

These will first be deprecated in 1.2.0, not 1.1.0.

9 years agoUse Box::into_raw rather than the deprecated boxed::into_raw in tests and documentation.
Ms2ger [Fri, 26 Jun 2015 20:29:40 +0000 (22:29 +0200)]
Use Box::into_raw rather than the deprecated boxed::into_raw in tests and documentation.

9 years agoAuto merge of #26568 - barosl:rel-notes-refs, r=alexcrichton
bors [Fri, 26 Jun 2015 20:09:13 +0000 (20:09 +0000)]
Auto merge of #26568 - barosl:rel-notes-refs, r=alexcrichton

I found some typos in the upcoming 1.1 release note. I corrected them, but I wanted to go further. So I wrote a script that checks the integrity of the Markdown references, and ran it against `RELEASES.md`.

This commit fixes some trivial cases, but also removes the following "unused" references:

- [`Iterator::cloned`](http://doc.rust-lang.org/nightly/core/iter/trait.Iterator.html#method.cloned)
- [`thread::scoped`](http://static.rust-lang.org/doc/master/std/thread/fn.scoped.html)
- [`Debug` improvements](https://github.com/rust-lang/rfcs/blob/master/text/0640-debug-improvements.md)
- [Rebalancing coherence.](https://github.com/rust-lang/rfcs/pull/1023)

However, I think there's a possibility that these features might need to get descriptions as well. How do you feel about it?

9 years agomake book match reference
Alexis Beingessner [Fri, 26 Jun 2015 19:06:05 +0000 (12:06 -0700)]
make book match reference

9 years agoaccessing private fields is not safe, and io isn't scary
Alexis Beingessner [Fri, 26 Jun 2015 18:44:02 +0000 (11:44 -0700)]
accessing private fields is not safe, and io isn't scary

9 years agoAdd E0088 error explanation
Guillaume Gomez [Fri, 26 Jun 2015 11:53:01 +0000 (13:53 +0200)]
Add E0088 error explanation

9 years agostd: clean up duplicated attrs and comment on panic
Richo Healey [Fri, 26 Jun 2015 16:53:56 +0000 (09:53 -0700)]
std: clean up duplicated attrs and comment on panic

9 years agoAuto merge of #26595 - dotdash:fca_slice, r=eddyb
bors [Fri, 26 Jun 2015 15:07:27 +0000 (15:07 +0000)]
Auto merge of #26595 - dotdash:fca_slice, r=eddyb

Storing them as FCAs is a regression from the recent change that made
fat pointers immediate return values so that they are passed in
registers instead of memory.

9 years agoAvoid storing fat pointers as first class aggregates
Björn Steinbrink [Fri, 26 Jun 2015 14:40:51 +0000 (16:40 +0200)]
Avoid storing fat pointers as first class aggregates

Storing them as FCAs is a regression from the recent change that made
fat pointers immediate return values so that they are passed in
registers instead of memory.

9 years agoAdd E0091 error explanation
Guillaume Gomez [Fri, 26 Jun 2015 11:39:39 +0000 (13:39 +0200)]
Add E0091 error explanation

Part of #24407.
cc @michaelsproul

9 years agorustc: switch most remaining middle::ty functions to methods.
Eduard Burtescu [Thu, 25 Jun 2015 20:42:17 +0000 (23:42 +0300)]
rustc: switch most remaining middle::ty functions to methods.

9 years agorustc: remove 3 dead functions in middle::ty.
Eduard Burtescu [Thu, 25 Jun 2015 01:10:11 +0000 (04:10 +0300)]
rustc: remove 3 dead functions in middle::ty.

9 years agorustc: make ty::mk_* constructors into methods on ty::ctxt.
Eduard Burtescu [Thu, 25 Jun 2015 01:09:46 +0000 (04:09 +0300)]
rustc: make ty::mk_* constructors into methods on ty::ctxt.

9 years agorustc: prefer unqualified `ctxt` to `ty::ctxt` in middle::ty.
Eduard Burtescu [Wed, 24 Jun 2015 05:44:10 +0000 (08:44 +0300)]
rustc: prefer unqualified `ctxt` to `ty::ctxt` in middle::ty.

9 years agorustc: move some functions in middle::ty working on Ty to methods.
Eduard Burtescu [Wed, 24 Jun 2015 05:24:13 +0000 (08:24 +0300)]
rustc: move some functions in middle::ty working on Ty to methods.

9 years agorustc: combine type-flag-checking traits and fns and into one trait.
Eduard Burtescu [Tue, 23 Jun 2015 23:54:32 +0000 (02:54 +0300)]
rustc: combine type-flag-checking traits and fns and into one trait.

9 years agoAuto merge of #25646 - huonw:align, r=alexcrichton
bors [Fri, 26 Jun 2015 02:58:31 +0000 (02:58 +0000)]
Auto merge of #25646 - huonw:align, r=alexcrichton

This removes a footgun, since it is a reasonable assumption to make that
pointers to `T` will be aligned to `align_of::<T>()`. This also matches
the behaviour of C/C++. `min_align_of` is now deprecated.

Closes #21611.

9 years agoCorrect a missing reference in the release note.
OGINO Masanori [Fri, 26 Jun 2015 02:09:15 +0000 (11:09 +0900)]
Correct a missing reference in the release note.

Fix #26537.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
9 years agoAuto merge of #26415 - jroesch:rename-as-predicate, r=nikomatsakis
bors [Fri, 26 Jun 2015 00:31:44 +0000 (00:31 +0000)]
Auto merge of #26415 - jroesch:rename-as-predicate, r=nikomatsakis

@nikomatsakis and I ran into this earlier and I figured we should rename the trait and method to match the typical naming convention.

9 years agoRename AsPredicate to ToPredicate in order to match naming conventions
Jared Roesch [Tue, 23 Jun 2015 18:50:50 +0000 (11:50 -0700)]
Rename AsPredicate to ToPredicate in order to match naming conventions

9 years agoIgnore KDevelop 4 (and 5 pre-release) project files
Cruz Julian Bishop [Thu, 25 Jun 2015 23:26:05 +0000 (23:26 +0000)]
Ignore KDevelop 4 (and 5 pre-release) project files

9 years agoAuto merge of #26567 - Techern:os-dupe-code, r=alexcrichton
bors [Thu, 25 Jun 2015 20:22:27 +0000 (20:22 +0000)]
Auto merge of #26567 - Techern:os-dupe-code, r=alexcrichton

It's nearly midnight. I'm tired. I'll look for something worth doing in the morning :)

9 years agolibstd/rand/os.rs: Remove a tiny bit of duplicated code
Cruz Julian Bishop [Thu, 25 Jun 2015 23:37:28 +0000 (23:37 +0000)]
libstd/rand/os.rs: Remove a tiny bit of duplicated code

It's nearly midnight. I'm tired. I'll look for something worth doing in the morning :)

9 years agoCorrect typos and remove unused references from RELEASES.md
Barosl Lee [Thu, 25 Jun 2015 15:41:48 +0000 (00:41 +0900)]
Correct typos and remove unused references from RELEASES.md

I found some typos in the upcoming 1.1 release note. I corrected them,
but I wanted to go further. So I wrote a script that checks the
integrity of the Markdown references, and ran it against `RELEASES.md`.

This commit fixes some trivial cases, but also removes the following
"unused" references:

- [`Iterator::cloned`](http://doc.rust-lang.org/nightly/core/iter/trait.Iterator.html#method.cloned)
- [`thread::scoped`](http://static.rust-lang.org/doc/master/std/thread/fn.scoped.html)
- [`Debug` improvements](https://github.com/rust-lang/rfcs/blob/master/text/0640-debug-improvements.md)
- [Rebalancing coherence.](https://github.com/rust-lang/rfcs/pull/1023)

However, I think there's a possibility that these features might need to
get descriptions as well. How do you feel about it?

9 years agoFix links in release notes.
Brian Anderson [Thu, 25 Jun 2015 19:31:06 +0000 (12:31 -0700)]
Fix links in release notes.

My bad!

9 years agoAuto merge of #26566 - michaelsproul:release-notes, r=alexcrichton
bors [Thu, 25 Jun 2015 18:52:13 +0000 (18:52 +0000)]
Auto merge of #26566 - michaelsproul:release-notes, r=alexcrichton

In the release notes, the link name `[err]` was used to refer both to the error index and the error chaining RFC. Another problem I noticed was that `[fs-expand]` is never defined.

9 years agoAuto merge of #26542 - GuillaumeGomez:patch-2, r=Manishearth
bors [Thu, 25 Jun 2015 17:21:44 +0000 (17:21 +0000)]
Auto merge of #26542 - GuillaumeGomez:patch-2, r=Manishearth

9 years agotest: Use liblibc in lang-item-public
Alex Crichton [Thu, 25 Jun 2015 16:13:30 +0000 (09:13 -0700)]
test: Use liblibc in lang-item-public

Makes this test case more robust by using standard libraries to ensure the
binary can be built.

9 years agorustc_trans: Handle empty dlls on MSVC
Alex Crichton [Thu, 25 Jun 2015 07:33:52 +0000 (00:33 -0700)]
rustc_trans: Handle empty dlls on MSVC

If a dylib doesn't actually export any symbols then link.exe won't emit a
`foo.lib` file to link against (as one isn't necessary). Detect this case in the
backend by omitting the `foo.lib` argument to the linker if it doesn't actually
exist.

9 years agomsvc: Implement runtime support for unwinding
Alex Crichton [Fri, 19 Jun 2015 21:57:06 +0000 (14:57 -0700)]
msvc: Implement runtime support for unwinding

Now that LLVM has been updated, the only remaining roadblock to implementing
unwinding for MSVC is to fill out the runtime support in `std::rt::unwind::seh`.
This commit does precisely that, fixing up some other bits and pieces along the
way:

* The `seh` unwinding module now uses `RaiseException` to initiate a panic.
* The `rust_try.ll` file was rewritten for MSVC (as it's quite different) and is
  located at `rust_try_msvc_64.ll`, only included on MSVC builds for now.
* The personality function for all landing pads generated by LLVM is hard-wired
  to `__C_specific_handler` instead of the standard `rust_eh_personality` lang
  item. This is required to get LLVM to emit SEH unwinding information instead
  of DWARF unwinding information. This also means that on MSVC the
  `rust_eh_personality` function is entirely unused (but is defined as it's a
  lang item).

More details about how panicking works on SEH can be found in the
`rust_try_msvc_64.ll` or `seh.rs` files, but I'm always open to adding more
comments!

A key aspect of this PR is missing, however, which is that **unwinding is still
turned off by default for MSVC**. There is a [bug in llvm][llvm-bug] which
causes optimizations to inline enough landing pads that LLVM chokes. If the
compiler is optimized at `-O1` (where inlining isn't enabled) then it can
bootstrap with unwinding enabled, but when optimized at `-O2` (inlining is
enabled) then it hits a fatal LLVM error.

[llvm-bug]: https://llvm.org/bugs/show_bug.cgi?id=23884

9 years agoAdd E0327 error code. Thanks @nagisa for his help!
Guillaume Gomez [Wed, 24 Jun 2015 20:32:12 +0000 (22:32 +0200)]
Add E0327 error code. Thanks @nagisa for his help!

9 years agomk: Move logic out of MSVC's 64-bit cfg makefile
Alex Crichton [Fri, 19 Jun 2015 21:51:29 +0000 (14:51 -0700)]
mk: Move logic out of MSVC's 64-bit cfg makefile

This logic applies to all MSVC targets, so instead refactor it into platform.mk
so it can one day apply to 32-bit MSVC.

9 years agoAuto merge of #26559 - BrodyHolden:ffi-doc-references-std-comm, r=bluss
bors [Thu, 25 Jun 2015 14:53:16 +0000 (14:53 +0000)]
Auto merge of #26559 - BrodyHolden:ffi-doc-references-std-comm, r=bluss

The FFI documentation references std::comm. Replace with std::sync::mpsc.

Also wrap the line.

9 years agorelnotes: Fix error index link.
Michael Sproul [Thu, 25 Jun 2015 13:29:09 +0000 (23:29 +1000)]
relnotes: Fix error index link.

9 years agoAuto merge of #26558 - nham:fix_24357, r=alexcrichton
bors [Thu, 25 Jun 2015 10:39:09 +0000 (10:39 +0000)]
Auto merge of #26558 - nham:fix_24357, r=alexcrichton

Fixes #24357.

Also adds a (totally separate) regression test, which

Closes #18119

9 years agoAuto merge of #26561 - SimonSapin:remove-titlecase, r=alexcrichton
bors [Thu, 25 Jun 2015 08:24:23 +0000 (08:24 +0000)]
Auto merge of #26561 - SimonSapin:remove-titlecase, r=alexcrichton

I added it because it was easy (same a `char::to_lowercase`, just a different table), but it doesn’t make sense to have this in std but not str::to_titlecase, which would require https://github.com/unicode-rs/unicode-segmentation

At some point in the future this feature will be available (both on char and str) in a crates.io crate.