]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAdd reftest that checks the layout of repr(int) on non-c-like enums
Alexis Beingessner [Wed, 1 Nov 2017 15:46:17 +0000 (11:46 -0400)]
Add reftest that checks the layout of repr(int) on non-c-like enums

This verifies the layout specified in rfc #2195

6 years agoAuto merge of #45435 - eddyb:binop-subtype-lhs, r=nikomatsakis
bors [Wed, 1 Nov 2017 09:40:15 +0000 (09:40 +0000)]
Auto merge of #45435 - eddyb:binop-subtype-lhs, r=nikomatsakis

rustc_typeck: use subtyping on the LHS of binops.

Fixes #45425.

r? @nikomatsakis

6 years agoAuto merge of #45674 - kennytm:rollup, r=kennytm
bors [Wed, 1 Nov 2017 07:04:17 +0000 (07:04 +0000)]
Auto merge of #45674 - kennytm:rollup, r=kennytm

Rollup of 14 pull requests

- Successful merges: #45450, #45579, #45602, #45619, #45624, #45644, #45646, #45648, #45649, #45650, #45652, #45660, #45664, #45671
- Failed merges:

6 years agoRollup merge of #45671 - est31:master, r=alexcrichton
kennytm [Wed, 1 Nov 2017 05:32:21 +0000 (13:32 +0800)]
Rollup merge of #45671 - est31:master, r=alexcrichton

Tidy: track rustc_const_unstable feature gates as well

This is important for the unstable book stub generation.

6 years agoRollup merge of #45664 - mbrubeck:docs, r=estebank
kennytm [Wed, 1 Nov 2017 05:32:20 +0000 (13:32 +0800)]
Rollup merge of #45664 - mbrubeck:docs, r=estebank

Fix incorrect error type in Read::byte docs

None

6 years agoRollup merge of #45660 - Cldfire:suggest-rename-import, r=estebank
kennytm [Wed, 1 Nov 2017 05:32:19 +0000 (13:32 +0800)]
Rollup merge of #45660 - Cldfire:suggest-rename-import, r=estebank

Suggest renaming import if names clash

Closes https://github.com/rust-lang/rust/issues/32354.

The output for the example in the issue looks like this:

```
~/p/local-rust-dev-testing ❯❯❯ cargo +local-s1 build
   Compiling local-rust-dev-testing v0.1.0 (file:///home/cldfire/programming_projects/local-rust-dev-testing)
error[E0252]: the name `ConstructorExtension` is defined multiple times
  --> src/main.rs:49:5
   |
48 | use extension1::ConstructorExtension;
   |     -------------------------------- previous import of the trait `ConstructorExtension` here
49 | use extension2::ConstructorExtension;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ConstructorExtension` reimported here
   |
   = note: `ConstructorExtension` must be defined only once in the type namespace of this module
help: You can use `as` to change the binding name of the import
   |
49 | use extension2::ConstructorExtension as OtherConstructorExtension;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

