]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoMake Vec::new const
Mark Mansi [Wed, 25 Apr 2018 21:33:02 +0000 (16:33 -0500)]
Make Vec::new const

6 years agoAuto merge of #49321 - ishitatsuyuki:compile-pass, r=alexcrichton
bors [Wed, 25 Apr 2018 14:52:30 +0000 (14:52 +0000)]
Auto merge of #49321 - ishitatsuyuki:compile-pass, r=alexcrichton

Introduce compile-pass

r? @alexcrichton

The plan is to move things that cannot fail (no assert, unwrap, etc) out so we don't have to run them, and in the long term we can also stop running LLVM for them.

Out of 3215 tests...

```
Language            Files        Lines         Code     Comments       Blanks
Rust                 3215       119254        64688        35135        19431
```

16% of them has an empty main (which is already moved in this PR).

```
grep -rnPzl 'fn main\(\)\s*{\s*}' | xargs rg --files-without-match cfg | wc -l
547
```

And only 50% of the tests contains assertions:

```
rg -e assert -e unwrap -e expect -e panic -l | wc -l
1600
```

The remainder is likely able to get moved, but they need check by a human so I didn't touch them in PR.

cc @rust-lang/compiler

* [ ] Update documentation

6 years agoAuto merge of #50134 - andjo403:jobserver, r=michaelwoerister
bors [Wed, 25 Apr 2018 11:40:18 +0000 (11:40 +0000)]
Auto merge of #50134 - andjo403:jobserver, r=michaelwoerister

make rustdoc test follow the jobserver limit of threads

fix that to many threads is executing at the same time
when rustdoc test is executed.

6 years agoAuto merge of #50110 - oli-obk:warn_all_the_constants, r=estebank
bors [Wed, 25 Apr 2018 09:19:07 +0000 (09:19 +0000)]
Auto merge of #50110 - oli-obk:warn_all_the_constants, r=estebank

Warn on all erroneous constants

fixes #49791
fixes #47054

@Zoxc this PR triggers the nondeterministic errors of https://github.com/rust-lang/rust/pull/49950#issuecomment-383074959 really often (at least on stage1).

6 years agocompiletest: introduce skip-trans
Tatsuyuki Ishi [Wed, 25 Apr 2018 09:05:47 +0000 (18:05 +0900)]
compiletest: introduce skip-trans

6 years agoAuto merge of #50106 - nnethercote:nearest_common_ancestor, r=nikomatsakis
bors [Wed, 25 Apr 2018 06:48:40 +0000 (06:48 +0000)]
Auto merge of #50106 - nnethercote:nearest_common_ancestor, r=nikomatsakis

Speed up `nearest_common_ancestor`.

`nearest_common_ancestor` can be made faster.

Here are all the benchmarks where one of the measurements improved by at least 1%.
```
clap-rs-check
avg: -4.5% min: -8.8% max: -0.3%
clap-rs
avg: -2.6% min: -4.5% max: 0.5%
script-servo
avg: -1.7% min: -3.6% max: 0.0%
regression-31157
avg: -1.5% min: -2.6% max: -0.4%
hyper
avg: -1.2% min: -2.5% max: -0.0%
piston-image
avg: -1.6% min: -2.5% max: 0.1%
regex
avg: -1.2% min: -2.2% max: 0.0%
issue-46449
avg: -1.8% min: -2.1% max: -0.7%
crates.io
avg: -1.2% min: -2.1% max: 0.0%
hyper-check
avg: -1.0% min: -2.1% max: -0.1%
clap-rs-opt
avg: -1.4% min: -2.0% max: -0.3%
piston-image-check
avg: -1.2% min: -1.9% max: -0.1%
regex-check
avg: -0.5% min: -1.8% max: -0.1%
syn
avg: -1.1% min: -1.7% max: -0.1%
tokio-webpush-simple-check
avg: -1.1% min: -1.6% max: -0.3%
tokio-webpush-simple
avg: -1.2% min: -1.6% max: -0.0%
helloworld-check
avg: -1.4% min: -1.6% max: -1.2%
deeply-nested
avg: -1.2% min: -1.4% max: -0.8%
encoding-check
avg: -0.8% min: -1.3% max: -0.3%
unify-linearly-check
avg: -1.0% min: -1.3% max: -0.8%
script-servo-check
avg: -0.6% min: -1.3% max: 0.0%
regression-31157-check
avg: -0.9% min: -1.2% max: -0.7%
script-servo-opt
avg: -0.5% min: -1.2% max: 0.1%
deeply-nested-check
avg: -0.8% min: -1.2% max: -0.7%
encoding
avg: -0.7% min: -1.1% max: -0.3%
issue-46449-check
avg: -0.9% min: -1.1% max: -0.6%
parser-check
avg: -0.9% min: -1.1% max: -0.8%
html5ever
avg: -0.5% min: -1.0% max: -0.0%
```

6 years agoAuto merge of #50100 - Manishearth:edition-path-lint, r=nikomatsakis
bors [Wed, 25 Apr 2018 04:19:06 +0000 (04:19 +0000)]
Auto merge of #50100 - Manishearth:edition-path-lint, r=nikomatsakis

Edition breakage lint for absolute paths starting with modules

We plan to enable `extern_absolute_paths` in the 2018 edition. To allow for that, folks must transition their paths in a previous edition to the new one. This makes paths which import module contents via `use module::` or `::module::` obsolete, and we must edition-lint these.

https://internals.rust-lang.org/t/the-great-module-adventure-continues/6678/205?u=manishearth is the current plan for paths.

r? @nikomatsakis

Fixes #48722

6 years agoAuto merge of #49986 - zofrex:better-derived-argument-names, r=Manishearth
bors [Wed, 25 Apr 2018 01:50:56 +0000 (01:50 +0000)]
Auto merge of #49986 - zofrex:better-derived-argument-names, r=Manishearth

Provide better names for builtin deriving-generated attributes

First attempt at fixing #49967

Not in love with any choices here, don't be shy if you aren't happy with anything :)

I've tested that this produces nicer names in documentation, and that it no longer has issues conflicting with constants with the same name. (I guess we _could_ make a test for that... unsure if that would be valuable)

In all cases I took the names from the methods as declared in the relevant trait.

