]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRemove `QualifResolver` abstraction
Dylan MacKenzie [Wed, 23 Oct 2019 19:10:08 +0000 (12:10 -0700)]
Remove `QualifResolver` abstraction

This is a relic from earlier attempts at dataflow-based const validation
that attempted to do promotion at the same time. #63812 takes a
different approach: `IsNotPromotable` is no longer a `Qualif` and is
computed lazily instead of eagerly. As a result, there's no need for an
eager `TempPromotionResolver`, and we can use the only implementer of
`QualifResolver` directly instead of through a trait.

4 years agoUse `is_lang_panic_fn` from `check_consts` in `promote_consts`
Dylan MacKenzie [Tue, 22 Oct 2019 22:00:51 +0000 (15:00 -0700)]
Use `is_lang_panic_fn` from `check_consts` in `promote_consts`

4 years agoDeduplicate `promote_consts::Validator` and `check_consts::Item`
Dylan MacKenzie [Tue, 22 Oct 2019 21:55:04 +0000 (14:55 -0700)]
Deduplicate `promote_consts::Validator` and `check_consts::Item`

4 years agoMake `Item` fields pub
Dylan MacKenzie [Tue, 22 Oct 2019 21:54:10 +0000 (14:54 -0700)]
Make `Item` fields pub

4 years agoMake `check_consts::Item` work on non-const fns
Dylan MacKenzie [Tue, 22 Oct 2019 21:30:31 +0000 (14:30 -0700)]
Make `check_consts::Item` work on non-const fns

This was originally only needed for validation, which is never run on
non-const `fn`s. The new promotion pass wants to use it, however.

4 years agolibsyntax: Document ast module
Igor Aleksanov [Thu, 24 Oct 2019 13:11:43 +0000 (16:11 +0300)]
libsyntax: Document ast module

Apply review suggestions

Remove links in the module docs

Flatten imports

Apply review suggestions

Remove useless comments

Fix nits

4 years agoAuto merge of #63812 - eddyb:promo-sanity, r=oli-obk
bors [Sat, 26 Oct 2019 00:11:36 +0000 (00:11 +0000)]
Auto merge of #63812 - eddyb:promo-sanity, r=oli-obk

rustc_mir: double-check const-promotion candidates for sanity.

Previously, const promotion involved tracking information about the value in a MIR local (or any part of the computation leading up to that value), aka "qualifs", in a quite stateful manner, which is hard to extend to arbitrary CFGs without a dataflow pass.

However, the nature of the promotion we do is that it's effectively an SSA-like "tree" (or DAG, really), of assigned-once locals - which is how we can take them from the original MIR in the first place.
This structure means that the subset of the MIR responsible for computing any given part of a const-promoted value is readily analyzable by walking that tree/DAG.

This PR implements such an analysis in `promote_consts`, reusing the `HasMutInterior` / `NeedsDrop` computation from `qualify_consts`, but reimplementing the equivalent of `IsNotPromotable` / `IsNotImplicitlyPromotable`.

Eventually we should be able to remove `IsNotPromotable` / `IsNotImplicitlyPromotable` from `qualify_consts`, which will simplify @ecstatic-morse's dataflow-based const-checking efforts.

But currently this is mainly for a crater check-only run - it will compare the results from the old promotion collection and the new promotion validation and ICE if they don't match.

r? @oli-obk

4 years agoMake inline associated constants a future compatibility warning
varkor [Fri, 25 Oct 2019 23:46:07 +0000 (00:46 +0100)]
Make inline associated constants a future compatibility warning

4 years agoRemove lint callback from driver
Mark Rousskov [Fri, 25 Oct 2019 23:27:57 +0000 (19:27 -0400)]
Remove lint callback from driver

This is leftover from a restructuring of lint registration for drivers;
it should now happen via the register_lints field on Config rather than
this function.

4 years agoPermit #[track_caller] on inherent methods
varkor [Thu, 24 Oct 2019 21:21:30 +0000 (22:21 +0100)]
Permit #[track_caller] on inherent methods

