]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoTypo
Felix Rabe [Sat, 21 Jul 2018 09:49:52 +0000 (11:49 +0200)]
Typo

6 years agoAuto merge of #52535 - alexcrichton:update-stdsimd, r=Mark-Simulacrum
bors [Sat, 21 Jul 2018 06:26:18 +0000 (06:26 +0000)]
Auto merge of #52535 - alexcrichton:update-stdsimd, r=Mark-Simulacrum

Update stdsimd to undo an accidental stabilization

Closes #52403

6 years agoUpdate stdsimd to undo an accidental stabilization
Alex Crichton [Thu, 19 Jul 2018 14:01:37 +0000 (07:01 -0700)]
Update stdsimd to undo an accidental stabilization

Closes #52403

6 years agoAuto merge of #52536 - alexcrichton:attr-spans, r=nikomatsakis
bors [Sat, 21 Jul 2018 04:19:15 +0000 (04:19 +0000)]
Auto merge of #52536 - alexcrichton:attr-spans, r=nikomatsakis

proc_macro: Preserve spans of attributes on functions

This commit updates the tokenization of items which are subsequently passed to
`proc_macro` to ensure that span information is preserved on attributes as much
as possible. Previously this area of the code suffered from #43081 where we
haven't actually implemented converting an attribute to to a token tree yet, but
a local fix was possible here.

Closes #47941

6 years agoAuto merge of #52438 - ljedrz:rustc_vec_capacity, r=eddyb
bors [Sat, 21 Jul 2018 00:55:46 +0000 (00:55 +0000)]
Auto merge of #52438 - ljedrz:rustc_vec_capacity, r=eddyb

Calculate Vec capacities in librustc

Calculate the required capacity of a few vectors in rustc based on the number of elements they are populated with.

6 years agoAuto merge of #52574 - kennytm:rollup, r=kennytm
bors [Fri, 20 Jul 2018 22:52:11 +0000 (22:52 +0000)]
Auto merge of #52574 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

Successful merges:

 - #52502 (fix unsafety: don't call ptr_rotate for ZST)
 - #52505 (rustc: Remove a workaround in ThinLTO fixed upstream)
 - #52526 (Enable run-pass/sepcomp-lib-lto.rs on Android)
 - #52527 (Remove duplicate E0396 tests)
 - #52539 (rustc: Fix two custom attributes with custom derive)
 - #52540 (Fix docker/run.sh script when run locally)
 - #52573 (Cleanups)

Failed merges:

r? @ghost

6 years agoRollup merge of #52573 - oli-obk:cleanups, r=RalfJung
kennytm [Fri, 20 Jul 2018 18:59:13 +0000 (02:59 +0800)]
Rollup merge of #52573 - oli-obk:cleanups, r=RalfJung

Cleanups

r? @RalfJung

6 years agoRollup merge of #52540 - alexcrichton:tweak-script, r=kennytm
kennytm [Fri, 20 Jul 2018 18:59:10 +0000 (02:59 +0800)]
Rollup merge of #52540 - alexcrichton:tweak-script, r=kennytm

Fix docker/run.sh script when run locally

Switch a `mkdir $foo` to `mkdir -p $foo` to handle the case that this script is
being run locally and has previously executed.

6 years agoRollup merge of #52539 - alexcrichton:two-attrs, r=petrochenkov
kennytm [Fri, 20 Jul 2018 18:59:09 +0000 (02:59 +0800)]
Rollup merge of #52539 - alexcrichton:two-attrs, r=petrochenkov

rustc: Fix two custom attributes with custom derive

This commit fixes an issue where multiple custom attributes could not be fed
into a custom derive in some situations with the `use_extern_macros` feature
enabled. The problem was that the macro expander didn't consider that it was
making progress when we were deducing that attributes should be lumped in with
custom derive invocations.

The fix applied here was to track in the expander if our attribute is changing
(getting stashed away elsewhere and replaced with a new invocation). If it is
swapped then it's considered progress, otherwise behavior should remain the
same.

Closes #52525

6 years agoRollup merge of #52527 - ljedrz:cleanup_13973, r=oli-obk
kennytm [Fri, 20 Jul 2018 18:59:08 +0000 (02:59 +0800)]
Rollup merge of #52527 - ljedrz:cleanup_13973, r=oli-obk

Remove duplicate E0396 tests

Resolves FIXME #13973 (erroneously marked as #13972). A test for E0396 already exists in `test/ui/const-deref-ptr.rs`.

6 years agoRollup merge of #52526 - ljedrz:cleanup_18800, r=alexcrichton
kennytm [Fri, 20 Jul 2018 18:59:06 +0000 (02:59 +0800)]
Rollup merge of #52526 - ljedrz:cleanup_18800, r=alexcrichton

Enable run-pass/sepcomp-lib-lto.rs on Android

#18800 is fixed, so it should be safe to restore this test.

6 years agoRollup merge of #52505 - alexcrichton:remove-thinlto-hack, r=nikomatsakis
kennytm [Fri, 20 Jul 2018 18:59:05 +0000 (02:59 +0800)]
Rollup merge of #52505 - alexcrichton:remove-thinlto-hack, r=nikomatsakis

rustc: Remove a workaround in ThinLTO fixed upstream