In some cases I had to prepend the names with _ otherwise there were errors about un-used variables. I'm uneasy with the inconsistency... do they all need to be like that? Is there a way to generate an alternate impl or use a different name (`_`?) in the cases where the arguments are not used?

Lastly the gensym addition to Ident I implemented largely as suggested, but I want to point out it's a little circuitous (at least, as far as I understand it). `cx.ident_of(name)` is just `Ident::from_str`, so we create an Ident then another Ident from it. `Ident::with_empty_ctxt(Symbol::gensym(string))` may or may not be equivalent, I don't know if it's important to intern it _then_ gensym it. It seems like either we could use that, or if we do want a new method to make this convenient, it could be on Ident instead (`from_str_gensymed`?)

6 years agoTest format hygiene
James Sanderson [Tue, 24 Apr 2018 21:15:00 +0000 (22:15 +0100)]
Test format hygiene

6 years agoAuto merge of #50096 - alexcrichton:less-simd-warnings, r=michaelwoerister
bors [Tue, 24 Apr 2018 20:59:15 +0000 (20:59 +0000)]
Auto merge of #50096 - alexcrichton:less-simd-warnings, r=michaelwoerister

Tweak some warnings around #[target_feature]

This commit fixes up some issues discovered when getting the `stdsimd` crate's CI compiling again.

6 years agoGensym arguments for format macro
James Sanderson [Tue, 24 Apr 2018 20:30:13 +0000 (21:30 +0100)]
Gensym arguments for format macro

6 years agoTest deriving hygiene
James Sanderson [Thu, 19 Apr 2018 20:11:43 +0000 (21:11 +0100)]
Test deriving hygiene

6 years agoAuto merge of #49933 - oli-obk:miri_rustup, r=eddyb
bors [Tue, 24 Apr 2018 18:04:51 +0000 (18:04 +0000)]
Auto merge of #49933 - oli-obk:miri_rustup, r=eddyb

Fix the miri tool

r? @eddyb

cc @bjorn3

fixes #49777

6 years agoAuto merge of #50079 - NickAtAccuPS:android_abstract_socket, r=sfackler
bors [Tue, 24 Apr 2018 14:15:56 +0000 (14:15 +0000)]
Auto merge of #50079 - NickAtAccuPS:android_abstract_socket, r=sfackler

Android abstract unix domain sockets AddressKind correction

The prior check causes abstract unix domain sockets to return AddressKind::Unnamed instead of AddressKind::Abstract on Android.

Other than the immediately proceeding comment "macOS seems to return a len of 16 and a zeroed sun_path for unnamed addresses" the check as-implemented does not seem to have alternative explanation. I couldn't find an alternative explanation while stepping though git blame. I suspect the AddressKind::Unnamed nonzero check should instead be if macos, length 16, and zeroed array. @sfackler could you comment on this, the code as-is is the same from your initial addition of abstract uds support.

6 years agoWarn on all erroneous constants
Oliver Schneider [Fri, 20 Apr 2018 12:18:29 +0000 (14:18 +0200)]
Warn on all erroneous constants

6 years agoAuto merge of #49911 - rcoh:master, r=nikomatsakis
bors [Tue, 24 Apr 2018 10:44:22 +0000 (10:44 +0000)]
Auto merge of #49911 - rcoh:master, r=nikomatsakis

Don't allow #[should_panic] with non-() tests

Adds (removes) support for `#[should_panic]` when the test is non-`()`

6 years agoAuto merge of #49837 - nikomatsakis:chalkify-engine, r=scalexm
bors [Tue, 24 Apr 2018 08:32:52 +0000 (08:32 +0000)]
Auto merge of #49837 - nikomatsakis:chalkify-engine, r=scalexm

work towards chalkify-ing the engine

This work towards creating a "all program clauses needed for this goal" query

r? @scalexm

6 years agoAuto merge of #50191 - kennytm:rollup, r=kennytm
bors [Tue, 24 Apr 2018 05:43:32 +0000 (05:43 +0000)]
Auto merge of #50191 - kennytm:rollup, r=kennytm

Rollup of 11 pull requests

Successful merges:

 - #49461 (std: Child::kill() returns error if process has already exited)
 - #49727 (Add Cell::update)
 - #49812 (Fix revision support for UI tests.)
 - #49829 (Add doc links to `std::os` extension traits)
 - #49906 (Stabilize `std::hint::unreachable_unchecked`.)
 - #49970 (Deprecate Read::chars and char::decode_utf8)
 - #49985 (don't see issue #0)
 - #50118 (fix search bar bug)
 - #50139 (encourage descriptive issue titles)
 - #50174 (Use FxHashMap in syntax_pos::symbol::Interner::intern.)
 - #50185 (core: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`)

Failed merges:

6 years agoRollup merge of #50185 - dmizuk:mod_euc-fix-overflow, r=kennytm
kennytm [Tue, 24 Apr 2018 03:57:11 +0000 (11:57 +0800)]
Rollup merge of #50185 - dmizuk:mod_euc-fix-overflow, r=kennytm

core: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`

This commit removes usage of `abs`, which overflows when `self == MIN`.

6 years agoRollup merge of #50174 - nnethercote:FxHashMap-Interner, r=michaelwoerister
kennytm [Tue, 24 Apr 2018 03:57:10 +0000 (11:57 +0800)]
Rollup merge of #50174 - nnethercote:FxHashMap-Interner, r=michaelwoerister

Use FxHashMap in syntax_pos::symbol::Interner::intern.

Because it's faster than HashMap.

This change reduces the time taken for a few of the rustc-perf
benchmarks, mostly the small ones, by up to 5%.
```
coercions
        avg: -1.3%      min: -5.5%      max: -0.0%
helloworld-check
        avg: -2.3%      min: -3.5%      max: -1.8%
deeply-nested-check
        avg: -1.4%      min: -3.2%      max: -0.5%
tuple-stress-opt
        avg: -0.7%      min: -2.0%      max: -0.1%
unify-linearly-check
        avg: -1.2%      min: -1.9%      max: -0.6%
coercions-check
        avg: -0.8%      min: -1.3%      max: -0.4%
unused-warnings-check
        avg: -1.0%      min: -1.3%      max: -0.8%
deeply-nested-opt
        avg: -0.5%      min: -1.2%      max: -0.2%
deeply-nested
        avg: -0.7%      min: -1.2%      max: -0.4%
