]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoincr.comp.: Always verify incr. comp. hashes when running incremental tests.
Michael Woerister [Wed, 8 Nov 2017 10:33:06 +0000 (11:33 +0100)]
incr.comp.: Always verify incr. comp. hashes when running incremental tests.

6 years agoincr.comp.: Adapt nested_items test to new HIR hashing rules.
Michael Woerister [Wed, 8 Nov 2017 10:32:16 +0000 (11:32 +0100)]
incr.comp.: Adapt nested_items test to new HIR hashing rules.

6 years agoincr.comp.: Add some missing reads in HIR map.
Michael Woerister [Wed, 8 Nov 2017 10:31:15 +0000 (11:31 +0100)]
incr.comp.: Add some missing reads in HIR map.

6 years agoincr.comp.: Make DefSpan an input dep-node so it is not affected by the existing...
Michael Woerister [Wed, 8 Nov 2017 10:30:14 +0000 (11:30 +0100)]
incr.comp.: Make DefSpan an input dep-node so it is not affected by the existing Span/HIR hashing hack.

6 years agolook for the note on the guarantor, not the root cmt
Niko Matsakis [Wed, 8 Nov 2017 09:46:44 +0000 (04:46 -0500)]
look for the note on the guarantor, not the root cmt

This was causing upvar inference to fail for all cases where the move
was from a projection, not the root variable.

6 years agoDisable `mmap` in `libbacktrace` on Apple platforms
John Colanduoni [Wed, 8 Nov 2017 10:28:17 +0000 (02:28 -0800)]
Disable `mmap`  in `libbacktrace` on Apple platforms

Fixes #45731

libbacktrace uses mmap if available to map ranges of the files containing debug information. On macOS `mmap` will succeed even if the mapped range does not exist, and a SIGBUS (with an unusual EXC_BAD_ACCESS code 10) will occur when the program attempts to page in the memory. To combat this we force `libbacktrace` to be built with the simple `read` based fallback on Apple platforms.

6 years agomove ExplicitSelf to rustc::ty::util, and use it to implement object safety checks
Michael Hewson [Wed, 8 Nov 2017 10:27:39 +0000 (05:27 -0500)]
move ExplicitSelf to rustc::ty::util, and use it to implement object safety checks

6 years agoUpdate fastcall-inreg codegen test so that functions actually get instantiated.
Michael Woerister [Wed, 8 Nov 2017 10:09:48 +0000 (11:09 +0100)]
Update fastcall-inreg codegen test so that functions actually get instantiated.

6 years agoAuto merge of #45862 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Wed, 8 Nov 2017 09:43:27 +0000 (09:43 +0000)]
Auto merge of #45862 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 4 pull requests

- Successful merges: #45582, #45766, #45830, #45849
- Failed merges:

6 years agouse the derived Debug rather than our custom written ones
Niko Matsakis [Wed, 8 Nov 2017 09:43:13 +0000 (04:43 -0500)]
use the derived Debug rather than our custom written ones

That encoding that the custom Debugs was using is rather inscrutable,
and incomplete.

6 years agomodify ExplicitSelf::determine to take an `is_self_type` predicate closure, instead...
Michael Hewson [Wed, 8 Nov 2017 09:31:48 +0000 (04:31 -0500)]
modify ExplicitSelf::determine to take an `is_self_type` predicate closure, instead of infcx

6 years agoAdd `Option::filter()` according to RFC 2124
Lukas Kalbertodt [Tue, 3 Oct 2017 10:27:42 +0000 (12:27 +0200)]
Add `Option::filter()` according to RFC 2124

6 years agoRollup merge of #45849 - GuillaumeGomez:more-shortcut, r=QuietMisdreavus
Guillaume Gomez [Wed, 8 Nov 2017 09:09:18 +0000 (10:09 +0100)]
Rollup merge of #45849 - GuillaumeGomez:more-shortcut, r=QuietMisdreavus

Add "-" shortcut

Fixes #45847.

r? @Havvy

6 years agoRollup merge of #45830 - pornel:dosglobs, r=dtolnay
Guillaume Gomez [Wed, 8 Nov 2017 09:09:17 +0000 (10:09 +0100)]
Rollup merge of #45830 - pornel:dosglobs, r=dtolnay

Warn about lack of args glob expansion in Windows shell

