Commit Graph

120726 Commits

Author SHA1 Message Date
Ben Lewis
3ef831069a Add lazy normalization tests 2020-05-17 11:01:23 +02:00
Ben Lewis
4cfdd2178e Emit ConstEquate obligation after checking/unifying for inference variables. This means
a inference variable can be unified with an unevaluated const.
2020-05-17 11:01:02 +02:00
Ben Lewis
8b14b84933 Assume unevaluated consts are equal to the other consts and add ConstEquate obligation. This delays
the need to evaluate consts eagerly and therefore gets around const eval query cycles.
2020-05-17 11:01:02 +02:00
bors
e7f230dfd2 Auto merge of #72208 - tmandry:fix-fuchsia-solink, r=Mark-Simulacrum
Don't pass --dynamic-linker for Fuchsia dylibs

This was causing a PT_INTERP header in Fuchsia dylibs (implying that
they're executable when they're not).

r? @Mark-Simulacrum
cc @frobtech @petrhosek
2020-05-17 05:58:54 +00:00
bors
440a46dd20 Auto merge of #5608 - flip1995:rustup, r=phansch
Rustup with git subtree

The commits from the last rustup #5587, are again included in this rustup, since I rebased the rustup. Lesson learned: never rebase, only merge when working with git subtree.

changelog: none
2020-05-17 05:41:39 +00:00
Wesley Wiser
27c818bc56 Bless mir-opt tests to account for #72220 2020-05-16 22:13:50 -04:00
bors
09739c22db Auto merge of #72286 - Dylan-DPC:rollup-n3rk6df, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #72233 (Fix {:#?} representation of proc_macro::Literal)
 - #72277 (emphasize that ManuallyDrop is safe-to-access and unsafe-to-drop)
 - #72281 (Fix whitespace in `?Sized` structured suggestion)
 - #72282 (Fix issue number typo in note)

Failed merges:

r? @ghost
2020-05-17 01:31:15 +00:00
Dylan MacKenzie
2fe1170613 ret has been optimized away in debuginfo test 2020-05-16 17:15:24 -07:00
Dylan MacKenzie
8c710118f6 Disable MIR optimization for alignment codegen tests
NRVO optimizes away the locals whose alignment is tested. I don't think
this affects the purpose of the test.
2020-05-16 17:15:24 -07:00
Dylan MacKenzie
b19d5c0592 Name return place in debuginfo if it is a user variable 2020-05-16 17:15:24 -07:00
Dylan MacKenzie
c38283d7a7 Test that Miri can handle MIR with NRVO applied 2020-05-16 17:15:24 -07:00
Dylan MacKenzie
e369d7f4e7 Expand comment with possible improvements 2020-05-16 17:15:24 -07:00
Dylan MacKenzie
2cba138f4a Add simple NRVO test 2020-05-16 17:15:24 -07:00
Dylan MacKenzie
966df3e926 Bless MIR tests that inline functions qualifying for NRVO 2020-05-16 17:15:24 -07:00
Dylan MacKenzie
6b96d17a5a Dumb NRVO 2020-05-16 17:15:23 -07:00
Dylan DPC
1d09a7b693
Rollup merge of #72282 - jonas-schievink:issue-typo, r=Dylan-DPC
Fix issue number typo in note
2020-05-17 01:51:35 +02:00
Dylan DPC
770b1f35de
Rollup merge of #72281 - estebank:fix-ws-sugg, r=Dylan-DPC
Fix whitespace in `?Sized` structured suggestion
2020-05-17 01:51:33 +02:00
Dylan DPC
444f449d10
Rollup merge of #72277 - RalfJung:manually-drop-docs, r=Mark-Simulacrum
emphasize that ManuallyDrop is safe-to-access and unsafe-to-drop

