]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #30049 - Manishearth:rollup, r=Manishearth
bors [Wed, 25 Nov 2015 05:43:43 +0000 (05:43 +0000)]
Auto merge of #30049 - Manishearth:rollup, r=Manishearth

- Successful merges: #30013, #30038, #30040
- Failed merges: #30030

8 years agoRollup merge of #30040 - apasel422:issue-30031, r=brson
Manish Goregaokar [Wed, 25 Nov 2015 03:51:19 +0000 (09:21 +0530)]
Rollup merge of #30040 - apasel422:issue-30031, r=brson

Closes #30031.

8 years agoRollup merge of #30038 - Carreau:cargo-philosopher, r=steveklabnik
Manish Goregaokar [Wed, 25 Nov 2015 03:51:18 +0000 (09:21 +0530)]
Rollup merge of #30038 - Carreau:cargo-philosopher, r=steveklabnik

At this point of the book, reader have likely use `cargo new --bin`,
likely 2 times, once if they are lazy. This remind them of the `cargo`
syntax.

I was myself unsure whether it was `cargo create`, `cargo new`, and
whether it would initialize in current working directory or needed a
target.

--

Otherwise thanks, I've been writing rust for a few hours, and likes it so far.

8 years agoRollup merge of #30013 - steveklabnik:doc_char, r=brson
Manish Goregaokar [Wed, 25 Nov 2015 03:51:18 +0000 (09:21 +0530)]
Rollup merge of #30013 - steveklabnik:doc_char, r=brson

Part of https://github.com/rust-lang/rust/issues/29333

8 years agoAuto merge of #30011 - jonas-schievink:macro-context, r=nrc
bors [Wed, 25 Nov 2015 03:02:05 +0000 (03:02 +0000)]
Auto merge of #30011 - jonas-schievink:macro-context, r=nrc

Fixes #22425

Also fixes #30007, since it's just a change from `true` to `false`.

8 years agoAuto merge of #29687 - Havvy:ux-guidelines, r=pnkfelix
bors [Wed, 25 Nov 2015 01:14:43 +0000 (01:14 +0000)]
Auto merge of #29687 - Havvy:ux-guidelines, r=pnkfelix

See https://github.com/rust-lang/rfcs/pull/1246 for discussion.

8 years agoAuto merge of #30016 - alexcrichton:fix-off-by-one, r=brson
bors [Tue, 24 Nov 2015 23:24:18 +0000 (23:24 +0000)]
Auto merge of #30016 - alexcrichton:fix-off-by-one, r=brson

Typical algebra currently doesn't work on the types in std::time currently (see
[this comment][comment]), so tweak the tests to account for this property.

[comment]: https://github.com/rust-lang/rust/issues/29866#issuecomment-159093809

Closes #29970

8 years agoAdd overflow check to `arc::Weak::upgrade`
Andrew Paseltiner [Tue, 24 Nov 2015 21:40:25 +0000 (16:40 -0500)]
Add overflow check to `arc::Weak::upgrade`

Closes #30031.

8 years agoAuto merge of #30009 - apasel422:tests, r=alexcrichton
bors [Tue, 24 Nov 2015 21:36:54 +0000 (21:36 +0000)]
Auto merge of #30009 - apasel422:tests, r=alexcrichton

Closes #25810.
Closes #29276.

r? @alexcrichton

8 years agoAdd cargo instructions for dinning_philosopher project
Matthias Bussonnier [Tue, 24 Nov 2015 20:58:18 +0000 (21:58 +0100)]
Add cargo instructions for dinning_philosopher project

At this point of the book, reader have likely use `cargo new --bin`,
likely 2 times, once if they are lazy. This remind them of the `cargo`
syntax.

I was myself unsure whether it was `cargo create`, `cargo new`, and
whether it would initialize in current working directory or needed a
target.

8 years agoAuto merge of #29960 - aturon:dismantle-traitref-subtyping, r=nikomatsakis
bors [Tue, 24 Nov 2015 19:46:59 +0000 (19:46 +0000)]
Auto merge of #29960 - aturon:dismantle-traitref-subtyping, r=nikomatsakis

Trait references are always invariant, so all uses of subtyping between
them are equivalent to using equality.

Moreover, the overlap check was previously performed twice per impl
pair, once in each direction. It is now performed only once, and
internally uses the equality check.

On glium, a crate that spends some time in coherence, this change sped
up coherence checking by a few percent (not very significant).

r? @nikomatsakis

8 years agoFix up docs for char
Steve Klabnik [Mon, 23 Nov 2015 21:56:07 +0000 (16:56 -0500)]
Fix up docs for char