helloworld
        avg: -0.8%      min: -1.1%      max: -0.7%
tuple-stress-check
        avg: -0.5%      min: -1.0%      max: -0.1%
unused-warnings
        avg: -0.8%      min: -1.0%      max: -0.7%
unused-warnings-opt
        avg: -0.8%      min: -1.0%      max: -0.7%
coercions-opt
        avg: -0.5%      min: -1.0%      max: -0.1%
helloworld-opt
        avg: -0.7%      min: -1.0%      max: -0.6%
```

6 years agoRollup merge of #50139 - nivkner:docs, r=steveklabnik
kennytm [Tue, 24 Apr 2018 03:57:09 +0000 (11:57 +0800)]
Rollup merge of #50139 - nivkner:docs, r=steveklabnik

encourage descriptive issue titles

There are two sides to avoiding duplicate issues, searching for existing ones, and making sure existing ones can be searched for. This addresses the later.

r? @steveklabnik

6 years agoRollup merge of #50118 - GuillaumeGomez:search-bar-bug, r=QuietMisdreavus
kennytm [Tue, 24 Apr 2018 03:57:08 +0000 (11:57 +0800)]
Rollup merge of #50118 - GuillaumeGomez:search-bar-bug, r=QuietMisdreavus

fix search bar bug

Fixes #50064.

r? @QuietMisdreavus

6 years agoRollup merge of #49985 - zackmdavis:0, r=estebank
kennytm [Tue, 24 Apr 2018 03:57:07 +0000 (11:57 +0800)]
Rollup merge of #49985 - zackmdavis:0, r=estebank

don't see issue #0

The unstable-feature attribute requires an issue (neglecting it is
E0547), which gets used in the error messages. Unfortunately, there are
some cases where "0" is apparently used a placeholder where no issue
exists, directing the user to see the (nonexistent) issue #0. (It would
have been better to either let `issue` be optional—compare to how issue
is an `Option<u32>` in the feature-gate declarations in
libsyntax/feature-gate.rs—or actually require that an issue be created.)
Rather than endeavoring to change how `#[unstable]` works at this time
(given competing contributor and reviewer priorities), this simple patch
proposes the less-ambitious solution of just not adding the "(see
issue)" note when the number is zero.

Resolves #49983.

6 years agoRollup merge of #49970 - SimonSapin:deprecate, r=sfackler
kennytm [Tue, 24 Apr 2018 03:57:05 +0000 (11:57 +0800)]
Rollup merge of #49970 - SimonSapin:deprecate, r=sfackler

Deprecate Read::chars and char::decode_utf8

Per FCP:

* https://github.com/rust-lang/rust/issues/27802#issuecomment-377537778
* https://github.com/rust-lang/rust/issues/33906#issuecomment-377534308

6 years agoRollup merge of #49906 - kennytm:stable-unreachable, r=sfackler
kennytm [Tue, 24 Apr 2018 03:57:04 +0000 (11:57 +0800)]
Rollup merge of #49906 - kennytm:stable-unreachable, r=sfackler

Stabilize `std::hint::unreachable_unchecked`.

Closes #43751.

6 years agoRollup merge of #49829 - ecstatic-morse:os-docs, r=steveklabnik
kennytm [Tue, 24 Apr 2018 03:57:03 +0000 (11:57 +0800)]
Rollup merge of #49829 - ecstatic-morse:os-docs, r=steveklabnik

Add doc links to `std::os` extension traits

Addresses a small subset of #29367.

This adds documentation links to the original type for various OS-specific extension traits, and uses a common sentence for introducing such traits (which now consistently ends in a period).

6 years agoRollup merge of #49812 - ehuss:ui-test-revisions, r=nikomatsakis
kennytm [Tue, 24 Apr 2018 03:57:02 +0000 (11:57 +0800)]
Rollup merge of #49812 - ehuss:ui-test-revisions, r=nikomatsakis

Fix revision support for UI tests.

Fixes #48878

6 years agoRollup merge of #49727 - stjepang:cell-update, r=SimonSapin
kennytm [Tue, 24 Apr 2018 03:57:00 +0000 (11:57 +0800)]
Rollup merge of #49727 - stjepang:cell-update, r=SimonSapin

Add Cell::update

This commit adds a new method `Cell::update`, which applies a function to the value inside the cell.

Previously discussed in: https://github.com/rust-lang/rfcs/issues/2171

### Motivation

Updating `Cell`s is currently a bit verbose. Here are several real examples (taken from rustc and crossbeam):

```rust
self.print_fuel.set(self.print_fuel.get() + 1);

self.diverges.set(self.diverges.get() | Diverges::Always);

let guard_count = self.guard_count.get();
self.guard_count.set(guard_count.checked_add(1).unwrap());
if guard_count == 0 {
    // ...
}
```

With the addition of the new method `Cell::update`, this code can be simplified to:

```rust
self.print_fuel.update(|x| x + 1);

self.diverges.update(|x| x | Diverges::Always);

if self.guard_count.update(|x| x.checked_add(1).unwrap()) == 1 {
    // ...
}
```

### Unresolved questions

1. Should we return the old value instead of the new value (like in `fetch_add` and `fetch_update`)?
2. Should the return type simply be `()`?
3. Naming: `update` vs `modify` vs `mutate` etc.

cc @SimonSapin

6 years agoRollup merge of #49461 - andreastt:child-kill-exited, r=Mark-Simulacrum
kennytm [Tue, 24 Apr 2018 03:56:59 +0000 (11:56 +0800)]
Rollup merge of #49461 - andreastt:child-kill-exited, r=Mark-Simulacrum

std: Child::kill() returns error if process has already exited

This patch makes it clear in std::process::Child::kill()'s API
documentation that an error is returned if the child process has
already cleanly exited.  This is implied by the example, but not
called out explicitly.

6 years agoAuto merge of #48999 - GuillaumeGomez:add-repeat-on-slice, r=Kimundi
bors [Tue, 24 Apr 2018 03:31:11 +0000 (03:31 +0000)]
Auto merge of #48999 - GuillaumeGomez:add-repeat-on-slice, r=Kimundi

Add repeat method on slice

Fixes #48784.

6 years agoAuto merge of #48989 - ExpHP:path-prefix, r=dtolnay
bors [Tue, 24 Apr 2018 01:15:36 +0000 (01:15 +0000)]
Auto merge of #48989 - ExpHP:path-prefix, r=dtolnay

