]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoUpdate LLVM submodule
Amanieu d'Antras [Mon, 18 May 2020 13:35:40 +0000 (14:35 +0100)]
Update LLVM submodule

4 years agoSimplify register name output for x86
Amanieu d'Antras [Thu, 14 May 2020 21:09:32 +0000 (22:09 +0100)]
Simplify register name output for x86

4 years agoUpdate compiler_builtins to 0.1.28
Amanieu d'Antras [Tue, 12 May 2020 14:24:24 +0000 (15:24 +0100)]
Update compiler_builtins to 0.1.28

4 years agoMark asm unstable book doctests as allow_fail since they don't work with system LLVM
Amanieu d'Antras [Mon, 11 May 2020 20:48:21 +0000 (21:48 +0100)]
Mark asm unstable book doctests as allow_fail since they don't work with system LLVM

4 years agoFix const handling and add tests for const operands
Amanieu d'Antras [Mon, 11 May 2020 16:53:32 +0000 (17:53 +0100)]
Fix const handling and add tests for const operands

4 years agoFix docs
Amanieu d'Antras [Fri, 8 May 2020 20:05:22 +0000 (21:05 +0100)]
Fix docs

4 years agoFix handling on InlineAsm for the unconditional recursion lint.
Amanieu d'Antras [Fri, 8 May 2020 20:00:33 +0000 (21:00 +0100)]
Fix handling on InlineAsm for the unconditional recursion lint.

4 years agoFix tests
Amanieu d'Antras [Fri, 8 May 2020 17:14:06 +0000 (18:14 +0100)]
Fix tests

4 years agoFix feature gate tests
Amanieu d'Antras [Fri, 8 May 2020 15:37:57 +0000 (16:37 +0100)]
Fix feature gate tests

4 years agoAdd documentation for asm!
Amanieu d'Antras [Fri, 8 May 2020 14:36:34 +0000 (15:36 +0100)]
Add documentation for asm!

4 years agoAdd borrow-check test
Amanieu d'Antras [Fri, 8 May 2020 00:15:56 +0000 (01:15 +0100)]
Add borrow-check test

4 years agoMinor fixes
Amanieu d'Antras [Thu, 7 May 2020 23:57:22 +0000 (00:57 +0100)]
Minor fixes

4 years agoHandle InlineAsm in clippy
Amanieu d'Antras [Wed, 6 May 2020 14:03:53 +0000 (15:03 +0100)]
Handle InlineAsm in clippy

4 years agoMove InlineAsmTemplatePiece and InlineAsmOptions to librustc_ast
Amanieu d'Antras [Wed, 6 May 2020 13:46:01 +0000 (14:46 +0100)]
Move InlineAsmTemplatePiece and InlineAsmOptions to librustc_ast

4 years agoDisable asm tests on system llvm
Amanieu d'Antras [Wed, 6 May 2020 11:04:22 +0000 (12:04 +0100)]
Disable asm tests on system llvm

4 years agoThe h modifier is only supported by reg_abcd
Amanieu d'Antras [Wed, 6 May 2020 10:41:37 +0000 (11:41 +0100)]
The h modifier is only supported by reg_abcd

4 years agoUpdate llvm-project submodule
Amanieu d'Antras [Fri, 1 May 2020 23:28:51 +0000 (00:28 +0100)]
Update llvm-project submodule

4 years agoImplement att_syntax option
Amanieu d'Antras [Fri, 1 May 2020 22:59:15 +0000 (23:59 +0100)]
Implement att_syntax option

4 years agoWork around more LLVM limitations
Amanieu d'Antras [Fri, 1 May 2020 22:23:55 +0000 (23:23 +0100)]
Work around more LLVM limitations

4 years agoAdd notes about functions that are not currently used
Amanieu d'Antras [Fri, 1 May 2020 19:51:54 +0000 (20:51 +0100)]
Add notes about functions that are not currently used

4 years agoAdd support for high byte registers on x86
Amanieu d'Antras [Tue, 28 Apr 2020 23:45:58 +0000 (00:45 +0100)]
Add support for high byte registers on x86

4 years agoUn-deprecate asm! macro
Amanieu d'Antras [Fri, 24 Apr 2020 20:16:00 +0000 (21:16 +0100)]
Un-deprecate asm! macro

4 years agoApply review feedback
Amanieu d'Antras [Thu, 19 Mar 2020 07:41:43 +0000 (07:41 +0000)]
Apply review feedback