Part of https://github.com/rust-lang/rust/issues/29333

8 years agoAuto merge of #30028 - steveklabnik:rollup, r=steveklabnik
bors [Tue, 24 Nov 2015 17:10:55 +0000 (17:10 +0000)]
Auto merge of #30028 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #29397, #29933, #30004, #30019, #30020, #30023
- Failed merges:

8 years agoFix test failures
Jonas Schievink [Tue, 24 Nov 2015 16:46:10 +0000 (17:46 +0100)]
Fix test failures

8 years agoRemove "this"
Jonas Schievink [Tue, 24 Nov 2015 15:34:48 +0000 (16:34 +0100)]
Remove "this"

8 years agoRollup merge of #30023 - Ms2ger:EntryOrExit, r=Manishearth
Steve Klabnik [Tue, 24 Nov 2015 14:43:47 +0000 (09:43 -0500)]
Rollup merge of #30023 - Ms2ger:EntryOrExit, r=Manishearth

8 years agoRollup merge of #30020 - Manishearth:unit, r=bluss
Steve Klabnik [Tue, 24 Nov 2015 14:43:46 +0000 (09:43 -0500)]
Rollup merge of #30020 - Manishearth:unit, r=bluss

`unit` was in code formatting, which is wrong, since it's not actual code. The correct code is `()`.

8 years agoRollup merge of #30019 - alex:patch-1, r=steveklabnik
Steve Klabnik [Tue, 24 Nov 2015 14:43:46 +0000 (09:43 -0500)]
Rollup merge of #30019 - alex:patch-1, r=steveklabnik

looks like a case of mixed tabs and spaces

8 years agoRollup merge of #30004 - michaelwoerister:primitive-ty-to-str, r=alexcrichton
Steve Klabnik [Tue, 24 Nov 2015 14:43:46 +0000 (09:43 -0500)]
Rollup merge of #30004 - michaelwoerister:primitive-ty-to-str, r=alexcrichton

Good candidate for a rollup, this one.

8 years agoRollup merge of #29933 - tbu-:pr_dont_opt_in_copy, r=nikomatsakis
Steve Klabnik [Tue, 24 Nov 2015 14:43:46 +0000 (09:43 -0500)]
Rollup merge of #29933 - tbu-:pr_dont_opt_in_copy, r=nikomatsakis

It was introduced with the change that made copy opt-in. The
implementation gives a warning, because the struct contains a raw
pointer.

8 years agoRollup merge of #29397 - dylanmckay:llvmdeps-deps, r=brson
Steve Klabnik [Tue, 24 Nov 2015 14:43:46 +0000 (09:43 -0500)]
Rollup merge of #29397 - dylanmckay:llvmdeps-deps, r=brson

Previously the file was not regenrated upon modification of `src/rustllvm` or others.

Now it will be rebuilt if `src/llvm` or `src/rustllvm` is touched.

Also added *.rs rule to 'clean' rule so that it is removed upon 'make
clean'.

Fixes #28614.

8 years agoAuto merge of #29934 - arielb1:constrained-projection-2, r=nikomatsakis
bors [Tue, 24 Nov 2015 14:30:46 +0000 (14:30 +0000)]
Auto merge of #29934 - arielb1:constrained-projection-2, r=nikomatsakis

Fixes #29861 - it was a bug I accidentally introduced in #26275.

r? @nikomatsakis

8 years agoUse the EntryOrExit variants qualified.
Ms2ger [Tue, 24 Nov 2015 12:06:12 +0000 (13:06 +0100)]
Use the EntryOrExit variants qualified.

8 years agoAuto merge of #30012 - jonas-schievink:log-level-trace, r=alexcrichton
bors [Tue, 24 Nov 2015 11:10:22 +0000 (11:10 +0000)]
Auto merge of #30012 - jonas-schievink:log-level-trace, r=alexcrichton

The `log` crate on crates.io already knows `TRACE`, but the internal liblog doesn't, which causes it to spew errors when a `TRACE` level is defined. I made `TRACE` behave like `DEBUG`.

8 years agoAuto merge of #30000 - Manishearth:unreachable-call, r=nrc
bors [Tue, 24 Nov 2015 06:58:25 +0000 (06:58 +0000)]
Auto merge of #30000 - Manishearth:unreachable-call, r=nrc

Fixes #1889

8 years agoUpdate reference.md
Manish Goregaokar [Tue, 24 Nov 2015 06:26:27 +0000 (11:56 +0530)]
Update reference.md