4 years agorustc_mir: use the new validator's Qualif in promotion.
Eduard-Mihai Burtescu [Mon, 21 Oct 2019 18:18:12 +0000 (21:18 +0300)]
rustc_mir: use the new validator's Qualif in promotion.

4 years agorustc_mir: double-check const-promotion candidates for sanity.
Eduard-Mihai Burtescu [Wed, 21 Aug 2019 20:31:58 +0000 (23:31 +0300)]
rustc_mir: double-check const-promotion candidates for sanity.

4 years agoCorrect handling of type flags with `ConstValue::Placeholder`
varkor [Sun, 20 Oct 2019 22:44:41 +0000 (23:44 +0100)]
Correct handling of type flags with `ConstValue::Placeholder`

4 years agoPermit `#[target_feature]` on method implementations
varkor [Mon, 14 Oct 2019 16:36:13 +0000 (17:36 +0100)]
Permit `#[target_feature]` on method implementations

4 years agoMove handling of `#[track_caller]` to `check_attr`
varkor [Mon, 14 Oct 2019 14:07:16 +0000 (15:07 +0100)]
Move handling of `#[track_caller]` to `check_attr`

4 years agoUpdate bitflags
varkor [Sun, 13 Oct 2019 23:37:55 +0000 (00:37 +0100)]
Update bitflags

4 years agoHandle `ImplItem` in `check_attr`
varkor [Sun, 13 Oct 2019 15:14:59 +0000 (16:14 +0100)]
Handle `ImplItem` in `check_attr`

4 years agoRefactor `check_track_caller`
varkor [Fri, 11 Oct 2019 01:42:23 +0000 (02:42 +0100)]
Refactor `check_track_caller`

4 years agoAdd test for attribute error checking on trait and foreign items
varkor [Fri, 11 Oct 2019 01:36:20 +0000 (02:36 +0100)]
Add test for attribute error checking on trait and foreign items

4 years agoImprove comments
varkor [Fri, 11 Oct 2019 01:36:01 +0000 (02:36 +0100)]
Improve comments

4 years agoEmit warning for ignored #[inline] on foreign function prototypes
varkor [Fri, 11 Oct 2019 01:35:49 +0000 (02:35 +0100)]
Emit warning for ignored #[inline] on foreign function prototypes

4 years agoEmit warning for ignored #[inline] on trait method prototypes
varkor [Fri, 11 Oct 2019 01:35:22 +0000 (02:35 +0100)]
Emit warning for ignored #[inline] on trait method prototypes

4 years agoRefactor check_attr
varkor [Fri, 11 Oct 2019 01:33:16 +0000 (02:33 +0100)]
Refactor check_attr

4 years agoAuto merge of #65826 - JohnTitor:rollup-mr6crka, r=JohnTitor
bors [Fri, 25 Oct 2019 20:41:28 +0000 (20:41 +0000)]
Auto merge of #65826 - JohnTitor:rollup-mr6crka, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #65705 (Add {String,Vec}::into_raw_parts)
 - #65749 (Insurance policy in case `iter.size_hint()` lies.)
 - #65799 (Fill tracking issue number for `array_value_iter`)
 - #65800 (self-profiling: Update measureme to 0.4.0 and remove non-RAII methods from profiler.)
 - #65806 (Add [T]::as_ptr_range() and [T]::as_mut_ptr_range().)
 - #65810 (SGX: Clear additional flag on enclave entry)

Failed merges:

r? @ghost

4 years agoDerive Eq and Hash for SourceInfo again
bjorn3 [Fri, 25 Oct 2019 19:11:29 +0000 (21:11 +0200)]
Derive Eq and Hash for SourceInfo again

4 years agoEFIAPI: Fix symbolname tests
roblabla [Fri, 25 Oct 2019 18:49:55 +0000 (18:49 +0000)]
EFIAPI: Fix symbolname tests

4 years agoAdd proper tracking issue for EFIAPI
roblabla [Fri, 25 Oct 2019 15:08:28 +0000 (15:08 +0000)]
Add proper tracking issue for EFIAPI

