Commit Graph

78008 Commits

Author SHA1 Message Date
varkor 365c8c3704 Remove GenericParamDef::to_type 2018-05-15 14:21:32 +01:00
varkor 007de2f896 Lift pure_wrt_drop to GenericParamDef 2018-05-15 14:21:32 +01:00
varkor 9200bdee26 Refactor generic params loops 2018-05-15 14:21:32 +01:00
varkor 18f77e25e9 Fix rebase fallout 2018-05-15 14:21:32 +01:00
varkor 9f9d4beda6 Rename RegionParamDef to LifetimeParamDef 2018-05-15 14:21:32 +01:00
varkor 4bed895cab Pull common parameters into GenericParamDef
This leads to a lot of simplifications, as most code doesn't actually need to know about the specific lifetime/type data; rather, it's concerned with properties like name, index and def_id.
2018-05-15 14:21:32 +01:00
varkor 5e89312a22 Inline get_type 2018-05-15 14:21:32 +01:00
varkor fc27c2eb38 Fix typo in late-bound region testing message 2018-05-15 14:21:31 +01:00
varkor d62fc236f9 Refactor to address comments 2018-05-15 14:21:31 +01:00
varkor df1c256a2b Replace type_param_to_index with param_def_id_to_index 2018-05-15 14:21:31 +01:00
varkor 7b45a892a4 Use GenericParamCount instead of FxHashMap 2018-05-15 14:21:31 +01:00
varkor a17896a3b6 Place Self at the start of ty::Generics' param lists 2018-05-15 14:21:03 +01:00
varkor 6f257bf26f Correct variable renaming fallout 2018-05-15 14:21:03 +01:00
varkor 0b8b14f6f5 Eliminate ty::Generics::types()
And with one final incanation, the specific kind iterators were banished from ty::Generics, never to be seen again!
2018-05-15 14:21:03 +01:00
varkor d557ff983f Eliminate ty::Generics::lifetimes()
Begone lazy lifetime code!
2018-05-15 14:21:03 +01:00
varkor b75f421ee9 Generalise more cases of explicit iteration of specific kinds 2018-05-15 14:21:03 +01:00
varkor 4a6c946368 Generalise cases of explicit iteration of specific kinds 2018-05-15 14:21:03 +01:00
varkor cadf96e8e1 Fix tidy errors caused by renaming 2018-05-15 14:20:19 +01:00
varkor 06f0a7c89f Rename TypeParameterDef -> TypeParamDef and RegionParameterDef -> RegionParamDef 2018-05-15 14:20:19 +01:00
varkor 178a8f1139 Rename GenericParam to GenericParamDef 2018-05-15 14:20:19 +01:00
varkor 15d2759d90 Rename has_type_parameters to requires_monomorphization 2018-05-15 14:20:19 +01:00
varkor a9622dc5c6 Fix generics type parameter handling in miri 2018-05-15 14:20:19 +01:00
varkor 5b4e2b7fbc Inline Generics::own_count 2018-05-15 14:20:19 +01:00
varkor e5825c29c3 Prefer iterator to vec 2018-05-15 14:20:19 +01:00
varkor e9e3d5703b Rename ty::GenericParameterDef to GenericParam 2018-05-15 14:20:19 +01:00
varkor 63553547e5 Rename ty::Generics::parameters to params 2018-05-15 14:20:19 +01:00
varkor de1c29c95e Reduce parent_params to parent_count 2018-05-15 14:20:19 +01:00
varkor fe0c119e7d Consolidate ty::Generics 2018-05-15 14:20:19 +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
bors 0b17da2d7b Auto merge of #50748 - steveklabnik:remove-simd-note, r=alexcrichton
Update stdsimd module

to include https://github.com/rust-lang-nursery/stdsimd/commit/a19ca1cd91cf97777af8268a6136bd2e4648e189
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
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
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
steveklabnik 647b1add7f Update stdsimd module to include https://github.com/rust-lang-nursery/stdsimd/commit/a19ca1cd91cf97777af8268a6136bd2e4648e189 2018-05-14 12:32:04 -04:00
Oliver Schneider 3a5b13ad36 Bump clippy 2018-05-14 16:11:57 +02: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
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
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
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
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
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
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
csmoe c4e99dd85d Revert "mark applicability"
This reverts commit a880971128.
2018-05-13 22:56:37 +08:00