8 years agofixed inconsistent indentation in book example
Alex Gaynor [Tue, 24 Nov 2015 06:24:27 +0000 (01:24 -0500)]
fixed inconsistent indentation in book example

looks like a case of mixed tabs and spaces

8 years agoFix unreachable code in libsyntax
Manish Goregaokar [Tue, 24 Nov 2015 01:53:53 +0000 (07:23 +0530)]
Fix unreachable code in libsyntax

8 years agoAuto merge of #30006 - ntrepid8:skip-check-for-DYLD-libs-in-child-proc, r=alexcrichton
bors [Tue, 24 Nov 2015 04:26:47 +0000 (04:26 +0000)]
Auto merge of #30006 - ntrepid8:skip-check-for-DYLD-libs-in-child-proc, r=alexcrichton

link: https://forums.developer.apple.com/thread/9233
The causes a test in `src/libstd/process.rs' to fail when those environment variables are not found in the child process.  This PR skips those variables similar to how the Windows envars that start with `=` are skipped.

8 years agoAuto merge of #30001 - Detegr:master, r=Manishearth
bors [Tue, 24 Nov 2015 01:42:31 +0000 (01:42 +0000)]
Auto merge of #30001 - Detegr:master, r=Manishearth

r? @Manishearth

8 years agostd: Tweak tests of std::time
Alex Crichton [Mon, 23 Nov 2015 22:51:45 +0000 (14:51 -0800)]
std: Tweak tests of std::time

Typical algebra currently doesn't work on the types in std::time currently (see
[this comment][comment]), so tweak the tests to account for this property.

[comment]: https://github.com/rust-lang/rust/issues/29866#issuecomment-159093809

Closes #29970

8 years agoAuto merge of #29955 - bltavares:makefile-29554, r=brson
bors [Mon, 23 Nov 2015 22:53:14 +0000 (22:53 +0000)]
Auto merge of #29955 - bltavares:makefile-29554, r=brson

Reference #29554

8 years agoAdd TRACE to the known log levels
Jonas Schievink [Mon, 23 Nov 2015 21:09:40 +0000 (22:09 +0100)]
Add TRACE to the known log levels

The `log` crate on crates.io already knows TRACE, but the internal
liblog doesn't, which causes it to spew errors when a TRACE level is
defined.

8 years agoMake unreachable_code lint warn on diverging call arguments as well
Manish Goregaokar [Mon, 23 Nov 2015 13:55:57 +0000 (19:25 +0530)]
Make unreachable_code lint warn on diverging call arguments as well

Fixes #1889

8 years agoAuto merge of #29952 - petrochenkov:depr, r=brson
bors [Mon, 23 Nov 2015 20:08:49 +0000 (20:08 +0000)]
Auto merge of #29952 - petrochenkov:depr, r=brson

Part of https://github.com/rust-lang/rust/issues/29935

The deprecation lint is still called "deprecated", so people can continue using `#[allow(deprecated)]` and similar things.

8 years agoPrint the macro context name on incomplete parse
Jonas Schievink [Mon, 23 Nov 2015 20:06:51 +0000 (21:06 +0100)]
Print the macro context name on incomplete parse

Fixes #22425

Also fixes #30007, since it's just a change from `true` to `false`.

8 years agoAdd tests for #25810 and #29276
Andrew Paseltiner [Mon, 23 Nov 2015 19:57:28 +0000 (14:57 -0500)]
Add tests for #25810 and #29276

Closes #25810.
Closes #29276.

8 years agoskip check for DYLD envars in child proc
Josh Austin [Mon, 23 Nov 2015 19:08:52 +0000 (14:08 -0500)]
skip check for DYLD envars in child proc

8 years agoAdd compile-fail test for issue #10969
Antti Keränen [Mon, 23 Nov 2015 19:06:08 +0000 (21:06 +0200)]
Add compile-fail test for issue #10969

8 years agoAuto merge of #29530 - jseyfried:resolve, r=nikomatsakis
bors [Mon, 23 Nov 2015 17:31:19 +0000 (17:31 +0000)]
Auto merge of #29530 - jseyfried:resolve, r=nikomatsakis

Replace `TypeNsDef` and `ValueNsDef` with a more general type `NsDef`.

Define a newtype `NameBinding` for `Rc<RefCell<Option<NsDef>>>` and refactor `NameBindings` to be a `NameBinding` for each namespace.

Replace uses of `NameBindings` with `NameBinding` where only one binding is being used (in `NamespaceResult`, `Target,` etc).