Because all shells on Linux/macOS expand globs, and even MinGW on Windows emulates this behavior, it's easy to forget that Windows by itself doesn't support glob expansion. This PR documents this cross-platform difference.

6 years agoRollup merge of #45766 - GuillaumeGomez:trait-methods-list, r=QuietMisdreavus
Guillaume Gomez [Wed, 8 Nov 2017 09:09:16 +0000 (10:09 +0100)]
Rollup merge of #45766 - GuillaumeGomez:trait-methods-list, r=QuietMisdreavus

Add more elements in the sidebar

Fixes #45740.

r? @rust-lang/docs

6 years agoRollup merge of #45582 - GuillaumeGomez:doc-unix-missing-links, r=frewsxcv
Guillaume Gomez [Wed, 8 Nov 2017 09:09:15 +0000 (10:09 +0100)]
Rollup merge of #45582 - GuillaumeGomez:doc-unix-missing-links, r=frewsxcv

Add missing links and examples

r? @rust-lang/docs

6 years agoAuto merge of #45735 - tirr-c:issue-45730, r=arielb1
bors [Wed, 8 Nov 2017 07:12:15 +0000 (07:12 +0000)]
Auto merge of #45735 - tirr-c:issue-45730, r=arielb1

Forbid casting to/from a pointer of unknown kind

Fixes #45730.

Before, it ICE'd when `pointer_kind` encountered `TyInfer`.

6 years agoAuto merge of #45379 - cuviper:unit_from_iter, r=alexcrichton
bors [Wed, 8 Nov 2017 01:32:12 +0000 (01:32 +0000)]
Auto merge of #45379 - cuviper:unit_from_iter, r=alexcrichton

impl FromIterator<()> for ()

This just collapses all unit items from an iterator into one.  This is
more useful when combined with higher-level abstractions, like
collecting to a `Result<(), E>` where you only care about errors:

```rust
use std::io::*;
data = vec![1, 2, 3, 4, 5];
let res: Result<()> = data.iter()
    .map(|x| writeln!(stdout(), "{}", x))
    .collect();
assert!(res.is_ok());
```

6 years agoAdd more elements in the sidebar
Guillaume Gomez [Sat, 4 Nov 2017 19:45:12 +0000 (20:45 +0100)]
Add more elements in the sidebar

6 years agoAdd "-" shortcut
Guillaume Gomez [Tue, 7 Nov 2017 21:44:18 +0000 (22:44 +0100)]
Add "-" shortcut

6 years agosave-analysis: run rustfmt
Nick Cameron [Tue, 7 Nov 2017 21:43:05 +0000 (10:43 +1300)]
save-analysis: run rustfmt

6 years agosave-analysis: fix bug with method ids
Nick Cameron [Tue, 7 Nov 2017 21:08:19 +0000 (10:08 +1300)]
save-analysis: fix bug with method ids

This just handles a missing entry, doesn't try to recover, because I couldn't actually find a test case.

cc https://github.com/rust-lang-nursery/rls/issues/558

6 years agoAuto merge of #44932 - cuviper:unsized-ptr-is_null, r=alexcrichton
bors [Tue, 7 Nov 2017 20:55:01 +0000 (20:55 +0000)]
Auto merge of #44932 - cuviper:unsized-ptr-is_null, r=alexcrichton

Remove `T: Sized` on pointer `as_ref()` and `as_mut()`

`NonZero::is_zero()` was already casting all pointers to thin `*mut u8` to check for null.  The same test on unsized fat pointers can also be used with `as_ref()` and `as_mut()` to get fat references.

(This PR formerly changed `is_null()` too, but checking just the data pointer is not obviously correct for trait objects, especially if `*const self` sorts of methods are ever allowed.)

6 years agosave-analysis: fix regression from #45709
Nick Cameron [Tue, 7 Nov 2017 20:46:06 +0000 (09:46 +1300)]
save-analysis: fix regression from #45709

closes https://github.com/nrc/rls-analysis/issues/117

6 years agoAdd missing links and examples
Guillaume Gomez [Fri, 27 Oct 2017 20:01:50 +0000 (22:01 +0200)]
Add missing links and examples

6 years agowrap error code in DiagnosticId::Error so it compiles
Michael Hewson [Tue, 7 Nov 2017 19:32:59 +0000 (14:32 -0500)]
wrap error code in DiagnosticId::Error so it compiles