This seems to sometimes confused people, and generally seems reasonable to state in the top-level summary of the type.
2020-05-17 01:51:31 +02:00
Dylan DPC
fc91043d24
Rollup merge of #72233 - dtolnay:literal, r=petrochenkov
Fix {:#?} representation of proc_macro::Literal

Before:

```rust
TokenStream [
    Ident {
        ident: "name",
        span: #0 bytes(37..41),
    },
    Punct {
        ch: '=',
        spacing: Alone,
        span: #0 bytes(42..43),
    },
    Literal { lit: Lit { kind: Str, symbol: "SNPP", suffix: None }, span: Span { lo: BytePos(44), hi: BytePos(50), ctxt: #0 } },
    Punct {
        ch: ',',
        spacing: Alone,
        span: #0 bytes(50..51),
    },
    Ident {
        ident: "owner",
        span: #0 bytes(56..61),
    },
    Punct {
        ch: '=',
        spacing: Alone,
        span: #0 bytes(62..63),
    },
    Literal { lit: Lit { kind: Str, symbol: "Canary M Burns", suffix: None }, span: Span { lo: BytePos(64), hi: BytePos(80), ctxt: #0 } },
]
```

After:

```rust
TokenStream [
    Ident {
        ident: "name",
        span: #0 bytes(37..41),
    },
    Punct {
        ch: '=',
        spacing: Alone,
        span: #0 bytes(42..43),
    },
    Literal {
        kind: Str,
        symbol: "SNPP",
        suffix: None,
        span: #0 bytes(44..50),
    },
    Punct {
        ch: ',',
        spacing: Alone,
        span: #0 bytes(50..51),
    },
    Ident {
        ident: "owner",
        span: #0 bytes(56..61),
    },
    Punct {
        ch: '=',
        spacing: Alone,
        span: #0 bytes(62..63),
    },
    Literal {
        kind: Str,
        symbol: "Canary M Burns",
        suffix: None,
        span: #0 bytes(64..80),
    },
]
```
2020-05-17 01:51:30 +02:00
flip1995
7f317b708f
Run fmt 2020-05-17 01:18:43 +02:00
flip1995
404ae5b211
Re-remove util/dev
Maybe someday, git subtree will do it right
2020-05-17 01:14:28 +02:00
flip1995
cb0d40a7ec
Merge remote-tracking branch 'upstream/master' into rustup 2020-05-17 01:13:02 +02:00
bors
0ec4b06524 Auto merge of #72178 - tmiasko:inliner-lifetimes, r=nikic
Consistently use LLVM lifetime markers during codegen

Ensure that inliner inserts lifetime markers if they have been emitted during
codegen. Otherwise if allocas from inlined functions are merged together,
lifetime markers from one function might invalidate load & stores performed
by the other one.

Fixes #72154.
2020-05-16 22:16:48 +00:00
Aleksei Latyshev
cb7f9679a6
simplify multispan_sugg interface
- add `multispan_sugg_with_applicability`
- not it gets `&str` instead of `String`, like in `diag.multispan_suggestion`
2020-05-17 00:09:37 +03:00
Jonas Schievink
1e4b663005 Improve documentation for drop elaboration 2020-05-16 23:00:56 +02:00
ThibsG
e55b920970 Rename lint identity_conversion to useless_conversion 2020-05-16 22:50:20 +02:00
bors
cfd720d506 Auto merge of #5563 - ThibsG:MergeLints, r=flip1995
Merge some lints together

This PR merges following lints:

- `block_in_if_condition_expr` and `block_in_if_condition_stmt` → `blocks_in_if_conditions`
- `option_map_unwrap_or`, `option_map_unwrap_or_else` and `result_map_unwrap_or_else` → `map_unwrap`
- `option_unwrap_used` and `result_unwrap_used` → `unwrap_used`
- `option_expect_used` and `result_expect_used` → `expect_used`
- `wrong_pub_self_convention` into `wrong_self_convention`
- `for_loop_over_option` and `for_loop_over_result` → `for_loops_over_fallibles`

Lints that have already been merged since the issue was created:
- [x] `new_without_default` and `new_without_default_derive` → `new_without_default`

Need more discussion:
- `string_add` and `string_add_assign`: do we agree to merge them or not? Is there something more to do? → **not merge finally**
- `identity_op` and `modulo_one` → `useless_arithmetic`: seems outdated, since `modulo_arithmetic` has been created.

fixes #1078

changelog: Merging some lints together:
- `block_in_if_condition_expr` and `block_in_if_condition_stmt` → `blocks_in_if_conditions`
- `option_map_unwrap_or`, `option_map_unwrap_or_else` and `result_map_unwrap_or_else` → `map_unwrap_or`
- `option_unwrap_used` and `result_unwrap_used` → `unwrap_used`
- `option_expect_used` and `result_expect_used` → `expect_used`
- `for_loop_over_option` and `for_loop_over_result` → `for_loops_over_fallibles`
2020-05-16 20:17:11 +00:00
Jonas Schievink
9271f998d1 Fix issue number typo in note 2020-05-16 22:15:37 +02:00
Esteban Küber
47034db851 Fix whitespace in ?Sized structured suggestion 2020-05-16 12:56:21 -07:00
Ralf Jung
993c4480ac emphasize that ManuallyDrop is safe-to-access and unsafe-to-drop 2020-05-16 19:50:09 +02:00
bors
dd927a5b0f Auto merge of #72276 - RalfJung:rollup-nkfu3is, r=RalfJung
Rollup of 5 pull requests

Successful merges:

 - #72045 (Incomplete features can also be unsound)
 - #72047 (Literal error reporting cleanup)
 - #72060 (move `ty::List` into a new submodule)
 - #72094 (cmdline: Make target features individually overridable)
 - #72254 (Remove redundant backtick in error message.)

Failed merges:

r? @ghost
2020-05-16 17:47:21 +00:00
Ralf Jung
12112f4d7d
Rollup merge of #72254 - ehuss:double-backtick, r=dtolnay
Remove redundant backtick in error message.

The value passed in already has backticks surrounding the text.
2020-05-16 19:46:37 +02:00
Ralf Jung
4fe6d52d97
Rollup merge of #72094 - petrochenkov:overfeature, r=nikic
cmdline: Make target features individually overridable

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

Previously `-C target-feature=+avx2 -C target-feature=+fma` was equivalent to `-C target-feature=+fma` because the later `-C target-feature` option fully overridden previous `-C target-feature`.
With this PR `-C target-feature=+avx2 -C target-feature=+fma` is equivalent to `-C target-feature=+avx2,+fma` and the options are combined.

I'm not sure where the comma-separated features in a single option came from (clang uses a scheme with single feature per-option), but logically these features are entirely independent options.
So they should be overridable individually as well to be more useful in hierarchical build system, and more consistent with other rustc options and clang behavior as well.

Target feature options have a few other issues (https://github.com/rust-lang/rust/issues/44815), but fixing those is going to be a bit more invasive.
2020-05-16 19:46:36 +02:00
Ralf Jung
ae66c62245
Rollup merge of #72060 - lcnr:move-list, r=estebank
move `ty::List` into a new submodule

`rustc_middle/ty` is currently right below the 3000 lines tidy file length limit.

Moves `rustc_middle::ty::List` to the private module `rustc_middle::ty::list` and adds
a `pub use self::list::List` at its previous location.
2020-05-16 19:46:34 +02:00
Ralf Jung
8bba1b7589 Rollup merge of #72047 - Julian-Wollersberger:literal_error_reporting_cleanup, r=petrochenkov
Literal error reporting cleanup

While doing some performance work, I noticed some code duplication in `librustc_parser/lexer/mod.rs`, so I cleaned it up.

This PR is probably best reviewed commit by commit.

I'm not sure what the API stability practices for `librustc_lexer` are. Four public methods in `unescape.rs` can be removed, but two are used by clippy, so I left them in for now.
I could open a PR for Rust-Analyzer when this one lands.

But how do I open a PR for clippy? (Git submodules are frustrating to work with)
2020-05-16 19:46:31 +02:00
Ralf Jung
ec5610ff8c
Rollup merge of #72047 - Julian-Wollersberger:literal_error_reporting_cleanup, r=petrochenkov
Literal error reporting cleanup

While doing some performance work, I noticed some code duplication in `librustc_parser/lexer/mod.rs`, so I cleaned it up.

This PR is probably best reviewed commit by commit.

I'm not sure what the API stability practices for `librustc_lexer` are. Four public methods in `unescape.rs` can be removed, but two are used by clippy, so I left them in for now.
I could open a PR for Rust-Analyzer when this one lands.

But how do I open a PR for clippy? (Git submodules are frustrating to work with)
2020-05-16 19:46:31 +02:00
Ralf Jung
aecab5e603
Rollup merge of #72045 - RalfJung:incomplete-unsound, r=petrochenkov
Incomplete features can also be unsound

Some incomplete features do not just ICE, they are also currently unsound (e.g. https://github.com/rust-lang/rust/pull/72029, and also `specialization` -- which is not yet marked incomplete but [should be](https://github.com/rust-lang/rust/pull/71420)). This makes the message reflect that.

While at it I also added a link to the tracking issue, which hopefully should explain what is incomplete/unsound about the feature.
2020-05-16 19:46:29 +02:00
Charles Lew
de24ddac0a Disallow forbidden usage of non-ascii identifiers. 2020-05-17 01:31:18 +08:00
marmeladema
4af04cb5cb Continue lowering for unsupported async generator instead of returning an error.
This way the hir is "valid" and we can remove one more call to
`opt_node_id_to_hir_id` but an error is still emitted.

This is another partial fix for #71104
2020-05-16 18:23:54 +01:00
bors
6163394e1f Auto merge of #72262 - Dylan-DPC:rollup-x56q1jj, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #71625 (Improve the documentation for ManuallyDrop to resolve conflicting usage of terminology)
 - #71919 (Update transitive dependency to work towards removing syn <1.0 dep)
 - #72166 (Simpler slice `Iterator` methods)
 - #72216 (Remove `lang_items\(\).*\.unwrap\(\)`)
 - #72230 (Updated documentation of Prefix::VerbatimDisk)
 - #72234 (Implement Default for proc_macro::TokenStream)
 - #72258 (Fix typo Arbintrary to Arbitrary)

Failed merges:

r? @ghost
2020-05-16 14:15:18 +00:00
Ralf Jung
07d5971eb6 move borrow-of-packed-field unsafety check out of loop 2020-05-16 16:04:31 +02:00
Dylan DPC
e43dd47db2
Rollup merge of #72258 - Rustin-Liu:rustin-patch-typo, r=dtolnay
Fix typo Arbintrary to Arbitrary

Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>

Closes #72122.
2020-05-16 12:43:08 +02:00
Dylan DPC
25c91ea206
Rollup merge of #72234 - dtolnay:default, r=petrochenkov
Implement Default for proc_macro::TokenStream

Hopefully this is uncontroversial. The only reason we've made it this far without is that proc-macro2 snuck this in for their TokenStream.
2020-05-16 12:43:06 +02:00
Dylan DPC
8b1cc10c60
Rollup merge of #72230 - SOF3:patch-1, r=kennytm
Updated documentation of Prefix::VerbatimDisk

PrefixComponent with Prefix::VerbatimDisk does not contain the trailing slash. The documentation here is also inconsistent with the documentation on other variants that reflect the `PrefixComponent::as_os_str()` return value.
2020-05-16 12:43:05 +02:00
Dylan DPC
1be88e6d1e
Rollup merge of #72216 - doctorn:require-lang-item, r=lcnr
Remove `lang_items\(\).*\.unwrap\(\)`

Follows up #72170 to remove the remaining uses of `lang_items\(\).*\.unwrap\(\)` (avoids a bunch of potential ICEs when working in `#![no_core]`).

Resolves #72195
2020-05-16 12:43:03 +02:00
Dylan DPC
e8f0fb1f13
Rollup merge of #72166 - nnethercote:simpler-slice-Iterator-methods, r=cuviper
Simpler slice `Iterator` methods

These reduce the amount of LLVM IR generated, helping compile times.

r? @cuviper
2020-05-16 12:43:01 +02:00
Dylan DPC
9dd7ad3ed2
Rollup merge of #71919 - Xanewok:bump-syn-1, r=Xanewok
Update transitive dependency to work towards removing syn <1.0 dep

This bumps a couple of transitive dependencies in hopes of eventually not transitively depending on syn <1.0 and friends. The only upstream changes that this is blocked on seems to be https://github.com/mattico/elasticlunr-rs/pull/27 and https://github.com/rust-lang/mdBook/pull/1210.

While working on https://github.com/rust-lang/rust/pull/71875 I noticed we still use syn 0.15 here and there so this is a drive-by PR which aims to help with things a bit.
2020-05-16 12:42:59 +02:00
Dylan DPC
9c32e7ac22
Rollup merge of #71625 - Diggsey:improve-manually-drop-docs, r=RalfJung
Improve the documentation for ManuallyDrop to resolve conflicting usage of terminology

cc @RalfJung

Follow-up from https://github.com/rust-lang/unsafe-code-guidelines/issues/233
2020-05-16 12:42:55 +02:00
bors
31add7e607 Auto merge of #71872 - nnethercote:less-aggressive-arena-growth, r=oli-obk
Be less aggressive with `DroplessArena`/`TypedArena` growth.

`DroplessArena` and `TypedArena` use an aggressive growth strategy: the first chunk is 4 KiB, the second is 8 KiB, and it keeps on doubling indefinitely. DHAT profiles show that sometimes this results in large chunks (e.g. 16-128 MiB) that are barely filled.

This commit changes things so that the doubling stops at 2 MiB. This is large enough that chunk allocations are still rare (you might get 100s instead of 10s of them) but avoids lots of unused space in the worst case. It makes the same change to `TypedArena`, too.
2020-05-16 10:32:46 +00:00
csmoe
2e1c2a6d0a break out earlier on empty snippet 2020-05-16 18:29:46 +08:00