]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:35 +0000 (17:03 +0800)]
Rollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakis

Change the --unpretty flag to -Z unpretty

First PR :smile: !

-Z unpretty no longer requires -Z unstable-options.

Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI).

Fix #47395

r? @nikomatsakis EDIT: apparently rust-highfive doesn't see edits...

6 years agoRollup merge of #47425 - EdSchouten:immutable-tls, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:34 +0000 (17:03 +0800)]
Rollup merge of #47425 - EdSchouten:immutable-tls, r=nikomatsakis

Properly pass down immutability info for thread-locals.

For thread-locals we call into cat_rvalue_node() to create a CMT
(Category, Mutability, Type) that always has McDeclared. This is
incorrect for thread-locals that don't have the 'mut' keyword; we should
use McImmutable there.

Extend cat_rvalue_node() to have an additional mutability parameter. Fix
up all the callers to make use of that function. Also extend one of the
existing unit tests to cover this.

Fixes: #47053
6 years agoRollup merge of #47423 - est31:rustbook_checking, r=alexcrichton
kennytm [Tue, 23 Jan 2018 09:03:32 +0000 (17:03 +0800)]
Rollup merge of #47423 - est31:rustbook_checking, r=alexcrichton

Check for deadlinks from the summary during book generation

Previously, any deadlinks from a book's SUMMARY.md wouldn't
cause any errors or warnings or similar but mdbook would simply
create a page with blank content.

This has kept bug #47394 hidden. It should have been detected
back in the PR when those wrongly named files got added to the
book.

PR #47414 was one component of the solution. This change
is a second line of defense for the unstable book and a first
line of defense for any other book.

We also update mdbook to the most recent version.

6 years agoAuto merge of #47373 - wesleywiser:incr_cache_hashing, r=michaelwoerister
bors [Mon, 22 Jan 2018 23:32:16 +0000 (23:32 +0000)]
Auto merge of #47373 - wesleywiser:incr_cache_hashing, r=michaelwoerister

[Incremental] Cache hashes for AdDef and ty::Slice<T>

r? @michaelwoerister

6 years agoAuto merge of #47507 - alexcrichton:rerun-bat-scripts, r=michaelwoerister
bors [Mon, 22 Jan 2018 20:30:14 +0000 (20:30 +0000)]
Auto merge of #47507 - alexcrichton:rerun-bat-scripts, r=michaelwoerister

rustc: Lower link args to `@`-files on Windows more

When spawning a linker rustc has historically been known to blow OS limits for
the command line being too large, notably on Windows. This is especially true of
incremental compilation where there can be dozens of object files per
compilation. The compiler currently has logic for detecting a failure to spawn
and instead passing arguments via a file instead, but this failure detection
only triggers if a process actually fails to spawn.

Unfortunately on Windows we've got something else to worry about which is
`cmd.exe`. The compiler may be running a linker through `cmd.exe` where
`cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`.
Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after
it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently
detect.

Consequently this commit updates the logic for the spawning the linker on
Windows to instead have a heuristic to see if we need to pass arguments via a
file. This heuristic is an overly pessimistic and "inaccurate" calculation which
just calls `len` on a bunch of `OsString` instances (where `len` is not
precisely the length in u16 elements). This number, when exceeding the 6k
threshold, will force rustc to always pass arguments through a file.

This strategy should avoid us trying to parse the output on Windows of the
linker to see if it successfully spawned yet failed to actually sub-spawn the
linker. We may just be passing arguments through files a little more commonly
now...

The motivation for this commit was a recent bug in Gecko [1] when beta testing,
notably when incremental compilation was enabled it blew out the limit on
`cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a
bat script as well (and we're blowing the limit there).

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886

Closes #46999

6 years agoAuto merge of #47353 - nikomatsakis:nll-issue-47189, r=pnkfelix+nmatsakis
bors [Mon, 22 Jan 2018 11:11:47 +0000 (11:11 +0000)]
Auto merge of #47353 - nikomatsakis:nll-issue-47189, r=pnkfelix+nmatsakis

renumber regions in generators

This fixes #47189, but I think we still have to double check various things around how to treat generators in MIR type check + borrow check (e.g., what borrows should be invalidated by a `Suspend`? What consistency properties should type check be enforcing anyway around the "interior" type?)

Also fixes #47587 thanks to @spastorino's commit.

r? @pnkfelix

6 years agoAuto merge of #47158 - rkruppe:repr-transparent, r=eddyb
bors [Mon, 22 Jan 2018 08:10:41 +0000 (08:10 +0000)]
Auto merge of #47158 - rkruppe:repr-transparent, r=eddyb

Implement repr(transparent)

r? @eddyb for the functional changes. The bulk of the PR is error messages and docs, might be good to have a doc person look over those.

cc #43036
cc @nox

6 years agoAuto merge of #47144 - estebank:moved-closure-arg, r=nikomatsakis
bors [Mon, 22 Jan 2018 05:30:37 +0000 (05:30 +0000)]
Auto merge of #47144 - estebank:moved-closure-arg, r=nikomatsakis

Custom error when moving arg outside of its closure

When given the following code:

```rust
fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) {
    f(&());
}