4 years agoAdd tests for asm!
Amanieu d'Antras [Thu, 20 Feb 2020 09:19:48 +0000 (09:19 +0000)]
Add tests for asm!

4 years agoImplement asm! codegen
Amanieu d'Antras [Mon, 17 Feb 2020 21:36:01 +0000 (21:36 +0000)]
Implement asm! codegen

4 years agoCheck that asm const operands are actually constants
Amanieu d'Antras [Mon, 17 Feb 2020 22:20:59 +0000 (22:20 +0000)]
Check that asm const operands are actually constants

4 years agoAdd asm! to MIR
Amanieu d'Antras [Fri, 14 Feb 2020 18:17:50 +0000 (18:17 +0000)]
Add asm! to MIR

4 years agoHIR passes for asm!
Amanieu d'Antras [Thu, 13 Feb 2020 11:00:55 +0000 (11:00 +0000)]
HIR passes for asm!

4 years agoImplement AST lowering for asm!
Amanieu d'Antras [Wed, 12 Feb 2020 15:48:03 +0000 (15:48 +0000)]
Implement AST lowering for asm!

4 years agoAdd asm! to HIR
Amanieu d'Antras [Wed, 12 Feb 2020 17:32:41 +0000 (17:32 +0000)]
Add asm! to HIR

4 years agoImplement asm! in librustc_builtin_macros
Amanieu d'Antras [Wed, 12 Feb 2020 15:47:43 +0000 (15:47 +0000)]
Implement asm! in librustc_builtin_macros

4 years agoAdd asm! to AST
Amanieu d'Antras [Wed, 22 Jan 2020 14:20:27 +0000 (14:20 +0000)]
Add asm! to AST

4 years agoAdd inline asm register definitions to librustc_target
Amanieu d'Antras [Wed, 22 Jan 2020 11:24:31 +0000 (11:24 +0000)]
Add inline asm register definitions to librustc_target

4 years agoAdd RISC-V target features
Amanieu d'Antras [Sun, 1 Mar 2020 09:52:04 +0000 (09:52 +0000)]
Add RISC-V target features

4 years agoAuto merge of #72316 - RalfJung:rollup-70g6bln, r=RalfJung
bors [Mon, 18 May 2020 07:53:03 +0000 (07:53 +0000)]
Auto merge of #72316 - RalfJung:rollup-70g6bln, r=RalfJung

Rollup of 2 pull requests

Successful merges:

 - #72143 (make offset must_use)
 - #72307 (use the new interface to initialize conditional variables)

Failed merges:

r? @ghost

4 years agoRollup merge of #72307 - hermitcore:condvar, r=Mark-Simulacrum
Ralf Jung [Mon, 18 May 2020 06:48:45 +0000 (08:48 +0200)]
Rollup merge of #72307 - hermitcore:condvar, r=Mark-Simulacrum

use the new interface to initialize conditional variables

HermitCore introduce a new interface to intialize conditional variables.
Consequently, minor changes are required to support this interface.

4 years agoRollup merge of #72143 - rust-lang:steveklabnik-must-use, r=sfackler
Ralf Jung [Mon, 18 May 2020 06:48:43 +0000 (08:48 +0200)]
Rollup merge of #72143 - rust-lang:steveklabnik-must-use, r=sfackler

make offset must_use

https://djugei.github.io/bad-at-unsafe/ describes an error a user had when trying to use offset:

> At first I just assumed that the .add() and .offset() methods on pointers would mutate the pointer. They do not. Instead they return a new pointer, which gets dropped silently if you don't use it. Unlike for example Result, which is must_use annotated.

This PR only adds `offset`, because I wanted to float the idea; I'm imagining that there's more than just `add` and `offset` that could use this. I am also very open to re-wording the warning.

r? @rust-lang/libs

4 years agoAuto merge of #72300 - flip1995:clippyup, r=Mark-Simulacrum
bors [Mon, 18 May 2020 04:10:01 +0000 (04:10 +0000)]
Auto merge of #72300 - flip1995:clippyup, r=Mark-Simulacrum

Sync Clippy

cc rust-lang/rust-clippy#5608

Included changes:

- renames/merges of some lints
- ICE fix
- Downgrade useless_let_if_seq to nursery
- FP fixes
- formatting

r? @oli-obk

4 years agoAuto merge of #72269 - RalfJung:unsafe-borrow-of-packed, r=Mark-Simulacrum
bors [Mon, 18 May 2020 00:54:42 +0000 (00:54 +0000)]
Auto merge of #72269 - RalfJung:unsafe-borrow-of-packed, r=Mark-Simulacrum

