| Age | Commit message (Collapse) | Author | Lines |
|
Rollup of 12 pull requests
Successful merges:
- #50302 (Add query search order check)
- #50320 (Fix invalid path generation in rustdoc search)
- #50349 (Rename "show type declaration" to "show declaration")
- #50360 (Clarify wordings of the `unstable_name_collision` lint.)
- #50365 (Use two vectors in nearest_common_ancestor.)
- #50393 (Allow unaligned reads in constants)
- #50401 (Revert "Implement FromStr for PathBuf")
- #50406 (Forbid constructing empty identifiers from concat_idents)
- #50407 (Always inline simple BytePos and CharPos methods.)
- #50416 (check if the token is a lifetime before parsing)
- #50417 (Update Cargo)
- #50421 (Fix ICE when using a..=b in a closure.)
Failed merges:
|
|
Implement tool_attributes feature (RFC 2103)
cc #44690
This is currently just a rebased and compiling (hopefully) version of #47773.
Let's see if travis likes this. I will add the implementation for `tool_lints` this week.
|
|
|
|
Use escape_default() for strings in LitKind::token().
This avoids converting every char to \u{...} form, which bloats the
resulting strings unnecessarily. It also provides consistency with the
existing escape_default() calls in LitKind::token() used for raw
string literals, char literals, and raw byte char literals.
There are two benefits from this change.
- Compilation is faster. Most of the rustc-perf benchmarks see a
non-trivial speedup, particularly for incremental rebuilds, with the
best speedup over 13%, and multiple others over 10%.
- Generated rlibs are smaller. An extreme example is libfutures.rlib,
which shrinks from 2073306 bytes to 1765927 bytes, a 15% reduction.
r? @jseyfried
<details><summary>Here are full numbers for all the rustc-perf runs where the improvement was > 1%.</summary>
```
regex-check
avg: -11.1% min: -13.4% max: -5.5%
futures-check
avg: -7.6% min: -11.4% max: -3.5%
futures-opt
avg: -6.3% min: -10.3% max: -2.3%
futures
avg: -6.6% min: -10.3% max: -2.8%
regex-opt
avg: -4.7% min: -10.2% max: -0.4%
regex
avg: -5.3% min: -10.2% max: -1.2%
hyper-check
avg: -4.8% min: -6.6% max: -2.7%
encoding-check
avg: -4.1% min: -5.5% max: -2.5%
issue-46449-check
avg: -4.7% min: -5.2% max: -4.1%
clap-rs-check
avg: -2.9% min: -5.2% max: -1.1%
hyper
avg: -3.0% min: -5.1% max: -0.8%
parser-check
avg: -4.2% min: -4.9% max: -3.2%
hyper-opt
avg: -2.6% min: -4.9% max: -0.3%
encoding-opt
avg: -2.3% min: -4.6% max: -0.5%
encoding
avg: -2.5% min: -4.4% max: -0.6%
issue-46449
avg: -2.3% min: -4.4% max: -1.8%
issue-46449-opt
avg: -1.7% min: -4.3% max: -0.9%
clap-rs-opt
avg: -1.6% min: -4.2% max: -0.2%
serde-check
avg: -1.4% min: -4.1% max: -0.2%
clap-rs
avg: -1.6% min: -3.9% max: -0.7%
unify-linearly-check
avg: -3.2% min: -3.7% max: -2.7%
serde
avg: -1.1% min: -3.5% max: -0.1%
regression-31157-check
avg: -2.6% min: -3.4% max: -1.6%
helloworld-check
avg: -2.5% min: -3.4% max: -0.6%
serde-opt
avg: -1.3% min: -3.3% max: -0.5%
tokio-webpush-simple-check
avg: -2.4% min: -3.2% max: -1.8%
piston-image-check
avg: -1.7% min: -3.2% max: -0.9%
deeply-nested-opt
avg: -1.5% min: -3.0% max: -0.6%
deeply-nested-check
avg: -1.9% min: -2.9% max: -0.4%
deeply-nested
avg: -1.9% min: -2.9% max: -1.2%
syn-check
avg: -1.8% min: -2.8% max: -0.6%
coercions
avg: -0.5% min: -2.8% max: 0.4%
syn-opt
avg: -0.9% min: -2.4% max: -0.1%
syn
avg: -1.1% min: -2.2% max: -0.3%
parser-opt
avg: -1.9% min: -2.1% max: -1.6%
parser
avg: -1.9% min: -2.1% max: -1.6%
style-servo-check
avg: -1.3% min: -2.0% max: -0.8%
regression-31157-opt
avg: -0.8% min: -2.0% max: 0.0%
piston-image
avg: -0.7% min: -1.8% max: -0.2%
piston-image-opt
avg: -0.6% min: -1.8% max: -0.0%
regression-31157
avg: -1.0% min: -1.7% max: -0.3%
html5ever-opt
avg: -0.6% min: -1.5% max: -0.1%
unify-linearly-opt
avg: -1.3% min: -1.5% max: -1.1%
unify-linearly
avg: -1.3% min: -1.4% max: -1.2%
tokio-webpush-simple-opt
avg: -0.4% min: -1.2% max: -0.0%
helloworld-opt
avg: -1.0% min: -1.1% max: -0.6%
helloworld
avg: -1.0% min: -1.1% max: -0.7%
inflate-opt
avg: -0.3% min: -1.1% max: 0.1%
html5ever-check
avg: -0.6% min: -1.0% max: -0.3%
inflate-check
avg: -0.3% min: -1.0% max: -0.1%
```
</details>
|
|
Reduce maximum repr(align(N)) to 2^29
The current maximum `repr(align(N))` alignment is larger than the maximum alignment accepted by LLVM, which can cause issues for huge values of `N`, as seen in #49492. Fixes #49492.
r? @rkruppe
|
|
str::escape_default() can be used instead.
|
|
This avoids converting every char to \u{...} form, which bloats the
resulting strings unnecessarily. It also provides consistency with the
existing escape_default() calls in LitKind::token() used for raw
string literals, char literals, and raw byte char literals.
There are two benefits from this change.
- Compilation is faster. Most of the rustc-perf benchmarks see a
non-trivial speedup, particularly for incremental rebuilds, with the
best speedup over 13%, and multiple others over 10%.
- Generated rlibs are smaller. An extreme example is libfutures.rlib,
which shrinks from 2073306 bytes to 1765927 bytes, a 15% reduction.
|
|
Extend Printer::buf on demand.
So that 55 entries (at 48 bytes each) don't need to be eagerly
initialized on creation.
This speeds up numerous rust-perf benchmark runs, by up to 3%.
```
crates.io-check
avg: -2.4% min: -3.7% max: -1.1%
encoding-check
avg: -2.1% min: -2.9% max: -1.2%
crates.io-opt
avg: -1.3% min: -2.7% max: -0.1%
crates.io
avg: -1.4% min: -2.7% max: -0.3%
encoding-opt
avg: -1.1% min: -2.5% max: 0.1%
encoding
avg: -1.3% min: -2.4% max: -0.3%
hyper-check
avg: -1.7% min: -2.3% max: -0.9%
regex-check
avg: -1.5% min: -1.9% max: -0.7%
piston-image-check
avg: -0.9% min: -1.8% max: -0.5%
hyper
avg: -1.0% min: -1.7% max: -0.3%
hyper-opt
avg: -0.9% min: -1.7% max: -0.1%
syn-check
avg: -1.0% min: -1.5% max: -0.6%
clap-rs
avg: -0.3% min: -1.5% max: 0.2%
regex-opt
avg: -0.6% min: -1.5% max: -0.0%
regression-31157-check
avg: -1.1% min: -1.4% max: -0.7%
regex
avg: -0.7% min: -1.3% max: -0.1%
clap-rs-check
avg: -0.5% min: -1.2% max: 0.1%
syn-opt
avg: -0.5% min: -1.1% max: -0.1%
syn
avg: -0.5% min: -1.1% max: -0.2%
serde-opt
avg: -0.3% min: -1.1% max: 0.1%
piston-image-opt
avg: -0.4% min: -1.1% max: -0.0%
piston-image
avg: -0.4% min: -1.0% max: -0.0%
```
|
|
|
|
|
|
And fix some typos
|
|
|
|
|
|
|
|
Remove unstable `macro_reexport`
It's subsumed by `feature(use_extern_macros)` and `pub use`
cc https://github.com/rust-lang/rust/issues/35896
closes https://github.com/rust-lang/rust/issues/29638
closes https://github.com/rust-lang/rust/issues/38951
|
|
This brings it into line with LLVM's maximum permitted alignment.
|
|
|
|
Module experiments: Add one more prelude layer for extern crate names passed with `--extern`
Implements one item from https://internals.rust-lang.org/t/the-great-module-adventure-continues/6678/183
When some name is looked up in lexical scope (`name`, i.e. not module-relative scope `some_mod::name` or `::name`), it's searched roughly in the next order:
- local variables
- items in unnamed blocks
- items in the current module
- :sparkles: NEW! :sparkles: crate names passed with `--extern` ("extern prelude")
- standard library prelude (`Vec`, `drop`)
- language prelude (built-in types like `u8`, `str`, etc)
The last two layers contain a limited set of names controlled by us and not arbitrary user-defined names like upper layers. We want to be able to add new names into these two layers without breaking user code, so "extern prelude" names have higher priority than std prelude and built-in types.
This is a one-time breaking change, that's why it would be nice to run this through crater.
Practical impact is expected to be minimal though due to stylistic reasons (there are not many `Uppercase` crates) and due to the way how primitive types are resolved (https://github.com/rust-lang/rust/pull/32131).
|
|
|
|
It's subsumed by `feature(use_extern_macros)` and `pub use`
|
|
stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940)
r? @nikomatsakis
|
|
So that 55 entries (at 48 bytes each) don't need to be eagerly
initialized on creation.
This speeds up numerous rust-perf benchmark runs, by up to 3%.
|
|
Use enum for approximate suggestions
r? @nrc @killercup
|
|
Warn on pointless #[derive] in more places
This fixes the regression in #49934 and ensures that unused `#[derive]` invocations on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. There is a separate warning hardcoded for `#[derive]` on macro invocations since linting (even the early-lint pass) occurs after expansion. This also adds regression tests for some nodes that were already warning properly.
closes #49934
|
|
This fixes the regression in #49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly.
closes #49934
|
|
Improve error message for #[repr(align=x)]
Before:
```
error[E0552]: unrecognized representation hint
--> src/main.rs:1:8
|
1 | #[repr(align="8")]
| ^^^^^^^^^
```
After:
```
error[E0693]: incorrect `repr(align)` attribute format
--> src/main.rs:1:8
|
2 | #[repr(align="8")]
| ^^^^^^^^^ help: use parentheses instead: `align(8)`
```
Fixes #50314.
|
|
|
|
This is in the matter of RFC 1940 and tracking issue #43302.
|
|
'label can start expressions
```Rust
let foo = 'label: loop { break 'label 42; };
```
is valid Rust code.
|
|
Stabilize dyn trait
This PR stabilizes RFC 2113. I followed the [stabilization guide](https://forge.rust-lang.org/stabilization-guide.html).
Related issue: https://github.com/rust-lang/rust/issues/49218
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tweak some warnings around #[target_feature]
This commit fixes up some issues discovered when getting the `stdsimd` crate's CI compiling again.
|
|
Don't allow #[should_panic] with non-() tests
Adds (removes) support for `#[should_panic]` when the test is non-`()`
|
|
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.
|
|
Feature gate where clauses on associated types
Fixes #49365. Requires crater: these have been usable since 1.24.
|
|
|
|
let foo = 'label: loop { break 'label 42; };
is valid Rust code.
|
|
Doc comments present after a particular syntax error cause an unhelpful error message to be output.
fixed: #48636
r? @estebank
|
|
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.
|
|
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
|
|
Add specific never search
Fixes #49529.
r? @QuietMisdreavus
|
|
|
|
|
|
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.)
|