4 years agoApply suggestions from code review
matthewjasper [Fri, 25 Oct 2019 17:50:40 +0000 (18:50 +0100)]
Apply suggestions from code review

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoRollup merge of #65810 - raoulstrackx:ac_mitigation, r=nagisa
Yuki Okushi [Fri, 25 Oct 2019 17:46:02 +0000 (02:46 +0900)]
Rollup merge of #65810 - raoulstrackx:ac_mitigation, r=nagisa

SGX: Clear additional flag on enclave entry

An attacker could set both the AC flag in CR0 as in rflags. This causes the enclave to perform an AEX upon a misaligned memory access, and an attacker learns some information about the internal enclave state.
The AC flag in rflags is copied from userspace upon an enclave entry. Upon AEX it is copied and later restored. This patch forces the rflag.AC bit to be reset right after an enter.

4 years agoRollup merge of #65806 - fusion-engineering-forks:slice-ptr-range, r=Centril
Yuki Okushi [Fri, 25 Oct 2019 17:46:01 +0000 (02:46 +0900)]
Rollup merge of #65806 - fusion-engineering-forks:slice-ptr-range, r=Centril

Add [T]::as_ptr_range() and [T]::as_mut_ptr_range().

Implementation of https://github.com/rust-lang/rfcs/pull/2791

4 years agoRollup merge of #65800 - michaelwoerister:measureme-0.4.0, r=wesleywiser
Yuki Okushi [Fri, 25 Oct 2019 17:45:59 +0000 (02:45 +0900)]
Rollup merge of #65800 - michaelwoerister:measureme-0.4.0, r=wesleywiser

self-profiling: Update measureme to 0.4.0 and remove non-RAII methods from profiler.

This PR removes all non-RAII based profiling methods from `SelfProfilerRef` :tada:
It also delegates the `TimingGuard` implementation to `measureme`, now that that is available there.

r? @wesleywiser

4 years agoRollup merge of #65799 - LukasKalbertodt:fill-array-value-iter-tracking-issue, r...
Yuki Okushi [Fri, 25 Oct 2019 17:45:58 +0000 (02:45 +0900)]
Rollup merge of #65799 - LukasKalbertodt:fill-array-value-iter-tracking-issue, r=Centril

Fill tracking issue number for `array_value_iter`

Thanks for [noticing](https://github.com/rust-lang/rust/pull/62959#discussion_r338930448)!

r? @Centril

4 years agoRollup merge of #65749 - Centril:insurance-policy, r=RalfJung
Yuki Okushi [Fri, 25 Oct 2019 17:45:57 +0000 (02:45 +0900)]
Rollup merge of #65749 - Centril:insurance-policy, r=RalfJung

Insurance policy in case `iter.size_hint()` lies.

Follow up to https://github.com/rust-lang/rust/pull/64949/files#r334235076.
(If the perf impact is bad we can use `debug_assert!` instead.)

The good news is that the UI tests pass locally so `iter.size_hint()` seems to be honest *thus far*.
On the other hand, with the status quo we do not have an insurance policy should that change in some case. This is problematic because a) this could possibly make some program be accepted which shouldn't, b) the compiler itself could have memory unsafety if the correctness of the iterator is assumed in `unsafe { ... }` code (even though the blame lies with the `unsafe { ... }` block in question.)

r? @RalfJung
cc @nnethercote

4 years agoRollup merge of #65705 - shepmaster:vec-into-raw, r=SimonSapin
Yuki Okushi [Fri, 25 Oct 2019 17:45:56 +0000 (02:45 +0900)]
Rollup merge of #65705 - shepmaster:vec-into-raw, r=SimonSapin

Add {String,Vec}::into_raw_parts

Aspects to address:

- [x] Create a tracking issue
  - #65816

4 years agorustc: replace a few `.cloned()` with `.copied()`.
Eduard-Mihai Burtescu [Fri, 25 Oct 2019 17:21:37 +0000 (20:21 +0300)]
rustc: replace a few `.cloned()` with `.copied()`.