move borrow-of-packed-field unsafety check out of loop

Looks like during the place refactoring, this code somehow got into this loop even though it does not actually depend on the loop variables.

4 years agominor changes to pass the format check
Stefan Lankes [Sun, 17 May 2020 22:06:32 +0000 (00:06 +0200)]
minor changes to pass the format check

4 years agouse new interface to initialize Condvar
Stefan Lankes [Sun, 17 May 2020 21:49:18 +0000 (23:49 +0200)]
use new interface to initialize Condvar

HermitCore introduce a new interface to intialize conditional variables.
Consequently, minor changes are required to support this interface.

4 years agoAuto merge of #72248 - petrochenkov:codemodel, r=Amanieu
bors [Sun, 17 May 2020 21:22:48 +0000 (21:22 +0000)]
Auto merge of #72248 - petrochenkov:codemodel, r=Amanieu

Cleanup and document `-C code-model`

r? @Amanieu

4 years agoAuto merge of #72295 - RalfJung:rollup-icmhbs7, r=RalfJung
bors [Sun, 17 May 2020 16:20:19 +0000 (16:20 +0000)]
Auto merge of #72295 - RalfJung:rollup-icmhbs7, r=RalfJung

Rollup of 3 pull requests

Successful merges:

 - #72259 (Disallow forbidden usage of non-ascii identifiers.)
 - #72261 (Break out early on empty span when generate_fn_span)
 - #72291 (bootstrap: fix typo)

Failed merges:

r? @ghost

4 years agoMerge commit 'e214ea82ad0a751563acf67e1cd9279cf302db3a' into clippyup
flip1995 [Sun, 17 May 2020 15:36:26 +0000 (17:36 +0200)]
Merge commit 'e214ea82ad0a751563acf67e1cd9279cf302db3a' into clippyup

4 years agomake many ptr functions must_use
Steve Klabnik [Tue, 12 May 2020 16:41:41 +0000 (11:41 -0500)]
make many ptr functions must_use

https://djugei.github.io/bad-at-unsafe/ describes an error a user had when trying to use offset:

> At first I just assumed that the .add() and .offset() methods on pointers would mutate the pointer. They do not. Instead they return a new pointer, which gets dropped silently if you don't use it. Unlike for example Result, which is must_use annotated.

4 years agoRollup merge of #72291 - RalfJung:format-typo, r=jonas-schievink
Ralf Jung [Sun, 17 May 2020 14:24:29 +0000 (16:24 +0200)]
Rollup merge of #72291 - RalfJung:format-typo, r=jonas-schievink

bootstrap: fix typo

4 years agoRollup merge of #72261 - csmoe:issue-72095, r=estebank
Ralf Jung [Sun, 17 May 2020 14:24:27 +0000 (16:24 +0200)]
Rollup merge of #72261 - csmoe:issue-72095, r=estebank

Break out early on empty span when generate_fn_span

Closes #72095
r? @oli-obk
cc @estebank @tmandry

4 years agoRollup merge of #72259 - crlf0710:ascii_only_check, r=petrochenkov
Ralf Jung [Sun, 17 May 2020 14:24:26 +0000 (16:24 +0200)]
Rollup merge of #72259 - crlf0710:ascii_only_check, r=petrochenkov

Disallow forbidden usage of non-ascii identifiers.

Part of RFC2457, this tightens allowed identifiers back to ascii only in two situations.

r? @petrochenkov

4 years agoAuto merge of #72204 - RalfJung:abort, r=Mark-Simulacrum
bors [Sun, 17 May 2020 12:49:01 +0000 (12:49 +0000)]
Auto merge of #72204 - RalfJung:abort, r=Mark-Simulacrum

make abort intrinsic safe, and correct its documentation

Turns out `std::process::abort` is not the same as the intrinsic, the comment was just wrong. Quoting from the unix implementation:
```
// On Unix-like platforms, libc::abort will unregister signal handlers
// including the SIGABRT handler, preventing the abort from being blocked, and
// fclose streams, with the side effect of flushing them so libc buffered
// output will be printed.  Additionally the shell will generally print a more
// understandable error message like "Abort trap" rather than "Illegal
// instruction" that intrinsics::abort would cause, as intrinsics::abort is
// implemented as an illegal instruction.
```