...
```

This is my first PR that touches the compiler in any way, so if there's something else I need to do here (e.g. add a test), please let me know :).

6 years agoRollup merge of #45652 - malbarbo:x32-2, r=alexcrichton
kennytm [Wed, 1 Nov 2017 05:32:18 +0000 (13:32 +0800)]
Rollup merge of #45652 - malbarbo:x32-2, r=alexcrichton

More fixes for x86_64-unknown-linux-gnux32

This update libc (all libc testing are passing) and fixes NR_GETRANDOM.

Fix all but one run-pass test (lto-unwind.rs, see https://github.com/rust-lang/rust/issues/45416)

6 years agoRollup merge of #45650 - michaelwoerister:per-crate-type-symbol-threshold, r=alexcrichton
kennytm [Wed, 1 Nov 2017 05:32:17 +0000 (13:32 +0800)]
Rollup merge of #45650 - michaelwoerister:per-crate-type-symbol-threshold, r=alexcrichton

Take crate-type into account when generating symbol export lists (linker version scripts)

r? @alexcrichton
cc https://github.com/rust-lang/rust/issues/45613

6 years agoRollup merge of #45649 - tbu-:pr_doc_bufread_eof, r=estebank
kennytm [Wed, 1 Nov 2017 05:32:16 +0000 (13:32 +0800)]
Rollup merge of #45649 - tbu-:pr_doc_bufread_eof, r=estebank

Add a hint what `BufRead` functions do on EOF

6 years agoRollup merge of #45648 - tbu-:pr_doc_unix_ext, r=estebank
kennytm [Wed, 1 Nov 2017 05:32:15 +0000 (13:32 +0800)]
Rollup merge of #45648 - tbu-:pr_doc_unix_ext, r=estebank

Update doc comment for the Unix extension module

It was a bit outdated, claimed to be able to do less than it actually
could.

6 years agoRollup merge of #45646 - sinkuu:dead-code-alias-in-pat, r=arielb1
kennytm [Wed, 1 Nov 2017 05:32:14 +0000 (13:32 +0800)]
Rollup merge of #45646 - sinkuu:dead-code-alias-in-pat, r=arielb1

Count type aliases used in patterns as usage by dead_code lint

Fixes #45614.

6 years agoRollup merge of #45644 - zackmdavis:edit_disallowed_inner_attr_note, r=estebank
kennytm [Wed, 1 Nov 2017 05:32:13 +0000 (13:32 +0800)]
Rollup merge of #45644 - zackmdavis:edit_disallowed_inner_attr_note, r=estebank

edit and fix bad spacing of inner-attribute-not-allowed note

This multiline string literal was missing a backslash, leaving an awkward
newline and 35 spaces in the middle of the message.

But while we're here, the existing message seems kind of long in comparison to
similar notes: to cut it down, we excise the mentions of doc comments, which
seems sensible because we know that this erroneous attribute is not a doc
comment (notice the `is_sugared_doc: false` at the end of the function; if it
had been a doc comment, that error would get set in the `token::DocComment`
match branch of `parse_outer_attributes`).

6 years agoRollup merge of #45624 - glaubitz:bootstrap-sparc64, r=kennytm
kennytm [Wed, 1 Nov 2017 05:32:12 +0000 (13:32 +0800)]
Rollup merge of #45624 - glaubitz:bootstrap-sparc64, r=kennytm

bootstrap: Add missing cputype matching for sparc64

Trying to configure rust natively on sparc64-unknown-linux-gnu currently fails with:

```
root@deb4g:/local_scratch/glaubitz/rust/rust# ./configure --host=sparc64-unknown-linux-gnu --enable-local-rust --local-rust-root=/usr/local
configure: processing command line
configure:
configure: build.host           := ['sparc64-unknown-linux-gnu']
configure: build.rustc          := /usr/local/bin/rustc
configure: build.cargo          := /usr/local/bin/cargo
configure: build.rustc          := /usr/local/bin/rustc
configure: build.cargo          := /usr/local/bin/cargo
configure: build.configure-args := ['--host=sparc64-unknown-linux-gnu', '--enable ...
unknown cpu type: sparc64
root@deb4g:/local_scratch/glaubitz/rust/rust#
```

This is trivially fixed by defining sparc64 as a valid cputype.

6 years agoRollup merge of #45619 - mneumann:fix-bootstrap-dragonfly, r=alexcrichton
kennytm [Wed, 1 Nov 2017 05:32:11 +0000 (13:32 +0800)]
Rollup merge of #45619 - mneumann:fix-bootstrap-dragonfly, r=alexcrichton

Support Dragonfly when building Openssl

6 years agoRollup merge of #45602 - petrochenkov:ospan, r=michaelwoerister
kennytm [Wed, 1 Nov 2017 05:32:10 +0000 (13:32 +0800)]
Rollup merge of #45602 - petrochenkov:ospan, r=michaelwoerister

Optimize some span operations

Do not decode span data twice/thrice/etc unnecessarily.
Applied to stable hashing and all methods in `impl Span`.

Follow up to https://github.com/rust-lang/rust/pull/44646
r? @michaelwoerister

6 years agoRollup merge of #45579 - leodasvacas:document-that-call-can-be-adt-constructor, r...
kennytm [Wed, 1 Nov 2017 05:32:09 +0000 (13:32 +0800)]
Rollup merge of #45579 - leodasvacas:document-that-call-can-be-adt-constructor, r=estebank

Document that call expressions also represent ADT constructors.

This is a rather obscure part of the language.

6 years agoRollup merge of #45450 - GuillaumeGomez:overlap-link, r=QuietMisdreavus
kennytm [Wed, 1 Nov 2017 05:32:08 +0000 (13:32 +0800)]
Rollup merge of #45450 - GuillaumeGomez:overlap-link, r=QuietMisdreavus

Fix title heading overlap in rust doc

Fixes #45158.

To be noted that this margin only appears when a title is the first element.

<img width="1440" alt="screen shot 2017-10-22 at 16 08 44" src="https://user-images.githubusercontent.com/3050060/31862746-6411070e-b743-11e7-9a75-4159e1f7f1d6.png">

r? @rust-lang/docs

6 years agoAuto merge of #45267 - oconnor663:rwlock_send, r=alexcrichton
bors [Wed, 1 Nov 2017 04:32:15 +0000 (04:32 +0000)]
Auto merge of #45267 - oconnor663:rwlock_send, r=alexcrichton

remove the `T: Sync` requirement for `RwLock<T>: Send`

That requirement makes sense for containers like `Arc` that don't
uniquely own their contents, but `RwLock` is not one of those.

This restriction was added in https://github.com/rust-lang/rust/commit/380d23b5d4b9fb8f5f0ebf178590f61528b2483e, but it's not clear why. @hniksic
and I [were discussing this on reddit](https://www.reddit.com/r/rust/comments/763o7r/blog_posts_introducing_lockfree_rust_comparing/dobcvbm/). I might be totally wrong about this change being sound, but I'm super curious to find out :)

6 years agoAuto merge of #45187 - GuillaumeGomez:doc-ui-improvement, r=QuietMisdreavus
bors [Wed, 1 Nov 2017 01:45:58 +0000 (01:45 +0000)]
Auto merge of #45187 - GuillaumeGomez:doc-ui-improvement, r=QuietMisdreavus

Improve sidebar rendering and add methods list

I suppose it can be reviewed as is, but this is just the first step of a more global plan.

cc @rust-lang/docs @nical

And a screenshot of course:

<img width="1440" alt="screen shot 2017-10-10 at 23 38 45" src="https://user-images.githubusercontent.com/3050060/31412170-657beaf6-ae14-11e7-9f01-1e562a034595.png">

6 years agoAdd UI test
Cldfire [Tue, 31 Oct 2017 23:35:51 +0000 (19:35 -0400)]
Add UI test

6 years agoAuto merge of #44764 - nvzqz:master, r=alexcrichton
bors [Tue, 31 Oct 2017 23:06:37 +0000 (23:06 +0000)]
Auto merge of #44764 - nvzqz:master, r=alexcrichton

Implement TryFrom<&[T]> for &[T; N]

There are many cases where a buffer with a static compile-time size is preferred over a slice with a dynamic size. This allows for performing a checked conversion from `&[T]` to `&[T; N]`. This may also lead to compile-time optimizations involving `[T; N]` such as loop unrolling.

This is my first PR to Rust, so I'm not sure if discussion of this change should happen here or does it need its own RFC? I figured these changes would be a subset of #33417.

6 years agoAlso support macro generated atomic types
est31 [Tue, 31 Oct 2017 20:46:05 +0000 (21:46 +0100)]
Also support macro generated atomic types

This is kind of a hack but it works...

6 years agoTidy: track rustc_const_unstable feature gates as well
est31 [Tue, 31 Oct 2017 20:39:32 +0000 (21:39 +0100)]
Tidy: track rustc_const_unstable feature gates as well

This is important for the unstable book stub generation.

6 years agoFix incorrect error type in Read::byte docs
Matt Brubeck [Tue, 31 Oct 2017 19:30:15 +0000 (12:30 -0700)]
Fix incorrect error type in Read::byte docs

6 years agobootstrap: Add missing cputype matching for sparc64
John Paul Adrian Glaubitz [Sun, 29 Oct 2017 22:51:14 +0000 (23:51 +0100)]
bootstrap: Add missing cputype matching for sparc64

6 years agoSuggest renaming import if names clash
Cldfire [Tue, 31 Oct 2017 17:31:48 +0000 (13:31 -0400)]
Suggest renaming import if names clash

6 years agorustc_typeck: use subtyping on the LHS of binops.
Eduard-Mihai Burtescu [Sat, 21 Oct 2017 16:41:27 +0000 (19:41 +0300)]
rustc_typeck: use subtyping on the LHS of binops.

6 years agoAuto merge of #45655 - alexcrichton:mips-less-cgus, r=michaelwoerister
bors [Tue, 31 Oct 2017 14:56:06 +0000 (14:56 +0000)]
Auto merge of #45655 - alexcrichton:mips-less-cgus, r=michaelwoerister

rustbuild: Don't build with ThinLTO on MIPS

Discovered in #45529 it looks like cross-module TLS imports aren't quite working
today, especially with `hidden` visibility which mostly comes up with multiple
codegen units. As a result this completely disables compiling with ThinLTO and
multiple codegen units on MIPS when bootstrapping.

cc #45654, the tracking issue for this

6 years agorustbuild: Don't build with ThinLTO on MIPS
Alex Crichton [Tue, 31 Oct 2017 13:56:36 +0000 (06:56 -0700)]
rustbuild: Don't build with ThinLTO on MIPS

Discovered in #45529 it looks like cross-module TLS imports aren't quite working
today, especially with `hidden` visibility which mostly comes up with multiple
codegen units. As a result this completely disables compiling with ThinLTO and
multiple codegen units on MIPS when bootstrapping.

cc #45654, the tracking issue for this

6 years agoFix NR_GETRANDOM for linux x32
Marco A L Barbosa [Tue, 31 Oct 2017 13:28:44 +0000 (11:28 -0200)]
Fix NR_GETRANDOM for linux x32

6 years agoBump libc to 0.2.33
Marco A L Barbosa [Tue, 31 Oct 2017 13:25:39 +0000 (11:25 -0200)]
Bump libc to 0.2.33

6 years agoAdd regression test for symbol visibility when compiling rlib+cdylib in one session.
Michael Woerister [Tue, 31 Oct 2017 13:00:28 +0000 (14:00 +0100)]
Add regression test for symbol visibility when compiling rlib+cdylib in one session.

6 years agoTake crate-type into account when computing symbol export list.
Michael Woerister [Tue, 31 Oct 2017 11:42:03 +0000 (12:42 +0100)]
Take crate-type into account when computing symbol export list.

6 years agoAdd a hint what `BufRead` functions do on EOF
Tobias Bucher [Tue, 31 Oct 2017 10:04:08 +0000 (11:04 +0100)]
Add a hint what `BufRead` functions do on EOF

6 years agoUpdate doc comment for the Unix extension module
Tobias Bucher [Tue, 31 Oct 2017 09:41:10 +0000 (10:41 +0100)]
Update doc comment for the Unix extension module

It was a bit outdated, claimed to be able to do less than it actually
could.

6 years agoAuto merge of #45551 - michaelwoerister:fix-hir-depnodes-and-ich, r=nikomatsakis
bors [Tue, 31 Oct 2017 05:03:25 +0000 (05:03 +0000)]
Auto merge of #45551 - michaelwoerister:fix-hir-depnodes-and-ich, r=nikomatsakis

incr.comp.: Fix two problems with HIR hashing.

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

This PR fixes two small problems:
* Overflow checks are always enabled in a constant context, so we need to hash spans of potentially overflowing operations. (Eventually I'd like to handle spans differently so we don't have to make HIR hashing know so much about things like this.)
* The HIR map collector had a bug where it would assign the `DepNode::Hir` instead of the corresponding `DepNode::HirBody` in some nested contexts.

r? @nikomatsakis

6 years agoCount type aliases in patterns
sinkuu [Tue, 31 Oct 2017 02:57:40 +0000 (11:57 +0900)]
Count type aliases in patterns

6 years agoAuto merge of #45550 - kennytm:update-xsv, r=BurntSushi
bors [Tue, 31 Oct 2017 00:53:12 +0000 (00:53 +0000)]
Auto merge of #45550 - kennytm:update-xsv, r=BurntSushi

cargotest: Update xsv.

This fixes a flaky test which caused spurious failures in #45348 and #45380.

6 years agoedit and fix bad spacing of inner-attribute-not-allowed note
Zack M. Davis [Mon, 30 Oct 2017 23:59:34 +0000 (16:59 -0700)]
edit and fix bad spacing of inner-attribute-not-allowed note

This multiline string literal was missing a backslash, leaving an awkward
newline and 35 spaces in the middle of the message.

But while we're here, the existing message seems kind of long in comparison to
similar notes: to cut it down, we excise the mentions of doc comments, which
seems sensible because we know that this erroneous attribute is not a doc
comment (notice the `is_sugared_doc: false` at the end of the function; if it
had been a doc comment, that error would get set in the `token::DocComment`
match branch of `parse_outer_attributes`).

6 years agoAuto merge of #45497 - mikhail-m1:dump-mir-graphviz, r=nikomatsakis
bors [Mon, 30 Oct 2017 21:22:40 +0000 (21:22 +0000)]
Auto merge of #45497 - mikhail-m1:dump-mir-graphviz, r=nikomatsakis

add graphvis DOT files to dump mir directory

r? @nikomatsakis

6 years agotweak the description
Niko Matsakis [Mon, 30 Oct 2017 14:22:35 +0000 (10:22 -0400)]
tweak the description

"in addition to" sounds better than "additionally to"

6 years agoAuto merge of #45626 - wesleywiser:doc_update_1, r=Mark-Simulacrum
bors [Mon, 30 Oct 2017 08:52:40 +0000 (08:52 +0000)]
Auto merge of #45626 - wesleywiser:doc_update_1, r=Mark-Simulacrum

Add link to stablized version of an intrinsic

6 years agoAuto merge of #45603 - joshleeb:iss42106, r=estebank
bors [Mon, 30 Oct 2017 06:17:39 +0000 (06:17 +0000)]
Auto merge of #45603 - joshleeb:iss42106, r=estebank

Fix duplicate display of error E0502

Ref. Repeated "mutable/immutable borrow" error messages #42106.

This PR modifies the return type of [`report_error_if_loan_conflicts_with_restriction`](https://github.com/rust-lang/rust/blob/0f0f5db465de96b6c12e71f0c7d3e475f618b104/src/librustc_borrowck/borrowck/check_loans.rs#L398-L403) so the result can be checked in [`report_error_if_loans_conflict`](https://github.com/rust-lang/rust/blob/0f0f5db465de96b6c12e71f0c7d3e475f618b104/src/librustc_borrowck/borrowck/check_loans.rs#L377-L396). This is done to prevent displaying a duplicate of the error message E0502 which is referenced in #42106.

The output of compiling:

```rust
fn do_something<T>(collection: &mut Vec<T>) {
    let _a = &collection;
    collection.swap(1, 2);
}

fn main() {}
```

is now

```bash
$ rustc src/test/compile-fail/issue-42106.rs
error[E0502]: cannot borrow `*collection` as mutable because `collection` is also borrowed as immutable
  --> src/test/compile-fail/issue-42106.rs:13:5
   |
12 |     let _a = &collection;
   |               ---------- immutable borrow occurs here
13 |     collection.swap(1, 2);
   |     ^^^^^^^^^^ mutable borrow occurs here
14 | }
   | - immutable borrow ends here

