]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoOnly underline suggestion if it is not the only code being shown
Esteban Küber [Wed, 5 Jul 2017 23:39:06 +0000 (16:39 -0700)]
Only underline suggestion if it is not the only code being shown

7 years agoAdd extra whitespace for suggestions
Esteban Küber [Wed, 28 Jun 2017 06:16:04 +0000 (23:16 -0700)]
Add extra whitespace for suggestions

7 years agoMake suggestion include the line number
Esteban Küber [Sun, 25 Jun 2017 20:11:22 +0000 (13:11 -0700)]
Make suggestion include the line number

When there're more than one suggestions in the same diagnostic, they are
displayed in their own block, instead of inline. In order to reduce
confusion, those blocks now display the line number.

7 years agoCheck adjustments and node substs
Vadim Petrochenkov [Sat, 3 Jun 2017 14:51:32 +0000 (17:51 +0300)]
Check adjustments and node substs

Cleanup checking of inherent static methods and fix checking of inherent associated constants
Add more tests

7 years agoCheck types for privacy
Vadim Petrochenkov [Sat, 22 Apr 2017 19:46:34 +0000 (22:46 +0300)]
Check types for privacy

7 years agochange error URLs to footnote style
Alex Burka [Wed, 5 Jul 2017 21:13:07 +0000 (21:13 +0000)]
change error URLs to footnote style

7 years agofix description for E0617
Alex Burka [Wed, 5 Jul 2017 21:12:09 +0000 (21:12 +0000)]
fix description for E0617