fn main() {
    let mut x = None;
    give_any(|y| x = Some(y));
}
```

provide a custom error:

```
error: borrowed data cannot be moved outside of its closure
 --> file.rs:7:27
  |
6 |     let mut x = None;
  |         ----- borrowed data cannot be moved into here...
7 |     give_any(|y| x = Some(y));
  |              ---          ^ cannot be moved outside of its closure
  |              |
  |              ...because it cannot outlive this closure
```

instead of the generic lifetime error:

```
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
 --> file.rs:7:27
  |
7 |     give_any(|y| x = Some(y));
  |                           ^
  |
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 7:14...
 --> file.rs:7:14
  |
7 |     give_any(|y| x = Some(y));
  |              ^^^^^^^^^^^^^^^
note: ...so that expression is assignable (expected &(), found &())
 --> file.rs:7:27
  |
7 |     give_any(|y| x = Some(y));
  |                           ^
note: but, the lifetime must be valid for the block suffix following statement 0 at 6:5...
 --> file.rs:6:5
  |
6 | /     let mut x = None;
7 | |     give_any(|y| x = Some(y));
8 | | }
  | |_^
note: ...so that variable is valid at time of its declaration
 --> file.rs:6:9
  |
6 |     let mut x = None;
  |         ^^^^^
```

Fix #45983.

6 years agorustc: Lower link args to `@`-files on Windows more
Alex Crichton [Tue, 16 Jan 2018 23:30:57 +0000 (15:30 -0800)]
rustc: Lower link args to `@`-files on Windows more

When spawning a linker rustc has historically been known to blow OS limits for
the command line being too large, notably on Windows. This is especially true of
incremental compilation where there can be dozens of object files per
compilation. The compiler currently has logic for detecting a failure to spawn
and instead passing arguments via a file instead, but this failure detection
only triggers if a process actually fails to spawn.

Unfortunately on Windows we've got something else to worry about which is
`cmd.exe`. The compiler may be running a linker through `cmd.exe` where
`cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`.
Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after
it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently
detect.

Consequently this commit updates the logic for the spawning the linker on
Windows to instead have a heuristic to see if we need to pass arguments via a
file. This heuristic is an overly pessimistic and "inaccurate" calculation which
just calls `len` on a bunch of `OsString` instances (where `len` is not
precisely the length in u16 elements). This number, when exceeding the 6k
threshold, will force rustc to always pass arguments through a file.

This strategy should avoid us trying to parse the output on Windows of the
linker to see if it successfully spawned yet failed to actually sub-spawn the
linker. We may just be passing arguments through files a little more commonly
now...

The motivation for this commit was a recent bug in Gecko [1] when beta testing,
notably when incremental compilation was enabled it blew out the limit on
`cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a
bat script as well (and we're blowing the limit there).

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886

Closes #46999

6 years agoAuto merge of #47644 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 21 Jan 2018 22:38:29 +0000 (22:38 +0000)]
Auto merge of #47644 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 9 pull requests

- Successful merges: #47247, #47334, #47512, #47582, #47595, #47625, #47632, #47633, #47637
- Failed merges:

6 years agoRollup merge of #47637 - russmack:fix-mailmap-dupes, r=steveklabnik
Guillaume Gomez [Sun, 21 Jan 2018 22:11:45 +0000 (23:11 +0100)]
Rollup merge of #47637 - russmack:fix-mailmap-dupes, r=steveklabnik

Fix mailmap duplicates, Carol and Brian.

This fix corrects the .mailmap file so that Carol (Nichols || Goulding) appears only once, and Brian Anderson also appears only once.

6 years agoRollup merge of #47633 - pietroalbini:fix-ice-use-self, r=nagisa
Guillaume Gomez [Sun, 21 Jan 2018 22:11:44 +0000 (23:11 +0100)]
Rollup merge of #47633 - pietroalbini:fix-ice-use-self, r=nagisa

Fix ICE with `use self;`

Closes #47623

6 years agoRollup merge of #47632 - sdroege:exact-chunks-docs-broken-links, r=kennytm
Guillaume Gomez [Sun, 21 Jan 2018 22:11:43 +0000 (23:11 +0100)]
Rollup merge of #47632 - sdroege:exact-chunks-docs-broken-links, r=kennytm

Fix broken links to other slice functions in chunks/chunks_mut/exact_…

…chunk/exact_chunks_mut docs

See https://github.com/rust-lang/rust/pull/47126#discussion_r162780492

6 years agoRollup merge of #47625 - astraw:btreeset-doctest-fix, r=kennytm
Guillaume Gomez [Sun, 21 Jan 2018 22:11:42 +0000 (23:11 +0100)]
Rollup merge of #47625 - astraw:btreeset-doctest-fix, r=kennytm

fix doctests for BTreeSet to use BTreeSet (not BTreeMap)

This fixes #47624

6 years agoRollup merge of #47595 - PieterPenninckx:master, r=shepmaster
Guillaume Gomez [Sun, 21 Jan 2018 22:11:41 +0000 (23:11 +0100)]
Rollup merge of #47595 - PieterPenninckx:master, r=shepmaster

Small improvements to the documentation of VecDeque.

Some small improvements to the documentation of `VecDeque`.

6 years agoRollup merge of #47582 - alexcrichton:auto-beta, r=kennytm
Guillaume Gomez [Sun, 21 Jan 2018 22:11:40 +0000 (23:11 +0100)]
Rollup merge of #47582 - alexcrichton:auto-beta, r=kennytm

Automaticaly calculate beta prerelease numbers

This is a forward-port of:

9426dda83d7a928d6ced377345e14b84b0f11c21
cbfb9858951da7aee22d82178405306fca9decb1

from the beta branch which is used to automatically calculate the beta number
based on the number of merges to the beta branch so far.

6 years agoRollup merge of #47512 - GuillaumeGomez:e0659, r=petrochenkov
Guillaume Gomez [Sun, 21 Jan 2018 22:11:39 +0000 (23:11 +0100)]
Rollup merge of #47512 - GuillaumeGomez:e0659, r=petrochenkov

Add E0659 for ambiguous names

Still on the tracks of the "no error without error code" road.

6 years agoRollup merge of #47334 - etaoins:only-call-res-init-on-gnu-unix, r=alexcrichton
Guillaume Gomez [Sun, 21 Jan 2018 22:11:38 +0000 (23:11 +0100)]
Rollup merge of #47334 - etaoins:only-call-res-init-on-gnu-unix, r=alexcrichton

Only link res_init() on GNU/*nix

To workaround a bug in glibc <= 2.26 lookup_host() calls res_init() based on the glibc version detected at runtime. While this avoids calling res_init() on platforms where it's not required we will still end up linking against the symbol.

This causes an issue on macOS where res_init() is implemented in a separate library (libresolv.9.dylib) from the main libc. While this is harmless for standalone programs it becomes a problem if Rust code is statically linked against another program. If the linked program doesn't already specify -lresolv it will cause the link to fail. This is captured in issue #46797

Fix this by hooking in to the glibc workaround in `cvt_gai` and only activating it for the "gnu" environment on Unix This should include all glibc platforms while excluding musl, windows-gnu, macOS, FreeBSD, etc.

This has the side benefit of removing the #[cfg] in sys_common; only unix.rs has code related to the workaround now.

Before this commit:
```shell
> cat main.rs
use std::net::ToSocketAddrs;

#[no_mangle]
pub extern "C" fn resolve_test() -> () {
    let addr_list = ("google.com.au", 0).to_socket_addrs().unwrap();
    println!("{:?}", addr_list);
}
> rustc --crate-type=staticlib main.rs
> clang libmain.a test.c -o combined
Undefined symbols for architecture x86_64:
  "_res_9_init", referenced from:
      std::net::lookup_host::h93c17fe9ad38464a in libmain.a(std-826c8d3b356e180c.std0.rcgu.o)
ld: symbol(s) not found for architecture x86_64
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
```

Afterwards:
```shell
> rustc --crate-type=staticlib main.rs
> clang libmain.a test.c -o combined
> ./combined
IntoIter([V4(172.217.25.131:0)])
```

Fixes  #46797

6 years agoRollup merge of #47247 - estebank:suggest-cast, r=petrochenkov
Guillaume Gomez [Sun, 21 Jan 2018 22:11:37 +0000 (23:11 +0100)]
Rollup merge of #47247 - estebank:suggest-cast, r=petrochenkov

Suggest casting on numeric type error

Re #47168.

6 years agoAuto merge of #47116 - estebank:non-accessible-ctor, r=petrochenkov
bors [Sun, 21 Jan 2018 16:52:09 +0000 (16:52 +0000)]
Auto merge of #47116 - estebank:non-accessible-ctor, r=petrochenkov

Tweaks to invalid ctor messages

 - Do not suggest using a constructor that isn't accessible
 - Suggest the appropriate syntax (`()`/`{}` as appropriate)
 - Add note when trying to use `Self` as a ctor

CC #22488, fix #47085.

6 years agoFix mailmap duplicates, Carol and Brian.
Russell Mackenzie [Sun, 21 Jan 2018 15:21:36 +0000 (15:21 +0000)]
Fix mailmap duplicates, Carol and Brian.

6 years agoRevert change to docs in panic section of VecDeque::split_off
Pieter Penninckx [Sun, 21 Jan 2018 14:05:53 +0000 (15:05 +0100)]
Revert change to docs in panic section of VecDeque::split_off

6 years agoAuto merge of #47001 - arielb1:private-match, r=nikomatsakis
bors [Sun, 21 Jan 2018 12:05:49 +0000 (12:05 +0000)]
Auto merge of #47001 - arielb1:private-match, r=nikomatsakis

check_match: fix handling of privately uninhabited types

the match-checking code used to use TyErr for signaling "unknown,
inhabited" types for a long time. It had been switched to using the
exact type in #38069, to handle uninhabited types.

However, in #39980, we discovered that we still needed the "unknown
inhabited" logic, but I used `()` instead of `TyErr` to handle that.
Revert to using `TyErr` to fix that problem.

Fixes #46964.

r? @nikomatsakis

6 years agoFix ICE with `use self;`
Pietro Albini [Sun, 21 Jan 2018 11:26:01 +0000 (12:26 +0100)]
Fix ICE with `use self;`

6 years agoFix broken links to other slice functions in chunks/chunks_mut/exact_chunk/exact_chun...
Sebastian Dröge [Sun, 21 Jan 2018 09:20:19 +0000 (11:20 +0200)]
Fix broken links to other slice functions in chunks/chunks_mut/exact_chunk/exact_chunks_mut docs

See https://github.com/rust-lang/rust/pull/47126#discussion_r162780492

6 years agoAuto merge of #45684 - bjorn3:runtime_choose_trans2, r=eddyb
bors [Sun, 21 Jan 2018 09:17:26 +0000 (09:17 +0000)]
Auto merge of #45684 - bjorn3:runtime_choose_trans2, r=eddyb

Allow runtime switching between trans backends

The driver callback after_llvm has been removed as it doesnt work with multiple backends.

r? @eddyb

6 years agoAuto merge of #47622 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 21 Jan 2018 06:32:03 +0000 (06:32 +0000)]
Auto merge of #47622 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 10 pull requests

- Successful merges: #46938, #47193, #47508, #47510, #47532, #47535, #47559, #47568, #47573, #47578
- Failed merges:

6 years agoAuto merge of #47495 - nikomatsakis:nll-issue-47153, r=pnkfelix
bors [Sun, 21 Jan 2018 03:38:34 +0000 (03:38 +0000)]
Auto merge of #47495 - nikomatsakis:nll-issue-47153, r=pnkfelix

remove bogus assertion and comments

The code (incorrectly) assumed that constants could not have generics
in scope, but it's not really a problem if they do.

Fixes #47153

r? @pnkfelix

6 years agofix doctests for BTreeSet to use BTreeSet (not BTreeMap)
Andrew Straw [Sat, 20 Jan 2018 22:23:44 +0000 (23:23 +0100)]
fix doctests for BTreeSet to use BTreeSet (not BTreeMap)

This fixes #47624

6 years agoRollup merge of #47578 - arthurprs:btree-doc, r=alexcrichton
Guillaume Gomez [Sat, 20 Jan 2018 21:32:50 +0000 (22:32 +0100)]
Rollup merge of #47578 - arthurprs:btree-doc, r=alexcrichton

Update BTreeMap recommendation

Focus on the ordering / range(instead of all) benefit as it's the most important feature.

6 years agoRollup merge of #47573 - estebank:closures, r=nikomatsakis
Guillaume Gomez [Sat, 20 Jan 2018 21:32:49 +0000 (22:32 +0100)]
Rollup merge of #47573 - estebank:closures, r=nikomatsakis

Closure argument mismatch tweaks

 - use consistent phrasing for expected and found arguments
 - suggest changing arguments to tuple if possible
 - suggest changing single tuple argument to arguments if possible

Fix #44150.

6 years agoRollup merge of #47568 - EdSchouten:cloudabi-linker, r=alexcrichton
Guillaume Gomez [Sat, 20 Jan 2018 21:32:48 +0000 (22:32 +0100)]
Rollup merge of #47568 - EdSchouten:cloudabi-linker, r=alexcrichton

Give TargetOptions::linker a sane default value for CloudABI.

Though some parts of rust use cc-rs to invoke a compiler/linker, Cargo
seems to make use of the TargetOptions::linker property. Make the out of
the box experience for CloudABI a bit better by using the same compiler
name as cc-rs.

6 years agoRollup merge of #47559 - walinga:pr-link-fix, r=kennytm
Guillaume Gomez [Sat, 20 Jan 2018 21:32:47 +0000 (22:32 +0100)]
Rollup merge of #47559 - walinga:pr-link-fix, r=kennytm

Fix the "Github - About Pull Requests" link in CONTRIBUTING.md

Previously the text that is supposed to link to the Github Pull Requests page, instead linked to the same file (CONTRIBUTING.md).

6 years agoRollup merge of #47535 - Manishearth:ignore-target, r=kennytm
Guillaume Gomez [Sat, 20 Jan 2018 21:32:46 +0000 (22:32 +0100)]
Rollup merge of #47535 - Manishearth:ignore-target, r=kennytm

add target/ to ignored tidy dirs

Sometimes you get a target directory from running cargo in the rust repo (the root is `src/`), and it contains generated files. Just whitelist it since it causes tidy to spew warnings uncontrollably.

6 years agoRollup merge of #47532 - tbu-:pr_path_oddities, r=TimNN
Guillaume Gomez [Sat, 20 Jan 2018 21:32:45 +0000 (22:32 +0100)]
Rollup merge of #47532 - tbu-:pr_path_oddities, r=TimNN

Add some edge cases to the documentation of `Path`

Affected methods are `starts_with` and `strip_prefix`.

6 years agoRollup merge of #47510 - sfackler:deprecate-dns, r=alexcrichton
Guillaume Gomez [Sat, 20 Jan 2018 21:32:44 +0000 (22:32 +0100)]
Rollup merge of #47510 - sfackler:deprecate-dns, r=alexcrichton

Deprecate std::net::lookup_host

We intended to do this quite a while ago but it snuck through.

r? @alexcrichton

6 years agoRollup merge of #47508 - QuietMisdreavus:rbe-bookshelf, r=steveklabnik
Guillaume Gomez [Sat, 20 Jan 2018 21:32:43 +0000 (22:32 +0100)]
Rollup merge of #47508 - QuietMisdreavus:rbe-bookshelf, r=steveklabnik

add Rust By Example to the bookshelf

cc #46194

With #46196 freshly merged, we should add a link to the main docs distribution so people can find it! We discussed this at the docs team meeting today and decided to go ahead with adding it to the bookshelf.

6 years agoRollup merge of #47193 - cramertj:result-opts, r=TimNN
Guillaume Gomez [Sat, 20 Jan 2018 21:32:42 +0000 (22:32 +0100)]
Rollup merge of #47193 - cramertj:result-opts, r=TimNN

Add transpose conversions for nested Option and Result

These impls are useful when working with combinator
methods that expect an option or a result, but you
have a `Result<Option<T>, E>` instead of an `Option<Result<T, E>>`
or vice versa.

6 years agoRollup merge of #46938 - hellow554:rustdoc-kbd-style, r=GuillaumeGomez
Guillaume Gomez [Sat, 20 Jan 2018 21:32:41 +0000 (22:32 +0100)]
Rollup merge of #46938 - hellow554:rustdoc-kbd-style, r=GuillaumeGomez

add kbd style tag to main.css in rustdoc

Added css style for kbd tags so they actually look like keys.
Result preview and discussion was going on in #46900 .

6 years agoAdd testing coverage for assigning to immutable thread-locals.
Ed Schouten [Sat, 20 Jan 2018 20:45:35 +0000 (21:45 +0100)]
Add testing coverage for assigning to immutable thread-locals.

It is currently allowed to perform such assignments when not making use
of NLL. NLL already does this right, but let's add a test in place to
ensure it never regresses.

6 years agoFix tests by keepeing needed suggestions
Esteban Küber [Sat, 20 Jan 2018 20:02:40 +0000 (12:02 -0800)]
Fix tests by keepeing needed suggestions

6 years agoRemove the 'extern "C"' in the right place
bjorn3 [Sat, 20 Jan 2018 16:27:00 +0000 (17:27 +0100)]
Remove the 'extern "C"' in the right place

6 years agoAuto merge of #46980 - zackmdavis:and_the_case_of_the_needlessly_parenthesized_argume...
bors [Sat, 20 Jan 2018 15:06:41 +0000 (15:06 +0000)]
Auto merge of #46980 - zackmdavis:and_the_case_of_the_needlessly_parenthesized_arguments, r=petrochenkov

in which the unused-parens lint comes to cover function and method args

Resolves #46137.

6 years agoAuto merge of #46952 - SimonSapin:nonnull, r=alexcrichton
bors [Sat, 20 Jan 2018 12:28:13 +0000 (12:28 +0000)]
Auto merge of #46952 - SimonSapin:nonnull, r=alexcrichton

Rename std::ptr::Shared to NonNull and stabilize it

This implements the changes proposed at https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629:

> * Rename `Shared<T>` to `NonNull<T>` and stabilize it. (Being in the `ptr` module is enough to say that it’s a pointer. I’m not very attached to this specific name though.)
> * Rename `Box<T>` methods ~~`from_unique`~~/`into_unique` to ~~`from_nonnull`~~/`into_nonnull` (or whatever names are deemed appropriate), replace `Unique<T>` with `NonNull<T>` in their signatures, and stabilize them.
> *  Replace `Unique<T>` with `NonNull<T>` in the signatures of methods of the `Alloc` trait.
> * Mark `Unique` “permanently-unstable” by replacing remaining occurrences of `#[unstable(feature = "unique", issue = "27730")]` with:
>
>   ```rust
>   #[unstable(feature = "ptr_internals", issue = "0", reason = "\
>       use NonNull instead and consider PhantomData<T> (if you also use #[may_dangle]), \
>       Send, and/or Sync")]
>   ```
>
>   (Maybe the `reason` string is only useful on the struct definition.) Ideally it would be made private to some crate instead, but it needs to be used in both liballoc and libstd.
> * (Leave `NonZero` and `Zeroable` unstable for now, and subject to future bikeshedding.)

6 years agoFix ICE
bjorn3 [Sat, 20 Jan 2018 10:55:55 +0000 (11:55 +0100)]
Fix ICE

6 years agoAssign its own tracking issue to Box::into_raw_non_null
Simon Sapin [Wed, 10 Jan 2018 20:11:55 +0000 (21:11 +0100)]
Assign its own tracking issue to Box::into_raw_non_null

https://github.com/rust-lang/rust/issues/47336

6 years agoRename NonNull::empty to dangling.
Simon Sapin [Wed, 10 Jan 2018 08:30:04 +0000 (09:30 +0100)]
Rename NonNull::empty to dangling.

6 years agoRevert Box::into_raw_non_null to unstable
Simon Sapin [Wed, 10 Jan 2018 08:25:11 +0000 (09:25 +0100)]
Revert Box::into_raw_non_null to unstable

6 years agoPreserve formatting options in Debug for NonNull/Unique
Simon Sapin [Wed, 10 Jan 2018 08:21:15 +0000 (09:21 +0100)]
Preserve formatting options in Debug for NonNull/Unique

6 years agoFix some doc-comment examples for earlier API refactor
Simon Sapin [Tue, 9 Jan 2018 10:25:22 +0000 (11:25 +0100)]
Fix some doc-comment examples for earlier API refactor

https://github.com/rust-lang/rust/pull/41064

6 years agoRename Box::into_non_null_raw to Box::into_raw_non_null
Simon Sapin [Wed, 27 Dec 2017 21:56:06 +0000 (22:56 +0100)]
Rename Box::into_non_null_raw to Box::into_raw_non_null

6 years agoRemove `Box::from_non_null_raw`
Simon Sapin [Wed, 27 Dec 2017 21:53:27 +0000 (22:53 +0100)]
Remove `Box::from_non_null_raw`

Per https://github.com/rust-lang/rust/pull/46952#issuecomment-353956225

6 years agoRename Box::*_nonnull_raw to *_non_null_raw
Simon Sapin [Fri, 22 Dec 2017 22:46:52 +0000 (23:46 +0100)]
Rename Box::*_nonnull_raw to *_non_null_raw

6 years agoStabilize std::ptr::NonNull
Simon Sapin [Fri, 22 Dec 2017 18:50:21 +0000 (19:50 +0100)]
Stabilize std::ptr::NonNull

6 years agoRemove a deprecated (renamed) and unstable method of NonNull
Simon Sapin [Fri, 22 Dec 2017 18:47:27 +0000 (19:47 +0100)]
Remove a deprecated (renamed) and unstable method of NonNull

6 years agoMark Unique as perma-unstable, with the feature renamed to ptr_internals.
Simon Sapin [Fri, 22 Dec 2017 18:29:16 +0000 (19:29 +0100)]
Mark Unique as perma-unstable, with the feature renamed to ptr_internals.

6 years agoReplace Box::{from,into}_unique with {from,into}_nonnull_raw
Simon Sapin [Fri, 22 Dec 2017 18:24:07 +0000 (19:24 +0100)]
Replace Box::{from,into}_unique with {from,into}_nonnull_raw

Thew `_raw` prefix is included because the fact that `Box`’s ownership
semantics are "dissolved" or recreated seem more important than the exact
parameter type or return type.

6 years agoReplace Unique<T> with NonZero<T> in Alloc trait
Simon Sapin [Fri, 22 Dec 2017 18:12:22 +0000 (19:12 +0100)]
Replace Unique<T> with NonZero<T> in Alloc trait

6 years agoRename std::ptr::Shared to NonNull
Simon Sapin [Fri, 22 Dec 2017 17:58:39 +0000 (18:58 +0100)]
Rename std::ptr::Shared to NonNull

`Shared` is now a deprecated `type` alias.

CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629

6 years agoImplement Debug for ptr::Shared and ptr::Unique.
Corey Farwell [Sun, 17 Dec 2017 22:28:01 +0000 (17:28 -0500)]
Implement Debug for ptr::Shared and ptr::Unique.

Fixes https://github.com/rust-lang/rust/issues/46755.

6 years agoClosure argument mismatch tweaks
Esteban Küber [Fri, 19 Jan 2018 09:28:20 +0000 (01:28 -0800)]
Closure argument mismatch tweaks

 - use consistent phrasing for expected and found arguments
 - suggest changing arugments to tuple if possible
 - suggest changing single tuple argument to arguments if possible

6 years agoRun yield-subtype test on nll mode too as a regression check
Santiago Pastorino [Fri, 19 Jan 2018 23:02:32 +0000 (20:02 -0300)]
Run yield-subtype test on nll mode too as a regression check

6 years agoIntegrate generators to universal region setup
Santiago Pastorino [Fri, 19 Jan 2018 22:18:02 +0000 (19:18 -0300)]
Integrate generators to universal region setup

6 years agochange MIR dump format to include yield type
Niko Matsakis [Fri, 19 Jan 2018 18:56:48 +0000 (13:56 -0500)]
change MIR dump format to include yield type

6 years agoAuto merge of #46919 - michaelwoerister:new-leb128, r=sfackler
bors [Sat, 20 Jan 2018 02:00:13 +0000 (02:00 +0000)]
Auto merge of #46919 - michaelwoerister:new-leb128, r=sfackler

Speed up leb128 encoding and decoding for unsigned values.

Make the implementation for some leb128 functions potentially faster.

@Mark-Simulacrum, could you please trigger a perf.rlo run?

6 years agoTweak wording and spans of closure lifetime errors
Esteban Küber [Fri, 19 Jan 2018 20:30:30 +0000 (12:30 -0800)]
Tweak wording and spans of closure lifetime errors

6 years agoHopefully fix the 32bit SEGV
bjorn3 [Fri, 19 Jan 2018 19:24:42 +0000 (20:24 +0100)]
Hopefully fix the 32bit SEGV

6 years agoJust forget the DynamicLibrary after getting a hot plugged backend
bjorn3 [Fri, 12 Jan 2018 17:57:00 +0000 (18:57 +0100)]
Just forget the DynamicLibrary after getting a hot plugged backend

6 years agoRemove accidential libloading dependency
bjorn3 [Fri, 12 Jan 2018 07:17:34 +0000 (08:17 +0100)]
Remove accidential libloading dependency

6 years agoFix ICE
bjorn3 [Wed, 10 Jan 2018 14:20:54 +0000 (15:20 +0100)]
Fix ICE

6 years agoRemove use of RUSTC_COMPILETEST env var
bjorn3 [Tue, 9 Jan 2018 17:37:33 +0000 (18:37 +0100)]
Remove use of RUSTC_COMPILETEST env var

6 years agoAdd missing licenses
bjorn3 [Thu, 4 Jan 2018 17:26:34 +0000 (18:26 +0100)]
Add missing licenses

6 years agoFix hotplug backend and add test
bjorn3 [Thu, 4 Jan 2018 17:15:40 +0000 (18:15 +0100)]
Fix hotplug backend and add test

6 years agoFix review comments
bjorn3 [Thu, 4 Jan 2018 11:40:11 +0000 (12:40 +0100)]
Fix review comments

6 years agoCleanup hot plug codegen backend code
bjorn3 [Wed, 3 Jan 2018 13:36:52 +0000 (14:36 +0100)]
Cleanup hot plug codegen backend code

6 years agoHot plug rustc_trans
bjorn3 [Mon, 1 Jan 2018 11:17:07 +0000 (12:17 +0100)]
Hot plug rustc_trans

6 years agoHide even more of rustc_trans
bjorn3 [Thu, 28 Dec 2017 09:11:26 +0000 (10:11 +0100)]
Hide even more of rustc_trans

6 years agoFix rustc_driver test.rs
bjorn3 [Thu, 28 Dec 2017 08:33:53 +0000 (09:33 +0100)]
Fix rustc_driver test.rs

6 years agoHide more stuff from rustc_trans
bjorn3 [Wed, 27 Dec 2017 18:03:48 +0000 (19:03 +0100)]
Hide more stuff from rustc_trans

6 years agoFix rustc_driver test.rs
bjorn3 [Wed, 27 Dec 2017 17:54:07 +0000 (18:54 +0100)]
Fix rustc_driver test.rs

6 years agoAllow runtime switching between trans backends
bjorn3 [Mon, 30 Oct 2017 17:42:21 +0000 (18:42 +0100)]
Allow runtime switching between trans backends

6 years agoAutomaticaly calculate beta prerelease numbers
Alex Crichton [Fri, 12 Jan 2018 20:53:51 +0000 (12:53 -0800)]
Automaticaly calculate beta prerelease numbers

This is a forward-port of:

9426dda83d7a928d6ced377345e14b84b0f11c21
cbfb9858951da7aee22d82178405306fca9decb1

from the beta branch which is used to automatically calculate the beta number
based on the number of merges to the beta branch so far.

6 years agoSmall improvements to the documentation of VecDeque.
Pieter Penninckx [Fri, 19 Jan 2018 15:51:46 +0000 (16:51 +0100)]
Small improvements to the documentation of VecDeque.

6 years agoUpdate BTreeMap recommendation
Arthur Silva [Fri, 19 Jan 2018 14:40:02 +0000 (15:40 +0100)]
Update BTreeMap recommendation

Focus on the ordering/range benefit.

6 years agoAuto merge of #47503 - arielb1:check-size, r=eddyb
bors [Fri, 19 Jan 2018 10:18:52 +0000 (10:18 +0000)]
Auto merge of #47503 - arielb1:check-size, r=eddyb

avoid double-unsizing arrays in bytestring match lowering

The match lowering code, when lowering matches against bytestrings,
works by coercing both the scrutinee and the pattern to `&[u8]` and
then comparing them using `<[u8] as Eq>::eq`.

If the scrutinee is already of type `&[u8]`, then unsizing it is both
unneccessary and a trait error caught by the new and updated MIR typeck,
so this PR changes lowering to avoid doing that (match lowering tried to
avoid that before, but that attempt was quite broken).

Fixes #46920.

r? @eddyb

6 years agoGive TargetOptions::linker a sane default value.
Ed Schouten [Fri, 19 Jan 2018 08:29:58 +0000 (09:29 +0100)]
Give TargetOptions::linker a sane default value.

Though some parts of rust use cc-rs to invoke a compiler/linker, Cargo
seems to make use of the TargetOptions::linker property. Make the out of
the box experience for CloudABI a bit better by using the same compiler
name as cc-rs.

6 years agoAuto merge of #47454 - topecongiro:update-rustfmt, r=nrc
bors [Fri, 19 Jan 2018 07:35:18 +0000 (07:35 +0000)]
Auto merge of #47454 - topecongiro:update-rustfmt, r=nrc

Update rustfmt to 0.3.6

r? @nrc

6 years agoAuto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakis
bors [Fri, 19 Jan 2018 04:45:22 +0000 (04:45 +0000)]
Auto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakis

Don't include DefIndex in proc-macro registrar function symbol.

There can only ever be one registrar function per plugin or proc-macro crate, so adding the `DefIndex` to the function's symbol name does not serve a real purpose. Remove the `DefIndex` from the symbol name makes it stable across incremental compilation sessions.

This should fix issue #47292.

6 years agoChange the --unpretty flag to -Z unpretty
Mark Mansi [Mon, 15 Jan 2018 03:11:40 +0000 (21:11 -0600)]
Change the --unpretty flag to -Z unpretty

-Z unpretty no longer requires -Z unstable-options. Also, I mildly
changed the syntax of the flag to match the other -Z flags. All uses of
the flag take the form `unpretty=something` where something can either
`string` or `string=string` (see the help messages of the CLI).

6 years agoAuto merge of #47401 - rkruppe:issue-47278, r=eddyb
bors [Fri, 19 Jan 2018 01:58:30 +0000 (01:58 +0000)]
Auto merge of #47401 - rkruppe:issue-47278, r=eddyb

Compute LLVM argument indices correctly in face of padding

Closes #47278

r? @eddyb

6 years agoUpdate CONTRIBUTING.md
Matthew Walinga [Thu, 18 Jan 2018 23:05:33 +0000 (18:05 -0500)]
Update CONTRIBUTING.md

6 years agoin which the unused-parens lint comes to cover function and method args
Zack M. Davis [Sun, 24 Dec 2017 03:28:33 +0000 (19:28 -0800)]
in which the unused-parens lint comes to cover function and method args

Resolves #46137.

6 years agoUpdate rustfmt to 0.3.6
topecongiro [Thu, 18 Jan 2018 14:40:37 +0000 (23:40 +0900)]
Update rustfmt to 0.3.6

6 years agoAuto merge of #47528 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 18 Jan 2018 14:03:12 +0000 (14:03 +0000)]
Auto merge of #47528 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 6 pull requests

- Successful merges: #47250, #47313, #47398, #47468, #47471, #47520
- Failed merges:

6 years agoAuto merge of #47280 - alexcrichton:update-cargo, r=kennytm
bors [Thu, 18 Jan 2018 11:10:14 +0000 (11:10 +0000)]
Auto merge of #47280 - alexcrichton:update-cargo, r=kennytm

Update Cargo and its dependencies

This'll probably have a bunch of build errors, so let's try and head those off
and find them sooner rather than later!

6 years agoadd target/ to ignored tidy dirs
Manish Goregaokar [Thu, 18 Jan 2018 05:32:32 +0000 (11:02 +0530)]
add target/ to ignored tidy dirs

6 years agoAdd E0659 for ambiguous names
Guillaume Gomez [Tue, 16 Jan 2018 23:00:17 +0000 (00:00 +0100)]
Add E0659 for ambiguous names

6 years agoconverted space to tab in css files
Marcel Hellwig [Thu, 18 Jan 2018 08:06:55 +0000 (09:06 +0100)]
converted space to tab in css files

6 years agoUpdate Cargo and its dependencies
Alex Crichton [Mon, 8 Jan 2018 21:56:22 +0000 (13:56 -0800)]
Update Cargo and its dependencies

This'll probably have a bunch of build errors, so let's try and head those off
and find them sooner rather than later!

6 years agoDeprecate std::net::lookup_host
Steven Fackler [Wed, 17 Jan 2018 04:54:48 +0000 (20:54 -0800)]
Deprecate std::net::lookup_host

We intended to do this quite a while ago but it snuck through.