4 years agoAuto merge of #5568 - ThibsG:RenameIdentityConversionLint, r=flip1995
bors [Sun, 17 May 2020 11:29:04 +0000 (11:29 +0000)]
Auto merge of #5568 - ThibsG:RenameIdentityConversionLint, r=flip1995

Rename lint `identity_conversion` to `useless_conversion`

Lint name `identity_conversion` was misleading, so this PR renames it to `useless_conversion`.

As decision has not really came up in the issue comments, this PR will probably need discussion.

fixes #3106

changelog: Rename lint `identity_conversion` to `useless_conversion`

4 years agoAuto merge of #5529 - alex-700:improve-option-and-then-some-lint, r=phansch
bors [Sun, 17 May 2020 10:58:56 +0000 (10:58 +0000)]
Auto merge of #5529 - alex-700:improve-option-and-then-some-lint, r=phansch

Improve `option_and_then_some` lint

fixed #5492

changelog: Improve and generalize `option_and_then_some` and rename it to `bind_instead_of_map`.

4 years agobootstrap: fix typo
Ralf Jung [Sun, 17 May 2020 09:40:58 +0000 (11:40 +0200)]
bootstrap: fix typo

4 years agomake abort intrinsic safe, and correct its documentation
Ralf Jung [Sun, 17 May 2020 09:06:59 +0000 (11:06 +0200)]
make abort intrinsic safe, and correct its documentation

4 years agoAuto merge of #72135 - oli-obk:const_prop_deaggregates, r=wesleywiser
bors [Sun, 17 May 2020 09:18:12 +0000 (09:18 +0000)]
Auto merge of #72135 - oli-obk:const_prop_deaggregates, r=wesleywiser

Propagate locals, even if they have unpropagatable assignments somewhere

Second try for https://github.com/rust-lang/rust/pull/71946#discussion_r422967292

r? @wesleywiser

cc @rust-lang/wg-mir-opt @RalfJung

4 years agoimprove and generalize `option_and_then_some` lint
Aleksei Latyshev [Sat, 25 Apr 2020 20:33:11 +0000 (23:33 +0300)]
improve and generalize `option_and_then_some` lint

- rename it to bind_instead_of_map

4 years agoAuto merge of #72208 - tmandry:fix-fuchsia-solink, r=Mark-Simulacrum
bors [Sun, 17 May 2020 05:58:54 +0000 (05:58 +0000)]
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

4 years agoAuto merge of #5608 - flip1995:rustup, r=phansch
bors [Sun, 17 May 2020 05:41:39 +0000 (05:41 +0000)]
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

4 years agoBless mir-opt tests to account for #72220
Wesley Wiser [Sun, 17 May 2020 02:12:01 +0000 (22:12 -0400)]
Bless mir-opt tests to account for #72220

4 years agoAuto merge of #72286 - Dylan-DPC:rollup-n3rk6df, r=Dylan-DPC
bors [Sun, 17 May 2020 01:31:15 +0000 (01:31 +0000)]
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

4 years agoRollup merge of #72282 - jonas-schievink:issue-typo, r=Dylan-DPC
Dylan DPC [Sat, 16 May 2020 23:51:35 +0000 (01:51 +0200)]
Rollup merge of #72282 - jonas-schievink:issue-typo, r=Dylan-DPC

Fix issue number typo in note

4 years agoRollup merge of #72281 - estebank:fix-ws-sugg, r=Dylan-DPC
Dylan DPC [Sat, 16 May 2020 23:51:33 +0000 (01:51 +0200)]
Rollup merge of #72281 - estebank:fix-ws-sugg, r=Dylan-DPC

Fix whitespace in `?Sized` structured suggestion

4 years agoRollup merge of #72277 - RalfJung:manually-drop-docs, r=Mark-Simulacrum
Dylan DPC [Sat, 16 May 2020 23:51:31 +0000 (01:51 +0200)]
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.