It used to point to the Book, but no specific section, and in fact the
information is not in the Book (see rust-lang-nursery/reference#77).

7 years agoFix a couple broken links to the reference from error messages.
Corey Farwell [Tue, 13 Jun 2017 03:40:58 +0000 (23:40 -0400)]
Fix a couple broken links to the reference from error messages.

7 years agoAuto merge of #43092 - aidanhs:aphs-retry-llvm-tarball, r=alexcrichton
bors [Thu, 6 Jul 2017 19:56:55 +0000 (19:56 +0000)]
Auto merge of #43092 - aidanhs:aphs-retry-llvm-tarball, r=alexcrichton

Retry downloading llvm commit tarball

As promised on https://github.com/rust-lang/rust/pull/42816#issuecomment-312890169

r? @alexcrichton

7 years agoAdd annotations to the resize fn #39791
Ryan Thomas [Thu, 6 Jul 2017 19:25:53 +0000 (20:25 +0100)]
Add annotations to the resize fn #39791

This adds the `inline(never)` and `cold` annotations to the
HashMap::resize function.

7 years agoremove associated_consts feature gate
Sean McArthur [Thu, 6 Jul 2017 18:52:25 +0000 (11:52 -0700)]
remove associated_consts feature gate

7 years agoRetry downloading llvm commit tarball
Aidan Hobson Sayers [Thu, 6 Jul 2017 17:55:07 +0000 (18:55 +0100)]
Retry downloading llvm commit tarball

7 years agoAuto merge of #42816 - alexcrichton:probestack, r=nikomatsakis
bors [Thu, 6 Jul 2017 17:15:14 +0000 (17:15 +0000)]
Auto merge of #42816 - alexcrichton:probestack, r=nikomatsakis

rustc: Implement stack probes for x86

This commit implements stack probes on x86/x86_64 using the freshly landed
support upstream in LLVM. The purpose of stack probes here are to guarantee a
segfault on stack overflow rather than having a chance of running over the guard
page already present on all threads by accident.

At this time there's no support for any other architecture because LLVM itself
does not have support for other architectures.

7 years agorustc: Implement stack probes for x86
Alex Crichton [Wed, 21 Jun 2017 19:08:18 +0000 (12:08 -0700)]
rustc: Implement stack probes for x86

This commit implements stack probes on x86/x86_64 using the freshly landed
support upstream in LLVM. The purpose of stack probes here are to guarantee a
segfault on stack overflow rather than having a chance of running over the guard
page already present on all threads by accident.

At this time there's no support for any other architecture because LLVM itself
does not have support for other architectures.

7 years agorustdoc: Don't run Markdown tests twice
Oliver Middleton [Wed, 5 Jul 2017 14:47:54 +0000 (15:47 +0100)]
rustdoc: Don't run Markdown tests twice

This matches the behaviour for finding tests in Rust files.

7 years agoAuto merge of #43066 - pornel:patch-1, r=Mark-Simulacrum
bors [Thu, 6 Jul 2017 14:46:13 +0000 (14:46 +0000)]
Auto merge of #43066 - pornel:patch-1, r=Mark-Simulacrum

Suggest rustup toolchain link

The contributing instructions only explain how to build the compiler, but not how to try it out.

I found `rustup toolchain link` to be super useful for this, so I think it's good to suggest it.

7 years agoAuto merge of #43078 - kennytm:fix-42755-vis-can-be-empty, r=petrochenkov
bors [Thu, 6 Jul 2017 11:28:32 +0000 (11:28 +0000)]
Auto merge of #43078 - kennytm:fix-42755-vis-can-be-empty, r=petrochenkov

Disallow `$($v:vis)*`. Fix #42755.

#42755

7 years agoSuggest rustup toolchain link
Kornel [Wed, 5 Jul 2017 14:24:41 +0000 (15:24 +0100)]
Suggest rustup toolchain link

7 years agoDisallow `$($v:vis)*`. Fix #42755.
kennytm [Thu, 6 Jul 2017 00:18:58 +0000 (08:18 +0800)]
Disallow `$($v:vis)*`. Fix #42755.

7 years agoAuto merge of #43008 - zackmdavis:field_init_shorthand_in_librustc, r=estebank
bors [Thu, 6 Jul 2017 07:49:44 +0000 (07:49 +0000)]
Auto merge of #43008 - zackmdavis:field_init_shorthand_in_librustc, r=estebank

use field init shorthand in src/librustc/

Commentary on #37340 [suggested](https://github.com/rust-lang/rust/issues/37340#issuecomment-255513390) using the new field init syntax in the compiler. Do we care about this? If so, here's a pull request for the librustc/ directory. While [`rustfmt` might do this in the future](https://github.com/rust-lang/rust/issues/37340#issuecomment-255513712), in the meantime, some simple Python will do:

```python
#!/usr/bin/env python3

import os, re, sys

OPPORTUNITY = re.compile(r" (\w+): \1,?\n")

def field_init_shorthand_substitution(filename):
    with open(filename) as f:
        text = f.read()
        revised = OPPORTUNITY.sub(r" \1,\n", text)
    with open(filename, 'w') as f:
        f.write(revised)

def substitute_in_directory(path):
    for dirname, _subdirs, basenames in os.walk(path):
        for basename in basenames:
            field_init_shorthand_substitution(os.path.join(dirname, basename))

if __name__ == "__main__":
    substitute_in_directory(sys.argv[1])
```

**Update 3 July**: edited the search (respectively replace) regex to ` (\w+): \1,?\n` (` \1,\n`) from ` (\w+): \1,` (` \1,`)

7 years agouse field init shorthand in src/librustc
Zack M. Davis [Mon, 3 Jul 2017 18:19:51 +0000 (11:19 -0700)]
use field init shorthand in src/librustc

The field init shorthand syntax was stabilized in 1.17.0 (aebd94f); we
are now free to use it in the compiler.

7 years agoAuto merge of #43001 - estebank:try-on-unimplemented, r=aturon
bors [Thu, 6 Jul 2017 05:29:09 +0000 (05:29 +0000)]
Auto merge of #43001 - estebank:try-on-unimplemented, r=aturon

Add `rustc_on_unimplemented` message to `std::ops::Try`

#42694, #35946.

7 years agoAdd `rustc_on_unimplemented` message to `std::ops::Try`
Esteban Küber [Sat, 1 Jul 2017 00:11:12 +0000 (17:11 -0700)]
Add `rustc_on_unimplemented` message to `std::ops::Try`

7 years agoAuto merge of #42899 - alexcrichton:compiler-builtins, r=nikomatsakis
bors [Thu, 6 Jul 2017 02:34:29 +0000 (02:34 +0000)]
Auto merge of #42899 - alexcrichton:compiler-builtins, r=nikomatsakis

Switch to rust-lang-nursery/compiler-builtins

This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.

7 years agoAuto merge of #42727 - alexcrichton:allocators-new, r=eddyb
bors [Thu, 6 Jul 2017 00:16:16 +0000 (00:16 +0000)]
Auto merge of #42727 - alexcrichton:allocators-new, r=eddyb

rustc: Implement the #[global_allocator] attribute

This PR is an implementation of [RFC 1974] which specifies a new method of
defining a global allocator for a program. This obsoletes the old
`#![allocator]` attribute and also removes support for it.

[RFC 1974]: https://github.com/rust-lang/rfcs/pull/1974

The new `#[global_allocator]` attribute solves many issues encountered with the
`#![allocator]` attribute such as composition and restrictions on the crate
graph itself. The compiler now has much more control over the ABI of the
allocator and how it's implemented, allowing much more freedom in terms of how
this feature is implemented.

cc #27389

7 years agorustc: Implement the #[global_allocator] attribute
Alex Crichton [Sat, 3 Jun 2017 21:54:08 +0000 (14:54 -0700)]
rustc: Implement the #[global_allocator] attribute

This PR is an implementation of [RFC 1974] which specifies a new method of
defining a global allocator for a program. This obsoletes the old
`#![allocator]` attribute and also removes support for it.

[RFC 1974]: https://github.com/rust-lang/rfcs/pull/197

The new `#[global_allocator]` attribute solves many issues encountered with the
`#![allocator]` attribute such as composition and restrictions on the crate
graph itself. The compiler now has much more control over the ABI of the
allocator and how it's implemented, allowing much more freedom in terms of how
this feature is implemented.

cc #27389

7 years agoAuto merge of #40939 - jseyfried:proc_macro_api, r=nrc
bors [Wed, 5 Jul 2017 21:16:34 +0000 (21:16 +0000)]
Auto merge of #40939 - jseyfried:proc_macro_api, r=nrc

proc_macro: implement `TokenTree`, `TokenKind`, hygienic `quote!`, and other API

All new API is gated behind `#![feature(proc_macro)]` and may be used with `#[proc_macro]`, `#[proc_macro_attribute]`, and `#[proc_macro_derive]` procedural macros.

More specifically, this PR adds the following in `proc_macro`:
```rust
// `TokenStream` constructors:
impl TokenStream { fn empty() -> TokenStream { ... } }
impl From<TokenTree> for TokenStream { ... }
impl From<TokenKind> for TokenStream { ... }
impl<T: Into<TokenStream>> FromIterator<T> for TokenStream { ... }
macro quote($($t:tt)*) { ... } // A hygienic `TokenStream` quoter

// `TokenStream` destructuring:
impl TokenStream { fn is_empty(&self) -> bool { ... } }
impl IntoIterator for TokenStream { type Item = TokenTree; ... }

struct TokenTree { span: Span, kind: TokenKind }
impl From<TokenKind> for TokenTree { ... }
impl Display for TokenTree { ... }

struct Span { ... } // a region of source code along with expansion/hygiene information
impl Default for Span { ... } // a span from the current procedural macro definition
impl Span { fn call_site() -> Span { ... } } // the call site of the current expansion
fn quote_span(span: Span) -> TokenStream;

enum TokenKind {
    Group(Delimiter, TokenStream), // A delimited sequence, e.g. `( ... )`
    Term(Term), // a unicode identifier, lifetime ('a), or underscore
    Op(char, Spacing), // a punctuation character (`+`, `,`, `$`, etc.).
    Literal(Literal), // a literal character (`'a'`), string (`"hello"`), or number (`2.3`)
}

enum Delimiter {
    Parenthesis, // `( ... )`
    Brace, // `[ ... ]`
    Bracket, // `{ ... }`
    None, // an implicit delimiter, e.g. `$var`, where $var is  `...`.
}

struct Term { ... } // An interned string
impl Term {
    fn intern(string: &str) -> Symbol { ... }
    fn as_str(&self) -> &str { ... }
}

enum Spacing {
    Alone, // not immediately followed by another `Op`, e.g. `+` in `+ =`.
    Joint, // immediately followed by another `Op`, e.g. `+` in `+=`
}

struct Literal { ... }
impl Display for Literal { ... }
impl Literal {
    fn integer(n: i128) -> Literal { .. } // unsuffixed integer literal
    fn float(n: f64) -> Literal { .. } // unsuffixed floating point literal
    fn u8(n: u8) -> Literal { ... } // similarly: i8, u16, i16, u32, i32, u64, i64, f32, f64
    fn string(string: &str) -> Literal { ... }
    fn character(ch: char) -> Literal { ... }
    fn byte_string(bytes: &[u8]) -> Literal { ... }
}
```
For details on `quote!` hygiene, see [this example](https://github.com/rust-lang/rust/pull/40939/commits/20a90485c040df87a667e9b6ee38e4d8a7d7fc5d) and [declarative macros 2.0](https://github.com/rust-lang/rust/pull/40847).

r? @nrc

7 years agorustbuild: Only -Zsave-analysis for libstd
Alex Crichton [Wed, 5 Jul 2017 20:51:34 +0000 (13:51 -0700)]
rustbuild: Only -Zsave-analysis for libstd

Don't pass the flag when we're compiling the compiler or other related tools

7 years agoMerge remote-tracking branch 'origin/master' into proc_macro_api
Alex Crichton [Wed, 5 Jul 2017 15:42:13 +0000 (08:42 -0700)]
Merge remote-tracking branch 'origin/master' into proc_macro_api

7 years agoSwitch to rust-lang-nursery/compiler-builtins
Alex Crichton [Thu, 22 Jun 2017 20:14:00 +0000 (13:14 -0700)]
Switch to rust-lang-nursery/compiler-builtins

This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.

7 years agoAuto merge of #42972 - GuillaumeGomez:fix-toggles-rustdoc, r=QuietMisdreavus
bors [Wed, 5 Jul 2017 13:56:32 +0000 (13:56 +0000)]
Auto merge of #42972 - GuillaumeGomez:fix-toggles-rustdoc, r=QuietMisdreavus

Toggle wrappers are now generated correctly

Fixes #42674.

7 years agoAuto merge of #43050 - stjepang:doc-vec-fix-parens, r=frewsxcv
bors [Wed, 5 Jul 2017 02:04:07 +0000 (02:04 +0000)]
Auto merge of #43050 - stjepang:doc-vec-fix-parens, r=frewsxcv

Minor fix in docs for Vec

Added missing parentheses after `mem::size_of::<T>`.

7 years agoAuto merge of #42732 - cengizIO:master, r=Mark-Simulacrum
bors [Tue, 4 Jul 2017 23:50:11 +0000 (23:50 +0000)]
Auto merge of #42732 - cengizIO:master, r=Mark-Simulacrum

Add pager support for `rustc --explain EXXXX`

Hello!

Fixes #32665.

Thanks!

**EDIT:** _I've limited access to a Windows machine so this is taking longer than I've anticipated_. 🐢

cc @alexcrichton @nikomatsakis @Mark-Simulacrum @retep998 @ollie27 @afiune

7 years agoAuto merge of #43051 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Tue, 4 Jul 2017 15:58:24 +0000 (15:58 +0000)]
Auto merge of #43051 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 8 pull requests

- Successful merges: #42227, #42836, #42975, #42994, #43041, #43042, #43043, #43045
- Failed merges:

7 years agoRollup merge of #43045 - PlasmaPower:patch-1, r=Mark-Simulacrum
Mark Simulacrum [Tue, 4 Jul 2017 13:41:45 +0000 (07:41 -0600)]
Rollup merge of #43045 - PlasmaPower:patch-1, r=Mark-Simulacrum

README: note how to enable debugging for rustc

I got stuck on this for a bit, looking for a debug option in `./x.py build --help`.

Diff without newline changes:

Before:

> Various other options are also supported, and are documented in the config file.

After:

> Various other options, such as enabling debug information, are also supported, and are documented in the config file.

7 years agoRollup merge of #43043 - sfackler:reverse-stability, r=Mark-Simulacrum
Mark Simulacrum [Tue, 4 Jul 2017 13:41:44 +0000 (07:41 -0600)]
Rollup merge of #43043 - sfackler:reverse-stability, r=Mark-Simulacrum

Add a stability marker for core::cmp::Reverse.0

Closes #43027

7 years agoRollup merge of #43042 - Mark-Simulacrum:rustbuild-cleanup, r=alexcrichton
Mark Simulacrum [Tue, 4 Jul 2017 13:41:43 +0000 (07:41 -0600)]
Rollup merge of #43042 - Mark-Simulacrum:rustbuild-cleanup, r=alexcrichton

Various minor cleanups to rustbuild

This is work I did before the migration to the new rustbuild. I'd prefer to land this first, before my other PR, to make the diff a little clearer.

r? @alexcrichton

7 years agoRollup merge of #43041 - andersk:dedup_by, r=alexcrichton
Mark Simulacrum [Tue, 4 Jul 2017 13:41:42 +0000 (07:41 -0600)]
Rollup merge of #43041 - andersk:dedup_by, r=alexcrichton

Document unintuitive argument order for Vec::dedup_by relation

When trying to use `dedup_by` to merge some auxiliary information from removed elements into kept elements, I was surprised to observe that `vec.dedup_by(same_bucket)` calls `same_bucket(a, b)` where `b` appears before `a` in the vector, and discards `a` when true is returned.  This argument order is probably a bug, but since it has already been stabilized, I guess we should document it as a feature and move on.

(`Vec::dedup` also uses `==` with this unexpected argument order, but I figure that’s not important since `==` is expected to be symmetric with no side effects.)

7 years agoRollup merge of #42994 - stepancheg:ignore-iml, r=aturon
Mark Simulacrum [Tue, 4 Jul 2017 13:41:41 +0000 (07:41 -0600)]
Rollup merge of #42994 - stepancheg:ignore-iml, r=aturon

Ignore *.iml files

... which are IntelliJ IDEA module files. (`.idea` is IDEA project files.)

7 years agoRollup merge of #42975 - ids1024:symlink2, r=aturon
Mark Simulacrum [Tue, 4 Jul 2017 13:41:40 +0000 (07:41 -0600)]
Rollup merge of #42975 - ids1024:symlink2, r=aturon

redox: symlink and readlink

7 years agoRollup merge of #42836 - rthomas:29355-debug, r=GuillaumeGomez
Mark Simulacrum [Tue, 4 Jul 2017 13:41:39 +0000 (07:41 -0600)]
Rollup merge of #42836 - rthomas:29355-debug, r=GuillaumeGomez

Update docs for Debug* structs. #29355

This adds docs for the Debug* structs as well as examples from the
Formatter::debug_* methods, so that a user knows how to construct them.

I added these examples as the builders module is not public and hence
the debug_*_new() functions are not available to a user.

r? @steveklabnik

7 years agoRollup merge of #42227 - ollie27:into_to_from, r=aturon
Mark Simulacrum [Tue, 4 Jul 2017 13:41:33 +0000 (07:41 -0600)]
Rollup merge of #42227 - ollie27:into_to_from, r=aturon

Convert Intos to Froms.

This is a resubmission of #42129 without `impl<T> From<Vec<T>> for Box<[T]>`.

7 years agoUse build.build instead of build.config.build
Mark Simulacrum [Tue, 27 Jun 2017 21:59:43 +0000 (15:59 -0600)]
Use build.build instead of build.config.build

7 years agoMove targets, hosts, and build triple into Build.
Mark Simulacrum [Tue, 27 Jun 2017 21:52:46 +0000 (15:52 -0600)]
Move targets, hosts, and build triple into Build.

7 years agoStore verbosity on Build
Mark Simulacrum [Tue, 27 Jun 2017 19:49:21 +0000 (13:49 -0600)]
Store verbosity on Build

Prevents accidental mistakes in not using the right verbosity by going
to only config or flags.

7 years agoStore positive instead of negative fail_fast.
Mark Simulacrum [Tue, 27 Jun 2017 19:37:24 +0000 (13:37 -0600)]
Store positive instead of negative fail_fast.

This makes later negation much easier to interpret.

7 years agoRemove src_is_git, instead call method on rust_info directly.
Mark Simulacrum [Tue, 27 Jun 2017 19:34:26 +0000 (13:34 -0600)]
Remove src_is_git, instead call method on rust_info directly.

7 years agoClarify meaning of Build.cargo, Build.rustc.
Mark Simulacrum [Tue, 27 Jun 2017 19:32:04 +0000 (13:32 -0600)]
Clarify meaning of Build.cargo, Build.rustc.

Rename Build.{cargo, rustc} to {initial_cargo, initial_rustc}.

7 years agoUpdate a few comments.
Mark Simulacrum [Tue, 27 Jun 2017 19:24:37 +0000 (13:24 -0600)]
Update a few comments.

7 years agoClippy lints
Mark Simulacrum [Tue, 27 Jun 2017 15:51:26 +0000 (09:51 -0600)]
Clippy lints

7 years agoCleanup dist
Mark Simulacrum [Tue, 27 Jun 2017 15:05:47 +0000 (09:05 -0600)]
Cleanup dist

7 years agoCleanup utils
Mark Simulacrum [Tue, 27 Jun 2017 15:05:40 +0000 (09:05 -0600)]
Cleanup utils

7 years agoCleanup compile.rs.
Mark Simulacrum [Tue, 27 Jun 2017 00:13:10 +0000 (18:13 -0600)]
Cleanup compile.rs.

7 years agoCleanups to check code.
Mark Simulacrum [Mon, 26 Jun 2017 16:23:50 +0000 (10:23 -0600)]
Cleanups to check code.

7 years agoRemove 'static lifetimes from channels.
Mark Simulacrum [Sat, 24 Jun 2017 11:42:38 +0000 (05:42 -0600)]
Remove 'static lifetimes from channels.

7 years agoClean up and restructure sanity checking.
Mark Simulacrum [Wed, 21 Jun 2017 23:03:14 +0000 (17:03 -0600)]
Clean up and restructure sanity checking.

7 years agoDon't allocate args in order to run find.
Mark Simulacrum [Wed, 21 Jun 2017 17:15:49 +0000 (11:15 -0600)]
Don't allocate args in order to run find.

7 years agoAuto merge of #43025 - est31:nan_cross_platform, r=BurntSushi
bors [Tue, 4 Jul 2017 13:21:20 +0000 (13:21 +0000)]
Auto merge of #43025 - est31:nan_cross_platform, r=BurntSushi

Make sNaN removal code tolerate different sNaN encodings

IEEE 754-1985 specifies the encoding of NaN floating point numbers,
but while it mentions that NaNs can be subdivided into signaling
and quiet ones, it doesn't fix the encoding of signaling NaNs in binary
formats. This led to different implementations (CPUs) having different
encodings. IEEE 754-2008 finally specified the encoding of signaling NaNs
but some architectures are compatible with it, while others aren't.
Certain MIPS and PA-RISC CPUs have different encodings for signaling
NaNs.

In order to have the float <-> binary cast feature of the std library be
portable to them, we don't mask any quiet NaNs like we did before (only
being compliant to IEEE 754-2008 and nothing else), but instead we
simply pass a known good NaN instead.

Note that in the code removed there was a bug; the 64 bit mask for quiet
NaNs should have been `0x0008000000000000` instead of the specified
`0x0001000000000000`.

7 years agoMinor fix in docs for Vec
Stjepan Glavina [Tue, 4 Jul 2017 13:14:08 +0000 (15:14 +0200)]
Minor fix in docs for Vec

7 years agoAuto merge of #43012 - scottmcm:delete-range-step-by, r=alexcrichton
bors [Tue, 4 Jul 2017 04:49:59 +0000 (04:49 +0000)]
Auto merge of #43012 - scottmcm:delete-range-step-by, r=alexcrichton

Delete deprecated & unstable range-specific `step_by`

Using the new one is annoying while this one exists, since the inherent method hides the one on iterator.

Tracking issue: #27741
Replacement: #41439
Deprecation: #42310 for 1.19
Fixes #41477

7 years agoREADME: note how to enable debugging for rustc
Lee Bousfield [Tue, 4 Jul 2017 02:04:57 +0000 (22:04 -0400)]
README: note how to enable debugging for rustc

7 years agoAuto merge of #42993 - stepancheg:editorconfig, r=brson
bors [Tue, 4 Jul 2017 01:08:15 +0000 (01:08 +0000)]
Auto merge of #42993 - stepancheg:editorconfig, r=brson

Add .editorconfig to src/rustllvm

... which uses 2 space indent instead of common 4 spaces.

7 years agoAdd a stability marker for core::cmp::Reverse.0
Steven Fackler [Mon, 3 Jul 2017 23:46:37 +0000 (13:46 -1000)]
Add a stability marker for core::cmp::Reverse.0

Closes #43027

7 years agoDocument unintuitive argument order for Vec::dedup_by relation
Anders Kaseorg [Mon, 3 Jul 2017 21:18:01 +0000 (17:18 -0400)]
Document unintuitive argument order for Vec::dedup_by relation

When trying to use dedup_by to merge some auxiliary information from
removed elements into kept elements, I was surprised to observe that
vec.dedup_by(same_bucket) calls same_bucket(a, b) where b appears
before a in the vector, and discards a when true is returned.  This
argument order is probably a bug, but since it has already been
stabilized, I guess we should document it as a feature and move on.

(Vec::dedup also uses == with this unexpected argument order, but I
figure that’s not important since == is expected to be symmetric with
no side effects.)

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
7 years agoMake sNaN removal code tolerate different sNaN encodings
est31 [Mon, 3 Jul 2017 14:16:45 +0000 (16:16 +0200)]
Make sNaN removal code tolerate different sNaN encodings

IEEE 754-1985 specifies the encoding of NaN floating point numbers,
but while it mentions that NaNs can be subdivided into signaling
and quiet ones, it doesn't fix the encoding of signaling NaNs in binary
formats. This led to different implementations (CPUs) having different
encodings. IEEE 754-2008 finally specified the encoding of signaling NaNs
but some architectures are compatible with it, while others aren't.
Certain MIPS and PA-RISC CPUs have different encodings for signaling
NaNs.

In order to have the float <-> binary cast feature of the std library be
portable to them, we don't mask any quiet NaNs like we did before (only
being compliant to IEEE 754-2008 and nothing else), but instead we
simply pass a known good NaN instead.