6 years agoClean up
Robin Kruppe [Sat, 28 Oct 2017 14:43:08 +0000 (16:43 +0200)]
Clean up

6 years agoImplement more efficient saturation
Robin Kruppe [Tue, 17 Oct 2017 14:42:10 +0000 (16:42 +0200)]
Implement more efficient saturation

6 years agoMake trans const eval error on overflow and NaN, matching HIR const eval.
Robin Kruppe [Sun, 15 Oct 2017 20:28:49 +0000 (22:28 +0200)]
Make trans const eval error on overflow and NaN, matching  HIR const eval.

6 years agoExtract (f32::MAX + 0.5 ULP) constant
Robin Kruppe [Sun, 15 Oct 2017 19:37:09 +0000 (21:37 +0200)]
Extract (f32::MAX + 0.5 ULP) constant

6 years agoFix bug in rustc_apfloat
Robin Kruppe [Sun, 15 Oct 2017 18:10:42 +0000 (20:10 +0200)]
Fix bug in rustc_apfloat

6 years agoSaturating casts between integers and floats (both directions).
Robin Kruppe [Mon, 9 Oct 2017 00:14:00 +0000 (02:14 +0200)]
Saturating casts between integers and floats (both directions).

This affects regular code generation as well as constant evaluation in trans,
but not the HIR constant evaluator because that one returns an error for
overflowing casts and NaN-to-int casts. That error is conservatively
correct and we should be careful to not accept more code in constant
expressions.
The changes to code generation are guarded by a new -Z flag, to be able
to evaluate the performance impact. The trans constant evaluation changes
are unconditional because they have no run time impact and don't affect
type checking either.

6 years agoUpdate/improve documentation of ExpliciSelf
Michael Hewson [Tue, 7 Nov 2017 10:33:54 +0000 (05:33 -0500)]
Update/improve documentation of ExpliciSelf

6 years agoAdd arbitrary_self_types feature gate error to some tests
Michael Hewson [Tue, 7 Nov 2017 10:16:24 +0000 (05:16 -0500)]
Add arbitrary_self_types feature gate error to some tests

6 years agoget the old error messages back
Michael Hewson [Mon, 6 Nov 2017 18:38:54 +0000 (13:38 -0500)]
get the old error messages back
- added some old code that used ExplicitSelf::determine to check for eqtype with the expected self type in the simple cases
- this fixes problems with error messages being worse in those cases, which caused some compile-fail tests to fail

6 years agoFix some of the tests
Michael Hewson [Sun, 5 Nov 2017 19:56:53 +0000 (14:56 -0500)]
Fix some of the tests

- removed the inherent impls compile-fail test, because we’ll be
supporting them
- remove E0308-2 because it’s gonna be supported now (behind a feature
gate)
- replaced the mismatched method receiver error message with something
better, so fixed the tests that that broke

6 years agoImprove feature gate error, and return after emitting errors instead of looping forever
Michael Hewson [Sun, 5 Nov 2017 19:53:31 +0000 (14:53 -0500)]
Improve feature gate error, and return after emitting errors instead of looping forever

6 years agoFix the lifetime error in ExplicitSelf
Michael Hewson [Sun, 5 Nov 2017 14:25:36 +0000 (09:25 -0500)]
Fix the lifetime error in ExplicitSelf

Had to take the infer context as a parameter instead of the type
context, so that the function can be called during inference

6 years agoRewrote check_method_receiver and ExplicitSelf, got a borrow checker error
Michael Hewson [Sun, 5 Nov 2017 11:43:29 +0000 (06:43 -0500)]
Rewrote check_method_receiver and ExplicitSelf, got a borrow checker error

Rewrote ExplicitSelf, adding a new `Other` variant for arbitrary self
types. It’s a bit more sophisticated now, and checks for type equality,
so you have to pass the type context and param env as arguments.
There’s a borrow-checker error here that I have to fix

Rewrote check_method_receiver, so it acts as if arbitrary self types
are allowed, and then checks for ExplicitSelf::Other at the end and
disallows it unless the feature is present.

6 years agoinitial implementation of arbitrary_self_types
Michael Hewson [Thu, 2 Nov 2017 11:58:21 +0000 (07:58 -0400)]
initial implementation of arbitrary_self_types