4 years agoRollup merge of #72233 - dtolnay:literal, r=petrochenkov
Dylan DPC [Sat, 16 May 2020 23:51:30 +0000 (01:51 +0200)]
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),
    },
]
```

4 years agoRun fmt
flip1995 [Sat, 16 May 2020 23:18:43 +0000 (01:18 +0200)]
Run fmt

4 years agoRe-remove util/dev
flip1995 [Sat, 16 May 2020 23:14:28 +0000 (01:14 +0200)]
Re-remove util/dev

Maybe someday, git subtree will do it right

4 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Sat, 16 May 2020 23:13:02 +0000 (01:13 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

4 years agoAuto merge of #72178 - tmiasko:inliner-lifetimes, r=nikic
bors [Sat, 16 May 2020 22:16:48 +0000 (22:16 +0000)]
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.

4 years agosimplify multispan_sugg interface
Aleksei Latyshev [Sat, 25 Apr 2020 17:52:00 +0000 (20:52 +0300)]
simplify multispan_sugg interface

- add `multispan_sugg_with_applicability`
- not it gets `&str` instead of `String`, like in `diag.multispan_suggestion`

4 years agoRename lint `identity_conversion` to `useless_conversion`
ThibsG [Mon, 4 May 2020 15:09:02 +0000 (17:09 +0200)]
Rename lint `identity_conversion` to `useless_conversion`

4 years agoAuto merge of #5563 - ThibsG:MergeLints, r=flip1995
bors [Sat, 16 May 2020 20:17:11 +0000 (20:17 +0000)]
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`

4 years agoFix issue number typo in note
Jonas Schievink [Sat, 16 May 2020 20:10:28 +0000 (22:10 +0200)]
Fix issue number typo in note

4 years agoFix whitespace in `?Sized` structured suggestion
Esteban Küber [Sat, 16 May 2020 19:56:21 +0000 (12:56 -0700)]
Fix whitespace in `?Sized` structured suggestion

4 years agoemphasize that ManuallyDrop is safe-to-access and unsafe-to-drop
Ralf Jung [Sat, 16 May 2020 09:14:00 +0000 (11:14 +0200)]
emphasize that ManuallyDrop is safe-to-access and unsafe-to-drop

4 years agoAuto merge of #72276 - RalfJung:rollup-nkfu3is, r=RalfJung
bors [Sat, 16 May 2020 17:47:21 +0000 (17:47 +0000)]
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

4 years agoRollup merge of #72254 - ehuss:double-backtick, r=dtolnay
Ralf Jung [Sat, 16 May 2020 17:46:37 +0000 (19:46 +0200)]
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.

4 years agoRollup merge of #72094 - petrochenkov:overfeature, r=nikic
Ralf Jung [Sat, 16 May 2020 17:46:36 +0000 (19:46 +0200)]
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.

4 years agoRollup merge of #72060 - lcnr:move-list, r=estebank
Ralf Jung [Sat, 16 May 2020 17:46:34 +0000 (19:46 +0200)]
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.

4 years agoRollup merge of #72047 - Julian-Wollersberger:literal_error_reporting_cleanup, r...
Ralf Jung [Sat, 16 May 2020 17:46:31 +0000 (19:46 +0200)]
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)

4 years agoRollup merge of #72047 - Julian-Wollersberger:literal_error_reporting_cleanup, r...
Ralf Jung [Sat, 16 May 2020 17:46:31 +0000 (19:46 +0200)]
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)

4 years agoRollup merge of #72045 - RalfJung:incomplete-unsound, r=petrochenkov
Ralf Jung [Sat, 16 May 2020 17:46:29 +0000 (19:46 +0200)]
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.

4 years agoDisallow forbidden usage of non-ascii identifiers.
Charles Lew [Sat, 16 May 2020 06:09:01 +0000 (14:09 +0800)]
Disallow forbidden usage of non-ascii identifiers.

4 years agoAuto merge of #72262 - Dylan-DPC:rollup-x56q1jj, r=Dylan-DPC
bors [Sat, 16 May 2020 14:15:18 +0000 (14:15 +0000)]
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

4 years agomove borrow-of-packed-field unsafety check out of loop
Ralf Jung [Sat, 16 May 2020 14:04:31 +0000 (16:04 +0200)]
move borrow-of-packed-field unsafety check out of loop

4 years agoRollup merge of #72258 - Rustin-Liu:rustin-patch-typo, r=dtolnay
Dylan DPC [Sat, 16 May 2020 10:43:08 +0000 (12:43 +0200)]
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.

4 years agoRollup merge of #72234 - dtolnay:default, r=petrochenkov
Dylan DPC [Sat, 16 May 2020 10:43:06 +0000 (12:43 +0200)]
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.

4 years agoRollup merge of #72230 - SOF3:patch-1, r=kennytm
Dylan DPC [Sat, 16 May 2020 10:43:05 +0000 (12:43 +0200)]
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.

4 years agoRollup merge of #72216 - doctorn:require-lang-item, r=lcnr
Dylan DPC [Sat, 16 May 2020 10:43:03 +0000 (12:43 +0200)]
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