4 years agorustc: make DefPathData (and friends) Copy (now that it uses Symbol).
Eduard-Mihai Burtescu [Fri, 25 Oct 2019 17:03:17 +0000 (20:03 +0300)]
rustc: make DefPathData (and friends) Copy (now that it uses Symbol).

4 years agoFix inverted check in EFIAPI
roblabla [Fri, 25 Oct 2019 14:50:51 +0000 (14:50 +0000)]
Fix inverted check in EFIAPI

4 years agoFix EFIABI test
roblabla [Fri, 25 Oct 2019 14:44:21 +0000 (14:44 +0000)]
Fix EFIABI test

Use revisions to run the EFIABI in multiple configurations, compiling
for each supported UEFI platform, and checking the ABI generated in the
LLVM IR is correct.

Use no_core to make it easier to test.

4 years agoFix slice::as_ptr_range doctest.
Mara Bos [Fri, 25 Oct 2019 15:22:03 +0000 (17:22 +0200)]
Fix slice::as_ptr_range doctest.

4 years agoTake out an insurance policy in case `iter.size_hint()`
Mazdak Farrokhzad [Thu, 24 Oct 2019 01:21:23 +0000 (03:21 +0200)]
Take out an insurance policy in case `iter.size_hint()`
lies, underreporting the number of elements.

4 years agoAdd {String,Vec}::into_raw_parts
Jake Goulding [Tue, 22 Oct 2019 16:48:52 +0000 (12:48 -0400)]
Add {String,Vec}::into_raw_parts

4 years agoUse ManuallyDrop in examples for {Vec,String}::from_raw_parts
Jake Goulding [Tue, 22 Oct 2019 19:40:22 +0000 (15:40 -0400)]
Use ManuallyDrop in examples for {Vec,String}::from_raw_parts

4 years agoRemove unneeded pointer casting
Jake Goulding [Tue, 22 Oct 2019 17:54:09 +0000 (13:54 -0400)]
Remove unneeded pointer casting

4 years agoci: fix tidy
Pietro Albini [Fri, 25 Oct 2019 14:51:12 +0000 (16:51 +0200)]
ci: fix tidy

4 years agoci: set MSYS_BITS environment variable for all windows builders
Pietro Albini [Fri, 25 Oct 2019 14:02:27 +0000 (16:02 +0200)]
ci: set MSYS_BITS environment variable for all windows builders

A few dist builders lacked that variable, causing build failures.

4 years agoci: fix installation condition for MinGW
Pietro Albini [Tue, 22 Oct 2019 15:10:08 +0000 (17:10 +0200)]
ci: fix installation condition for MinGW

I mistakenly inverted the "variable is not set" check in bash.

4 years agoci: split install-msys2 step into two separate scripts
Pietro Albini [Tue, 22 Oct 2019 14:40:54 +0000 (16:40 +0200)]
ci: split install-msys2 step into two separate scripts

4 years agoci: fix wrong path being set in install-msys2.sh
Pietro Albini [Fri, 18 Oct 2019 14:32:58 +0000 (16:32 +0200)]
ci: fix wrong path being set in install-msys2.sh

4 years agoci: fix innosetup installation
Pietro Albini [Tue, 15 Oct 2019 08:21:11 +0000 (10:21 +0200)]
ci: fix innosetup installation

4 years agoci: reuse the mirrors base url from shared.sh in scripts
Pietro Albini [Wed, 9 Oct 2019 13:43:30 +0000 (15:43 +0200)]
ci: reuse the mirrors base url from shared.sh in scripts

4 years agoci: fix tidy
Pietro Albini [Tue, 8 Oct 2019 14:10:25 +0000 (16:10 +0200)]
ci: fix tidy

4 years agoci: cleanup platform detection
Pietro Albini [Tue, 8 Oct 2019 10:05:45 +0000 (12:05 +0200)]
ci: cleanup platform detection