Make signature of Path::strip_prefix accept non-references

I did this a while back but didn't submit a PR. Might as well see what happens.

Fixes #48390.

**Note: This has the potential to cause regressions in type inference.**  However, in order for code to break, it would need to be relying on the signature to determine that a type is `&_`, while still being able to figure out what the `_` is.  I'm having a hard time imagining such a scenario in real code.

6 years agoAuto merge of #49779 - oli-obk:const_err_regression, r=eddyb
bors [Mon, 23 Apr 2018 22:58:00 +0000 (22:58 +0000)]
Auto merge of #49779 - oli-obk:const_err_regression, r=eddyb

Don't report compile-time errors for promoteds

Fixes the regression part of #49760, the missing warnings still are missing

r? @eddyb

6 years agofix search bar bug
Guillaume Gomez [Fri, 20 Apr 2018 14:42:44 +0000 (16:42 +0200)]
fix search bar bug

6 years agoAuto merge of #49368 - matthewjasper:feature-gate-where-clause, r=nikomatsakis
bors [Mon, 23 Apr 2018 19:29:25 +0000 (19:29 +0000)]
Auto merge of #49368 - matthewjasper:feature-gate-where-clause, r=nikomatsakis

Feature gate where clauses on associated types

Fixes #49365. Requires crater: these have been usable since 1.24.

6 years agoAssign the tracking issue
Stjepan Glavina [Mon, 23 Apr 2018 18:34:49 +0000 (20:34 +0200)]
Assign the tracking issue

6 years agocore: Minor cleanup
Daiki Mizukami [Mon, 23 Apr 2018 18:32:40 +0000 (03:32 +0900)]
core: Minor cleanup

6 years agoClarify the docs for Cell::update
Stjepan Glavina [Mon, 23 Apr 2018 18:23:04 +0000 (20:23 +0200)]
Clarify the docs for Cell::update

6 years agosort strings on output
Niko Matsakis [Tue, 17 Apr 2018 10:06:33 +0000 (06:06 -0400)]
sort strings on output

6 years agoeliminate the `Lrc` of a slice and just return the slice
Niko Matsakis [Mon, 23 Apr 2018 17:12:00 +0000 (13:12 -0400)]
eliminate the `Lrc` of a slice and just return the slice

Also, introduce `Clauses` and `Goals` type alises for readability.

6 years agofirst draft of `program_clauses_for_env`
Niko Matsakis [Tue, 10 Apr 2018 09:55:18 +0000 (05:55 -0400)]
first draft of `program_clauses_for_env`

This computes the transitive closure of traits that appear in the
environment and then appends their clauses. It needs some work, but
it's in the right direction.

6 years agoin unit tests, use `note` to dump multiple program clauses
Niko Matsakis [Wed, 18 Apr 2018 23:58:22 +0000 (19:58 -0400)]
in unit tests, use `note` to dump multiple program clauses

(rather than issuing multiple errors)

Also, reorder so that the annotations are considered "used" when the
lint runs.

6 years agorustfmt lowering.rs
Niko Matsakis [Tue, 10 Apr 2018 09:56:35 +0000 (05:56 -0400)]
rustfmt lowering.rs

6 years agointroduce new DefPathData variants for traits, assoc types
Niko Matsakis [Fri, 30 Mar 2018 04:51:39 +0000 (00:51 -0400)]
introduce new DefPathData variants for traits, assoc types

6 years agoadd `Goal::CannotProve` and extract `ProgramClause` struct
Niko Matsakis [Fri, 23 Mar 2018 08:58:18 +0000 (04:58 -0400)]
add `Goal::CannotProve` and extract `ProgramClause` struct

6 years agocreate a `QueryRegionConstraint` type
Niko Matsakis [Fri, 23 Mar 2018 08:19:34 +0000 (04:19 -0400)]
create a `QueryRegionConstraint` type

Chalk wants to be able to pass these constraints around. Also, the
form we were using in our existing queries was not as general as we
are going to need.

6 years agoadd a `-Zchalk` command-line option
Niko Matsakis [Thu, 22 Mar 2018 09:19:25 +0000 (05:19 -0400)]
add a `-Zchalk` command-line option

6 years agocore: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`
Daiki Mizukami [Mon, 23 Apr 2018 16:45:44 +0000 (01:45 +0900)]
core: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`

6 years agomake rustdoc test follow the jobserver limit of threadsfix that to many threads is...
Andreas Jonson [Mon, 23 Apr 2018 15:00:08 +0000 (17:00 +0200)]
make rustdoc test follow the jobserver limit of threadsfix that to many threads is executing at the same timewhen rustdoc test is executed.

6 years agoDon't allow #[should_panic] with non-() tests
Russell Cohen [Thu, 12 Apr 2018 19:30:37 +0000 (12:30 -0700)]
Don't allow #[should_panic] with non-() tests

6 years agoAuto merge of #49372 - Phlosioneer:inherent-impl-default-error-message, r=nagisa
bors [Mon, 23 Apr 2018 10:40:08 +0000 (10:40 +0000)]
Auto merge of #49372 - Phlosioneer:inherent-impl-default-error-message, r=nagisa

Better error message when trying to write default impls

Previously, if you tried to write this (using the specialization
feature flag):

default impl PartialEq<MyType> {
...
}

The compiler would give you the mysterious warning "inherent impls
cannot be default". What it really means is that you're trying to
write an impl for a Structure or *Trait Object*, and that cannot
be "default". However, one of the ways to encounter this error
(as shown by the above example) is when you forget to write "for
MyType".

This PR adds a help message that reads "maybe missing a `for`
keyword?" This is useful, actionable advice that will help any user
identify their mistake, and doesn't get in the way or mislead any
user that really meant to use the "default" keyword for this weird
purpose. In particular, this help message will be useful for any
users who don't know the "inherent impl" terminology, and/or users
who forget that inherent impls CAN be written for traits (they apply
to the trait objects). Both of these are somewhat confusing, seldom-
used concepts; a one-line error message without any error number for
longer explanation is NOT the place to introduce these ideas.