This commit removes a hack in our ThinLTO passes which removes available
externally functions manually. The [upstream bug][1] has long since been fixed,
so we should be able to rely on LLVM natively for this now!

[1]: https://bugs.llvm.org/show_bug.cgi?id=35736

6 years agoRollup merge of #52502 - RalfJung:rotate, r=scottmcm
kennytm [Fri, 20 Jul 2018 18:59:04 +0000 (02:59 +0800)]
Rollup merge of #52502 - RalfJung:rotate, r=scottmcm

fix unsafety: don't call ptr_rotate for ZST

`rotate::ptr_rotate` has a comment saying
```
/// # Safety
///
/// The specified range must be valid for reading and writing.
/// The type `T` must have non-zero size.
```
So we better make sure we don't call it on ZST...

Cc @scottmcm (author of https://github.com/rust-lang/rust/pull/41670)

6 years agoRefactor a few push loops to iterators in librustc
ljedrz [Mon, 16 Jul 2018 17:35:45 +0000 (19:35 +0200)]
Refactor a few push loops to iterators in librustc

6 years agoAuto merge of #52354 - QuietMisdreavus:rustdoc-lints, r=GuillaumeGomez
bors [Fri, 20 Jul 2018 18:02:05 +0000 (18:02 +0000)]
Auto merge of #52354 - QuietMisdreavus:rustdoc-lints, r=GuillaumeGomez

stabilize lint handling in rustdoc

When https://github.com/rust-lang/rust/pull/51732 added CLI flags to manipulate lints in rustdoc, they were added as unstable flags. This made sense as they were new additions, but since they mirrored the flags that rustc has, it's worth considering them to not need an unstable period.

Stabilizing them also provides the opportunity for a critical fix: allowing Cargo to pass `--cap-lints allow` when documenting dependencies, the same as when it compiles them.

r? @rust-lang/rustdoc

6 years agoRemove unused method
Oliver Schneider [Fri, 20 Jul 2018 16:42:45 +0000 (18:42 +0200)]
Remove unused method

6 years agoOnly methods are fn-like, not other associated items
Oliver Schneider [Fri, 20 Jul 2018 15:19:58 +0000 (17:19 +0200)]
Only methods are fn-like, not other associated items

6 years agoAuto merge of #52498 - oli-obk:const_prop, r=nikomatsakis
bors [Fri, 20 Jul 2018 13:22:36 +0000 (13:22 +0000)]
Auto merge of #52498 - oli-obk:const_prop, r=nikomatsakis

Const propagate casts

fixes #49760

So... This fixes the original issue about the missing warnings.

But our test suite contains fun things like

```rust
fn foo() {}
assert_eq!(foo as i16, foo as usize as i16);
```

Which, will result in

> a raw memory access tried to access part of a pointer value as raw bytes

on both sides of the assertion. Because well... that's exactly what's going on! We're ripping out 16 bits of a pointer.

6 years agoAuto merge of #52476 - wesleywiser:categorize_queries, r=nikomatsakis
bors [Fri, 20 Jul 2018 11:10:58 +0000 (11:10 +0000)]
Auto merge of #52476 - wesleywiser:categorize_queries, r=nikomatsakis

Categorize queries for later self-profiling

Change the define_queries! macro per feedback on #51657.

Big thanks to @mark-i-m for the help getting the macro changes correct!

I'm pulling this commit out of the other PR because it's hard to keep up-to-date as queries are added or changed.

r? @nikomatsakis

6 years agoAuto merge of #52467 - alexcrichton:lints-and-macros, r=Manishearth
bors [Fri, 20 Jul 2018 08:54:14 +0000 (08:54 +0000)]
Auto merge of #52467 - alexcrichton:lints-and-macros, r=Manishearth

Squash all lints tied to foreign macros by default

This PR is a continuation of https://github.com/rust-lang/rust/pull/49755 (thanks for the initial jump-start @Dylan-DPC!) and is targeted at solving https://github.com/rust-lang/rust/issues/48855. This change updates the lint infrastructure to, by default, ignore all lints emitted for code that originates in a foreign macro. For example if `println!("...")` injects some idiomatic warnings these are all ignored by default. The rationale here is that for almost all lints there's no action that can be taken if the code originates from a foreign lint.

Closes #48855
Closes #52483
Closes #52479

6 years agoRemove duplicate E0396 tests
ljedrz [Thu, 19 Jul 2018 08:28:25 +0000 (10:28 +0200)]
Remove duplicate E0396 tests

6 years agoAuto merge of #52445 - alexcrichton:wasm-import-module, r=eddyb
bors [Fri, 20 Jul 2018 06:40:10 +0000 (06:40 +0000)]
Auto merge of #52445 - alexcrichton:wasm-import-module, r=eddyb

rustc: Stabilize #[wasm_import_module] as #[link(...)]

This commit stabilizes the `#[wasm_import_module]` attribute as
`#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in
the `#[link]` attribute is used to configured the module name that the imports
are listed with. The WebAssembly specification indicates two utf-8 names are
associated with all imported items, one for the module the item comes from and
one for the item itself. The item itself is configurable in Rust via its
identifier or `#[link_name = "..."]`, but the module name was previously not
configurable and defaulted to `"env"`. This commit ensures that this is also
configurable.

Closes #52090

6 years agoAuto merge of #52349 - RalfJung:once, r=alexcrichton
bors [Fri, 20 Jul 2018 02:52:19 +0000 (02:52 +0000)]
Auto merge of #52349 - RalfJung:once, r=alexcrichton

sync::Once use release-acquire access modes

Nothing here makes a case distinction like "this happened before OR after that". All we need is to get happens-before edges whenever we see that the state/signal has been changed. Release-acquire is good enough for that.

6 years agoAuto merge of #52024 - oli-obk:existential_parse, r=nikomatsakis
bors [Thu, 19 Jul 2018 21:14:01 +0000 (21:14 +0000)]
Auto merge of #52024 - oli-obk:existential_parse, r=nikomatsakis

Implement existential types

(not for associated types yet)

r? @nikomatsakis

cc @Centril @varkor @alexreg

6 years agoAuto merge of #51854 - davidtwco:rfc-2008-rustdoc, r=QuietMisdreavus
bors [Thu, 19 Jul 2018 19:03:03 +0000 (19:03 +0000)]
Auto merge of #51854 - davidtwco:rfc-2008-rustdoc, r=QuietMisdreavus

RFC 2008 non-exhaustive enums/structs: Rustdoc

Part of #44109. Not sure how those who maintain rustdoc primarily would prefer this addition look or where it should be placed, happy to make any changes required.

r? @QuietMisdreavus (not sure if this is the right person, just guessing)

6 years agoGenerate a page for existential types
Oliver Schneider [Thu, 19 Jul 2018 08:23:56 +0000 (10:23 +0200)]
Generate a page for existential types

6 years agoUpdated FRU terminology.
David Wood [Thu, 19 Jul 2018 16:03:17 +0000 (17:03 +0100)]
Updated FRU terminology.

6 years agoFix docker/run.sh script when run locally
Alex Crichton [Thu, 19 Jul 2018 14:48:17 +0000 (07:48 -0700)]
Fix docker/run.sh script when run locally

Switch a `mkdir $foo` to `mkdir -p $foo` to handle the case that this script is
being run locally and has previously executed.

6 years agorustc: Fix two custom attributes with custom derive
Alex Crichton [Thu, 19 Jul 2018 14:43:58 +0000 (07:43 -0700)]
rustc: Fix two custom attributes with custom derive

This commit fixes an issue where multiple custom attributes could not be fed
into a custom derive in some situations with the `use_extern_macros` feature
enabled. The problem was that the macro expander didn't consider that it was
making progress when we were deducing that attributes should be lumped in with
custom derive invocations.

The fix applied here was to track in the expander if our attribute is changing
(getting stashed away elsewhere and replaced with a new invocation). If it is
swapped then it's considered progress, otherwise behavior should remain the
same.

Closes #52525

6 years agoproc_macro: Preserve spans of attributes on functions
Alex Crichton [Thu, 19 Jul 2018 14:06:31 +0000 (07:06 -0700)]
proc_macro: Preserve spans of attributes on functions

This commit updates the tokenization of items which are subsequently passed to
`proc_macro` to ensure that span information is preserved on attributes as much
as possible. Previously this area of the code suffered from #43081 where we
haven't actually implemented converting an attribute to to a token tree yet, but
a local fix was possible here.

Closes #47941

6 years agoAuto merge of #52197 - euclio:exit-code, r=oli-obk
bors [Thu, 19 Jul 2018 13:46:15 +0000 (13:46 +0000)]
Auto merge of #52197 - euclio:exit-code, r=oli-obk

overhaul exit codes for rustc and rustdoc

This commit changes the exit status of rustc to 1 in the presence of
compilation errors. In the event of an unexpected panic (ICE) the
standard panic error exit status of 101 remains.

A run-make test is added to ensure that the exit code does not regress,
and compiletest is updated to check for an exit status of 1 or 101,
depending on the mode and suite.

This is a breaking change for custom drivers.

Note that while changes were made to the rustdoc binary, there is no
intended behavior change. rustdoc errors (i.e., failed lints) will still
report 101. While this could *also* hide potential ICEs, I will leave
that work to a future PR.

Fixes #51971.

6 years agoAuto merge of #52515 - Manishearth:clippyup, r=kennytm
bors [Thu, 19 Jul 2018 09:55:17 +0000 (09:55 +0000)]
Auto merge of #52515 - Manishearth:clippyup, r=kennytm

Update clippy

Silences the warnings for now, will fix those over time.

6 years agoEnable run-pass/sepcomp-lib-lto.rs on Android
ljedrz [Thu, 19 Jul 2018 08:11:55 +0000 (10:11 +0200)]
Enable run-pass/sepcomp-lib-lto.rs on Android

6 years agofix safety-related comment in slice::rotate
Ralf Jung [Thu, 19 Jul 2018 07:11:56 +0000 (09:11 +0200)]
fix safety-related comment in slice::rotate

6 years agoUpdate clippy
Manish Goregaokar [Thu, 19 Jul 2018 03:25:11 +0000 (20:25 -0700)]
Update clippy

6 years agoAuto merge of #52429 - alexcrichton:update-cargo, r=Mark-Simulacrum
bors [Thu, 19 Jul 2018 03:05:05 +0000 (03:05 +0000)]
Auto merge of #52429 - alexcrichton:update-cargo, r=Mark-Simulacrum

Update Cargo and stdsimd submodules

Update Cargo to bring in some bug fixes and such, and update `stdsimd` to...

Closes #52403

6 years agoAuto merge of #52486 - kennytm:rollup, r=kennytm
bors [Thu, 19 Jul 2018 00:56:21 +0000 (00:56 +0000)]
Auto merge of #52486 - kennytm:rollup, r=kennytm

Rollup of 13 pull requests

Successful merges:

 - #51628 (use checked write in `LineWriter` example)
 - #52116 (Handle array manually in str case conversion methods)
 - #52218 (Amend option.take examples)
 - #52418 (Do not use desugared ident when suggesting adding a type)
 - #52439 (Revert some changes from #51917 to fix custom libdir)
 - #52455 (Fix doc comment: use `?` instead of `.unwrap()`)
 - #52458 (rustc: Fix a suggestion for the `proc_macro` feature)
 - #52464 (Allow clippy to be installed with make install)
 - #52472 (rustc: Enable `use_extern_macros` in 2018 edition)
 - #52477 (Clarify short-circuiting behvaior of Iterator::zip.)
 - #52480 (Cleanup #24958)
 - #52487 (Don't build twice the sanitizers on Linux)
 - #52510 (rustdoc: remove FIXME about macro redirects)

Failed merges:

r? @ghost

6 years agoUpdate Cargo submodule
Alex Crichton [Tue, 17 Jul 2018 16:04:22 +0000 (09:04 -0700)]
Update Cargo submodule

6 years agoAuto merge of #52431 - semarie:compiler-builtins, r=alexcrichton
bors [Wed, 18 Jul 2018 22:15:46 +0000 (22:15 +0000)]
Auto merge of #52431 - semarie:compiler-builtins, r=alexcrichton

update compiler-builtins for openbsd

import rust-lang-nursery/compiler-builtins/pull/249 in rust main line.

it solves an issue on OpenBSD with building of `librsvg`.

6 years agoRollup merge of #52510 - QuietMisdreavus:redirects-are-cool, r=nrc
kennytm [Wed, 18 Jul 2018 21:46:10 +0000 (05:46 +0800)]
Rollup merge of #52510 - QuietMisdreavus:redirects-are-cool, r=nrc

rustdoc: remove FIXME about macro redirects

Based on the discussion in #35705, the rustdoc team has determined that macro redirects are here to stay.

Closes #35705

6 years agoRollup merge of #52418 - estebank:desugaring-type, r=nikomatsakis
kennytm [Wed, 18 Jul 2018 21:45:16 +0000 (05:45 +0800)]
Rollup merge of #52418 - estebank:desugaring-type, r=nikomatsakis

Do not use desugared ident when suggesting adding a type

Re #51116.

6 years agoremove FIXME about macro redirects
QuietMisdreavus [Wed, 18 Jul 2018 20:41:13 +0000 (15:41 -0500)]
remove FIXME about macro redirects

Based on the discussion in #35705, the rustdoc team has determined that macro redirects are here to stay.

Closes #35705

6 years agoUpdated wording and placement of non-exhaustive notice so it is collapsed by default...
David Wood [Wed, 18 Jul 2018 19:27:25 +0000 (20:27 +0100)]
Updated wording and placement of non-exhaustive notice so it is collapsed by default and easier to understand.

6 years agorustc: Remove a workaroudn in ThinLTO fixed upstream
Alex Crichton [Wed, 18 Jul 2018 18:37:56 +0000 (11:37 -0700)]
rustc: Remove a workaroudn in ThinLTO fixed upstream

This commit removes a hack in our ThinLTO passes which removes available
externally functions manually. The [upstream bug][1] has long since been fixed,
so we should be able to rely on LLVM natively for this now!

[1]: https://bugs.llvm.org/show_bug.cgi?id=35736

6 years agoupdate compiler-builtins for openbsd
Sébastien Marie [Mon, 16 Jul 2018 14:26:43 +0000 (16:26 +0200)]
update compiler-builtins for openbsd

6 years agoUpdate test output
Esteban Küber [Wed, 18 Jul 2018 17:04:10 +0000 (10:04 -0700)]
Update test output

6 years agoChange label span to point at iterator instead of iter item
Esteban Küber [Mon, 16 Jul 2018 21:05:42 +0000 (14:05 -0700)]
Change label span to point at iterator instead of iter item

6 years agoDo not use desugared ident when suggesting adding a type
Esteban Küber [Mon, 16 Jul 2018 03:52:41 +0000 (20:52 -0700)]
Do not use desugared ident when suggesting adding a type

6 years agoRollup merge of #52480 - ljedrz:cleanup_24958, r=oli-obk
kennytm [Wed, 18 Jul 2018 17:00:33 +0000 (01:00 +0800)]
Rollup merge of #52480 - ljedrz:cleanup_24958, r=oli-obk

Cleanup #24958

Since #24958 was closed we might want to remove the workarounds it introduced for android, arm and aarch64.

6 years agoRollup merge of #51628 - euclio:line-writer, r=frewsxcv
kennytm [Wed, 18 Jul 2018 16:59:47 +0000 (00:59 +0800)]
Rollup merge of #51628 - euclio:line-writer, r=frewsxcv

use checked write in `LineWriter` example

The example was wrong because it didn't check the return value of
`write()`, and it didn't flush the buffer before comparing the contents
of the file.

Fixes #51621.

6 years agoRollup merge of #52487 - alexcrichton:build-less-sanitizers, r=kennytm
kennytm [Wed, 18 Jul 2018 16:58:55 +0000 (00:58 +0800)]
Rollup merge of #52487 - alexcrichton:build-less-sanitizers, r=kennytm

Don't build twice the sanitizers on Linux

This commit is an attempted fix at #50887. It was noticed that on that issue
we're building both x86_64 and i386 versions of libraries, but we only actually
need the x86_64 versions! This hopes that the build race condition exhibited
in #50887 is connected to building both architectures and/or building a lot of
libraries, so this should help us build precisely what we need and no more.

6 years agoConst-propagate casts
Oliver Schneider [Wed, 18 Jul 2018 12:23:07 +0000 (14:23 +0200)]
Const-propagate casts

6 years agoAuto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearth
bors [Wed, 18 Jul 2018 15:04:17 +0000 (15:04 +0000)]
Auto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearth

Lint `async` identifiers in 2018 preparation mode

r? @Manishearth

fixes https://github.com/rust-lang/rust/issues/49716

6 years agorustc: Stabilize #[wasm_import_module] as #[link(...)]
Alex Crichton [Mon, 16 Jul 2018 18:31:14 +0000 (11:31 -0700)]
rustc: Stabilize #[wasm_import_module] as #[link(...)]

This commit stabilizes the `#[wasm_import_module]` attribute as
`#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in
the `#[link]` attribute is used to configured the module name that the imports
are listed with. The WebAssembly specification indicates two utf-8 names are
associated with all imported items, one for the module the item comes from and
one for the item itself. The item itself is configurable in Rust via its
identifier or `#[link_name = "..."]`, but the module name was previously not
configurable and defaulted to `"env"`. This commit ensures that this is also
configurable.

Closes #52090

6 years agoDon't build twice the sanitizers on Linux
Alex Crichton [Wed, 18 Jul 2018 14:34:54 +0000 (07:34 -0700)]
Don't build twice the sanitizers on Linux

This commit is an attempted fix at #50887. It was noticed that on that issue
we're building both x86_64 and i386 versions of libraries, but we only actually
need the x86_64 versions! This hopes that the build race condition exhibited
in #50887 is connected to building both architectures and/or building a lot of
libraries, so this should help us build precisely what we need and no more.

6 years agoRollup merge of #52477 - frewsxcv:frewsxcv-iter-short, r=alexcrichton
kennytm [Wed, 18 Jul 2018 14:35:04 +0000 (22:35 +0800)]
Rollup merge of #52477 - frewsxcv:frewsxcv-iter-short, r=alexcrichton

Clarify short-circuiting behvaior of Iterator::zip.

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

6 years agoRollup merge of #52472 - alexcrichton:macros-edition-2018, r=petrochenkov
kennytm [Wed, 18 Jul 2018 14:35:03 +0000 (22:35 +0800)]
Rollup merge of #52472 - alexcrichton:macros-edition-2018, r=petrochenkov

rustc: Enable `use_extern_macros` in 2018 edition

This was previously enabled via `proc_macro`, but since `proc_macro` is now
stable this is no longer the case. Explicitly include it in the 2018 edition
here.

6 years agoRollup merge of #52464 - o01eg:patch-1, r=alexcrichton
kennytm [Wed, 18 Jul 2018 14:35:01 +0000 (22:35 +0800)]
Rollup merge of #52464 - o01eg:patch-1, r=alexcrichton

Allow clippy to be installed with make install

After #51122 clippy is available as a component but doesn't install when building from source.

This PR allows to install clippy with extended tools.

6 years agoRollup merge of #52458 - alexcrichton:fix-suggestion, r=petrochenkov
kennytm [Wed, 18 Jul 2018 14:35:00 +0000 (22:35 +0800)]
Rollup merge of #52458 - alexcrichton:fix-suggestion, r=petrochenkov

rustc: Fix a suggestion for the `proc_macro` feature

This feature is stable, we shouldn't suggest it any more! Instead suggest the
real feature, `use_extern_macros`.

6 years agoRollup merge of #52455 - felixrabe:patch-1, r=estebank
kennytm [Wed, 18 Jul 2018 14:34:59 +0000 (22:34 +0800)]
Rollup merge of #52455 - felixrabe:patch-1, r=estebank

Fix doc comment: use `?` instead of `.unwrap()`

6 years agoRollup merge of #52439 - o01eg:fix-52317, r=alexcrichton
kennytm [Wed, 18 Jul 2018 14:34:57 +0000 (22:34 +0800)]
Rollup merge of #52439 - o01eg:fix-52317, r=alexcrichton

Revert some changes from #51917 to fix custom libdir

Should fix #52317 also adds `libdir` value to output.

6 years agoRollup merge of #52218 - rivertam:patch-1, r=withoutboats
kennytm [Wed, 18 Jul 2018 14:34:56 +0000 (22:34 +0800)]
Rollup merge of #52218 - rivertam:patch-1, r=withoutboats

Amend option.take examples

It wasn't abundantly clear to me what `.take` returned. Perhaps this is a slightly frivolous change, but I think it's an improvement. =)