error: aborting due to 2 previous errors
```

r? @estebank

6 years agoAdd link to stablized version of an intrinsic
Wesley Wiser [Mon, 30 Oct 2017 02:53:07 +0000 (22:53 -0400)]
Add link to stablized version of an intrinsic

6 years agoAuto merge of #45618 - kennytm:update-cargo, r=alexcrichton
bors [Mon, 30 Oct 2017 02:33:52 +0000 (02:33 +0000)]
Auto merge of #45618 - kennytm:update-cargo, r=alexcrichton

Update cargo.

Brings in rust-lang/cargo#4672, unbreaks nightly on macOS APFS.

Fixes #45607.

r? @alexcrichton

6 years agoMove issue-42106 test from compile-fail to ui
Josh Leeb-du Toit [Sun, 29 Oct 2017 22:58:45 +0000 (09:58 +1100)]
Move issue-42106 test from compile-fail to ui

6 years agoAuto merge of #45424 - petrochenkov:grlint, r=oli-obk
bors [Sun, 29 Oct 2017 23:59:07 +0000 (23:59 +0000)]
Auto merge of #45424 - petrochenkov:grlint, r=oli-obk

Add several lints into `unused` lint group

Also a couple of obsolete (not reported) lints are removed.

r? @oli-obk

6 years agoRefactor if block to use idiomatic matches
Josh Leeb-du Toit [Sun, 29 Oct 2017 22:58:09 +0000 (09:58 +1100)]
Refactor if block to use idiomatic matches

6 years agoAuto merge of #45597 - DSpeckhals:rustfmt-update, r=nrc
bors [Sun, 29 Oct 2017 21:25:12 +0000 (21:25 +0000)]
Auto merge of #45597 - DSpeckhals:rustfmt-update, r=nrc

tools: Update rustfmt and re-enable testing

This allows rustfmt and the RLS to test and compile again.

6 years agoRefactor matches to use Result::err
Josh Leeb-du Toit [Sun, 29 Oct 2017 21:20:52 +0000 (08:20 +1100)]
Refactor matches to use Result::err

6 years agoUpdate rustfmt again
Dustin Speckhals [Sun, 29 Oct 2017 19:16:02 +0000 (15:16 -0400)]
Update rustfmt again

6 years agoAdd several lints into `unused` lint group
Vadim Petrochenkov [Fri, 20 Oct 2017 21:00:57 +0000 (00:00 +0300)]
Add several lints into `unused` lint group

Remove a couple of obsolete lints

6 years agoAuto merge of #45616 - fhartwig:ptr-docs, r=dtolnay
bors [Sun, 29 Oct 2017 18:44:16 +0000 (18:44 +0000)]
Auto merge of #45616 - fhartwig:ptr-docs, r=dtolnay

Fix references to zero_memory and copy_memory in ptr docs

Fixes #45606

6 years agoSupport Dragonfly when building Openssl
Michael Neumann [Sun, 29 Oct 2017 17:42:04 +0000 (18:42 +0100)]
Support Dragonfly when building Openssl

6 years agoUpdate cargo.
kennytm [Sun, 29 Oct 2017 17:32:08 +0000 (01:32 +0800)]
Update cargo.

Brings in rust-lang/cargo#4672, unbreaks nightly on macOS APFS.

6 years agoMerge branch 'master' into rustfmt-update
Dustin Speckhals [Sun, 29 Oct 2017 17:27:06 +0000 (13:27 -0400)]
Merge branch 'master' into rustfmt-update

6 years agoAuto merge of #45611 - Manishearth:lint-generics, r=petrochenkov
bors [Sun, 29 Oct 2017 15:22:38 +0000 (15:22 +0000)]
Auto merge of #45611 - Manishearth:lint-generics, r=petrochenkov

Add generics to LateContext

Fixes clippy breakage from https://github.com/rust-lang/rust/pull/44766 as discussed in https://github.com/rust-lang-nursery/rust-clippy/pull/2140#issuecomment-336973875

r? @nikomatsakis

6 years agoFix references to zero_memory and copy_memory in ptr docs
Florian Hartwig [Sun, 29 Oct 2017 14:40:09 +0000 (15:40 +0100)]
Fix references to zero_memory and copy_memory in ptr docs

6 years agoUpdate clippy
Manish Goregaokar [Sun, 29 Oct 2017 09:27:34 +0000 (05:27 -0400)]
Update clippy

6 years agoAuto merge of #45295 - Technius:docs/process, r=steveklabnik
bors [Sun, 29 Oct 2017 06:24:20 +0000 (06:24 +0000)]
Auto merge of #45295 - Technius:docs/process, r=steveklabnik

Improve std::process module docs

Addresses part of #29370

I've changed the first `cat` example to a "Hello World" example involving echo, and I've also added another example showing how to pipe output. I'm still working on the module-level description.

For now, I'd like feedback on the examples.

r? @steveklabnik

6 years agoAdd no_run to process examples involving unix commands
Bryan Tan [Sun, 29 Oct 2017 03:24:49 +0000 (20:24 -0700)]
Add no_run to process examples involving unix commands

6 years agoAuto merge of #45554 - integer32llc:update-book, r=steveklabnik
bors [Sun, 29 Oct 2017 02:16:24 +0000 (02:16 +0000)]
Auto merge of #45554 - integer32llc:update-book, r=steveklabnik

Update the book for a fix to the print button

Fixes #45552.

Brings in recent improvements in the text that we've made recently as well.

r? @steveklabnik

6 years agoAdd test for fix duplicate display of E0502
Josh Leeb-du Toit [Sun, 29 Oct 2017 01:10:59 +0000 (12:10 +1100)]
Add test for fix duplicate display of E0502

6 years agoFix duplicate display of error E0502
Josh Leeb-du Toit [Sat, 28 Oct 2017 23:37:59 +0000 (10:37 +1100)]
Fix duplicate display of error E0502

6 years agoUpdate the book for a fix to the print button
Carol (Nichols || Goulding) [Thu, 26 Oct 2017 18:49:12 +0000 (14:49 -0400)]
Update the book for a fix to the print button

Fixes #45552.

6 years agoAuto merge of #45580 - kennytm:sdkmanager, r=alexcrichton
bors [Sat, 28 Oct 2017 23:40:31 +0000 (23:40 +0000)]
Auto merge of #45580 - kennytm:sdkmanager, r=alexcrichton

ci: Upgrade Android SDK/NDK and refactor to use sdkmanager/avdmanager.

* SDK tools is upgraded to 27.0.0.

* Stopped using the deprecated `android` tool, instead use the recommended `sdkmanager` and `avdmanager`.

* NDK is upgrade to r15c.

    The r15 series [dropped support for android-9](https://github.com/android-ndk/ndk/wiki/Changelog-r15) (2.3 / Gingerbread), the minimal supported version is now android-14 (4.0 / Ice Cream Sandwich).

r? @alexcrichton

(WIP, haven't confirmed if the change really works yet)

6 years agoOptimize some span operations
Vadim Petrochenkov [Sat, 21 Oct 2017 14:21:02 +0000 (17:21 +0300)]
Optimize some span operations

Decode span data only once

6 years agoci: Upgrade Android SDK/NDK and refactor to use sdkmanager/avdmanager.
kennytm [Fri, 27 Oct 2017 19:14:25 +0000 (03:14 +0800)]
ci: Upgrade Android SDK/NDK and refactor to use sdkmanager/avdmanager.

* SDK tools is upgraded to 27.0.0.
   - Refactored to use `sdkmanager`/`avdmanager` instead of the deprecated
     `android` tool.

* The Java version used by Android SDK is downgraded to OpenJDK-8, in order
  to download the SDK through HTTPS.

* NDK is upgrade to r15c.
   - Dropped support for android-9 (2.3 / Gingerbread), the minimal
     supported version is now android-14 (4.0 / Ice Cream Sandwich).
   - Changed the default Android compiler from GCC to clang.
   - For details of change introduced by NDK r15, see
     https://github.com/android-ndk/ndk/wiki/Changelog-r15.

6 years agoAdd generics field to LateContext
Manish Goregaokar [Sat, 28 Oct 2017 21:19:07 +0000 (17:19 -0400)]
Add generics field to LateContext

6 years agoAuto merge of #45540 - virgil-palanciuc:master, r=estebank
bors [Sat, 28 Oct 2017 21:01:07 +0000 (21:01 +0000)]
Auto merge of #45540 - virgil-palanciuc:master, r=estebank

Avoid repetition on “use of unstable library feature 'rustc_private'”

This PR fixes the error by only emitting it when the span contains a real file (is not inside a macro) - and making sure it's emitted only once per span.
The first check was needed because spans-within-macros seem to differ a lot and "fixing" them to the real location is not trivial (and the method that does this is private to another module). It also feels like there always will be an error on import, with the real file name, so not sure there's a point to re-emit the same error at macro use.

Fix #44953.

6 years agofixed tidy error
Virgil Palanciuc [Sat, 28 Oct 2017 19:38:15 +0000 (22:38 +0300)]
fixed tidy error

6 years agoUpdate rustfmt
Dustin Speckhals [Sat, 28 Oct 2017 17:46:43 +0000 (13:46 -0400)]
Update rustfmt

This allows rustfmt and the RLS to test and compile again.

6 years agoimplemented code review
Virgil Palanciuc [Sat, 28 Oct 2017 17:39:00 +0000 (20:39 +0300)]
implemented code review

6 years agoAuto merge of #45489 - oli-obk:json_diagnostics, r=petrochenkov
bors [Sat, 28 Oct 2017 16:15:17 +0000 (16:15 +0000)]
Auto merge of #45489 - oli-obk:json_diagnostics, r=petrochenkov

Fix a quadradic duplication in json for multi-suggestions

r? @petrochenkov

6 years agoFix weird bugs
Guillaume Gomez [Fri, 27 Oct 2017 23:11:01 +0000 (01:11 +0200)]
Fix weird bugs

6 years agoAuto merge of #44295 - plietar:extern-types, r=arielb1
bors [Sat, 28 Oct 2017 13:34:12 +0000 (13:34 +0000)]
Auto merge of #44295 - plietar:extern-types, r=arielb1

Implement RFC 1861: Extern types

A few notes :

- Type parameters are not supported. This was an unresolved question from the RFC. It is not clear how useful this feature is, and how variance should be treated. This can be added in a future PR.

- `size_of_val` / `align_of_val` can be called with extern types, and respectively return 0 and 1. This differs from the RFC, which specified that they should panic, but after discussion with @eddyb on IRC this seems like a better solution.
If/when a `DynSized` trait is added, this will be disallowed statically.

- Auto traits are not implemented by default, since the contents of extern types is unknown. This means extern types are `!Sync`, `!Send` and `!Freeze`. This seems like the correct behaviour to me.
Manual `unsafe impl Sync for Foo` is still possible.

- This PR allows extern type to be used as the tail of a struct, as described by the RFC :
```rust
extern {
    type OpaqueTail;
}

