Commit Graph

78346 Commits

Author SHA1 Message Date
Matthew Jasper
27183a9030 Feature gate trivial bounds 2018-05-15 11:43:57 +01:00
Matthew Jasper
d0ec8ea1cc Implement RFC 2056 - trivial constraints 2018-05-15 11:37:33 +01:00
bors
eca0da5985 Auto merge of #50351 - varkor:vestigial-never-conversion, r=nikomatsakis
Remove vestigial diverging !-coercion

Such conversions are no longer permitted. Fixes #50350.

r? @nikomatsakis
2018-05-15 10:34:45 +00:00
Oliver Schneider
0370c38895
Don't inject clippy into the rls anymore 2018-05-15 11:34:24 +02:00
Nick Cameron
a10577ca53 save-analysis: handle aliasing imports a bit more nicely 2018-05-15 20:34:17 +12:00
bors
0b17da2d7b Auto merge of #50748 - steveklabnik:remove-simd-note, r=alexcrichton
Update stdsimd module

to include a19ca1cd91
2018-05-15 08:19:06 +00:00
bors
d5ecf70fd6 Auto merge of #50259 - GuillaumeGomez:improve-results, r=ollie27
Rustdoc improvements

Fixes #50658. (last commit)

A lot of small improvements.

r? @QuietMisdreavus
2018-05-15 05:39:35 +00:00
bors
d711dc9d57 Auto merge of #50011 - varkor:partialord-opt-ii, r=Manishearth
Ensure derive(PartialOrd) is no longer accidentally exponential

Previously, two comparison operations would be generated for each field, each of which could delegate to another derived PartialOrd. Now we use ordering and optional chaining to ensure each pair of fields is only compared once, addressing https://github.com/rust-lang/rust/issues/49650#issuecomment-379467572.

Closes #49505.

r? @Manishearth (sorry for changing it again so soon!)

Close #50755
2018-05-15 03:14:46 +00:00
bors
308b7b05c3 Auto merge of #50705 - oli-obk:clippy, r=kennytm
Update clippy

r? @Manishearth

@bors p=1
2018-05-15 00:35:47 +00:00
Vadim Petrochenkov
d1b027421e Turn deprecation lint legacy_imports into a hard error 2018-05-15 02:25:04 +03:00
John Paul Adrian Glaubitz
df2bbf7960 ci: Add Dockerfile for dist-sparc64-linux 2018-05-15 00:19:30 +02:00
bors
ac5c0848d3 Auto merge of #50693 - dlrobertson:fix_50493, r=petrochenkov
typeck: Save the index of private fields

Save the index of all fields regardless of their visibility. Problems
could occur later when attempting to index fields in error recovery if
they are not inserted.

Fixes: #50493
2018-05-14 20:46:09 +00:00
QuietMisdreavus
10ac995024 drop unnecessary "warning" from warning text 2018-05-14 15:34:52 -05:00
Taylor Cramer
a74e1686d9 Add implementation of Extend for () 2018-05-14 11:50:44 -07:00
bors
935a2f12b2 Auto merge of #50735 - eddyb:issue-50731, r=nikomatsakis
rustc: don't trip an assertion for enums with present but uninhabited variants.

Fixes #50731.