I wasn't quite sure what grammar / wording to use. I'm open to suggestions. CC @rust-lang/docs (I hope I'm doing that notation right)

(Apparently not. :( )

6 years agoFix the miri tool
Oliver Schneider [Fri, 13 Apr 2018 14:05:54 +0000 (16:05 +0200)]
Fix the miri tool

6 years agoUse FxHashMap in syntax_pos::symbol::Interner::intern.
Nicholas Nethercote [Sun, 22 Apr 2018 23:48:08 +0000 (09:48 +1000)]
Use FxHashMap in syntax_pos::symbol::Interner::intern.

Because it's faster than HashMap.

This change reduces the time taken for a few of the rustc-perf
benchmarks, mostly the small ones, by up to 5%.

6 years agoalways optimize test
Oliver Schneider [Mon, 23 Apr 2018 09:12:33 +0000 (11:12 +0200)]
always optimize test

The error messages differ between optimized and nonoptimized mode

6 years agoAuto merge of #50129 - wesleywiser:clean_up1, r=michaelwoerister
bors [Mon, 23 Apr 2018 08:26:23 +0000 (08:26 +0000)]
Auto merge of #50129 - wesleywiser:clean_up1, r=michaelwoerister

Clean up `IsolatedEncoder::encode_info_for_impl_item()` a bit

Suggested in the [comments of #49991](https://github.com/rust-lang/rust/pull/49991/files/4a77d35c1ed89310a0ed128ce931cd4b85ca4cd4#r183048939)

6 years agoAuto merge of #50171 - mattico:update-mdbook, r=Mark-Simulacrum
bors [Mon, 23 Apr 2018 04:23:42 +0000 (04:23 +0000)]
Auto merge of #50171 - mattico:update-mdbook, r=Mark-Simulacrum

Update MDBook

Updates MDBook to get some CSS fixes.

#50147, updated to resolve licensing issue.

r? @Mark-Simulacrum

6 years agoAuto merge of #48946 - PramodBisht:issues/48636, r=estebank
bors [Mon, 23 Apr 2018 01:36:51 +0000 (01:36 +0000)]
Auto merge of #48946 - PramodBisht:issues/48636, r=estebank

Doc comments present after a particular syntax error cause an unhelpful error message to be output.

fixed: #48636

r? @estebank

6 years agoUpdate MDBook
Matt Ickstadt [Sat, 21 Apr 2018 21:06:13 +0000 (16:06 -0500)]
Update MDBook

6 years agoAuto merge of #50144 - sfackler:oom-lang-item, r=alexcrichton
bors [Sun, 22 Apr 2018 19:38:32 +0000 (19:38 +0000)]
Auto merge of #50144 - sfackler:oom-lang-item, r=alexcrichton

Replace {Alloc,GlobalAlloc}::oom with a lang item.

The decision of what to do after an allocation fails is orthogonal to the decision of how to allocate the memory, so this PR splits them apart. `Alloc::oom` and `GlobalAlloc::oom` have been removed, and a lang item has been added:

```rust
#[lang = "oom"]
fn oom() -> !;
```

It is specifically a weak lang item, like panic_fmt, except that it is required when you depend on liballoc rather than libcore. libstd provides an implementation that aborts with the message `fatal runtime error: memory allocation failed`, matching the current behavior.

The new implementation is also significantly simpler - it's "just another weak lang item". [RFC 2070](https://github.com/rust-lang/rfcs/blob/master/text/2070-panic-implementation.md) specifies a path towards stabilizing panic_fmt, so any complexities around stable weak lang item definition are already being solved.

To bootstrap, oom silently aborts in stage0. alloc_system no longer has a bunch of code to print to stderr, and alloc_jemalloc no longer depends on alloc_system to pull in that code.

One fun note: System's GlobalAlloc implementation didn't override the default implementation of oom, so it currently aborts silently!

r? @alexcrichton

6 years agoRemove unused AllocatorTy::Bang
Steven Fackler [Sat, 21 Apr 2018 22:16:59 +0000 (15:16 -0700)]
Remove unused AllocatorTy::Bang

6 years agoRemove Alloc::oom
Steven Fackler [Sat, 21 Apr 2018 16:47:41 +0000 (09:47 -0700)]
Remove Alloc::oom

6 years agoReplace GlobalAlloc::oom with a lang item
Steven Fackler [Sat, 21 Apr 2018 04:05:13 +0000 (21:05 -0700)]
Replace GlobalAlloc::oom with a lang item

6 years agoAuto merge of #50152 - petrochenkov:nooverhyg, r=alexcrichton
bors [Sun, 22 Apr 2018 16:58:12 +0000 (16:58 +0000)]
Auto merge of #50152 - petrochenkov:nooverhyg, r=alexcrichton

parser: Do not override syntactic context for dummy spans

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

https://github.com/rust-lang/rust/commit/e2afefd80bf779bc3c6f697a3c6cc3a476993602 seemingly did everything right, but uncovered a preexisting bug.

6 years agoAuto merge of #50135 - matklad:update-cargo, r=kennytm
bors [Sun, 22 Apr 2018 13:23:49 +0000 (13:23 +0000)]
Auto merge of #50135 - matklad:update-cargo, r=kennytm

Update Cargo

Some noteble changes:

 * ~~regression fix: https://github.com/rust-lang/cargo/pull/5390~~
  * ~~potentially breaking bug-fix: https://github.com/rust-lang/cargo/pull/5389~~
  * ~~Cargo now caches the result of `rustc -vV`. It checks `rustc` binary
    mtime and rustup toolchain settings, so it should probably "just work"
    with rustbuild.~~

potentially breaking bug-fix: https://github.com/rust-lang/cargo/pull/5390

6 years agoAuto merge of #49954 - GuillaumeGomez:doc-settings, r=ollie27,QuietMisdreavus
bors [Sun, 22 Apr 2018 11:04:41 +0000 (11:04 +0000)]
Auto merge of #49954 - GuillaumeGomez:doc-settings, r=ollie27,QuietMisdreavus

Add rustdoc settings menu

Fixes #18167.

r? @QuietMisdreavus

6 years agoAuto merge of #50123 - kennytm:do-not-test-rls-if-build-failed, r=alexcrichton
bors [Sun, 22 Apr 2018 08:48:32 +0000 (08:48 +0000)]
Auto merge of #50123 - kennytm:do-not-test-rls-if-build-failed, r=alexcrichton

Do not test RLS/Rustfmt if build failed

6 years ago1) Addresses #48636
Pramod Bisht [Sat, 21 Apr 2018 13:09:34 +0000 (18:39 +0530)]
1) Addresses #48636
2) Changed position of help message, incase comma is missing
3) added few missing spaces and handled span_suggestion for vscode
4) updated stderr file