Apologies if I'm not following proper procedures.

6 years agoRollup merge of #52116 - Pazzaz:match-str-case, r=SimonSapin
kennytm [Wed, 18 Jul 2018 14:34:54 +0000 (22:34 +0800)]
Rollup merge of #52116 - Pazzaz:match-str-case, r=SimonSapin

Handle array manually in str case conversion methods

Avoiding the overhead incurred from `String.extend(char.to_lowercase())` showed a notable performance improvement when I benchmarked it.

I tested on these strings:
```rust
ALL_LOWER:       "loremipsumdolorsitametduosensibusmnesarchumabcdefgh"
ALL_UPPER:       "LOREMIPSUMDOLORSITAMETDUOSENSIBUSMNESARCHUMABCDEFGH"
REALISTIC_UPPER: "LOREM IPSUM DOLOR SIT AMET, DUO SENSIBUS MNESARCHUM"
SIGMAS:          "ΣΣΣΣΣ ΣΣΣΣΣ ΣΣΣΣΣ ΣΣΣ ΣΣΣΣ, ΣΣΣ ΣΣΣΣΣΣΣΣ ΣΣΣΣΣΣΣΣΣΣ"
WORD_UPPER:      "Lorem Ipsum Dolor Sit Amet, Duo Sensibus Mnesarchum"
```
the performance improvements of `to_lowercase()` were
```
running 10 tests
test tests::all_lower           ... bench:       1,752 ns/iter (+/- 49)
test tests::all_lower_new       ... bench:       1,266 ns/iter (+/- 15)   -28%
test tests::all_upper           ... bench:       1,832 ns/iter (+/- 39)
test tests::all_upper_new       ... bench:       1,337 ns/iter (+/- 18)   -27%
test tests::realistic_upper     ... bench:       1,993 ns/iter (+/- 14)
test tests::realistic_upper_new ... bench:       1,445 ns/iter (+/- 22)   -27%
test tests::sigmas              ... bench:       1,342 ns/iter (+/- 39)
test tests::sigmas_new          ... bench:       1,226 ns/iter (+/- 16)    -9%
test tests::word_upper          ... bench:       1,899 ns/iter (+/- 12)
test tests::word_upper_new      ... bench:       1,381 ns/iter (+/- 26)   -27%
```
and of `to_uppercase()`
```
running 10 tests
test tests::all_lower           ... bench:       1,813 ns/iter (+/- 20)
test tests::all_lower_new       ... bench:       1,321 ns/iter (+/- 16)   -27%
test tests::all_upper           ... bench:       1,629 ns/iter (+/- 22)
test tests::all_upper_new       ... bench:       1,241 ns/iter (+/- 9)    -24%
test tests::realistic_upper     ... bench:       1,670 ns/iter (+/- 24)
test tests::realistic_upper_new ... bench:       1,241 ns/iter (+/- 17)   -26%
test tests::sigmas              ... bench:       2,053 ns/iter (+/- 20)
test tests::sigmas_new          ... bench:       1,753 ns/iter (+/- 23)   -15%
test tests::word_upper          ... bench:       1,873 ns/iter (+/- 30)
test tests::word_upper_new      ... bench:       1,412 ns/iter (+/- 25)   -25%
```
I gave up on the more advanced method from #52061 as it wasn't always a clear improvement and would help in even less cases if this PR was merged.