r? @nikomatsakis
2018-05-14 18:04:11 +00:00
QuietMisdreavus
bb6224bc84 add ui test for rustdoc's deprecated attributes 2018-05-14 12:38:27 -05:00
QuietMisdreavus
9415adcd8a deprecate #![doc(no_default_passes, passes, plugins)] 2018-05-14 12:38:27 -05:00
steveklabnik
647b1add7f Update stdsimd module to include a19ca1cd91 2018-05-14 12:32:04 -04:00
QuietMisdreavus
c3fd12ff4e tidy 2018-05-14 11:03:22 -05:00
QuietMisdreavus
6bc1db0255 replace error/warning println with structured diag 2018-05-14 11:03:22 -05:00
QuietMisdreavus
3566ea853a factor out rustdoc's error message handler 2018-05-14 11:03:22 -05:00
kennytm
2ccf71c3b2
Migrate the toolstate update bot to rust-highfive 2018-05-14 22:34:53 +08:00
Matt Kraai
120cd2cfd6
Uncapitalize "You" 2018-05-14 07:15:48 -07:00
Oliver Schneider
3a5b13ad36
Bump clippy 2018-05-14 16:11:57 +02:00
Nicholas Nethercote
f46b888f73 Remove LazyBTreeMap.
It was introduced in #50240 to avoid an allocation when creating a new
BTreeMap, which gave some speed-ups. But then #50352 made that the
default behaviour for BTreeMap, so LazyBTreeMap is no longer necessary.
2018-05-14 22:27:45 +10:00
bors
cb1ce7ddf8 Auto merge of #50385 - durka:stabilize-macro-lifetime, r=petrochenkov
stabilize macro_lifetime_matcher

This stabilizes `:lifetime` which has completed FCP in #34303.
2018-05-14 12:24:45 +00:00
gnzlbg
50c4506329 Switch Vec from doubling size on growth to using RawVec's reserve
On growth, Vec does not require to exactly double its size for correctness,
like, for example, VecDeque does.

Using reserve instead better expresses this intent. It also allows to reuse
Excess capacity on growth and for better growth-policies to be provided by
RawVec.
2018-05-14 13:58:28 +02:00
Tobias Bucher
6d1da82329 Don't unconditionally set CLOEXEC twice on every fd we open on Linux
Previously, every `open64` was accompanied by a `ioctl(…, FIOCLEX)`,
because some old Linux version would ignore the `O_CLOEXEC` flag we pass
to the `open64` function.

Now, we check whether the `CLOEXEC` flag is set on the first file we
open – if it is, we won't do extra syscalls for every opened file. If it
is not set, we fall back to the old behavior of unconditionally calling
`ioctl(…, FIOCLEX)` on newly opened files.

On old Linuxes, this amounts to one extra syscall per process, namely
the `fcntl(…, F_GETFD)` call to check the `CLOEXEC` flag.

On new Linuxes, this reduces the number of syscalls per opened file by
one, except for the first file, where it does the same number of
syscalls as before (`fcntl(…, F_GETFD)` to check the flag instead of
`ioctl(…, FIOCLEX)` to set it).
2018-05-14 13:20:39 +02:00
John-John Tedro
f73c4a4768 env: remove unwrap in examples in favor of try op 2018-05-14 12:56:18 +02:00
bors
7bfa20b8b0 Auto merge of #50648 - nox:volatile-store, r=eddyb
Fix volatile_store and nontemporal_store

Fixes #50371.
2018-05-14 10:00:41 +00:00
Eduard-Mihai Burtescu
29b4c7b9e0 rustc: don't trip an assertion for enums with present but uninhabited variants. 2018-05-14 12:23:12 +03:00
bors
8f39dbae8c Auto merge of #50703 - semarie:openbsd-libcompiler_builtins, r=alexcrichton
update libcompiler_builtins

let's OpenBSD to use libcompiler_rt.a from system library. it unbreaks
the build from source on OpenBSD.

see https://github.com/rust-lang-nursery/compiler-builtins/pull/241 for related PR

note this PR brings some other changes (on `floatdisf`/`floatundisf`) with compiler-builtins update.

r? @alexcrichton
2018-05-14 07:28:48 +00:00
Katrin Leinweber
703ecebe02
Hyperlink DOI against preferred resolver
https://www.doi.org/doi_handbook/3_Resolution.html#3.8
2018-05-14 07:17:56 +02:00
bors
76027ed2ad Auto merge of #50694 - leodasvacas:fix-impl-trait-self-substitution, r=petrochenkov
Fix self referential impl Trait substitutions

A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta.

There was a check for this which wasn't catching all cases, it was made more robust.

Fixes #49376
Fixes #50626