4 years agoci: use shared.sh in scripts/install-awscli.sh
Pietro Albini [Tue, 8 Oct 2019 10:04:28 +0000 (12:04 +0200)]
ci: use shared.sh in scripts/install-awscli.sh

4 years agoci: extract verifying line endings into a script
Pietro Albini [Tue, 8 Oct 2019 10:02:41 +0000 (12:02 +0200)]
ci: extract verifying line endings into a script

4 years agoci: extract checking out submodules into a script
Pietro Albini [Tue, 8 Oct 2019 09:57:06 +0000 (11:57 +0200)]
ci: extract checking out submodules into a script

4 years agoci: extract enabling ipv6 on docker into a script
Pietro Albini [Tue, 8 Oct 2019 09:46:55 +0000 (11:46 +0200)]
ci: extract enabling ipv6 on docker into a script

4 years agoci: extract installing ninja into a script
Pietro Albini [Tue, 8 Oct 2019 09:01:47 +0000 (11:01 +0200)]
ci: extract installing ninja into a script

4 years agoci: extract installing mingw into a script
Pietro Albini [Tue, 8 Oct 2019 08:57:07 +0000 (10:57 +0200)]
ci: extract installing mingw into a script

4 years agoci: extract installing msys2 into a script
Pietro Albini [Mon, 7 Oct 2019 16:48:50 +0000 (18:48 +0200)]
ci: extract installing msys2 into a script

4 years agoforgot pushfq/popqfq: fixed
Raoul Strackx [Fri, 25 Oct 2019 14:06:13 +0000 (16:06 +0200)]
forgot pushfq/popqfq: fixed

4 years agoci: extract disabling git crlf handling into a script
Pietro Albini [Mon, 7 Oct 2019 12:57:09 +0000 (14:57 +0200)]
ci: extract disabling git crlf handling into a script

4 years agoci: extract parts of windows-build-deps into scripts
Pietro Albini [Mon, 7 Oct 2019 12:01:18 +0000 (14:01 +0200)]
ci: extract parts of windows-build-deps into scripts

4 years agoci: extract switching xcode into a script
Pietro Albini [Mon, 7 Oct 2019 11:44:37 +0000 (13:44 +0200)]
ci: extract switching xcode into a script

4 years agoci: extract installing clang into a script
Pietro Albini [Fri, 4 Oct 2019 16:53:52 +0000 (18:53 +0200)]
ci: extract installing clang into a script

4 years agoci: extract installing sccache into a script
Pietro Albini [Fri, 4 Oct 2019 16:42:53 +0000 (18:42 +0200)]
ci: extract installing sccache into a script

4 years agoci: extract dumping the environment into a script
Pietro Albini [Fri, 4 Oct 2019 16:31:31 +0000 (18:31 +0200)]
ci: extract dumping the environment into a script

4 years agoci: move install-awscli.sh into scripts/
Pietro Albini [Fri, 4 Oct 2019 16:24:10 +0000 (18:24 +0200)]
ci: move install-awscli.sh into scripts/

4 years agoExplain why pointer::add in slice::as_ptr_range is safe.
Mara Bos [Fri, 25 Oct 2019 13:21:00 +0000 (15:21 +0200)]
Explain why pointer::add in slice::as_ptr_range is safe.

4 years agocleaning up code
Raoul Strackx [Fri, 25 Oct 2019 13:44:07 +0000 (15:44 +0200)]
cleaning up code

4 years agoremoved unnecessary push
Raoul Strackx [Fri, 25 Oct 2019 13:27:48 +0000 (15:27 +0200)]
removed unnecessary push

4 years agoAdd new EFIAPI ABI
roblabla [Thu, 24 Oct 2019 15:29:29 +0000 (15:29 +0000)]
Add new EFIAPI ABI

Adds a new ABI for the EFIAPI calls. This ABI should reflect the latest
version of the UEFI specification at the time of commit (UEFI spec 2.8,
URL below). The specification says that for x86_64, we should follow the
win64 ABI, while on all other supported platforms (ia32, itanium, arm,
arm64 and risc-v), we should follow the C ABI.