6 years agoAuto merge of #50109 - SimonSapin:copy, r=sfackler
bors [Sun, 22 Apr 2018 06:03:20 +0000 (06:03 +0000)]
Auto merge of #50109 - SimonSapin:copy, r=sfackler

Implement Copy for std::alloc::Layout

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

6 years agoAuto merge of #49757 - GuillaumeGomez:never-search, r=QuietMisdreavus
bors [Sun, 22 Apr 2018 02:18:41 +0000 (02:18 +0000)]
Auto merge of #49757 - GuillaumeGomez:never-search, r=QuietMisdreavus

Add specific never search

Fixes #49529.

r? @QuietMisdreavus

6 years agoparser: Do not override syntactic context for dummy spans
Vadim Petrochenkov [Sun, 22 Apr 2018 01:10:15 +0000 (04:10 +0300)]
parser: Do not override syntactic context for dummy spans

6 years agoAuto merge of #49896 - SimonSapin:inherent, r=alexcrichton
bors [Sun, 22 Apr 2018 00:01:29 +0000 (00:01 +0000)]
Auto merge of #49896 - SimonSapin:inherent, r=alexcrichton

Add inherent methods in libcore for [T], [u8], str, f32, and f64

# Background

Primitive types are defined by the language, they don’t have a type definition like `pub struct Foo { … }` in any crate. So they don’t “belong” to any crate as far as `impl` coherence is concerned, and on principle no crate would be able to define inherent methods for them, without a trait. Since we want these types to have inherent methods anyway, the standard library (with cooperation from the compiler) bends this rule with code like [`#[lang = "u8"] impl u8 { /*…*/ }`](https://github.com/rust-lang/rust/blob/1.25.0/src/libcore/num/mod.rs#L2244-L2245). The `#[lang]` attribute is permanently-unstable and never intended to be used outside of the standard library.

Each lang item can only be defined once. Before this PR there is one impl-coherence-rule-bending lang item per primitive type (plus one for `[u8]`, which overlaps with `[T]`). And so one `impl` block each. These blocks for `str`, `[T]` and `[u8]` are in liballoc rather than libcore because *some* of the methods (like `<[T]>::to_vec(&self) -> Vec<T> where T: Clone`) need a global memory allocator which we don’t want to make a requirement in libcore. Similarly, `impl f32` and `impl f64` are in libstd because some of the methods are based on FFI calls to C’s `libm` and we want, as much as possible, libcore not to require “runtime support”.

In libcore, the methods of `str` and `[T]` that don’t allocate are made available through two **unstable traits** `StrExt` and `SliceExt` (so the traits can’t be *named* by programs on the Stable release channel) that have **stable methods** and are re-exported in the libcore prelude (so that programs on Stable can *call* these methods anyway). Non-allocating `[u8]` methods are not available in libcore: https://github.com/rust-lang/rust/issues/45803. Some `f32` and `f64` methods are in an unstable `core::num::Float` trait with stable methods, but that one is **not in the libcore prelude**. (So as far as Stable programs are concerns it doesn’t exist, and I don’t know what the point was to mark these methods `#[stable]`.)

https://github.com/rust-lang/rust/issues/32110 is the tracking issue for these unstable traits.

# High-level proposal

Since the standard library is already bending the rules, why not bend them *a little more*? By defining a few additional lang items, the compiler can allow the standard library to have *two* `impl` blocks (in different crates) for some primitive types.

The `StrExt` and `SliceExt` traits still exist for now so that we can bootstrap from a previous-version compiler that doesn’t have these lang items yet, but they can be removed in next release cycle. (`Float` is used internally and needs to be public for libcore unit tests, but was already `#[doc(hidden)]`.) I don’t know if https://github.com/rust-lang/rust/issues/32110 should be closed by this PR, or only when the traits are entirely removed after we make a new bootstrap compiler.

# Float methods

Among the methods of the `core::num::Float` trait, three are based on LLVM intrinsics: `abs`, `signum`, and `powi`. PR https://github.com/rust-lang/rust/pull/27823 “Remove dependencies on libm functions from libcore” moved a bunch of `core::num::Float` methods back to libstd, but left these three behind. However they aren’t specifically discussed in the PR thread. The `compiler_builtins` crate defines `__powisf2` and `__powidf2` functions that look like implementations of `powi`, but I couldn’t find a connection with the `llvm.powi.f32` and `llvm.powi.f32` intrinsics by grepping through LLVM’s code.

In discussion starting at https://github.com/rust-lang/rust/issues/32110#issuecomment-370647922 Alex says that we do not want methods in libcore that require “runtime support”, but it’s not clear whether that applies to these `abs`, `signum`, or `powi`. In doubt, I’ve **removed** them for the trait and moved them to inherent methods in libstd for now. We can move them back later (or in this PR) if we decide that’s appropriate.

# Change details

For users on the Stable release channel:

* I believe this PR does not make any breaking change
* Some methods for `[u8]`, `f32`, and `f64` are newly available to `#![no_std]` users (fixes https://github.com/rust-lang/rust/issues/45803)
* There should be no visible change for `std` users in terms of what programs compile or what their behavior is. (Only in compiler error messages, possibly.)

For Nightly users, additionally:

* The unstable `StrExt` and `SliceExt` traits are gone
* Their methods are now inherent methods of `str` and `[T]` (so only code that explicitly named the traits should be affected, not "normal" method calls)
* The `abs`, `signum` and `powi` methods of the `Float` trait are gone
* The `Float` trait’s unstable feature name changed to `float_internals` with no associated tracking issue, to reflect it being a permanently unstable implementation detail rather than a public API on a path to stabilization.
* Its remaining methods are now inherent methods of `f32` and `f64`.

-----

CC @rust-lang/libs for the API changes, @rust-lang/compiler for the new lang items

6 years agoAdd doc about doc alias feature
Guillaume Gomez [Sat, 21 Apr 2018 20:41:08 +0000 (22:41 +0200)]
Add doc about doc alias feature

6 years agoAdd tracking issue number for doc alias feature
Guillaume Gomez [Sat, 21 Apr 2018 20:33:11 +0000 (22:33 +0200)]
Add tracking issue number for doc alias feature

6 years agoAuto merge of #50121 - pnkfelix:revert-stabilization-of-never-type-et-al, r=alexcrichton
bors [Sat, 21 Apr 2018 21:14:53 +0000 (21:14 +0000)]
Auto merge of #50121 - pnkfelix:revert-stabilization-of-never-type-et-al, r=alexcrichton

Revert stabilization of never_type (!) et al

Fix #49691

I *think* this correctly adopts @nikomatsakis 's desired fix of:
 * reverting stabilization of `!` and `TryFrom`, and
 * returning to the previous fallback semantics (i.e. it is once again dependent on whether the crate has opted into `#[feature(never_type)]`,
 * **without** attempting to put back in the previous future-proofing warnings regarding the change in fallback semantics.

(I'll be away from computers for a week starting now, so any updates to this PR should be either pushed into it, or someone else should adopt the task of polishing this fix and put up their own PR.)

6 years agoremove unused condition
Guillaume Gomez [Thu, 19 Apr 2018 21:50:17 +0000 (23:50 +0200)]
remove unused condition

6 years agoAdd alias tests
Guillaume Gomez [Thu, 19 Apr 2018 18:14:47 +0000 (20:14 +0200)]
Add alias tests

6 years agoupdate tester
Guillaume Gomez [Thu, 19 Apr 2018 18:14:24 +0000 (20:14 +0200)]
update tester

6 years agofix invalid items removal
Guillaume Gomez [Thu, 19 Apr 2018 17:59:45 +0000 (19:59 +0200)]
fix invalid items removal

6 years agoadd more aliases
Guillaume Gomez [Thu, 19 Apr 2018 17:56:10 +0000 (19:56 +0200)]
add more aliases

6 years agoAdd aliases in the search as well
Guillaume Gomez [Thu, 19 Apr 2018 16:23:12 +0000 (18:23 +0200)]
Add aliases in the search as well

6 years agoGenerate alias file
Guillaume Gomez [Thu, 19 Apr 2018 15:46:13 +0000 (17:46 +0200)]
Generate alias file

6 years agoAdd specific never search
Guillaume Gomez [Sat, 7 Apr 2018 12:04:03 +0000 (14:04 +0200)]
Add specific never search

6 years agoRemove link generation on image, favicon and logo in settings
Guillaume Gomez [Fri, 20 Apr 2018 10:20:50 +0000 (12:20 +0200)]
Remove link generation on image, favicon and logo in settings

6 years agoAuto merge of #50039 - ExpHP:quick-50002, r=alexcrichton
bors [Sat, 21 Apr 2018 18:42:41 +0000 (18:42 +0000)]
Auto merge of #50039 - ExpHP:quick-50002, r=alexcrichton

smaller PR just to fix #50002

I pulled this out of #50010 to make it easier to backport to beta if necessary, considering that inclusive range syntax is stabilizing soon (?).

It fixes a bug in `<str>::index_mut` with `(..=end)` ranges (#50002), which prior to this fix was not only unusable but also UB in the cases where it "worked" (it gave improperly truncated UTF-8).

(not that I can imagine why anybody would *use* `<str>::index_mut`... but I'm not here to judge)

6 years agoAuto merge of #50093 - alexcrichton:android-uwtable, r=michaelwoerister
bors [Sat, 21 Apr 2018 16:18:22 +0000 (16:18 +0000)]
Auto merge of #50093 - alexcrichton:android-uwtable, r=michaelwoerister

rustc: Always emit `uwtable` on Android

Long ago (#40549) we enabled the `uwtable` attribute on Windows by default
(even with `-C panic=abort`) to allow unwinding binaries for [stack unwinding
information][winstack]. It looks like this same issue is [plaguing][arm1]
Gecko's Android platforms [as well][arm2]. This commit applies the same fix
as #40549 except that this time it's applied for all Android targets.

Generating a `-C panic=abort` binary for `armv7-linux-androideabi` before this
commit generated a number of `cantunwind` functions (detected with `readelf -u`)
but after this commit they all list appropriate unwind information.

Closes #49867

[winstack]: https://bugzilla.mozilla.org/show_bug.cgi?id=1302078
[arm1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1453220
[arm2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1451741

6 years agorustc: Always emit `uwtable` on Android
Alex Crichton [Thu, 19 Apr 2018 22:17:34 +0000 (15:17 -0700)]
rustc: Always emit `uwtable` on Android

Long ago (#40549) we enabled the `uwtable` attribute on Windows by default
(even with `-C panic=abort`) to allow unwinding binaries for [stack unwinding
information][winstack]. It looks like this same issue is [plaguing][arm1]
Gecko's Android platforms [as well][arm2]. This commit applies the same fix
as #40549 except that this time it's applied for all Android targets.

Generating a `-C panic=abort` binary for `armv7-linux-androideabi` before this
commit generated a number of `cantunwind` functions (detected with `readelf -u`)
but after this commit they all list appropriate unwind information.

Closes #49867

[winstack]: https://bugzilla.mozilla.org/show_bug.cgi?id=1302078
[arm1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1453220
[arm2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1451741

6 years agoAuto merge of #50120 - alexcrichton:more-proc-macro-gates, r=petrochenkov
bors [Sat, 21 Apr 2018 13:50:58 +0000 (13:50 +0000)]
Auto merge of #50120 - alexcrichton:more-proc-macro-gates, r=petrochenkov

rustc: Tweak custom attribute capabilities

This commit starts to lay some groundwork for the stabilization of custom
attribute invocations and general procedural macros. It applies a number of
changes discussed on [internals] as well as a [recent issue][issue], namely:

* The path used to specify a custom attribute must be of length one and cannot
  be a global path. This'll help future-proof us against any ambiguities and
  give us more time to settle the precise syntax. In the meantime though a bare
  identifier can be used and imported to invoke a custom attribute macro. A new
  feature gate, `proc_macro_path_invoc`, was added to gate multi-segment paths
  and absolute paths.

* The set of items which can be annotated by a custom procedural attribute has
  been restricted. Statements, expressions, and modules are disallowed behind
  two new feature gates: `proc_macro_expr` and `proc_macro_mod`.

* The input to procedural macro attributes has been restricted and adjusted.
  Today an invocation like `#[foo(bar)]` will receive `(bar)` as the input token
  stream, but after this PR it will only receive `bar` (the delimiters were
  removed). Invocations like `#[foo]` are still allowed and will be invoked in
  the same way as `#[foo()]`. This is a **breaking change** for all nightly
  users as the syntax coming in to procedural macros will be tweaked slightly.

* Procedural macros (`foo!()` style) can only be expanded to item-like items by
  default. A separate feature gate, `proc_macro_non_items`, is required to
  expand to items like expressions, statements, etc.

Closes #50038

[internals]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
[issue]: https://github.com/rust-lang/rust/issues/50038

6 years agoAuto merge of #50076 - spastorino:fix_exhaust_iter_in_debug, r=pnkfelix
bors [Sat, 21 Apr 2018 11:26:09 +0000 (11:26 +0000)]
Auto merge of #50076 - spastorino:fix_exhaust_iter_in_debug, r=pnkfelix

Fix Iter exhaustion in prove_predicates when debug is on

Fixes the issue noted in this comment https://github.com/rust-lang/rust/pull/49885/files#r182560268

r? @pnkfelix
/cc @nikomatsakis

6 years agotypofix
Niv Kaminer [Sat, 21 Apr 2018 10:10:27 +0000 (13:10 +0300)]
typofix

6 years agoencourage descriptive issue titles
Niv Kaminer [Sat, 21 Apr 2018 09:08:01 +0000 (12:08 +0300)]
encourage descriptive issue titles

6 years agoUpdate Cargo
Aleksey Kladov [Sat, 21 Apr 2018 08:49:06 +0000 (11:49 +0300)]
Update Cargo

Some noteble changes:

  * regression fix: https://github.com/rust-lang/cargo/pull/5390
  * potentially breaking bug-fix: https://github.com/rust-lang/cargo/pull/5389
  * Cargo now caches the result of `rustc -vV`. It checks `rustc` binary
    mtime and rustup toolchain settings, so it should probably "just work"
    with rustbuild.

6 years agoMake the unstable StrExt and SliceExt traits private to libcore in not(stage0)
Simon Sapin [Thu, 12 Apr 2018 06:36:31 +0000 (08:36 +0200)]
Make the unstable StrExt and SliceExt traits private to libcore in not(stage0)

`Float` still needs to be public for libcore unit tests.

6 years agoMove intrinsics-based float methods out of libcore into libstd
Simon Sapin [Tue, 10 Apr 2018 14:36:23 +0000 (16:36 +0200)]
Move intrinsics-based float methods out of libcore into libstd

Affected methods are `abs`, `signum`, and `powi`.
CC https://github.com/rust-lang/rust/issues/32110#issuecomment-379503183

6 years agoAdd some f32 and f64 inherent methods in libcore
Simon Sapin [Sun, 8 Apr 2018 08:09:52 +0000 (10:09 +0200)]
Add some f32 and f64 inherent methods in libcore

… previously in the unstable core::num::Float trait.

Per https://github.com/rust-lang/rust/issues/32110#issuecomment-379503183,
the `abs`, `signum`, and `powi` methods are *not* included for now
since they rely on LLVM intrinsics and we haven’t determined yet whether
those instrinsics lower to calls to libm functions on any platform.

6 years agoReplace StrExt with inherent str methods in libcore
Simon Sapin [Sat, 7 Apr 2018 19:56:02 +0000 (21:56 +0200)]
Replace StrExt with inherent str methods in libcore

6 years agoReplace SliceExt with inherent [T] methods in libcore
Simon Sapin [Sat, 7 Apr 2018 17:38:35 +0000 (19:38 +0200)]
Replace SliceExt with inherent [T] methods in libcore

6 years agoMove non-allocating [u8] inherent methods to libcore
Simon Sapin [Sat, 7 Apr 2018 09:45:22 +0000 (11:45 +0200)]
Move non-allocating [u8] inherent methods to libcore

Fixes #45803

6 years agoRemove unused methods on the private Wtf8 type
Simon Sapin [Sat, 7 Apr 2018 09:12:35 +0000 (11:12 +0200)]
Remove unused methods on the private Wtf8 type

The type and its direct parent module are `pub`, but they’re not reachable outside of std

6 years agoAdd back missing `#![feature(never_type)]`s
kennytm [Fri, 20 Apr 2018 18:48:56 +0000 (02:48 +0800)]
Add back missing `#![feature(never_type)]`s

6 years agoAuto merge of #50080 - klnusbaum:edition_49591, r=Manishearth
bors [Sat, 21 Apr 2018 05:28:21 +0000 (05:28 +0000)]
Auto merge of #50080 - klnusbaum:edition_49591, r=Manishearth

add --edition option

This adds an official `edition` flag to the rust compiler

6 years agorustc: Tweak custom attribute capabilities
Alex Crichton [Fri, 20 Apr 2018 14:50:39 +0000 (07:50 -0700)]
rustc: Tweak custom attribute capabilities

This commit starts to lay some groundwork for the stabilization of custom
attribute invocations and general procedural macros. It applies a number of
changes discussed on [internals] as well as a [recent issue][issue], namely:

* The path used to specify a custom attribute must be of length one and cannot
  be a global path. This'll help future-proof us against any ambiguities and
  give us more time to settle the precise syntax. In the meantime though a bare
  identifier can be used and imported to invoke a custom attribute macro. A new
  feature gate, `proc_macro_path_invoc`, was added to gate multi-segment paths
  and absolute paths.

* The set of items which can be annotated by a custom procedural attribute has
  been restricted. Statements, expressions, and modules are disallowed behind
  two new feature gates: `proc_macro_expr` and `proc_macro_mod`.

* The input to procedural macro attributes has been restricted and adjusted.
  Today an invocation like `#[foo(bar)]` will receive `(bar)` as the input token
  stream, but after this PR it will only receive `bar` (the delimiters were
  removed). Invocations like `#[foo]` are still allowed and will be invoked in
  the same way as `#[foo()]`. This is a **breaking change** for all nightly
  users as the syntax coming in to procedural macros will be tweaked slightly.

* Procedural macros (`foo!()` style) can only be expanded to item-like items by
  default. A separate feature gate, `proc_macro_non_items`, is required to
  expand to items like expressions, statements, etc.

Closes #50038

[internals]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252
[issue]: https://github.com/rust-lang/rust/issues/50038