#[repr(C)]
struct FfiStruct {
    data: u8,
    more_data: u32,
    tail: OpaqueTail,
}
```

However this is undesirable, as the alignment of `tail` is unknown (the current PR assumes an alignment of 1). Unfortunately we can't prevent it in the general case as the tail could be a type parameter :
```rust
#[repr(C)]
struct FfiStruct<T: ?Sized> {
    data: u8,
    more_data: u32,
    tail: T,
}
```

Adding a `DynSized` trait would solve this as well, by requiring tail fields to be bound by it.

- Despite being unsized, pointers to extern types are thin and can be casted from/to integers. However it is not possible to write a `null<T>() -> *const T` function which works with extern types, as I've explained here : https://github.com/rust-lang/rust/issues/43467#issuecomment-321678621

- Trait objects cannot be built from extern types. I intend to support it eventually, although how this interacts with `DynSized`/`size_of_val` is still unclear.

- The definition of `c_void` is unmodified

6 years agoAuto merge of #45589 - kennytm:rollup, r=kennytm
bors [Sat, 28 Oct 2017 09:42:38 +0000 (09:42 +0000)]
Auto merge of #45589 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

- Successful merges: #45421, #45449, #45505, #45535, #45549, #45574, #45585
- Failed merges:

6 years agoRollup merge of #45585 - frewsxcv:frewsxcv-diagnostic, r=kennytm
kennytm [Sat, 28 Oct 2017 07:56:25 +0000 (15:56 +0800)]
Rollup merge of #45585 - frewsxcv:frewsxcv-diagnostic, r=kennytm

Remove 'future Rust version' code block in diagnostic text.

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

6 years agoRollup merge of #45574 - nzig:on_unimplemented_example, r=steveklabnik
kennytm [Sat, 28 Oct 2017 07:56:24 +0000 (15:56 +0800)]
Rollup merge of #45574 - nzig:on_unimplemented_example, r=steveklabnik

Fixed rustc_on_unimplemented example in Unstable Book

I saw [this](https://doc.rust-lang.org/beta/unstable-book/language-features/on-unimplemented.html) example and it seemed wrong. This fixes the example to emit an error message that makes more sense.

6 years agoRollup merge of #45549 - steveklabnik:remove-just, r=QuietMisdreavus
kennytm [Sat, 28 Oct 2017 07:56:23 +0000 (15:56 +0800)]
Rollup merge of #45549 - steveklabnik:remove-just, r=QuietMisdreavus

Remove 'just' in diagnostics

This is better writing

6 years agoRollup merge of #45535 - topecongiro:bootstrap-exit-code, r=kennytm
kennytm [Sat, 28 Oct 2017 07:56:22 +0000 (15:56 +0800)]
Rollup merge of #45535 - topecongiro:bootstrap-exit-code, r=kennytm

Return 0 as an exit status when no subcommand is given to bootstrap

Running `./x.py` emits usage and error messages when no subcommand is given:
```
Usage: x.py <subcommand> [options] [<paths>...]