Note that in the code removed there was a bug; the 64 bit mask for quiet
NaNs should have been `0x0008000000000000` instead of the specified
`0x0001000000000000`.

7 years agoAuto merge of #42999 - behnam:ucd10, r=alexcrichton
bors [Mon, 3 Jul 2017 17:00:17 +0000 (17:00 +0000)]
Auto merge of #42999 - behnam:ucd10, r=alexcrichton

[libstd_unicode] Upgrade to Unicode 10.0.0

Update `libstd_unicode`'s data tables to Unicode 10.0.0, as released on 2017 June 20: http://www.unicode.org/versions/Unicode10.0.0/

7 years agoAuto merge of #42976 - ids1024:redoxfix, r=sfackler
bors [Mon, 3 Jul 2017 12:20:57 +0000 (12:20 +0000)]
Auto merge of #42976 - ids1024:redoxfix, r=sfackler

Fix Redox build, apparently broken by #42687

7 years agoremove isatty dependency
Cengiz Can [Mon, 3 Jul 2017 08:46:12 +0000 (11:46 +0300)]
remove isatty dependency

7 years agouse single line comments
Cengiz Can [Mon, 3 Jul 2017 08:45:31 +0000 (11:45 +0300)]
use single line comments

7 years agouse embedded implementation instead of istty crate
Cengiz Can [Sun, 2 Jul 2017 22:34:25 +0000 (01:34 +0300)]
use embedded implementation instead of istty crate

