]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoCopy `AsciiExt` methods to `[u8]` directly
Lukas Kalbertodt [Sun, 1 Oct 2017 19:13:49 +0000 (21:13 +0200)]
Copy `AsciiExt` methods to `[u8]` directly

This is done in order to deprecate AsciiExt eventually. Note that
this commit contains a bunch of `cfg(stage0)` statements. This is
due to a new compiler feature I am using: the `slice_u8` lang item.
Once this lang item is available in the stage0 compiler, all those
cfg flags (and more) can be removed.

6 years agoAdd a lang item to allow `impl [u8] {…}` in the standard library
Simon Sapin [Sun, 1 Oct 2017 15:05:35 +0000 (17:05 +0200)]
Add a lang item to allow `impl [u8] {…}` in the standard library

6 years agoFix lists in doc comments for ascii methods of u8 and char
Lukas Kalbertodt [Fri, 29 Sep 2017 16:34:39 +0000 (18:34 +0200)]
Fix lists in doc comments for ascii methods of u8 and char

6 years agoAdd missing space in match arm
Lukas Kalbertodt [Fri, 29 Sep 2017 14:55:31 +0000 (16:55 +0200)]
Add missing space in match arm

6 years agoTweak documentation for `u8::eq_ignore_ascii_case()`
Lukas Kalbertodt [Fri, 29 Sep 2017 14:54:24 +0000 (16:54 +0200)]
Tweak documentation for `u8::eq_ignore_ascii_case()`

6 years agoRemove examples in doc-comments of `AsciiExt` methods
Lukas Kalbertodt [Fri, 29 Sep 2017 13:23:02 +0000 (15:23 +0200)]
Remove examples in doc-comments of `AsciiExt` methods

The doc comments were incorrect before: since the inherent ascii methods
shadow the `AsciiExt` methods, the examples didn't use the `AsciiExt` at
all. Since the trait will be deprecated soon anyway, the easiest solution
was to remove the examples and already mention that the methods will be
deprecated in the near future.

6 years agoUse direct implementation on u8/char to implement AsciiExt
Lukas Kalbertodt [Thu, 28 Sep 2017 16:25:16 +0000 (18:25 +0200)]
Use direct implementation on u8/char to implement AsciiExt

The methods were copied to u8/char, so we can just use it in
AsciiExt impls to avoid duplicate code.

6 years agoCopy `AsciiExt` methods to `char` directly
Lukas Kalbertodt [Thu, 28 Sep 2017 15:04:38 +0000 (17:04 +0200)]
Copy `AsciiExt` methods to `char` directly

This is done in order to deprecate AsciiExt eventually.

6 years agoRevert signature of eq_ignore_ascii_case() to original
Lukas Kalbertodt [Thu, 28 Sep 2017 14:41:21 +0000 (16:41 +0200)]
Revert signature of eq_ignore_ascii_case() to original

Since the methods on u8 directly will shadow the AsciiExt methods,
we cannot change the signature without breaking everything. It
would have been nice to take `u8` as argument instead of `&u8`, but
we cannot break stuff! So this commit reverts it to the original
`&u8` version.

6 years agoMake ascii methods on u8 insta-stable
Lukas Kalbertodt [Thu, 28 Sep 2017 14:37:37 +0000 (16:37 +0200)]
Make ascii methods on u8 insta-stable

Those methods will shadow the methods of `AsciiExt`, so if we don't
make them insta-stable, everyone will hitting stability errors. It
is fine adding those as stable, because they are just being moved
around [according to sfackler][1].

OPEN QUESTION: this commit also stabilizes the `AsciiExt` methods
that were previously feature gated by the `ascii_ctype` feature.
Maybe we don't want to stablilize those yet.

[1]: https://github.com/rust-lang/rust/pull/44042#issuecomment-329939279

6 years agoAdd all methods of AsciiExt to u8 directly
Lukas Kalbertodt [Tue, 22 Aug 2017 17:45:36 +0000 (19:45 +0200)]
Add all methods of AsciiExt to u8 directly

This is the first step in order to deprecate AsciiExt. Since
this is a WIP commit, there is still some code duplication (notably
the static arrays) that will be removed later.