6 years agoAdjust run pass test to stricter existential type rules
Oliver Schneider [Wed, 18 Jul 2018 11:54:32 +0000 (13:54 +0200)]
Adjust run pass test to stricter existential type rules

6 years agoRemove workarounds for #24958
ljedrz [Wed, 18 Jul 2018 11:58:08 +0000 (13:58 +0200)]
Remove workarounds for #24958

6 years agoAuto merge of #52364 - ljedrz:mir_remove_clone, r=RalfJung
bors [Wed, 18 Jul 2018 11:49:38 +0000 (11:49 +0000)]
Auto merge of #52364 - ljedrz:mir_remove_clone, r=RalfJung

Remove a clone in mir/transform/add_validation

Remove a clone of `mir.local_decls`.

6 years agoMake `async_idents` allow-by-default
Oliver Schneider [Wed, 18 Jul 2018 08:55:41 +0000 (10:55 +0200)]
Make `async_idents` allow-by-default

6 years agoMove the const casting code into its dedicated file
Oliver Schneider [Wed, 18 Jul 2018 09:39:17 +0000 (11:39 +0200)]
Move the const casting code into its dedicated file

6 years agoAuto merge of #52426 - ljedrz:#28273_cleanup, r=nikomatsakis
bors [Wed, 18 Jul 2018 09:10:16 +0000 (09:10 +0000)]
Auto merge of #52426 - ljedrz:#28273_cleanup, r=nikomatsakis