7 years agodo not spawn pager if not tty
Cengiz Can [Sun, 2 Jul 2017 20:27:10 +0000 (23:27 +0300)]
do not spawn pager if not tty

7 years agouse unwrap_or_else to prevent unnecessary alloc
Cengiz Can [Thu, 29 Jun 2017 14:57:54 +0000 (17:57 +0300)]
use unwrap_or_else to prevent unnecessary alloc

7 years agodo not append an extra newline char
Cengiz Can [Thu, 29 Jun 2017 07:40:51 +0000 (10:40 +0300)]
do not append an extra newline char

7 years agouse PAGER to view --explain output #32665
Cengiz Can [Mon, 29 May 2017 21:13:09 +0000 (00:13 +0300)]
use PAGER to view --explain output #32665

7 years agoAuto merge of #43010 - stjepang:stabilize-sort-unstable, r=alexcrichton
bors [Sun, 2 Jul 2017 23:54:32 +0000 (23:54 +0000)]
Auto merge of #43010 - stjepang:stabilize-sort-unstable, r=alexcrichton

Stabilize feature sort_unstable

Closes #40585

7 years agoRemove the remaining feature gates
Stjepan Glavina [Sun, 2 Jul 2017 19:29:39 +0000 (21:29 +0200)]
Remove the remaining feature gates