If the feature is enabled, allow method `self` types to be any type
that auto-derefs to `self`.
- Currently, this supports inherent methods as well as trait methods.
The plan AFAIK is to only allow this for trait methods, so I guess it
won’t stay this way
- Dynamic dispatch isn’t implemented yet, so the compiler will ICE if
you define a trait method that takes `self: Rc<Self>` and try to call
it on an `Rc<Trait>`. I will probably just make those methods
non-object-safe initially.

6 years agoadd tests for the arbitrary_self_types, which won't pass yet
Michael Hewson [Fri, 20 Oct 2017 06:42:47 +0000 (02:42 -0400)]
add tests for the arbitrary_self_types, which won't pass yet

6 years agoAuto merge of #45822 - kennytm:rollup, r=kennytm
bors [Tue, 7 Nov 2017 18:04:33 +0000 (18:04 +0000)]
Auto merge of #45822 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

- Successful merges: #45470, #45588, #45682, #45714, #45751, #45764, #45778, #45782, #45784
- Failed merges:

6 years agoWarn about non-portability of glob patterns
Kornel [Tue, 7 Nov 2017 12:17:04 +0000 (12:17 +0000)]
Warn about non-portability of glob patterns

6 years agoAlways treat #[rustc_std_internal_symbol]s as root TransItems.
Michael Woerister [Tue, 7 Nov 2017 15:41:42 +0000 (16:41 +0100)]
Always treat #[rustc_std_internal_symbol]s as root TransItems.

6 years agoincr.comp.: Acknowledge the fact that shift operations can panic at runtime.
Michael Woerister [Tue, 7 Nov 2017 14:49:51 +0000 (15:49 +0100)]
incr.comp.: Acknowledge the fact that shift operations can panic at runtime.

6 years agoRollup merge of #45784 - harpocrates:fix/print-parens-cast-lt, r=kennytm
kennytm [Tue, 7 Nov 2017 07:52:15 +0000 (15:52 +0800)]
Rollup merge of #45784 - harpocrates:fix/print-parens-cast-lt, r=kennytm

Pretty print parens around casts on the LHS of `<`/`<<`

When pretty printing a cast expression occuring on the LHS of a `<` or `<<` expression, we should add parens around the cast. Otherwise, the `<`/`<<` gets interpreted as the beginning of the generics for the type on the RHS of the cast.

Consider:

    $ cat parens_cast.rs
    macro_rules! negative {
        ($e:expr) => { $e < 0 }
    }

    fn main() {
        negative!(1 as i32);
    }

Before this PR, the output of the following is not valid Rust:

    $ rustc -Z unstable-options --pretty=expanded parens_cast.rs
    #![feature(prelude_import)]
    #![no_std]
    #[prelude_import]
    use std::prelude::v1::*;
    #[macro_use]
    extern crate std as std;
    macro_rules! negative(( $ e : expr ) => { $ e < 0 });

    fn main() { 1 as i32 < 0; }

After this PR, the output of the following is valid Rust:

    $ rustc -Z unstable-options --pretty=expanded parens_cast.rs
    #![feature(prelude_import)]
    #![no_std]
    #[prelude_import]
    use std::prelude::v1::*;
    #[macro_use]
    extern crate std as std;
    macro_rules! negative(( $ e : expr ) => { $ e < 0 });

    fn main() { (1 as i32) < 0; }

I've gone through several README/wiki style documents but I'm still not sure where to test this though. I'm not even sure if this sort of thing is tested...

6 years agoRollup merge of #45782 - frewsxcv:frewsxcv-shorthands-helpers, r=manishearth
kennytm [Tue, 7 Nov 2017 07:52:14 +0000 (15:52 +0800)]
Rollup merge of #45782 - frewsxcv:frewsxcv-shorthands-helpers, r=manishearth

Display all emission types in error msg if user inputs invalid option.

before:

```
> rustc --emit foo
error: unknown emission type: `foo`
```

after:

```
> rustc --emit foo
error: unknown emission type: `foo` - expected one of: `llvm-bc`, `asm`, `llvm-ir`, `mir`, `obj`, `metadata`, `link`, `dep-info`
```

6 years agoRollup merge of #45778 - Havvy:patch-1, r=steveklabnik
kennytm [Tue, 7 Nov 2017 07:52:13 +0000 (15:52 +0800)]
Rollup merge of #45778 - Havvy:patch-1, r=steveklabnik

Update reference link in doc's 404