Enable default inlining in platform intrinsics

Since [#28273](https://github.com/rust-lang/rust/issues/28273) has been fixed for quite some time, it might be a good idea to return to default inlining in platform intrinsics.

6 years agoAdd some tests around associated types
Oliver Schneider [Tue, 17 Jul 2018 13:11:00 +0000 (15:11 +0200)]
Add some tests around associated types

6 years agoPrepare for using wfcheck on existential types
Oliver Schneider [Tue, 17 Jul 2018 11:44:42 +0000 (13:44 +0200)]
Prepare for using wfcheck on existential types

6 years agoCheck lifetimes on existential types
Oliver Schneider [Tue, 17 Jul 2018 09:21:54 +0000 (11:21 +0200)]
Check lifetimes on existential types

6 years agoMatch ergonomics
Oliver Schneider [Tue, 17 Jul 2018 09:21:26 +0000 (11:21 +0200)]
Match ergonomics

6 years agoSimplify defining scope logic
Oliver Schneider [Tue, 17 Jul 2018 09:21:10 +0000 (11:21 +0200)]
Simplify defining scope logic

6 years agoMore documentation
Oliver Schneider [Tue, 17 Jul 2018 09:20:50 +0000 (11:20 +0200)]
More documentation

6 years agoSplit monster tests into smaller ones
Oliver Schneider [Mon, 16 Jul 2018 15:17:01 +0000 (17:17 +0200)]
Split monster tests into smaller ones

6 years agoMove some tests around
Oliver Schneider [Mon, 16 Jul 2018 14:49:35 +0000 (16:49 +0200)]
Move some tests around

6 years agodefault impls for methods can contain existential types inside
Oliver Schneider [Mon, 16 Jul 2018 09:20:35 +0000 (11:20 +0200)]
default impls for methods can contain existential types inside

6 years agoDon't call `local_def_id` twice on the same node id
Oliver Schneider [Mon, 16 Jul 2018 09:19:36 +0000 (11:19 +0200)]
Don't call `local_def_id` twice on the same node id

6 years agoAdd test for using existential types in associated types
Oliver Schneider [Mon, 16 Jul 2018 08:57:31 +0000 (10:57 +0200)]
Add test for using existential types in associated types

6 years agoOnly check existential types, not the desugared impl Trait
Oliver Schneider [Mon, 16 Jul 2018 08:46:27 +0000 (10:46 +0200)]
Only check existential types, not the desugared impl Trait

6 years agoTypeck existential types properly
Oliver Schneider [Wed, 11 Jul 2018 14:01:48 +0000 (16:01 +0200)]
Typeck existential types properly

6 years agoImplement existential types
Oliver Schneider [Tue, 3 Jul 2018 17:38:14 +0000 (19:38 +0200)]
Implement existential types

6 years agorustc: distinguish compilation failure from ICE
Andy Russell [Mon, 9 Jul 2018 18:01:10 +0000 (14:01 -0400)]
rustc: distinguish compilation failure from ICE

This commit changes the exit status of rustc to 1 in the presence of
compilation errors. In the event of an unexpected panic (ICE) the
standard panic error exit status of 101 remains.

A run-make test is added to ensure that the exit code does not regress,
and compiletest is updated to check for an exit status of 1 or 101,
depending on the mode and suite.

This is a breaking change for custom drivers.

Fixes #51971.

6 years agoClarify short-circuiting behvaior of Iterator::zip.
Corey Farwell [Wed, 18 Jul 2018 03:39:37 +0000 (23:39 -0400)]
Clarify short-circuiting behvaior of Iterator::zip.

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

6 years agoAuto merge of #52353 - alexcrichton:wasm-custom-section, r=eddyb
bors [Wed, 18 Jul 2018 03:05:27 +0000 (03:05 +0000)]
Auto merge of #52353 - alexcrichton:wasm-custom-section, r=eddyb

rustc: Use link_section, not wasm_custom_section

This commit transitions definitions of custom sections on the wasm target from
the unstable `#[wasm_custom_section]` attribute to the
already-stable-for-other-targets `#[link_section]` attribute. Mostly the same
restrictions apply as before, except that this now applies only to statics.

Closes #51088

6 years agoCategorize queries for later self-profiling
Wesley Wiser [Sat, 19 May 2018 17:50:58 +0000 (13:50 -0400)]
Categorize queries for later self-profiling

Change the define_queries! macro per feedback on #51657.

Big thanks to @mark-i-m for the help getting the macro changes correct!

6 years agoAuto merge of #52342 - nnethercote:CanonicalVar, r=nikomatsakis
bors [Wed, 18 Jul 2018 00:45:57 +0000 (00:45 +0000)]
Auto merge of #52342 - nnethercote:CanonicalVar, r=nikomatsakis

Avoid most allocations in `Canonicalizer`.

Extra allocations are a significant cost of NLL, and the most common
ones come from within `Canonicalizer`. In particular, `canonical_var()`
contains this code:

    indices
.entry(kind)
.or_insert_with(|| {
    let cvar1 = variables.push(info);
    let cvar2 = var_values.push(kind);
    assert_eq!(cvar1, cvar2);
    cvar1
})
.clone()

`variables` and `var_values` are `Vec`s. `indices` is a `HashMap` used
to track what elements have been inserted into `var_values`. If `kind`
hasn't been seen before, `indices`, `variables` and `var_values` all get
a new element. (The number of elements in each container is always the
same.) This results in lots of allocations.

In practice, most of the time these containers only end up holding a few
elements. This PR changes them to avoid heap allocations in the common
case, by changing the `Vec`s to `SmallVec`s and only using `indices`
once enough elements are present. (When the number of elements is small,
a direct linear search of `var_values` is as good or better than a
hashmap lookup.)

The changes to `variables` are straightforward and contained within
`Canonicalizer`. The changes to `indices` are more complex but also
contained within `Canonicalizer`. The changes to `var_values` are more
intrusive because they require defining a new type
`SmallCanonicalVarValues` -- which is to `CanonicalVarValues` as
`SmallVec` is to `Vec -- and passing stack-allocated values of that type
in from outside.

All this speeds up a number of NLL "check" builds, the best by 2%.

r? @nikomatsakis

6 years agorustc: Enable `use_extern_macros` in 2018 edition
Alex Crichton [Tue, 17 Jul 2018 21:45:16 +0000 (14:45 -0700)]
rustc: Enable `use_extern_macros` in 2018 edition

This was previously enabled via `proc_macro`, but since `proc_macro` is now
stable this is no longer the case. Explicitly include it in the 2018 edition
here.

6 years agoAuto merge of #52145 - ExpHP:drop-it-like-its-eof, r=nikomatsakis
bors [Tue, 17 Jul 2018 19:28:23 +0000 (19:28 +0000)]
Auto merge of #52145 - ExpHP:drop-it-like-its-eof, r=nikomatsakis

Fix macro parser quadratic complexity in small repeating groups

Observed in #51754, and more easily demonstrated with the following:

```rust
macro_rules! stress {
    ($($t:tt)+) => { };
}

fn main() {
    stress!{
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        //    ... 65536 copies of "a" total ...
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    }
}
```
which takes 50 seconds to compile prior to the fix and <1s after.

I hope this has a visible impact on the compile times for real code.  (I think it is most likely to affect incremental TT munchers that deal with large inputs, though it depends on how they are written)

For a fuller description of the performance issue:  https://github.com/rust-lang/rust/issues/51754#issuecomment-403242159

---

There is no test (yet) because I'm not sure how easily to measure this for regressions.

6 years agorustc: Polish off `in_external_macro`
Alex Crichton [Tue, 17 Jul 2018 17:23:03 +0000 (10:23 -0700)]
rustc: Polish off `in_external_macro`

This commit polishes off this new function to compile on newer rustc as well as
update and add a suite of test cases to work with this new check for lints.

6 years agosync::Once: Use Acquire on the hot path, and explain why we don't use it elsewhere
Ralf Jung [Tue, 17 Jul 2018 18:51:31 +0000 (20:51 +0200)]
sync::Once: Use Acquire on the hot path, and explain why we don't use it elsewhere

6 years agoMake `async_idents` an edition incompat lint
Oliver Schneider [Tue, 17 Jul 2018 17:56:41 +0000 (19:56 +0200)]
Make `async_idents` an edition incompat lint

6 years agoAllow clippy to be installed with make install
O01eg [Tue, 17 Jul 2018 16:39:54 +0000 (19:39 +0300)]
Allow clippy to be installed with make install

After #51122 clippy is available as a component but don't install when building from source.

This PR allows to install clippy with extended tools.

6 years agoadded function to check if lints belong to an external macro
dylan_DPC [Sat, 7 Apr 2018 10:20:36 +0000 (15:50 +0530)]
added function to check if lints belong to an external macro

6 years agoPull out a statement that all match arms are executing
Oliver Schneider [Tue, 17 Jul 2018 13:46:08 +0000 (15:46 +0200)]
Pull out a statement that all match arms are executing

6 years agoAuto merge of #52404 - felixrabe:doc-link-ch19-04-typo, r=GuillaumeGomez
bors [Tue, 17 Jul 2018 15:39:33 +0000 (15:39 +0000)]
Auto merge of #52404 - felixrabe:doc-link-ch19-04-typo, r=GuillaumeGomez

Fix doc link

Result of first searching via:

    find src -type f -exec fgrep -l dynamically-sized-types--sized {} \;

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -exec sed -i.bak \
      s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g {} \;
    find src -type f -name '*.bak' -exec rm {} \;

(Note: Commands run on macOS 10.13 (BSD).  `sed -i.bak` should work on
GNU/Linux as well, but not tested.)

EDIT: Did not compile / test Rust for this change at all.

Clickable links for comparison:
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken)
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)

6 years agorustc: Fix a suggestion for the `proc_macro` feature
Alex Crichton [Tue, 17 Jul 2018 14:14:54 +0000 (07:14 -0700)]
rustc: Fix a suggestion for the `proc_macro` feature

This feature is stable, we shouldn't suggest it any more! Instead suggest the
real feature, `use_extern_macros`.

6 years agoAuto merge of #52433 - kennytm:rollup, r=kennytm
bors [Tue, 17 Jul 2018 13:31:35 +0000 (13:31 +0000)]
Auto merge of #52433 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

Successful merges:

 - #52286 (Deny bare trait objects in src/librustc_errors)
 - #52306 (Reduce the number of clone()s needed in obligation_forest)
 - #52338 (update miri)
 - #52385 (Pass edition flags to compiler from rustdoc as expected)
 - #52392 (AsRef doc wording tweaks)
 - #52430 (update nomicon)
 - #52434 (Enable incremental independent of stage)
 - #52435 (Calculate the exact capacity for 2 HashMaps)
 - #52446 (Block beta if clippy breaks.)

r? @ghost

6 years agoFix doc comment: use `?` instead of `.unwrap()`
Felix Rabe [Tue, 17 Jul 2018 12:18:58 +0000 (14:18 +0200)]
Fix doc comment: use `?` instead of `.unwrap()`