7 years agoFix lint errors
Stjepan Glavina [Sun, 2 Jul 2017 17:14:16 +0000 (19:14 +0200)]
Fix lint errors

7 years agoAdd docs for Debug* structs. #29355
Ryan Thomas [Thu, 22 Jun 2017 19:49:22 +0000 (20:49 +0100)]
Add docs for Debug* structs. #29355

This adds docs for the Debug* structs as well as examples from the
Formatter::debug_* methods, so that a user knows how to construct them.

I added these examples as the builders module is not public and hence
the debug_*_new() functions are not available to a user.

r? @steveklabnik

Review comments.

Mainly adding in the links for all of the structs and functions.

Remove rust tag on code blocks.

7 years agoAuto merge of #42938 - est31:col_number, r=eddyb
bors [Sun, 2 Jul 2017 15:40:26 +0000 (15:40 +0000)]
Auto merge of #42938 - est31:col_number, r=eddyb

Output column number info when panicking

Outputs the column number when panicking. Useful when you e.g. have code like `foo[i] = bar[k] + bar[l]` and you get a panic with index out of bounds, or when you have an expression like `a = b + c + d + e` and the addition overflows. Now you know which operation to blame!

The format is `file:line:column`, just like for compiler errors. Example output with the patch:

```
thread 'main' panicked at 'index out of bounds: the len is 5 but the index is 8', src/main.rs:3:8
```