4 years agoRollup merge of #72166 - nnethercote:simpler-slice-Iterator-methods, r=cuviper
Dylan DPC [Sat, 16 May 2020 10:43:01 +0000 (12:43 +0200)]
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

4 years agoRollup merge of #71919 - Xanewok:bump-syn-1, r=Xanewok
Dylan DPC [Sat, 16 May 2020 10:42:59 +0000 (12:42 +0200)]
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.

4 years agoRollup merge of #71625 - Diggsey:improve-manually-drop-docs, r=RalfJung
Dylan DPC [Sat, 16 May 2020 10:42:55 +0000 (12:42 +0200)]
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

4 years agoAuto merge of #71872 - nnethercote:less-aggressive-arena-growth, r=oli-obk
bors [Sat, 16 May 2020 10:32:46 +0000 (10:32 +0000)]
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.

4 years agobreak out earlier on empty snippet
csmoe [Sat, 16 May 2020 10:29:46 +0000 (18:29 +0800)]
break out earlier on empty snippet

4 years agorustc-book: Document `-C code-model`
Vadim Petrochenkov [Sat, 16 May 2020 09:02:16 +0000 (12:02 +0300)]
rustc-book: Document `-C code-model`

4 years agorustc_target: Stop using "string typing" for code models
Vadim Petrochenkov [Thu, 7 May 2020 00:34:27 +0000 (03:34 +0300)]
rustc_target: Stop using "string typing" for code models

Introduce `enum CodeModel` instead.

4 years agoAuto merge of #5596 - ebroto:issue_5212, r=phansch
bors [Sat, 16 May 2020 08:49:15 +0000 (08:49 +0000)]
Auto merge of #5596 - ebroto:issue_5212, r=phansch

Fix comparison_chain false positive

changelog: comparison_chain: fix false positives when the binary operation is the same.

Fixes #5212

4 years agoAuto merge of #5602 - ebroto:issue_3430, r=phansch
bors [Sat, 16 May 2020 08:33:47 +0000 (08:33 +0000)]
Auto merge of #5602 - ebroto:issue_3430, r=phansch

identity_op: allow `1 << 0`

I went for accepting `1 << 0` verbatim instead of something more general as it seems to be what everyone in the issue thread needed.

changelog: identity_op: allow `1 << 0` as it's a common pattern in bit manipulation code.

Fixes #3430

4 years agoAuto merge of #71665 - RalfJung:miri-intern-no-ice, r=oli-obk
bors [Sat, 16 May 2020 07:14:52 +0000 (07:14 +0000)]
Auto merge of #71665 - RalfJung:miri-intern-no-ice, r=oli-obk

Miri interning: replace ICEs by proper errors

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

I also did some refactoring, as I kept being confused by all the parameters to `intern_shallow`, some of which have invalid combinations (such as a mutable const). So instead `InternMode` now contains all the information that is needed and invalid combinations are ruled out by the type system.

Also I removed interpreter errors from interning. We already ignored almost all errors, and the `ValidationFailure` errors that we handled separately actually cannot ever happen here. The only interpreter failure that was actually reachable was the UB on dangling pointers -- and arguably, a dangling raw pointer is not UB, so the error was not even correct. It's just that the rest of the compiler does not like "dangling" `AllocId`.

It should be possible to review the 3 commits separately.

r? @oli-obk
Cc @rust-lang/wg-const-eval

4 years agoFix typo Arbintrary to Arbitrary
Rustin-Liu [Sat, 16 May 2020 06:40:45 +0000 (14:40 +0800)]
Fix typo Arbintrary to Arbitrary

Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
4 years agoAuto merge of #72079 - semarie:openbsd-stacker, r=Mark-Simulacrum
bors [Sat, 16 May 2020 03:55:49 +0000 (03:55 +0000)]
Auto merge of #72079 - semarie:openbsd-stacker, r=Mark-Simulacrum

update stacker to 0.1.9 to unbreak build on OpenBSD

the version 0.1.8 of stacker (what is currently pinned in Cargo.lock) doesn't build on OpenBSD (see https://github.com/rust-lang/stacker/pull/34).

update the version to 0.1.9

4 years agoRemove redundant backtick in error message.
Eric Huss [Sat, 16 May 2020 03:51:12 +0000 (20:51 -0700)]
Remove redundant backtick in error message.

The value passed in already has backticks surrounding the text.