To simplify the implementation, we will simply follow the C ABI on all
platforms except x86_64, even those technically unsupported by the UEFI
specification.

https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf

4 years agoUpdate test output.
Felix S. Klock II [Fri, 18 Oct 2019 09:37:05 +0000 (11:37 +0200)]
Update test output.

(My inference is that the number changed from 4 to 5 because `derive(PartialEq)` now injects an extra trait impl before.)

4 years agoReview feedback: elaborated comments.
Felix S. Klock II [Fri, 25 Oct 2019 12:47:04 +0000 (14:47 +0200)]
Review feedback: elaborated comments.

4 years agoMigrate from `#[structural_match]` attribute a lang-item trait.
Felix S. Klock II [Thu, 17 Oct 2019 08:54:37 +0000 (10:54 +0200)]
Migrate from `#[structural_match]` attribute a lang-item trait.

(Or more precisely, a pair of such traits: one for `derive(PartialEq)` and one
for `derive(Eq)`.)

((The addition of the second marker trait, `StructuralEq`, is largely a hack to
work-around `fn (&T)` not implementing `PartialEq` and `Eq`; see also issue
rust-lang/rust#46989; otherwise I would just check if `Eq` is implemented.))

Note: this does not use trait fulfillment error-reporting machinery; it just
uses the trait system to determine if the ADT was tagged or not. (Nonetheless, I
have kept an `on_unimplemented` message on the new trait for structural_match
check, even though it is currently not used.)

Note also: this does *not* resolve the ICE from rust-lang/rust#65466, as noted
in a comment added in this commit. Further work is necessary to resolve that and
other problems with the structural match checking, especially to do so without
breaking stable code (adapted from test fn-ptr-is-structurally-matchable.rs):

```rust
fn r_sm_to(_: &SM) {}

fn main() {
    const CFN6: Wrap<fn(&SM)> = Wrap(r_sm_to);
    let input: Wrap<fn(&SM)> = Wrap(r_sm_to);
    match Wrap(input) {
        Wrap(CFN6) => {}
        Wrap(_) => {}
    };
}
```

where we would hit a problem with the strategy of unconditionally checking for
`PartialEq` because the type `for <'a> fn(&'a SM)` does not currently even
*implement* `PartialEq`.

----

added review feedback:
* use an or-pattern
* eschew `return` when tail position will do.
* don't need fresh_expansion; just add `structural_match` to appropriate `allow_internal_unstable` attributes.

also fixed example in doc comment so that it actually compiles.

4 years agoAdd slice_ptr_range tracking issue number.
Mara Bos [Fri, 25 Oct 2019 12:33:07 +0000 (14:33 +0200)]
Add slice_ptr_range tracking issue number.

4 years agoAdd [T]::as_ptr_range() and [T]::as_mut_ptr_range().
Mara Bos [Fri, 25 Oct 2019 12:07:08 +0000 (14:07 +0200)]
Add [T]::as_ptr_range() and [T]::as_mut_ptr_range().

See https://github.com/rust-lang/rfcs/pull/2791 for motivation.

4 years agoAuto merge of #65804 - Centril:rollup-arlxgch, r=Centril
bors [Fri, 25 Oct 2019 11:13:30 +0000 (11:13 +0000)]
Auto merge of #65804 - Centril:rollup-arlxgch, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #64639 (Stabilize `#[non_exhaustive]` (RFC 2008))
 - #65074 (Fix the start/end byte positions in the compiler JSON output)
 - #65315 (Intern place projection)
 - #65685 (Fix check of `statx` and handle EPERM)
 - #65731 (Prevent unnecessary allocation in PathBuf::set_extension.)
 - #65740 (Fix default "disable-shortcuts" feature value)
 - #65787 (move panictry! to where it is used.)
 - #65789 (move Attribute::with_desugared_doc to librustdoc)
 - #65790 (move report_invalid_macro_expansion_item to item.rs)

Failed merges:

r? @ghost

4 years agoRollup merge of #65790 - Centril:move-report-invalid, r=davidtwco
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:55 +0000 (13:12 +0200)]
Rollup merge of #65790 - Centril:move-report-invalid, r=davidtwco

move report_invalid_macro_expansion_item to item.rs

From https://github.com/rust-lang/rust/pull/65324.

r? @Mark-Simulacrum

4 years agoRollup merge of #65789 - Centril:with-desugared-doc, r=davidtwco
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:54 +0000 (13:12 +0200)]
Rollup merge of #65789 - Centril:with-desugared-doc, r=davidtwco