As some of the API between the compiler and the library landscape gets broken, this is a bit hackier than I'd originally wanted it to be.

* `panic` and `panic_bounds_check` lang items got an additional column param, on stage0 I still have to use the previous version. After a SNAP this should be resolved.
* For `#[derive(RustcDeserialze)]`, stage0 requires a fixed signature for `std::rt::begin_panic`, so we can't change it right away. What we need to do instead is to keep the signature, and add a `begin_panic_new` function that we use in later stages instead. After a SNAP we can change the `begin_panic` function and rely on it instead of `begin_panic_new`, and one SNAP later we can remove `begin_panic_new`.
* Fortunately I didn't have to break anything about the panic hook API, I could easily extend it.

Note that debuginfo remains unchanged, so RUST_BACKTRACE output won't contain any column info. See issue #42921 for discussion on including the column in debuginfo.

7 years agoUpdate cargo
est31 [Sun, 2 Jul 2017 11:51:28 +0000 (13:51 +0200)]
Update cargo

... to get https://github.com/rust-lang/cargo/pull/4244 and
https://github.com/rust-lang/cargo/pull/4246

7 years agoAuto merge of #43015 - arielb1:every-error-counts, r=eddyb
bors [Sun, 2 Jul 2017 13:22:23 +0000 (13:22 +0000)]
Auto merge of #43015 - arielb1:every-error-counts, r=eddyb