Refactor away `resolve_definition_of_name_in_module` and `NameDefinition`, fixing issue #4952.

8 years agoAvoid some code duplication around getting names of numeric types.
Michael Woerister [Mon, 23 Nov 2015 14:59:36 +0000 (15:59 +0100)]
Avoid some code duplication around getting names of numeric types.

8 years agoAdd a note when trying to call a non-function
Antti Keränen [Mon, 23 Nov 2015 14:48:55 +0000 (16:48 +0200)]
Add a note when trying to call a non-function

The note added tells the definition location of the non-function
that is being called. Fixes #10969

8 years agoAuto merge of #29998 - fiveop:patch-1, r=steveklabnik
bors [Mon, 23 Nov 2015 14:37:35 +0000 (14:37 +0000)]
Auto merge of #29998 - fiveop:patch-1, r=steveklabnik

8 years agowording: results don't fail
Philipp Matthias Schäfer [Mon, 23 Nov 2015 08:39:58 +0000 (09:39 +0100)]
wording: results don't fail

8 years agoAuto merge of #29984 - Manishearth:slice-assert, r=alexcrichton
bors [Mon, 23 Nov 2015 06:27:49 +0000 (06:27 +0000)]
Auto merge of #29984 - Manishearth:slice-assert, r=alexcrichton

I'd like to have the message print out the index and length values like it does elsewhere, but I'm not sure how to do that without affecting perf here. Will `assert!(cond, "index out of bounds got {} but len is ", idx, len)` make things slower? It calls `panic_fmt` which is marked as cold but also calls `format_args!`, and I don't know if that allocates or does any heavy lifting.

cc @alexcrichton @Gankro

8 years agoImprove slice indexing assertion
Manish Goregaokar [Sun, 22 Nov 2015 13:14:37 +0000 (18:44 +0530)]
Improve slice indexing assertion

8 years agoMark slice_error_fail as a cold path
Manish Goregaokar [Mon, 23 Nov 2015 04:04:01 +0000 (09:34 +0530)]
Mark slice_error_fail as a cold path

8 years agoAuto merge of #28907 - SingingTree:rustfmt_libterm, r=nrc
bors [Sun, 22 Nov 2015 23:01:56 +0000 (23:01 +0000)]
Auto merge of #28907 - SingingTree:rustfmt_libterm, r=nrc

Hey hey,

This is the result of running rustfmt over the libterm module. The first commit reflects the unaltered changes from rustfmt, and the commit message contains some notes on areas where I thought rustfmt had behaved strangely. The second commit attempts to fix the strange areas from the first commit.

Clarification edit: there are still some areas where I think rustfmt has made changes which may merit discussion (one is noted in the comments below). My second commit only undoes the changes that I figured would not warrant discussion (based on my opinion of the style, which is of course subjective).

r? @nrc

8 years agoAuto merge of #29964 - alexcrichton:update-libc, r=brson
bors [Sun, 22 Nov 2015 21:17:57 +0000 (21:17 +0000)]
Auto merge of #29964 - alexcrichton:update-libc, r=brson

Includes rust-lang-nursery/libc#66 which should:

Closes #29818
Closes #29956

8 years agolibc: Update to master
Alex Crichton [Fri, 20 Nov 2015 22:17:27 +0000 (14:17 -0800)]
libc: Update to master

Includes rust-lang-nursery/libc#66 which should:

Closes #29956

8 years agoAuto merge of #29983 - tbu-:pr_env_windows_hidden_variables, r=alexcrichton
bors [Sun, 22 Nov 2015 18:34:13 +0000 (18:34 +0000)]
Auto merge of #29983 - tbu-:pr_env_windows_hidden_variables, r=alexcrichton

Fixes #29972.

8 years agotest_inherit_env: Don't look for hidden environment variables on Windows
Tobias Bucher [Sun, 22 Nov 2015 11:12:18 +0000 (11:12 +0000)]
test_inherit_env: Don't look for hidden environment variables on Windows

Fixes #29972.

8 years agoAuto merge of #29716 - Manishearth:repr-error, r=Gankro
bors [Sun, 22 Nov 2015 08:43:22 +0000 (08:43 +0000)]
Auto merge of #29716 - Manishearth:repr-error, r=Gankro

r? @Gankro

8 years agoAuto merge of #29980 - Manishearth:missing-diag, r=eddyb
bors [Sun, 22 Nov 2015 06:42:56 +0000 (06:42 +0000)]
Auto merge of #29980 - Manishearth:missing-diag, r=eddyb

None