6 years agoAuto merge of #45734 - kennytm:ci-fix-centos-broken-link, r=alexcrichton
bors [Fri, 3 Nov 2017 12:30:09 +0000 (12:30 +0000)]
Auto merge of #45734 - kennytm:ci-fix-centos-broken-link, r=alexcrichton

ci: Fix broken link in `build-powerpc64le-toolchain.sh`

r? @rust-lang/infra

This is just an emergency fix to keep bors running for another week. I think the numbers will be broken soon. Can we verify if this statement is still true later?

> First, download the CentOS7 glibc.ppc64le and relevant header files.
> (upstream ppc64le support wasn't added until 2.19, which el7 backported.)

6 years agoFix broken link in `build-powerpc64le-toolchain.sh`
kennytm [Fri, 3 Nov 2017 07:53:36 +0000 (15:53 +0800)]
Fix broken link in `build-powerpc64le-toolchain.sh`

6 years agoAuto merge of #45484 - oli-obk:lint_names, r=nikomatsakis
bors [Fri, 3 Nov 2017 00:42:11 +0000 (00:42 +0000)]
Auto merge of #45484 - oli-obk:lint_names, r=nikomatsakis

Report lint names in json diagnostics

This allows tools like `rustfix` to have whitelists for what to automatically apply and what not.

6 years agoAuto merge of #45409 - tamird:suggest-match-default-bindings, r=nikomatsakis
bors [Thu, 2 Nov 2017 16:28:16 +0000 (16:28 +0000)]
Auto merge of #45409 - tamird:suggest-match-default-bindings, r=nikomatsakis

typeck: suggest use of match_default_bindings feature

Fixes #45383.
Updates #42640.

r? @nikomatsakis
cc @tschottdorf

This needs a UI test, but thought I'd get some early feedback.

6 years agoAuto merge of #45647 - nrc:rls-bugs, r=eddyb
bors [Thu, 2 Nov 2017 12:34:13 +0000 (12:34 +0000)]
Auto merge of #45647 - nrc:rls-bugs, r=eddyb

save-analysis: support unions

r? @eddyb

6 years agoMake the difference between lint codes and error codes explicit
Oliver Schneider [Fri, 27 Oct 2017 06:21:22 +0000 (08:21 +0200)]
Make the difference between lint codes and error codes explicit

6 years agoReport lint names in json diagnostics
Oliver Schneider [Tue, 24 Oct 2017 06:37:41 +0000 (08:37 +0200)]
Report lint names in json diagnostics

6 years agoAuto merge of #45630 - joshleeb:iss35241, r=estebank
bors [Thu, 2 Nov 2017 08:30:03 +0000 (08:30 +0000)]
Auto merge of #45630 - joshleeb:iss35241, r=estebank

Improve display of error E0308

Ref. Forgetting to call a variant constructor causes a confusing error message #35241.

This PR modifies [`note_type_err`](https://github.com/rust-lang/rust/blob/b7041bfab3a83702a8026fb7a18d8ea7d54cc648/src/librustc/infer/error_reporting/mod.rs#L669-L674) to display a `help` message when a `TyFnPtr` or `TyFnDef` are found and the return type, of the function or function pointer, is the same as the type that is expected.

The output of compiling

```rust
struct Foo(u32);

fn test() -> Foo { Foo }

fn main() {}
```

is now

```bash
$ rustc src/test/ui/issue-35241.rs
error[E0308]: mismatched types
  --> src/test/ui/issue-35241.rs:13:20
   |
13 | fn test() -> Foo { Foo }
   |              ---   ^^^ expected struct `Foo`, found fn item
   |              |
   |              expected `Foo` because of return type
   |
   = help: did you mean `Foo { /* fields */ }`?
   = note: expected type `Foo`
              found type `fn(u32) -> Foo {Foo::{{constructor}}}`

error: aborting due to previous error
```

6 years agoAuto merge of #45468 - Xanewok:crate-source, r=nrc
bors [Thu, 2 Nov 2017 03:36:50 +0000 (03:36 +0000)]
Auto merge of #45468 - Xanewok:crate-source, r=nrc

Emit crate disambiguators in save-analysis data

Needed for https://github.com/nrc/rls-analysis/issues/93.
Blocked by https://github.com/nrc/rls-data/pull/11. (For now, this pulls my branch [rls-data/crate-source](https://github.com/Xanewok/rls-data/tree/crate-source))

This will allow to disambiguate different crates types/versions when indexing resulting save-analysis data (most importantly allow to support bin+lib and different crate versions).

r? @nrc

6 years agoAuto merge of #45306 - whitequark:ref_slice, r=alexcrichton
bors [Thu, 2 Nov 2017 00:06:16 +0000 (00:06 +0000)]
Auto merge of #45306 - whitequark:ref_slice, r=alexcrichton

Bring back slice::ref_slice as slice::from_ref.

These functions were deprecated and removed in 1.5, but such simple
functionality shouldn't require using unsafe code, and it isn't
cluttering libstd too much.

The original removal was quite contentious (see #27774), since then
we've had precedent for including such nuggets of functionality (see rust-lang/rfcs#1789),
and @nikomatsakis has provided a lot of use cases in https://github.com/rust-lang/rfcs/pull/1789#issuecomment-314640034.
Hence this PR.

I'm not too sure what to do with stability, feel free to correct me.
It seems pointless to go through stabilization for these functions though.

cc @aturon

6 years agoDe-stabilize core::slice::{from_ref, from_ref_mut}.
whitequark [Wed, 1 Nov 2017 21:56:17 +0000 (21:56 +0000)]
De-stabilize core::slice::{from_ref, from_ref_mut}.

6 years agoAuto merge of #45538 - nikomatsakis:nll-liveness, r=pnkfelix
bors [Wed, 1 Nov 2017 18:14:13 +0000 (18:14 +0000)]
Auto merge of #45538 - nikomatsakis:nll-liveness, r=pnkfelix

enable non-lexical lifetimes in the MIR borrow checker

This PR, joint work with @spastorino, fills out the NLL infrastructure and integrates it with the borrow checker. **Don't get too excited:** it includes still a number of hacks (the subtyping code is particularly hacky). However, it *does* kinda' work. =)

The final commit demonstrates this by including a test that -- with both the AST borrowck and MIR borrowck -- reports an error by default. But if you pass `-Znll`, you only get an error from the AST borrowck, demonstrating that the integration succeeds:

```
struct MyStruct {
    field: String
}

fn main() {
    let mut my_struct = MyStruct { field: format!("Hello") };

    let value = &my_struct.field;
    if value.is_empty() {
        my_struct.field.push_str("Hello, world!");
        //~^ ERROR cannot borrow (Ast)
    }
}
```

6 years agoAuto merge of #45472 - michaelwoerister:incr-comp-caching-base, r=nikomatsakis
bors [Wed, 1 Nov 2017 14:28:11 +0000 (14:28 +0000)]
Auto merge of #45472 - michaelwoerister:incr-comp-caching-base, r=nikomatsakis

incr.comp.: Implement compiler diagnostic persistence.

This PR implements storing and loading diagnostics that the compiler generates and thus allows for emitting warnings during incremental compilation without actually re-evaluating the thing the warning originally came from. It also lays some groundwork for storing and loading type information and MIR in the incr. comp. cache.

~~It is still work in progress:~~
- ~~There's still some documentation to be added.~~
- ~~The way anonymous queries are handled might lead to duplicated emissions of warnings. Not sure if there is a better way or how frequent such duplication would be in practice.~~

Diagnostic message duplication is addressed separately in #45519.

r? @nikomatsakis

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 agoUpdate rls so it compiles with #45468
Igor Matuszewski [Mon, 30 Oct 2017 19:40:58 +0000 (20:40 +0100)]
Update rls so it compiles with #45468

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

6 years agoImprove display of error E0308 for structs
Josh Leeb-du Toit [Sat, 28 Oct 2017 23:44:05 +0000 (10:44 +1100)]
Improve display of error E0308 for structs

Improve the display of error E0308 for structs by adding a "did you
mean" span label.

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 agopatch mir-opt reference files
Niko Matsakis [Tue, 31 Oct 2017 18:02:31 +0000 (14:02 -0400)]
patch mir-opt reference files

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 agorewrite `write_mir_fn_graphviz` to cope with non-global tcx
Niko Matsakis [Tue, 31 Oct 2017 16:55:54 +0000 (12:55 -0400)]
rewrite `write_mir_fn_graphviz` to cope with non-global tcx

6 years agotreat -Znll as implying -Zborrowck-mir
Niko Matsakis [Tue, 31 Oct 2017 15:41:54 +0000 (11:41 -0400)]
treat -Znll as implying -Zborrowck-mir

6 years agoruntest: fix mir directory and delete outdated MIR files
Niko Matsakis [Tue, 31 Oct 2017 15:41:42 +0000 (11:41 -0400)]
runtest: fix mir directory and delete outdated MIR files

6 years agoremove the NLL pass (it is now invoked by mir borrowck)
Niko Matsakis [Mon, 30 Oct 2017 20:19:24 +0000 (16:19 -0400)]
remove the NLL pass (it is now invoked by mir borrowck)

6 years agoWIP patch `compile-fail/nll/region-ends-after-if-condition.rs`
Niko Matsakis [Mon, 30 Oct 2017 14:59:14 +0000 (10:59 -0400)]
WIP patch `compile-fail/nll/region-ends-after-if-condition.rs`

6 years agochange region display to `'_#Nr`, update the `newtype_index!` macro
Niko Matsakis [Mon, 30 Oct 2017 13:01:12 +0000 (09:01 -0400)]
change region display to `'_#Nr`, update the `newtype_index!` macro

The macro now takes a format string. It no longer defaults to using the
type name. Didn't seem worth going through contortions to maintain.  I
also changed most of the debug formats to be `foo[N]` instead of `fooN`.

6 years agoconnect MIR borrowck with NLL
Niko Matsakis [Mon, 30 Oct 2017 12:28:07 +0000 (08:28 -0400)]
connect MIR borrowck with NLL

6 years agomake the dataflow / mir-borrowck types carry a `'tcx` lifetime
Niko Matsakis [Mon, 30 Oct 2017 09:50:39 +0000 (05:50 -0400)]
make the dataflow / mir-borrowck types carry a `'tcx` lifetime

Also, factor out `do_mir_borrowck`, which is the code that actually
performs the MIR borrowck from within the scope of an inference context.

This change should be a pure refactoring.

6 years agotest "needs drop" on region-erased, lifted types
Niko Matsakis [Mon, 30 Oct 2017 09:28:46 +0000 (05:28 -0400)]
test "needs drop" on region-erased, lifted types

This will be important in next commit, since the input types will be
tagged not with `'gcx` but rather `'tcx`. Also, using the region-erased,
lifted types enables better caching.

6 years agoreorder 'gcx and 'tcx in `BorrowckErrors` impl
Niko Matsakis [Thu, 26 Oct 2017 13:49:29 +0000 (09:49 -0400)]
reorder 'gcx and 'tcx in `BorrowckErrors` impl

6 years agomake `closure_self_ty` invokable with `'gcx` and `'tcx`
Niko Matsakis [Thu, 26 Oct 2017 13:49:04 +0000 (09:49 -0400)]
make `closure_self_ty` invokable with `'gcx` and `'tcx`

6 years agomake `MirSource::from_local_def_id` invokable with 'gcx and 'tcx
Niko Matsakis [Thu, 26 Oct 2017 13:48:33 +0000 (09:48 -0400)]
make `MirSource::from_local_def_id` invokable with 'gcx and 'tcx

6 years agomake nll separately invokable
Niko Matsakis [Thu, 26 Oct 2017 13:48:20 +0000 (09:48 -0400)]
make nll separately invokable

6 years agoadd basic region subtyping inference
Santiago Pastorino [Wed, 25 Oct 2017 22:04:57 +0000 (18:04 -0400)]
add basic region subtyping inference

6 years agoadd reborrow constraints
Santiago Pastorino [Wed, 25 Oct 2017 19:10:48 +0000 (15:10 -0400)]
add reborrow constraints

6 years agomake end-point optional in the borrow check
Niko Matsakis [Wed, 25 Oct 2017 18:17:17 +0000 (14:17 -0400)]
make end-point optional in the borrow check

6 years agofactor out NLL invocation interface
Niko Matsakis [Wed, 25 Oct 2017 16:09:01 +0000 (12:09 -0400)]
factor out NLL invocation interface

6 years agoupdate the format of liveness debug dumps to be more readable
Niko Matsakis [Wed, 25 Oct 2017 14:59:50 +0000 (10:59 -0400)]
update the format of liveness debug dumps to be more readable

6 years agoadd subregion between borrow region and resulting reference
Niko Matsakis [Tue, 24 Oct 2017 22:28:39 +0000 (18:28 -0400)]
add subregion between borrow region and resulting reference

6 years agopreliminary support for may-dangle attribute and drop constraints
Niko Matsakis [Tue, 24 Oct 2017 21:14:39 +0000 (17:14 -0400)]
preliminary support for may-dangle attribute and drop constraints

6 years agoextend liveness to distinguish "drop" and "non-drop" uses
Niko Matsakis [Tue, 24 Oct 2017 20:20:47 +0000 (16:20 -0400)]
extend liveness to distinguish "drop" and "non-drop" uses

6 years agoreorder liveness to bring the more significant code up top
Niko Matsakis [Tue, 24 Oct 2017 19:39:08 +0000 (15:39 -0400)]
reorder liveness to bring the more significant code up top

6 years agoavoid unnecessary copies in liveness computation
Niko Matsakis [Tue, 24 Oct 2017 19:37:47 +0000 (15:37 -0400)]
avoid unnecessary copies in liveness computation

6 years agointroduce liveness constraints into NLL code
Niko Matsakis [Tue, 24 Oct 2017 18:20:47 +0000 (14:20 -0400)]
introduce liveness constraints into NLL code

And do a bunch of gratuitious refactoring that I did not bother to
separate into nice commits.

6 years agoadd helper `for_each_free_region` that iterates over free regions
Niko Matsakis [Tue, 24 Oct 2017 18:20:32 +0000 (14:20 -0400)]
add helper `for_each_free_region` that iterates over free regions

6 years agoextend liveness to compute intrablock liveness and add unit tests
Niko Matsakis [Tue, 24 Oct 2017 17:32:00 +0000 (13:32 -0400)]
extend liveness to compute intrablock liveness and add unit tests

6 years agointroduce `apply` helper that applies a DefUse set to live bits
Niko Matsakis [Tue, 24 Oct 2017 15:57:22 +0000 (11:57 -0400)]
introduce `apply` helper that applies a DefUse set to live bits

6 years agoextend `dump_mir` to work for any tcx, not just global tcx
Niko Matsakis [Tue, 24 Oct 2017 15:55:03 +0000 (11:55 -0400)]
extend `dump_mir` to work for any tcx, not just global tcx

6 years agorename `BlockInfo` and `BlockInfoVisitor` to `DefsUses`
Niko Matsakis [Tue, 24 Oct 2017 15:31:03 +0000 (11:31 -0400)]
rename `BlockInfo` and `BlockInfoVisitor` to `DefsUses`

6 years agofactor out `pre_defs` field by going backwards
Niko Matsakis [Tue, 24 Oct 2017 15:28:25 +0000 (11:28 -0400)]
factor out `pre_defs` field by going backwards

6 years agoadd a test for the subtle case around calls
Niko Matsakis [Tue, 24 Oct 2017 15:06:58 +0000 (11:06 -0400)]
add a test for the subtle case around calls

6 years agoexecute liveness, write a simple test
Niko Matsakis [Tue, 24 Oct 2017 14:42:47 +0000 (10:42 -0400)]
execute liveness, write a simple test

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 agosave-analysis: support unions
Nick Cameron [Tue, 31 Oct 2017 05:24:48 +0000 (18:24 +1300)]
save-analysis: support unions

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 agotypeck: suggest use of match_default_bindings feature
Tamir Duberstein [Fri, 20 Oct 2017 12:59:55 +0000 (08:59 -0400)]
typeck: suggest use of match_default_bindings feature

Fixes #45383.
Updates #42640.

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