r? @petrochenkov
2018-05-14 04:56:56 +00:00
Nicholas Nethercote
e913d69211 Remove StringReader::col.
It only has a single use, within code handling indented block comments.
We can replace that with the new `FileMap::col_pos()`, which computes
the col position (BytePos instead of CharPos) based on the record of the
last newline char (which we already record).

This is actually an improvement, because
`trim_whitespace_prefix_and_push_line()` was using `col`, which is a
`CharPos`, as a slice index, which is a byte/char confusion.
2018-05-14 14:41:34 +10:00
bors
4468e3ea3e Auto merge of #50675 - csmoe:var_span, r=oli-obk
Reduce span highlighted code in unused_variables lint

Fixes #50472
- [X] reduce var span
- [ ] mark applicable

Before:
```
mut unused_mut_var
^^^^^^^^^^^^^^^^^^
```
After:
```
mut unused_mut_var
    ^^^^^^^^^^^^^^
```
2018-05-14 02:24:13 +00:00
Dan Robertson
cdd61396c9
typeck: Save the index of private fields
Save the index of all fields regardless of their visibility. Problems
could occur later when attempting to index fields in error recovery if
they are not inserted.
2018-05-14 01:28:15 +00:00
John-John Tedro
56f505e6c6 read2: Use inner function instead of closure 2018-05-14 03:23:32 +02:00
Nicholas Nethercote
444b770f4c Make nextnextch() more closely resemble nextch(). 2018-05-14 10:00:39 +10:00
Corey Farwell
2c4b152356 Add “Examples” section header in f32/f64 doc comments.
This is recommend by [RFC 0505] and as far as I know, the only primitive
types without this heading.

[RFC 0505]: c892139be6/text/0505-api-comment-conventions.md (using-markdown)
2018-05-13 15:54:40 -04:00
Alex Burka
e857c1b790 restore feature for stage0 2018-05-13 19:51:33 +00:00
Alex Burka
e6f7cf7e75 remove stray ui stderr 2018-05-13 19:51:32 +00:00
Alex Burka
394945ee36 stabilize :lifetime 2018-05-13 19:51:32 +00:00
Corey Farwell
61d1c14633 Fix incorrect statement about return value for Iterator::zip.
Fixes https://github.com/rust-lang/rust/issues/50225.
2018-05-13 15:45:33 -04:00
bors
9fae153746 Auto merge of #49835 - da-x:literal-fragment-pr, r=petrochenkov
Macros: Add a 'literal' fragment specifier

See: https://github.com/rust-lang/rust/issues/35625

```rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```

ToDo:

* [x] Feature gate
* [x] Basic tests
* [x] Tests for range patterns
* [x] Tests for attributes
* [x] Documentation
* [x] Fix for `true`/`false`
* [x] Fix for negative number literals
2018-05-13 17:07:38 +00:00
John Kåre Alsaker
41a032db90 Fix conversion from Miri Value to ConstValue 2018-05-13 19:03:49 +02:00
Dan Aloni
37ed2ab910 Macros: Add a 'literal' fragment specifier
Implements RFC 1576.

See: https://github.com/rust-lang/rfcs/blob/master/text/1576-macros-literal-matcher.md

Changes are mostly in libsyntax, docs, and tests. Feature gate is
enabled for 1.27.0.

Many thanks to Vadim Petrochenkov for following through code reviews
and suggestions.

Example:

````rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```
2018-05-13 19:17:02 +03:00
leonardo.yvens
87890561f3 Improve eager type resolution error message
This PR improves the span of eager resolution type errors referring to indexing and field access to use the base span rather than the whole expression.

Also a note "Type must be known at this point." is added to where we at some point in the past emitted the "type must be known at this context" error, so that early failures can be differentiated and will hopefully be less surprising.

Fixes #50692 (or at least does the best we can for the moment)

r? @estebank
2018-05-13 13:02:34 -03:00
csmoe
c4e99dd85d Revert "mark applicability"
This reverts commit a880971128.
2018-05-13 22:56:37 +08:00
csmoe
a880971128 mark applicability 2018-05-13 21:10:15 +08:00