8 years agoImprove transmute diagnostics with a note about destructors
Manish Goregaokar [Sun, 22 Nov 2015 04:56:50 +0000 (10:26 +0530)]
Improve transmute diagnostics with a note about destructors

fixes #29922

8 years agoRegister diagnostics for rustc_privacy and rustc_trans properly
Manish Goregaokar [Sun, 22 Nov 2015 04:52:25 +0000 (10:22 +0530)]
Register diagnostics for rustc_privacy and rustc_trans properly

fixes #29665

8 years agoAuto merge of #29968 - Manishearth:bang-macro-diag, r=eddyb
bors [Sun, 22 Nov 2015 04:13:49 +0000 (04:13 +0000)]
Auto merge of #29968 - Manishearth:bang-macro-diag, r=eddyb

r? @eddyb

fixes #5780

8 years agoLook up macro names as well when suggesting replacements for function resolve errors
Manish Goregaokar [Sat, 21 Nov 2015 09:37:50 +0000 (15:07 +0530)]
Look up macro names as well when suggesting replacements for function resolve errors

fixes #5780

8 years agoRustfmt libterm, skip long static in compiled.rs
Bryce Van Dyk [Sun, 22 Nov 2015 00:24:56 +0000 (13:24 +1300)]
Rustfmt libterm, skip long static in compiled.rs

8 years agoAuto merge of #29963 - dotdash:fat_copy, r=eddyb
bors [Sat, 21 Nov 2015 22:08:26 +0000 (22:08 +0000)]
Auto merge of #29963 - dotdash:fat_copy, r=eddyb

Since fat pointers do not qualify as structural types, they got copied
using load_ty and store_ty, which means that we load an FCA and use
extractvalue to get the components of the fat pointer. This breaks
certain optimizations in LLVM.

Found via apasel422/ref_count#13

8 years agoAuto merge of #29966 - MatthiasKauer:master, r=steveklabnik
bors [Sat, 21 Nov 2015 06:06:16 +0000 (06:06 +0000)]
Auto merge of #29966 - MatthiasKauer:master, r=steveklabnik

This commit changes the location of the rust docs.
https://github.com/rust-lang/rust/commit/024aa9a345e92aa1926517c4d9b16bd83e74c10d
Clicking the contribution link on the front page therefore becomes a 'not found' error.

8 years agoAuto merge of #29948 - devonhollowood:fromstr-parse, r=steveklabnik
bors [Sat, 21 Nov 2015 04:22:15 +0000 (04:22 +0000)]
Auto merge of #29948 - devonhollowood:fromstr-parse, r=steveklabnik

Implement #29919

8 years agoAuto merge of #29913 - tbu-:pr_windows_path_error_on_nul, r=alexcrichton
bors [Sat, 21 Nov 2015 02:38:18 +0000 (02:38 +0000)]
Auto merge of #29913 - tbu-:pr_windows_path_error_on_nul, r=alexcrichton

On Windows: Previously these paths were silently truncated at these NUL
characters, now they fail with `ErrorKind::InvalidInput`.

8 years agoAlso check for NULs in environment variables
Tobias Bucher [Thu, 19 Nov 2015 18:01:11 +0000 (18:01 +0000)]
Also check for NULs in environment variables

This check is necessary, because the underlying API only reads strings
until the first NUL.

8 years agoAuto merge of #29916 - Manishearth:diag-401, r=steveklabnik
bors [Sat, 21 Nov 2015 00:54:16 +0000 (00:54 +0000)]
Auto merge of #29916 - Manishearth:diag-401, r=steveklabnik

None

8 years agochange link on book front page trpl -> book
Matthias Kauer [Fri, 20 Nov 2015 23:49:25 +0000 (07:49 +0800)]
change link on book front page trpl -> book

8 years agoAuto merge of #29961 - alexcrichton:order-dependent, r=brson
bors [Fri, 20 Nov 2015 22:08:19 +0000 (22:08 +0000)]
Auto merge of #29961 - alexcrichton:order-dependent, r=brson

This commit fixes a bug where a crate could fail to compile depending on the
order of `extern crate` directives at the top of the crate. Specifically, if the
same crate is found at two locations, then if it's loaded first via `--extern`
it will not emit a duplicate warning, but if it's first loaded transitively
via a dep and *then* via `--extern` an error will be emitted.

The loader was tweaked to catch this scenario and coalesce the loading of these
two crates to prevent errors from being emitted.

8 years agoAvoid FCA loads and extractvalue when copying fat pointers
Björn Steinbrink [Fri, 20 Nov 2015 20:42:13 +0000 (21:42 +0100)]
Avoid FCA loads and extractvalue when copying fat pointers