It's currently linking to a page that says it's on the page I'm changing the link too.

6 years agoRollup merge of #45764 - QuietMisdreavus:rustdoc-doctest-lints, r=GuillaumeGomez
kennytm [Tue, 7 Nov 2017 07:52:12 +0000 (15:52 +0800)]
Rollup merge of #45764 - QuietMisdreavus:rustdoc-doctest-lints, r=GuillaumeGomez

rustdoc: add #[allow(unused)] to every doctest

More information in #45750 - this is behavior that was documented but not actually implemented.

I also reordered how outer attributes are applied to doctests. Previously, attributes from `#![doc(test(attr(...)))]` would be applied *after* attributes from within the test itself, meaning if a doctest tried to override lints that would be set crate-wide, it wouldn't work at all. This gives a better scope of how lints can be applied.

Closes #45750

6 years agoRollup merge of #45751 - estebank:issue-44684, r=nikomatsakis
kennytm [Tue, 7 Nov 2017 07:52:11 +0000 (15:52 +0800)]
Rollup merge of #45751 - estebank:issue-44684, r=nikomatsakis

Handle anon lifetime arg being returned with named lifetime return type

When there's a lifetime mismatch between an argument with an anonymous
lifetime being returned in a method with a return type that has a named
lifetime, show specialized lifetime error pointing at argument with a
hint to give it an explicit lifetime matching the return type.

```
error[E0621]: explicit lifetime required in the type of `other`
  --> file2.rs:21:21
   |
17 |     fn bar(&self, other: Foo) -> Foo<'a> {
   |                   ----- consider changing the type of `other` to `Foo<'a>`
...
21 |                     other
   |                     ^^^^^ lifetime `'a` required