move Attribute::with_desugared_doc to librustdoc

From https://github.com/rust-lang/rust/pull/65324.

r? @varkor

4 years agoRollup merge of #65787 - Centril:panictry, r=davidtwco
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:53 +0000 (13:12 +0200)]
Rollup merge of #65787 - Centril:panictry, r=davidtwco

move panictry! to where it is used.

From https://github.com/rust-lang/rust/pull/65324

r? @davidtwco

4 years agoRollup merge of #65740 - GuillaumeGomez:fix-disable-shortcut-feature, r=Dylan-DPC
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:51 +0000 (13:12 +0200)]
Rollup merge of #65740 - GuillaumeGomez:fix-disable-shortcut-feature, r=Dylan-DPC

Fix default "disable-shortcuts" feature value

Follow-up of https://github.com/rust-lang/rust/pull/65656

It fixes the bad handling of the default value of the feature (which would disable shortcut by default, which is bad!).

r? @Dylan-DPC
cc @kinnison

4 years agoRollup merge of #65731 - fusion-engineering-forks:set-extension, r=dtolnay
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:50 +0000 (13:12 +0200)]
Rollup merge of #65731 - fusion-engineering-forks:set-extension, r=dtolnay

Prevent unnecessary allocation in PathBuf::set_extension.

It was allocating a new `OsString` that was immediately dropped after using it with `set_file_name`. Now it directly changes the extension in the original buffer, without touching the rest of the file name or allocating a temporary string.

4 years agoRollup merge of #65685 - oxalica:statx-eperm, r=alexcrichton
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:48 +0000 (13:12 +0200)]
Rollup merge of #65685 - oxalica:statx-eperm, r=alexcrichton

Fix check of `statx` and handle EPERM

Should fix #65662

https://github.com/rust-lang/rust/issues/65662#issuecomment-544593939
> I think a reasonable solution might be to do something like try to stat AT_CWD initially and if that fails with EPERM or ENOSYS we disable the syscall entirely, otherwise it's cached as always good to use.

r? @alexcrichton

4 years agoRollup merge of #65315 - spastorino:intern-place-projection, r=oli-obk
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:46 +0000 (13:12 +0200)]
Rollup merge of #65315 - spastorino:intern-place-projection, r=oli-obk

Intern place projection

This should sit on top of https://github.com/rust-lang/rust/pull/65197. After that one merged, I'm gonna rebase on top of it.

The important commits are the last three and there's a bunch of code repetition that I'm going to remove but for that I need to refactor some things that probably need to be added before this PR.

Anyway this work helps as is because we can run perf tests :).

r? @oli-obk /cc @nikomatsakis

4 years agoRollup merge of #65074 - Rantanen:json-byte-pos, r=matklad
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:45 +0000 (13:12 +0200)]
Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad

Fix the start/end byte positions in the compiler JSON output

Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output.

This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one.

The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions.

Fixes #65029

4 years agoRollup merge of #64639 - davidtwco:rfc-2008-stabilization, r=Centril
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:43 +0000 (13:12 +0200)]
Rollup merge of #64639 - davidtwco:rfc-2008-stabilization, r=Centril

Stabilize `#[non_exhaustive]` (RFC 2008)

Fixes #44109.

This pull request stabilizes the `#[non_exhaustive]` attribute, which is used to indicate that a type will have more fields / variants added in the future. It can be applied to `struct`s, `enum`s and `enum` variants. See https://github.com/rust-lang/rust/issues/44109#issuecomment-533356866 for the stabilization report.

r? @Centril