Since fat pointers do not qualify as structural types, they got copied
using load_ty and store_ty, which means that we load an FCA and use
extractvalue to get the components of the fat pointer. This breaks
certain optimizations in LLVM.

Found via apasel422/ref_count#13

8 years agoAuto merge of #29945 - nrc:save-crate-name, r=alexcrichton
bors [Fri, 20 Nov 2015 20:03:16 +0000 (20:03 +0000)]
Auto merge of #29945 - nrc:save-crate-name, r=alexcrichton

r? @alexcrichton

This prevents outputting csv files with the same name and thus overwriting each other when indexing Cargo projects with a bin crate (and some other cases).

8 years agorustc: Fix `extern crate` being order dependent
Alex Crichton [Wed, 21 Oct 2015 04:05:39 +0000 (21:05 -0700)]
rustc: Fix `extern crate` being order dependent

This commit fixes a bug where a crate could fail to compile depending on the
order of `extern crate` directives at the top of the crate. Specifically, if the
same crate is found at two locations, then if it's loaded first via `--extern`
it will not emit a duplicate warning, but if it's first loaded transitively
via a dep and *then* via `--extern` an error will be emitted.

The loader was tweaked to catch this scenario and coalesce the loading of these
two crates to prevent errors from being emitted.

8 years agoAuto merge of #29822 - petrochenkov:pubexport, r=alexcrichton
bors [Fri, 20 Nov 2015 18:13:10 +0000 (18:13 +0000)]
Auto merge of #29822 - petrochenkov:pubexport, r=alexcrichton

This patch implements the plan described in https://internals.rust-lang.org/t/privacy-and-its-interaction-with-docs-lints-and-stability/2880 with one deviation.

It turns out, that rustdoc needs the "directly public" set for its docs inlining logic, so the privacy pass have to produce three sets and not two. Three is arguably too many, so I merged them in one map:
`public_items/exported_items/reachable_items: NodeSet => access_levels: NodeMap<AccessLevel>`

r? @alexcrichton

8 years agoChange TraitRef subtyping checks to equality
Aaron Turon [Fri, 20 Nov 2015 17:34:33 +0000 (09:34 -0800)]
Change TraitRef subtyping checks to equality

Trait references are always invariant, so all uses of subtyping between
them are equivalent to using equality.

Moreover, the overlap check was previously performed twice per impl
pair, once in each direction. It is now performed only once, and
internally uses the equality check.

On glium, a crate that spends some time in coherence, this change sped
up coherence checking by a few percent (not very significant).

8 years agoAdd E0517, E0518 for repr() errors
Manish Goregaokar [Mon, 9 Nov 2015 16:43:55 +0000 (22:13 +0530)]
Add E0517, E0518 for repr() errors

8 years agoAuto merge of #29951 - fhahn:fix-plugin-compiler-example, r=steveklabnik
bors [Fri, 20 Nov 2015 15:26:35 +0000 (15:26 +0000)]
Auto merge of #29951 - fhahn:fix-plugin-compiler-example, r=steveklabnik

PR for #29930. Adds missing #![feature(slice_patterns)] to make compiler plugin example compile again.

8 years agoSet CFLAGS/LDFLAGS/etc according to Debian policy
Angus Lees [Fri, 20 Nov 2015 14:48:19 +0000 (12:48 -0200)]
Set CFLAGS/LDFLAGS/etc according to Debian policy