```

Follow up to #44124 and #42669. Fix #44684.

6 years agoRollup merge of #45714 - sdroege:thread-panic-docs, r=dtolnay
kennytm [Tue, 7 Nov 2017 07:52:11 +0000 (15:52 +0800)]
Rollup merge of #45714 - sdroege:thread-panic-docs, r=dtolnay

Update the std::thread docs and clarify that panics can nowadays be caught

6 years agoRollup merge of #45682 - RalfJung:rwlock-guards, r=alexcrichton
kennytm [Tue, 7 Nov 2017 07:52:10 +0000 (15:52 +0800)]
Rollup merge of #45682 - RalfJung:rwlock-guards, r=alexcrichton

RwLock guards are Sync if T is

Currently, the compiler requires `T` to also be `Send`.  There is no reason for
that.  `&Rw{Read,Write}LockGuard` only provides a shared referenced to `T`, sending
that across threads is safe if `T` is `Sync`.

Cc @oconnor663

6 years agoRollup merge of #45588 - Keruspe:master, r=alexcrichton
kennytm [Tue, 7 Nov 2017 07:52:09 +0000 (15:52 +0800)]
Rollup merge of #45588 - Keruspe:master, r=alexcrichton

rustbuild: don't try to install rls if ToolState is not Testing

We already do that for the Dist Step so we would end up trying to install something that we didn't dist.

6 years agoRollup merge of #45470 - GuillaumeGomez:unix-metadata-ext, r=QuietMisdreavus
kennytm [Tue, 7 Nov 2017 07:52:08 +0000 (15:52 +0800)]
Rollup merge of #45470 - GuillaumeGomez:unix-metadata-ext, r=QuietMisdreavus

add missing docs for MetadataExt

r? @rust-lang/docs

6 years agoAuto merge of #45666 - Amanieu:tls-model, r=alexcrichton
bors [Tue, 7 Nov 2017 14:24:15 +0000 (14:24 +0000)]
Auto merge of #45666 - Amanieu:tls-model, r=alexcrichton

Allow overriding the TLS model

This PR adds the ability to override the default "global-dynamic" TLS model with a more specific one through a target json option or a command-line option. This allows for better code generation in certain situations.

This is similar to the `-ftls-model=` option in GCC and Clang.

6 years agoincr.comp.: Add -Zincremental-verify-ich, which allows to perform a consistency check...
Michael Woerister [Tue, 7 Nov 2017 14:22:29 +0000 (15:22 +0100)]
incr.comp.: Add -Zincremental-verify-ich, which allows to perform a consistency check for stored query result fingerprints.

6 years agoincr.comp.: Don't filter out StmtDecls from hir::Block during hashing as these make...
Michael Woerister [Tue, 7 Nov 2017 14:18:00 +0000 (15:18 +0100)]
incr.comp.: Don't filter out StmtDecls from hir::Block during hashing as these make a difference for the RegionScopeTree.

6 years agoincr.comp.: Sort exported symbols list in order to achieve stable incr. comp. hash.
Michael Woerister [Tue, 7 Nov 2017 14:15:45 +0000 (15:15 +0100)]
incr.comp.: Sort exported symbols list in order to achieve stable incr. comp. hash.

6 years agoincr.comp.: Always require Session when decoding Spans (as to avoid silently wrong...
Michael Woerister [Tue, 7 Nov 2017 14:14:32 +0000 (15:14 +0100)]
incr.comp.: Always require Session when decoding Spans (as to avoid silently wrong results).

6 years agoincr.comp.: Make assertion in try_mark_green() more targeted.
Michael Woerister [Tue, 7 Nov 2017 14:04:10 +0000 (15:04 +0100)]
incr.comp.: Make assertion in try_mark_green() more targeted.

6 years agoincr.comp.: Mark more input nodes as inputs.
Michael Woerister [Tue, 7 Nov 2017 13:54:07 +0000 (14:54 +0100)]
incr.comp.: Mark more input nodes as inputs.

6 years agoincr.comp.: Allow for forcing input nodes lazily.
Michael Woerister [Tue, 7 Nov 2017 13:53:21 +0000 (14:53 +0100)]
incr.comp.: Allow for forcing input nodes lazily.

6 years agoRemove `send` lang item.
leonardo.yvens [Tue, 7 Nov 2017 12:39:17 +0000 (10:39 -0200)]
Remove `send` lang item.

It's completely unused.

6 years agoFix some rebasing fallout.
Michael Woerister [Mon, 6 Nov 2017 09:35:52 +0000 (10:35 +0100)]
Fix some rebasing fallout.

6 years agoDon't duplicate logic of when an Instance requests to be inlined.
Michael Woerister [Mon, 30 Oct 2017 17:49:56 +0000 (18:49 +0100)]
Don't duplicate logic of when an Instance requests to be inlined.

6 years agoUpdate run-make tests.
Michael Woerister [Mon, 30 Oct 2017 17:21:06 +0000 (18:21 +0100)]
Update run-make tests.

6 years agoUpdate mir-opt tests.
Michael Woerister [Mon, 30 Oct 2017 17:20:07 +0000 (18:20 +0100)]
Update mir-opt tests.

6 years agoUpdate compile-fail tests.
Michael Woerister [Mon, 30 Oct 2017 17:19:31 +0000 (18:19 +0100)]
Update compile-fail tests.

6 years agoUpdate codegen tests.
Michael Woerister [Mon, 30 Oct 2017 17:18:00 +0000 (18:18 +0100)]
Update codegen tests.

6 years agoFix incremental tests after change to instantiation strategy.
Michael Woerister [Fri, 27 Oct 2017 16:57:15 +0000 (18:57 +0200)]
Fix incremental tests after change to instantiation strategy.

6 years agoincr.comp.: Improve error message for unknown fingerprint.
Michael Woerister [Fri, 27 Oct 2017 16:56:29 +0000 (18:56 +0200)]
incr.comp.: Improve error message for unknown fingerprint.

6 years agoUpdate invalid inline arg test.
Michael Woerister [Fri, 27 Oct 2017 14:15:23 +0000 (16:15 +0200)]
Update invalid inline arg test.

6 years agoAdd regression tests for non-instantiation of inline and const fns.
Michael Woerister [Fri, 27 Oct 2017 12:32:26 +0000 (14:32 +0200)]
Add regression tests for non-instantiation of inline and const fns.

6 years agoUpdate codegen-unit tests.
Michael Woerister [Fri, 27 Oct 2017 12:31:18 +0000 (14:31 +0200)]
Update codegen-unit tests.

6 years agoFix translation item collection for inline and const fns.
Michael Woerister [Fri, 27 Oct 2017 12:30:34 +0000 (14:30 +0200)]
Fix translation item collection for inline and const fns.

6 years agoAuto merge of #45620 - ollie27:rustdoc_impl_generic_dupe, r=QuietMisdreavus
bors [Tue, 7 Nov 2017 07:24:13 +0000 (07:24 +0000)]
Auto merge of #45620 - ollie27:rustdoc_impl_generic_dupe, r=QuietMisdreavus

rustdoc: Fix duplicated impls with generics

The same type can appear multiple times in impls so we need to use a set
to avoid adding it multiple times.

Fixes: #45584
6 years agoUpdate comments in cast-lt.pp
Alec Theriault [Tue, 7 Nov 2017 06:18:14 +0000 (22:18 -0800)]
Update comments in cast-lt.pp

6 years agoreview comments
Esteban Küber [Tue, 7 Nov 2017 05:02:31 +0000 (21:02 -0800)]
review comments

6 years agoAuto merge of #45571 - zackmdavis:regenerate_char_private, r=alexcrichton
bors [Tue, 7 Nov 2017 02:07:34 +0000 (02:07 +0000)]
Auto merge of #45571 - zackmdavis:regenerate_char_private, r=alexcrichton

regenerate libcore/char_private.rs

(filed separately from the work in #45569, because of this matter of the updated Unicode data; see also #45567)

char_private.rs is generated programmatically by char_private.py, using data retrieved from the Unicode Consortium's website.

The motivation here was to make `is_printable` crate-visible (with `pub(crate)`), but it would seem that the Unicode data has changed slightly since char_private.rs was last generated.

6 years agoDisplay all emission types in error msg if user inputs invalid option.
Corey Farwell [Sun, 5 Nov 2017 14:20:59 +0000 (09:20 -0500)]
Display all emission types in error msg if user inputs invalid option.

before:

```
> rustc --emit foo
error: unknown emission type: `foo`
```

after:

```
> rustc --emit foo
error: unknown emission type: `foo` - expected one of: `llvm-bc`, `asm`, `llvm-ir`, `mir`, `obj`, `metadata`, `link`, `dep-info`
```

6 years agoAuto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1
bors [Mon, 6 Nov 2017 23:30:57 +0000 (23:30 +0000)]
Auto merge of #45668 - nikomatsakis:nll-free-region, r=arielb1

extend NLL with preliminary support for free regions on functions

This PR extends https://github.com/rust-lang/rust/pull/45538 with support for free regions. This is pretty preliminary and will no doubt want to change in various ways, particularly as we add support for closures, but it's enough to get the basic idea in place:

- We now create specific regions to represent each named lifetime declared on the function.
- Region values can contain references to these regions (represented for now as a `BTreeSet<RegionIndex>`).
- If we wind up trying to infer that `'a: 'b` must hold, but no such relationship was declared, we report an error.

It also does a number of drive-by refactorings.

r? @arielb1

cc @spastorino

6 years agoFix navbar click while in a search
Guillaume Gomez [Mon, 6 Nov 2017 20:14:37 +0000 (21:14 +0100)]
Fix navbar click while in a search

6 years agocollect unused unsafe code
Ariel Ben-Yehuda [Sun, 5 Nov 2017 18:04:18 +0000 (20:04 +0200)]
collect unused unsafe code

FIXME: de-uglify

6 years agorun unsafety checking before dead block collection
Ariel Ben-Yehuda [Sun, 5 Nov 2017 16:09:39 +0000 (18:09 +0200)]
run unsafety checking before dead block collection

Fixes #45087.

6 years agoMove tls-model to a -Z option since it is unstable
Amanieu d'Antras [Mon, 6 Nov 2017 21:10:49 +0000 (21:10 +0000)]
Move tls-model to a -Z option since it is unstable

6 years agoAuto merge of #45811 - DSpeckhals:update-rustfmt-rls, r=nikomatsakis
bors [Mon, 6 Nov 2017 20:43:46 +0000 (20:43 +0000)]
Auto merge of #45811 - DSpeckhals:update-rustfmt-rls, r=nikomatsakis

tools: Fix rustfmt and the RLS

These tools have been corrected in their upstream repo's, and the submodules have been updated here to reflect that. I also had to update Cargo to match what the RLS is expecting.

The tool states for `rustfmt` and `rls` where both changed from "Broken" to "Testing" in this commit, thus enabling testing and distribution again.

6 years agoTest error for `...` in expressions
Badel2 [Mon, 6 Nov 2017 12:04:54 +0000 (13:04 +0100)]
Test error for `...` in expressions

6 years agoUsing `...` in expressions is now an error
Badel2 [Sat, 4 Nov 2017 23:46:41 +0000 (00:46 +0100)]
Using `...` in expressions is now an error

6 years agoAuto merge of #45322 - infinity0:master, r=alexcrichton
bors [Mon, 6 Nov 2017 18:04:13 +0000 (18:04 +0000)]
Auto merge of #45322 - infinity0:master, r=alexcrichton

When cross-compiling, also build target-arch tarballs for libstd. (Closes: #42320)

Half of the logic is actually in there already in install.rs:install_std but it fails with an error like:

sh: 0: Can't open /<<BUILDDIR>>/rustc-1.21.0+dfsg1/build/tmp/dist/rust-std-1.21.0-powerpc64le-unknown-linux-gnu/install.sh

because the target-arch dist tarball wasn't built as well. This commit fixes that so the overall install works.

There is one minor bug in the existing code which this commit doesn't fix - the install.log from multiple runs of the installer gets clobbered, which seems like it might interfere with the uninstall process (I didn't look very deeply into this, because it doesn't affect what I need to do.) The actual installed files under DESTDIR seem fine though - either they are installed under an arch-specific path, or the multiple runs will clobber the same path with the same arch-independent file.

6 years agotools: Fix rustfmt and the RLS
Dustin Speckhals [Mon, 6 Nov 2017 17:59:33 +0000 (12:59 -0500)]
tools: Fix rustfmt and the RLS

These tools have been corrected in their upstream repo's, and the
submodules have been updated here to reflect that. I also had to update
Cargo to match what the RLS is expecting.

The tool states for `rustfmt` and `rls` where both changed from "Broken"
to "Testing" in this commit, thus enabling testing and distribution
again.

6 years agoForbid casting to/from a pointer of unknown kind
Wonwoo Choi [Fri, 3 Nov 2017 07:58:01 +0000 (16:58 +0900)]
Forbid casting to/from a pointer of unknown kind

6 years agoUpdate tests for new format! error message
Tommy Ip [Mon, 6 Nov 2017 14:20:31 +0000 (14:20 +0000)]
Update tests for new format! error message

6 years agoAdd tests for new format! error message
Tommy Ip [Mon, 6 Nov 2017 14:20:15 +0000 (14:20 +0000)]
Add tests for new format! error message

6 years agoMake format! positional argument errors clear
Tommy Ip [Mon, 6 Nov 2017 08:49:47 +0000 (08:49 +0000)]
Make format! positional argument errors clear

6 years agorustbuild: Re-enable ThinLTO for MIPS
Alex Crichton [Mon, 6 Nov 2017 14:59:19 +0000 (06:59 -0800)]
rustbuild: Re-enable ThinLTO for MIPS

Now that the upstream LLVM bug is now fixed this commit cherry-picks the commit
onto our LLVM and then re-enables the ThinLTO paths for MIPS.

Closes #45654

6 years agoAuto merge of #45369 - fintelia:patch-1, r=BurntSushi
bors [Mon, 6 Nov 2017 15:19:48 +0000 (15:19 +0000)]
Auto merge of #45369 - fintelia:patch-1, r=BurntSushi

Implement is_empty() for BufReader

Simple implementation of `is_empty` method for BufReader so it is possible to tell whether there is any data in its buffer.

I didn't know correct stability annotation to place on the function. Presumably there is no reason to place this feature behind a feature flag, but I wasn't sure how to tag it as an unstable feature without that.

CC: #45323
6 years ago[intrinsics] add div and rem vector tests
gnzlbg [Mon, 6 Nov 2017 12:37:26 +0000 (13:37 +0100)]
[intrinsics] add div and rem vector tests

6 years agofix unsafety checking for generators
Ariel Ben-Yehuda [Sun, 5 Nov 2017 14:48:22 +0000 (16:48 +0200)]
fix unsafety checking for generators

Fixes #45729

6 years agoInclusive range updated to `..=` syntax
Badel2 [Fri, 3 Nov 2017 17:17:44 +0000 (18:17 +0100)]
Inclusive range updated to `..=` syntax

6 years agoAuto merge of #45737 - oli-obk:json, r=petrochenkov
bors [Mon, 6 Nov 2017 12:18:12 +0000 (12:18 +0000)]
Auto merge of #45737 - oli-obk:json, r=petrochenkov

Pretty print json in ui tests

I found the json output in one line to not be useful for reviewing

r? @petrochenkov