report the total number of errors on compilation failure

Prior to this PR, when we aborted because a "critical pass" failed, we displayed the number of errors from that critical pass. While that's the number of errors that caused compilation to abort in *that place*, that's not what people really want to know. Instead, always report the total number of errors, and don't bother to track the number of errors from the last pass that failed.

This changes the compiler driver API to handle errors more smoothly, therefore is a compiler-api-[breaking-change].

Fixes #42793.

r? @eddyb

7 years agoreport the total number of errors on compilation failure
Ariel Ben-Yehuda [Sun, 2 Jul 2017 13:09:09 +0000 (16:09 +0300)]
report the total number of errors on compilation failure

Prior to this PR, when we aborted because a "critical pass" failed, we
displayed the number of errors from that critical pass. While that's the
number of errors that caused compilation to abort in *that place*,
that's not what people really want to know. Instead, always report the
total number of errors, and don't bother to track the number of errors
from the last pass that failed.

This changes the compiler driver API to handle errors more smoothly,
and therefore is a compiler-api-[breaking-change].

Fixes #42793.

7 years agoStyle fix
est31 [Sun, 2 Jul 2017 07:06:08 +0000 (09:06 +0200)]
Style fix

7 years agoDocumentation
est31 [Wed, 28 Jun 2017 00:41:24 +0000 (02:41 +0200)]
Documentation

7 years agoFix the test failure, add comment, and refactor a little bit
est31 [Tue, 27 Jun 2017 23:15:29 +0000 (01:15 +0200)]
Fix the test failure, add comment, and refactor a little bit

7 years agoOutput line column info when panicking
est31 [Tue, 27 Jun 2017 02:26:52 +0000 (04:26 +0200)]
Output line column info when panicking

7 years agoRevert "Change error count messages"
Ariel Ben-Yehuda [Sun, 2 Jul 2017 10:49:30 +0000 (13:49 +0300)]
Revert "Change error count messages"

This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.

7 years agoFix tidy errors
Stjepan Glavina [Sun, 2 Jul 2017 09:16:37 +0000 (11:16 +0200)]
Fix tidy errors

7 years agoDelete deprecated & unstable range-specific `step_by`
Scott McMurray [Sun, 2 Jul 2017 02:18:02 +0000 (19:18 -0700)]
Delete deprecated & unstable range-specific `step_by`

Replacement: 41439
Deprecation: 42310 for 1.19
Fixes 41477

7 years agoAuto merge of #43003 - milmazz:bootstrap-pep8, r=alexcrichton
bors [Sun, 2 Jul 2017 01:51:30 +0000 (01:51 +0000)]
Auto merge of #43003 - milmazz:bootstrap-pep8, r=alexcrichton

bootstrap: Fix all the pep-8 issues reported by flake8

This commit also adds a few missing docstrings.