Subcommands:
    build       Compile either the compiler or libraries
    test        Build and run some test suites
    bench       Build and run some benchmarks
    doc         Build documentation
    clean       Clean out build directories
    dist        Build distribution artifacts
    install     Install distribution artifacts

To learn more about a subcommand, run `./x.py <subcommand> -h`

failed to run: /home/topecongiro/rust/build/bootstrap/debug/bootstrap
```
IMHO the last line is unnecessary. This PR removes it by changing the return code of `bootstrap` to 0 when no sub command is given.

6 years agoRollup merge of #45505 - spk:use-expect-instead-unwrap, r=kennytm
kennytm [Sat, 28 Oct 2017 07:56:21 +0000 (15:56 +0800)]
Rollup merge of #45505 - spk:use-expect-instead-unwrap, r=kennytm

Use expect for current_dir on librustc/session mod

Reference bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871638

Like described on the reference bug report:

~~~
$ mkdir dir
$ cd dir
$ rm -rf ../dir
$ RUST_BACKTRACE=1 rustc -C target-cpu=help
error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 2, message: "No such file or directory" } }', src/libcore/result.rs:837
stack backtrace:
   1:     0x7f7d23970dda - <unknown>
   2:     0x7f7d2398305f - <unknown>
   3:     0x7f7d2397f8a5 - <unknown>
   4:     0x7f7d2397ffc7 - std::panicking::rust_panic_with_hook::h109e116a3a861224
   5:     0x7f7d2397fe54 - <unknown>
   6:     0x7f7d2397fd79 - std::panicking::begin_panic_fmt::h26713cea9bce3ab0
   7:     0x7f7d2397fd07 - rust_begin_unwind
   8:     0x7f7d239cb41d - core::panicking::panic_fmt::hcfbb59eeb7f27f75
   9:     0x7f7d20be63d3 - <unknown>
  10:     0x7f7d20d6ebcc - rustc::session::build_session_::h7a3559f2373a5d05
  11:     0x7f7d20d6dd7e - rustc::session::build_session_with_codemap::h68bc7bcd2f34eee4
  12:     0x7f7d20d6d72c - rustc::session::build_session::h437fda3c327a8bde
  13:     0x7f7d23d26030 - <rustc_driver::RustcDefaultCalls as rustc_driver::CompilerCalls<'a>>::no_input::h8047df7741757d1c
  14:     0x7f7d23d21d27 - rustc_driver::run_compiler::hafe7bbfedf95a825
  15:     0x7f7d23c57378 - <unknown>
  16:     0x7f7d2398ae0a - __rust_maybe_catch_panic
  17:     0x7f7d23c76fa8 - <unknown>
  18:     0x7f7d2397eb74 - <unknown>
  19:     0x7f7d1ed4f493 - start_thread
  20:     0x7f7d23645afe - __clone
  21:                0x0 - <unknown>
~~~

With this patch this will give instead:

~~~
error: Current directory is invalid: No such file or directory (os error 2)
~~~

6 years agoRollup merge of #45449 - frewsxcv:frewsxcv-udp-nonblocking, r=sfackler
kennytm [Sat, 28 Oct 2017 07:56:20 +0000 (15:56 +0800)]
Rollup merge of #45449 - frewsxcv:frewsxcv-udp-nonblocking, r=sfackler

Improve docs for UdpSocket::set_nonblocking.

Closes https://github.com/rust-lang/rust/issues/44050.

6 years agoRollup merge of #45421 - QuietMisdreavus:update-pulldown, r=steveklabnik
kennytm [Sat, 28 Oct 2017 07:56:19 +0000 (15:56 +0800)]
Rollup merge of #45421 - QuietMisdreavus:update-pulldown, r=steveklabnik

rustdoc: update pulldown + fix spurious rendering difference around footnotes

fixes #45420

6 years agoAuto merge of #45566 - cuviper:option-checking, r=alexcrichton
bors [Sat, 28 Oct 2017 07:08:52 +0000 (07:08 +0000)]
Auto merge of #45566 - cuviper:option-checking, r=alexcrichton

configure.py: fix --disable-option-checking and extra config paths

- indexing 'option-checking' out of `known_args` had a type error
- when option checking is disabled, don't error on duplicate args, just take the last
- add config.toml stubs for datadir, infodir, and localstatedir (which were already accepted, but broken)

---

This fixes a regression from 1.21 to beta, when the configure script was rewritten in python.

6 years agoAuto merge of #45503 - thombles:tk/i44339-v5, r=petrochenkov
bors [Sat, 28 Oct 2017 03:02:17 +0000 (03:02 +0000)]
Auto merge of #45503 - thombles:tk/i44339-v5, r=petrochenkov

Improve diagnostics when list of tokens has incorrect separators

Make `parse_seq_to_before_tokens` more resilient to error conditions. Where possible it is better if it can consume up to the final bracket before returning. This change improves the diagnostics in a couple of situations:

```
struct S(pub () ()); // omitted separator
use std::{foo. bar}; // used a similar but wrong separator
```

Fixes #44339
r? @petrochenkov

6 years agoRemove 'future Rust version' code block in diagnostic text.
Corey Farwell [Sat, 28 Oct 2017 02:49:56 +0000 (22:49 -0400)]
Remove 'future Rust version' code block in diagnostic text.

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

6 years agoMove type_has_metadata to trans_utils
Paul Liétar [Fri, 27 Oct 2017 21:36:18 +0000 (23:36 +0200)]
Move type_has_metadata to trans_utils

6 years agoEncode urls
Guillaume Gomez [Fri, 27 Oct 2017 21:09:10 +0000 (23:09 +0200)]
Encode urls

6 years agoChange sidebar items order
Guillaume Gomez [Thu, 26 Oct 2017 22:16:44 +0000 (00:16 +0200)]
Change sidebar items order

6 years agoImprove sidebar rendering and add methods list
Guillaume Gomez [Tue, 10 Oct 2017 21:39:10 +0000 (23:39 +0200)]
Improve sidebar rendering and add methods list

6 years agofix rebase
Paul Liétar [Fri, 27 Oct 2017 20:58:17 +0000 (22:58 +0200)]
fix rebase

6 years agoUndo changes to core::ptr
Paul Liétar [Thu, 5 Oct 2017 00:12:59 +0000 (02:12 +0200)]
Undo changes to core::ptr

6 years agoImplement RFC 1861: Extern types
Paul Lietar [Sun, 3 Sep 2017 18:53:58 +0000 (19:53 +0100)]
Implement RFC 1861: Extern types

6 years agoDocument that call expressions also represent ADT constructors.
leonardo.yvens [Fri, 27 Oct 2017 18:27:59 +0000 (16:27 -0200)]
Document that call expressions also represent ADT constructors.

This is a rather obscure part of the language.

6 years agoAuto merge of #45285 - alexcrichton:update-bootstrap, r=Mark-Simulacrum
bors [Fri, 27 Oct 2017 18:00:32 +0000 (18:00 +0000)]
Auto merge of #45285 - alexcrichton:update-bootstrap, r=Mark-Simulacrum

Bump to 1.23 and update bootstrap

This commit updates the bootstrap compiler, bumps the version to 1.23, updates
Cargo, updates books, and updates crates.io dependencies

6 years agoFix tidy error line longer than 100 chars
Laurent Arnoud [Fri, 27 Oct 2017 17:31:33 +0000 (19:31 +0200)]
Fix tidy error line longer than 100 chars

6 years agoQuit immediately when current directory is invalid
Laurent Arnoud [Fri, 27 Oct 2017 17:14:03 +0000 (19:14 +0200)]
Quit immediately when current directory is invalid

Thanks-to: @kennytm
6 years agoUpdate license exceptions.
kennytm [Fri, 27 Oct 2017 14:12:51 +0000 (22:12 +0800)]
Update license exceptions.

The `zircon` crates have been renamed as `fuchsia-zircon`.

6 years agoAuto merge of #45570 - nrc:manifest-no-rls, r=alexcrichton
bors [Fri, 27 Oct 2017 15:03:47 +0000 (15:03 +0000)]
Auto merge of #45570 - nrc:manifest-no-rls, r=alexcrichton

Don't fail to build a manifest if a tarball is missing

This is guesswork because I can't test build_manifest nor do I know what is actually causing the error to begin with. My hypothesis is that when we try to find the version from the RLS tarball and the tarball is not there, then we panic. I attempt to fix this by making the version string optional, then not adding the RLS package, rename, and extension component if the version is missing.

In theory, this should fix the broken nightlies.

r? @alexcrichton