Debian wants to build all binaries with particular hardening flags.
The Rust makefiles are inconsistent in which architectures they
correctly include CFLAGS/etc from the enivoronment (see mk/cfg/*).

This patch adds LDFLAGS, and then unconditionally prepends
CFLAGS/LDFLAGS/etc to the build commands.

8 years agoRemove slice pattern from compiler plugin example
Florian Hahn [Fri, 20 Nov 2015 11:19:05 +0000 (12:19 +0100)]
Remove slice pattern from compiler plugin example

closes #29930

8 years agoRename #[deprecated] to #[rustc_deprecated]
Vadim Petrochenkov [Fri, 20 Nov 2015 13:11:20 +0000 (16:11 +0300)]
Rename #[deprecated] to #[rustc_deprecated]

8 years agoAuto merge of #29950 - fhahn:small-doc-fix-rename-var, r=bluss
bors [Fri, 20 Nov 2015 12:30:00 +0000 (12:30 +0000)]
Auto merge of #29950 - fhahn:small-doc-fix-rename-var, r=bluss

This tiny PR renames the result variable in HashSet's `intersection` example from `diff` to `intersection` and the same for `union`, which seem more appropriate.

8 years agoRename result variable in HashSet's intersection and union examples
Florian Hahn [Fri, 20 Nov 2015 10:39:28 +0000 (11:39 +0100)]
Rename result variable in HashSet's intersection and union examples

8 years agoAuto merge of #29534 - oli-obk:fix/const_fn_eval, r=dotdash
bors [Fri, 20 Nov 2015 09:48:11 +0000 (09:48 +0000)]
Auto merge of #29534 - oli-obk:fix/const_fn_eval, r=dotdash

8 years agoAdd information about str::parse() in FromStr docs
Devon Hollowood [Fri, 20 Nov 2015 08:41:10 +0000 (00:41 -0800)]
Add information about str::parse() in FromStr docs

8 years agoAuto merge of #29943 - brson:inline-threshold, r=nrc
bors [Fri, 20 Nov 2015 05:09:24 +0000 (05:09 +0000)]
Auto merge of #29943 - brson:inline-threshold, r=nrc

Corresponds directly to llvm's inline-threshold.

I want this so I can experiment out-of-tree with tweaking optimization settings, and this is the most important value that isn't exposed. I can't get it to work either via `-C llvm-args`.

cc @rust-lang/compiler

8 years agoAuto merge of #29942 - brson:rmsegstack, r=alexcrichton
bors [Fri, 20 Nov 2015 03:26:19 +0000 (03:26 +0000)]
Auto merge of #29942 - brson:rmsegstack, r=alexcrichton

8 years agosave-analysis: make the dump file's name closer to the crate file's name
Nick Cameron [Fri, 20 Nov 2015 02:00:10 +0000 (15:00 +1300)]
save-analysis: make the dump file's name closer to the crate file's name

8 years agoAuto merge of #29939 - mitaa:doc_const_fn, r=alexcrichton
bors [Fri, 20 Nov 2015 01:40:03 +0000 (01:40 +0000)]
Auto merge of #29939 - mitaa:doc_const_fn, r=alexcrichton

fixes #27362

8 years agoAdd -C inline-threshold
Brian Anderson [Fri, 20 Nov 2015 00:07:09 +0000 (16:07 -0800)]
Add -C inline-threshold

Corresponds directly to llvm's inline-threshold

8 years agoRemove segmented stack option from LLVMRustCreateTargetMachine. Unused.
Brian Anderson [Thu, 19 Nov 2015 19:32:16 +0000 (11:32 -0800)]
Remove segmented stack option from LLVMRustCreateTargetMachine. Unused.

8 years agoAuto merge of #29894 - alexcrichton:stdtime, r=brson
bors [Thu, 19 Nov 2015 23:57:07 +0000 (23:57 +0000)]
Auto merge of #29894 - alexcrichton:stdtime, r=brson

This commit is an implementation of [RFC 1288][rfc] which adds two new unstable
types to the `std::time` module. The `Instant` type is used to represent
measurements of a monotonically increasing clock suitable for measuring time
withing a process for operations such as benchmarks or just the elapsed time to
do something. An `Instant` favors panicking when bugs are found as the bugs are
programmer errors rather than typical errors that can be encountered.

[rfc]: https://github.com/rust-lang/rfcs/pull/1288

The `SystemTime` type is used to represent a system timestamp and is not
monotonic. Very few guarantees are provided about this measurement of the system
clock, but a fixed point in time (`UNIX_EPOCH`) is provided to learn about the
relative distance from this point for any particular time stamp.

This PR takes the same implementation strategy as the `time` crate on crates.io,
namely:

|  Platform  |  Instant                 |  SystemTime              |
|------------|--------------------------|--------------------------|
| Windows    | QueryPerformanceCounter  | GetSystemTimeAsFileTime  |
| OSX        | mach_absolute_time       | gettimeofday             |
| Unix       | CLOCK_MONOTONIC          | CLOCK_REALTIME           |

These implementations can perhaps be refined over time, but they currently
satisfy the requirements of the `Instant` and `SystemTime` types while also
being portable across implementations and revisions of each platform.

cc #29866

8 years agoAuto merge of #29901 - tbu-:pr_env_ignore_malformed_windows, r=alexcrichton
bors [Thu, 19 Nov 2015 22:15:13 +0000 (22:15 +0000)]
Auto merge of #29901 - tbu-:pr_env_ignore_malformed_windows, r=alexcrichton

See also #29297.

8 years agoShow constness for functions of reexported docs
mitaa [Thu, 19 Nov 2015 15:27:17 +0000 (16:27 +0100)]
Show constness for functions of reexported docs

8 years agoFix rustdocs `unsafe const fn` ordering
mitaa [Thu, 19 Nov 2015 20:08:50 +0000 (21:08 +0100)]
Fix rustdocs `unsafe const fn` ordering

8 years agoAdd run-pass test for paths containing the NUL character
Tobias Bucher [Thu, 19 Nov 2015 14:18:09 +0000 (14:18 +0000)]
Add run-pass test for paths containing the NUL character

8 years agoError when paths contain NUL characters
Tobias Bucher [Wed, 18 Nov 2015 14:49:23 +0000 (14:49 +0000)]
Error when paths contain NUL characters

On Windows: Previously these paths were silently truncated at these NUL
characters, now they fail with `ErrorKind::InvalidInput`.

8 years agoRe-unignore environment test on MinGW
Tobias Bucher [Thu, 19 Nov 2015 19:07:27 +0000 (19:07 +0000)]
Re-unignore environment test on MinGW

8 years agoIgnore malformed environment variables on Windows too
Tobias Bucher [Tue, 17 Nov 2015 23:33:34 +0000 (23:33 +0000)]
Ignore malformed environment variables on Windows too

Leading equals symbols are treated as part of the variable name, if
there is no other equality symbol or none at all, the environment string
is ignored.

8 years agoAuto merge of #29925 - Ms2ger:fmt-trans-base, r=luqmana
bors [Thu, 19 Nov 2015 19:51:27 +0000 (19:51 +0000)]
Auto merge of #29925 - Ms2ger:fmt-trans-base, r=luqmana

8 years agoconstrained_type_params: make projections depend on their trait-ref
Ariel Ben-Yehuda [Wed, 18 Nov 2015 22:43:31 +0000 (00:43 +0200)]
constrained_type_params: make projections depend on their trait-ref

As this is a soundness fix, it is a [breaking-change].

Fixes #29861.

8 years agostd: Add Instant and SystemTime to std::time
Alex Crichton [Tue, 17 Nov 2015 01:36:14 +0000 (17:36 -0800)]
std: Add Instant and SystemTime to std::time

This commit is an implementation of [RFC 1288][rfc] which adds two new unstable
types to the `std::time` module. The `Instant` type is used to represent
measurements of a monotonically increasing clock suitable for measuring time
withing a process for operations such as benchmarks or just the elapsed time to
do something. An `Instant` favors panicking when bugs are found as the bugs are
programmer errors rather than typical errors that can be encountered.

[rfc]: https://github.com/rust-lang/rfcs/pull/1288

The `SystemTime` type is used to represent a system timestamp and is not
monotonic. Very few guarantees are provided about this measurement of the system
clock, but a fixed point in time (`UNIX_EPOCH`) is provided to learn about the
relative distance from this point for any particular time stamp.

This PR takes the same implementation strategy as the `time` crate on crates.io,
namely:

|  Platform  |  Instant                 |  SystemTime              |
|------------|--------------------------|--------------------------|
| Windows    | QueryPerformanceCounter  | GetSystemTimeAsFileTime  |
| OSX        | mach_absolute_time       | gettimeofday             |
| Unix       | CLOCK_MONOTONIC          | CLOCK_REALTIME           |

These implementations can perhaps be refined over time, but they currently
satisfy the requirements of the `Instant` and `SystemTime` types while also
being portable across implementations and revisions of each platform.

8 years agoAuto merge of #29932 - steveklabnik:trpl_book, r=brson
bors [Thu, 19 Nov 2015 16:49:20 +0000 (16:49 +0000)]
Auto merge of #29932 - steveklabnik:trpl_book, r=brson

The book was located under 'src/doc/trpl' because originally, it was
going to be hosted under that URL. Late in the game, before 1.0, we
decided that /book was a better one, so we changed the output, but
not the input. This causes confusion for no good reason. So we'll change
the source directory to look like the output directory, like for every
other thing in src/doc.

r? @brson

8 years agosrc/doc/trpl -> src/doc/book
Steve Klabnik [Thu, 19 Nov 2015 16:30:18 +0000 (11:30 -0500)]
src/doc/trpl -> src/doc/book

The book was located under 'src/doc/trpl' because originally, it was
going to be hosted under that URL. Late in the game, before 1.0, we
decided that /book was a better one, so we changed the output, but
not the input. This causes confusion for no good reason. So we'll change
the source directory to look like the output directory, like for every
other thing in src/doc.