Today, after reading this [article](https://blog.rust-lang.org/2017/06/27/Increasing-Rusts-Reach.html), I downloaded this project and started building from source. In the meantime, I began to read the `bootstrap.py`, to know more about the building process, and I made a few changes, this is my first contribution to the project, hope you like it.

BTW, I have a few doubts about the `bootstrap.py`, any guidance is more than welcome:

* Where can I find the unit tests for this script? In case it doesn't exist yet, do you like to include some unit tests with pytest?
* Some methods like `fix_executable`, `get_string`, and `exe_suffix` in the `RustBuild` class should be converted to a function because it doesn't use `self` anywhere. What do you think?

7 years agoStabilize feature sort_unstable
Stjepan Glavina [Sun, 2 Jul 2017 00:09:21 +0000 (02:09 +0200)]
Stabilize feature sort_unstable

7 years agoAuto merge of #43002 - SergioBenitez:more-io-inner-stable, r=BurntSushi
bors [Sat, 1 Jul 2017 21:54:13 +0000 (21:54 +0000)]
Auto merge of #43002 - SergioBenitez:more-io-inner-stable, r=BurntSushi

Stabilize 'more_io_inner_methods' feature.

As in the title. Closes #41519.

7 years agoAuto merge of #42882 - stjepang:improve-sort-tests-and-benches, r=alexcrichton
bors [Sat, 1 Jul 2017 13:31:32 +0000 (13:31 +0000)]
Auto merge of #42882 - stjepang:improve-sort-tests-and-benches, r=alexcrichton

Improve tests and benchmarks for slice::sort and slice::sort_unstable

This PR just hardens the tests and improves benchmarks.
More specifically:

1. Benchmarks don't generate vectors in `Bencher::iter` loops, but simply clone pregenerated vectors.
2. Benchmark `*_strings` doesn't allocate Strings in `Bencher::iter` loops, but merely clones a `Vec<&str>`.
3. Benchmarks use seeded `XorShiftRng` to be more consistent.
4. Additional tests for `slice::sort` are added, which test sorting on slices with several ascending/descending runs. The implementation identifies such runs so it's a good idea to test that scenario a bit.
5. More checks are added to `run-pass/vector-sort-panic-safe.rs`. Sort algorithms copy elements around a lot (merge sort uses an auxilliary buffer and pdqsort copies the pivot onto the stack before partitioning, then writes it back into the slice). If elements that are being sorted are internally mutable and comparison function mutates them, it is important to make sure that sort algorithms always use the latest "versions" of elements. New checks verify that this is true for both `slice::sort` and `slice::sort_unstable`.

As a side note, all of those improvements were made as part of the parallel sorts PR in Rayon (nikomatsakis/rayon#379) and now I'm backporting them into libcore/libstd.

r? @alexcrichton

7 years agoSimplify print arguments
Milton Mazzarri [Sat, 1 Jul 2017 12:16:57 +0000 (07:16 -0500)]
Simplify print arguments

7 years agoAuto merge of #42991 - sfackler:unstable-rangeargument, r=alexcrichton
bors [Sat, 1 Jul 2017 11:21:53 +0000 (11:21 +0000)]
Auto merge of #42991 - sfackler:unstable-rangeargument, r=alexcrichton

Revert "Stabilize RangeArgument"

This reverts commit 143206d54d7558c2326212df99efc98110904fdb.

From the discussion in #30877 it seems like this is premature.

7 years agoAuto merge of #42977 - Keruspe:master, r=alexcrichton
bors [Sat, 1 Jul 2017 09:10:13 +0000 (09:10 +0000)]
Auto merge of #42977 - Keruspe:master, r=alexcrichton

 rustbuild: set __CARGO_DEFAULT_LIB_METADATA to channel

Also, update the cargo submodule to handle the new value.

7 years agoAuto merge of #42971 - stepancheg:ir-demangle, r=nagisa
bors [Sat, 1 Jul 2017 05:52:08 +0000 (05:52 +0000)]
Auto merge of #42971 - stepancheg:ir-demangle, r=nagisa

When writing LLVM IR output demangled fn name in comments

`--emit=llvm-ir` looks like this now:

```
; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut
; Function Attrs: inlinehint uwtable
define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 {
start:
  ...
```

cc https://github.com/integer32llc/rust-playground/issues/15

7 years agobootstrap: Fix some PEP8 issues
Milton Mazzarri [Sat, 1 Jul 2017 04:24:35 +0000 (23:24 -0500)]
bootstrap: Fix some PEP8 issues

This commit also adds a few missing docstrings

7 years agoAuto merge of #42896 - llogiq:clippy_compiletest, r=alexcrichton
bors [Sat, 1 Jul 2017 03:26:29 +0000 (03:26 +0000)]
Auto merge of #42896 - llogiq:clippy_compiletest, r=alexcrichton

fixed some clippy warnings in compiletest

This is mainly readability stuff. Whenever the `clone_ref` lint asked me to clone the dereferenced object, I removed the `.clone()` instead, relying on the fact that it has worked so far and the immutable borrow ensures that the value won't change.

7 years agoStabilize 'more_io_inner_methods' feature.
Sergio Benitez [Sat, 1 Jul 2017 01:05:04 +0000 (18:05 -0700)]
Stabilize 'more_io_inner_methods' feature.