4 years agorefactoring: move const_to_pat code into its own submodule.
Felix S. Klock II [Fri, 25 Oct 2019 09:39:12 +0000 (11:39 +0200)]
refactoring: move const_to_pat code into its own submodule.

4 years agoFill tracking issue number for `array_value_iter` and fix Rust version
Lukas Kalbertodt [Fri, 25 Oct 2019 08:50:21 +0000 (10:50 +0200)]
Fill tracking issue number for `array_value_iter` and fix Rust version

4 years agorefactor: move structural_match analysis into its own module.
Felix S. Klock II [Fri, 25 Oct 2019 09:27:36 +0000 (11:27 +0200)]
refactor: move structural_match analysis into its own module.

4 years agoself-profiling: Switch query-blocking measurements to RAII-style API.
Michael Woerister [Thu, 24 Oct 2019 15:37:48 +0000 (17:37 +0200)]
self-profiling: Switch query-blocking measurements to RAII-style API.

4 years agofix typo in filename.
Felix S. Klock II [Tue, 8 Oct 2019 13:55:12 +0000 (15:55 +0200)]
fix typo in filename.

4 years agofix typo in test.
Felix S. Klock II [Tue, 8 Oct 2019 13:54:37 +0000 (15:54 +0200)]
fix typo in test.

4 years agowith_desugared_doc: correctly refer to `attr` instead of `self`
Mazdak Farrokhzad [Fri, 25 Oct 2019 08:43:08 +0000 (10:43 +0200)]
with_desugared_doc: correctly refer to `attr` instead of `self`

Co-Authored-By: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
4 years agoRFC 2008: Stabilization
David Wood [Fri, 20 Sep 2019 20:09:39 +0000 (21:09 +0100)]
RFC 2008: Stabilization

This commit stabilizes RFC 2008 (#44109) by removing the feature gate.

Signed-off-by: David Wood <david@davidtw.co>
4 years agorerun cargo to generate lock file
Stefan Lankes [Fri, 25 Oct 2019 08:24:14 +0000 (10:24 +0200)]
rerun cargo to generate lock file

4 years agoupdate Cargo.lock
Stefan Lankes [Fri, 25 Oct 2019 08:03:41 +0000 (10:03 +0200)]
update Cargo.lock

4 years agoAuto merge of #65764 - Manishearth:clippyup, r=Manishearth
bors [Fri, 25 Oct 2019 07:47:13 +0000 (07:47 +0000)]
Auto merge of #65764 - Manishearth:clippyup, r=Manishearth

Update clippy

Fixes #65754

r? @ghost

4 years agoMerge branch 'master' into rusty-hermit, resolve conflicts
Stefan Lankes [Fri, 25 Oct 2019 07:09:55 +0000 (09:09 +0200)]
Merge branch 'master' into rusty-hermit, resolve conflicts

4 years agoAuto merge of #65793 - Centril:rollup-v40xke9, r=Centril
bors [Fri, 25 Oct 2019 04:24:40 +0000 (04:24 +0000)]
Auto merge of #65793 - Centril:rollup-v40xke9, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #62959 (Add by-value iterator for arrays )
 - #65390 (Add long error explanation for E0576)
 - #65408 (reorder config.toml.example options and add one missing option)
 - #65414 (ignore uninhabited non-exhaustive variant fields)
 - #65666 (Deprecated proc_macro doesn't trigger warning on build library)
 - #65742 (Pre-expansion gate most of the things)
 - #65747 (Adjust the tracking issue for `untagged_unions`.)
 - #65763 (Changed APIT with explicit generic args span to specific arg spans)
 - #65775 (Fix more `ReEmpty` ICEs)

Failed merges:

 - #65519 (trait-based structural match implementation)

r? @ghost

4 years agoRollup merge of #65775 - matthewjasper:reempty, r=pnkfelix
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:14 +0000 (06:18 +0200)]
Rollup merge of #65775 - matthewjasper:reempty, r=pnkfelix

Fix more `ReEmpty` ICEs

closes #65553

r? @pnkfelix