Commit graph

150811 commits

Author SHA1 Message Date
Yuki Okushi
1823b3f2b3
Rollup merge of #85520 - FabianWolff:issue-85475, r=jackh726
Fix typo and improve documentation for E0632

Edit: After https://github.com/rust-lang/rust/pull/85520#issuecomment-870095546, this PR has been boiled down to just an extended description for `E0632` and a fixed typo.
2021-07-01 05:20:55 +09:00
Yuki Okushi
7c06191d2c
Rollup merge of #85504 - liigo:patch-13, r=Mark-Simulacrum
the foundation owns rust trademarks
2021-07-01 05:20:54 +09:00
Camille GILLOT
f69877426a Update comments. 2021-06-30 20:56:49 +02:00
Camille GILLOT
aa1bc5874e Fix AST pretty. 2021-06-30 20:53:10 +02:00
Camille GILLOT
2f28737ebe Move AST crate. 2021-06-30 20:53:10 +02:00
Camille GILLOT
c520cf2253 Arena-allocate Crate during lowering. 2021-06-30 20:31:56 +02:00
Camille GILLOT
e05cd155fe Move lowering to create_global_ctxt. 2021-06-30 20:31:55 +02:00
Camille GILLOT
b80f720a2a Inline lower_to_hir. 2021-06-30 20:31:54 +02:00
Camille GILLOT
18c10fb1a6 Separate resolver creation from expansion. 2021-06-30 20:31:53 +02:00
Camille GILLOT
5f98e5ee56 Simplify DepGraph creation. 2021-06-30 20:31:52 +02:00
Cameron Steffen
2a60f090b9 Add suggestion for missing compile flag group 2021-06-30 13:28:15 -05:00
bors
cadb93b6de Auto merge of #7400 - popzxc:restrict-locales, r=Manishearth
New lint: `disallowed_script_idents`

This PR implements a new lint to restrict locales that can be used in the code,
as proposed in #7376.

Current concerns / unresolved questions:

- ~~Mixed usage of `script` (as a Unicode term) and `locale` (as something that is easier to understand for the broad audience). I'm not sure whether these terms are fully interchangeable and whether in the current form it is more confusing than helpful.~~ `script` is now used everywhere.
- ~~Having to mostly copy-paste `AllowedScript`. Probably it's not a big problem, as the list of scripts is standardized and is unlikely to change, and even if we'd stick to the `unicode_script::Script`, we'll still have to implement custom deserialization, and I don't think that it will be shorter in terms of the amount of LoC.~~ `unicode::Script` is used together with a filtering deserialize function.
- Should we stick to the list of "recommended scripts" from [UAX #31](http://www.unicode.org/reports/tr31/#Table_Recommended_Scripts) in the configuration?

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: ``[`disallowed_script_idents`]``

r? `@Manishearth`
2021-06-30 18:14:16 +00:00
Daniel Paoliello
aac8a88552 Improve debug symbol names to avoid ambiguity and work better with MSVC's debugger
There are several cases where names of types and functions in the debug info are either ambiguous, or not helpful, such as including ambiguous placeholders (e.g., `{{impl}}`, `{{closure}}` or `dyn _'`) or dropping qualifications (e.g., for dynamic types).

Instead, each debug symbol name should be unique and useful:
* Include disambiguators for anonymous `DefPathDataName` (closures and generators), and unify their formatting when used as a path-qualifier vs item being qualified.
* Qualify the principal trait for dynamic types.
* If there is no principal trait for a dynamic type, emit all other traits instead.
* Respect the `qualified` argument when emitting ref and pointer types.
* For implementations, emit the disambiguator.
* Print const generics when emitting generic parameters or arguments.

Additionally, when targeting MSVC, its debugger treats many command arguments as C++ expressions, even when the argument is defined to be a symbol name. As such names in the debug info need to be more C++-like to be parsed correctly:
* Avoid characters with special meaning (`#`, `[`, `"`, `+`).
* Never start a name with `<` or `{` as this is treated as an operator.
* `>>` is always treated as a right-shift, even when parsing generic arguments (so add a space to avoid this).
* Emit function declarations using C/C++ style syntax (e.g., leading return type).
* Emit arrays as a synthetic `array$<type, size>` type.
* Include a `$` in all synthetic types as this is a legal character for C++, but not Rust (thus we avoid collisions with user types).
2021-06-30 11:10:29 -07:00
Miguel Ojeda
7c9445d4a7 alloc: RawVec<T, A>::shrink can be in no_global_oom_handling.
Found in https://github.com/Rust-for-Linux/linux/pull/402.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-06-30 19:42:41 +02:00
Simonas Kazlauskas
9b67cba4f6 Add support for leaf fn frame pointer elimination
This PR adds ability for the target specifications to specify frame
pointer emission type that's not just “always” or “whatever cg decides”.

In particular there's a new mode that allows omission of the frame
pointer for leaf functions (those that don't call any other functions).

We then set this new mode for Aarch64-based Apple targets.

Fixes #86196
2021-06-30 19:45:17 +03:00
Fabian Wolff
0c267830d5 Match on hir::TraitFn::Provided instead of using maybe_body_owned_by 2021-06-30 18:27:07 +02:00
Igor Aleksanov
018be41dee Implement 'disallowed_script_idents' lint 2021-06-30 19:06:33 +03:00
Deadbeef
c424510746
Add tests for cross-crate usage of impl const 2021-06-30 23:57:17 +08:00
Deadbeef
3b9453bfe2
use is_const_fn_raw when encoding constness
this properly encodes cross-crate constness data.
2021-06-30 23:56:43 +08:00
bors
3525a6b61a Auto merge of #7390 - popzxc:issue-7331, r=flip1995
Improve lint message for match-same-arms lint

fixes #7331

Follow-up to #7377

This PR improves the lint message for `match-same-arms` lint and adds `todo!(..)`  example to the lint docs.

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: None
2021-06-30 15:12:55 +00:00
bors
868c702d0c Auto merge of #86695 - sexxi-goose:closure_size, r=nikomatsakis
Introduce -Zprofile-closures to evaluate the impact of 2229

This creates a CSV with name "closure_profile_XXXXX.csv", where the
variable part is the process id of the compiler.

To profile a cargo project you can run one of the following depending on
if you're compiling a library or a binary:

```
cargo +nightly rustc --lib -- -Zprofile-closures
cargo +nightly rustc --bin {binary_name} -- -Zprofile-closures
```

r? `@nikomatsakis`
2021-06-30 13:42:50 +00:00
Guillaume Gomez
855923c895 Add test to ensure that the typed queries are not including other types 2021-06-30 14:20:17 +02:00
Guillaume Gomez
7b62d28cf2 Enforce search typed queries 2021-06-30 14:11:09 +02:00
Fabian Wolff
11fd8579e4 Emit explanatory note for functions in trait and impl items as well 2021-06-30 13:56:26 +02:00
bors
5d34076975 Auto merge of #86650 - GuillaumeGomez:fix-boldness, r=Nemo157
Fix boldness (put it back where needed)

I realized that I created a GUI test that wasn't run because it had ".rs" extension instead of ".goml" so I moved its content into `font-weight.goml` (since it was checking font weight).
2021-06-30 10:54:08 +00:00
bors
7ede6e2a23 Auto merge of #86739 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/86723
Cc `@rust-lang/miri` r? `@ghost`
2021-06-30 07:28:42 +00:00
Ralf Jung
80fa596145 update Miri 2021-06-30 09:21:20 +02:00
1000teslas
fe822fe64d copy rust-lld as ld in dist 2021-06-30 16:30:40 +10:00
bors
51fd129ac1 Auto merge of #86689 - rylev:future-compat-lint-group, r=nikomatsakis
Only include lint in future_incompatible lint group if not an edition lint

A follow up to #86330 - this only includes lints annotated with `FutureIncompatibleInfo` in the `future_incompatibile` lint group if the future compatibility is not tied to an edition.

We probably want to rename `FutureIncompatibleInfo` to something else since this type is now used to indicate future breakages of all kinds (even those that happen in editions). I'd prefer to do that in a separate PR though.

r? `@nikomatsakis`
2021-06-30 05:02:01 +00:00
Joshua Nelson
81f3ab6bca Use a macro for documenting rustdoc 2021-06-29 23:05:02 -04:00
bors
9af4bdeab0 Auto merge of #86724 - cuviper:indexmap-1.7, r=Mark-Simulacrum
Upgrade to indexmap 1.7, using hashbrown 0.11
2021-06-30 02:20:50 +00:00
bors
0ce21126b2 Auto merge of #86522 - JohnTitor:move-ui-tests, r=petrochenkov
Move some UI tests to more suitable subdirs

cc #73494
The classified result is here: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427

- issues/issue-27060.rs: misclassified, should be packed.
- issues/issue-45157.rs: moved to nll.
- issues/issue-69532.rs: ~~couldn't figured out the best place, placed a new `llvm` dir~~ moved to consts.
- fsu-moves-and-copies.rs: moved to borrowck.
- issues/issue-36638.rs: misclassified, moved to keyword.
- issues/issue-48636.rs: moved to parser.
- issues/issue-37655.rs: I'm not sure but associated-types shouldn't the best, moved to coercion but region may be better.
- issues/issue-20005.rs: moved to associated-types.
- issues/issue-82869.rs: moved to asm.
- issues/issue-24535-allow-mutable-borrow-in-match-guard.rs: moved to nll.
- issues/issue-52169.rs: moved to macros.
- test-passed.rs: moved to test-attrs along with `test-` prefixed tests.
  - test-cfg.rs: moved to conditional-compilation.
- non-integer-atomic.rs: moved to intrinsics.
- issues/issue-54521-2.rs: moved to parser.
- issues/issue-17756.rs: moved to consts.
- conversion-methods.rs: ~~moved to suggestions~~ moved to typeck.

r? `@petrochenkov`
2021-06-29 23:40:00 +00:00
Yuki Okushi
2c6268678d
Move some UI tests to more suitable subdirs 2021-06-30 06:41:10 +09:00
bors
6d820866a2 Auto merge of #86725 - JohnTitor:normalizecss-8, r=GuillaumeGomez
Upgrade normalize.css to v8.0.1

Fixes #86629, this addresses #82548 and #82542 with tweaks. I expect that this changes the style *slightly* but shouldn't have any major changes.
Here's some changes I observed, I'd say they all are an improvement.

<details>
<summary>Before</summary>

![before 1](https://user-images.githubusercontent.com/25030997/123854746-0fc84800-d95a-11eb-8484-ea86dfe0ae14.png)
![before 2](https://user-images.githubusercontent.com/25030997/123854754-135bcf00-d95a-11eb-8cca-f49994629e08.png)

</details>

<details>
<summary>After</summary>

![after 1](https://user-images.githubusercontent.com/25030997/123854809-21115480-d95a-11eb-9dd2-0d3b9ca45edd.png)
![after 2](https://user-images.githubusercontent.com/25030997/123854818-22428180-d95a-11eb-83aa-fb5a698124f9.png)

</details>

r? `@jsha`
2021-06-29 20:59:14 +00:00
Fabian Wolff
2586e962e0 Check node kind to avoid ICE in check_expr_return() 2021-06-29 22:20:06 +02:00
Yuki Okushi
510107815f
Fix some style regressions due to normalize.css 8 2021-06-30 04:13:46 +09:00
Yuki Okushi
66430652d1
Upgrade normalize.css to v8.0.1 2021-06-30 04:13:16 +09:00
Josh Stone
ae9713a399 Upgrade to indexmap 1.7, using hashbrown 0.11 2021-06-29 11:38:16 -07:00
bors
6e0b554619 Auto merge of #86603 - Mark-Simulacrum:stage-step, r=pietroalbini
Update to new bootstrap compiler

r? `@pietroalbini`
2021-06-29 18:33:13 +00:00
bors
e98897e5dc Auto merge of #86475 - crlf0710:miri_vtable_refactor, r=bjorn3
Change vtable memory representation to use tcx allocated allocations.

This fixes https://github.com/rust-lang/rust/issues/86324. However i suspect there's more to change before it can land.

r? `@bjorn3`
cc `@rust-lang/miri`
2021-06-29 15:52:21 +00:00
Ian Wahbe
e77acf7d27 Add non-mutable methods to Cursor 2021-06-29 15:35:14 +02:00
Ian Wahbe
a981be75cc add head/tail methods to linked list mutable cursor 2021-06-29 15:24:01 +02:00
bors
fbd77ef5d3 Auto merge of #7411 - camsteffen:use-self-visitor, r=flip1995
Simplify use_self impl

changelog: none

Mainly to remove an extra visit and simplify the "in body?" logic.
2021-06-29 13:23:04 +00:00
Cameron Steffen
bae76f9c17 Remove a visitor from use_self 2021-06-29 08:17:23 -05:00
Cameron Steffen
6e801e251f Use type_of for impl self type 2021-06-29 08:15:45 -05:00
Cameron Steffen
4913d82175 Simplify in impl check 2021-06-29 08:14:21 -05:00
Cameron Steffen
8827e96303 Make ItemKind check dry 2021-06-29 08:14:21 -05:00
bors
8971fff984 Auto merge of #86009 - cjgillot:fwarn, r=davidtwco
Make ForceWarn a lint level.

Follow-up to #85788
cc `@rylev`
2021-06-29 13:11:16 +00:00
bors
95c2ab75db Auto merge of #7405 - jyn514:fix-stable, r=camsteffen
Stabilize `cargo clippy --fix`

This has been unstable since it was first introduced in
https://github.com/rust-lang/rust-clippy/pull/5363. In that time, I have
been using it successfully in nightly without issues. I don't think
there are any blocking issues now that RUSTC_WORKSPACE_WRAPPER is
stabilized, so this can be stabilized.

changelog: Stabilize `cargo clippy --fix`
2021-06-29 13:03:45 +00:00
Fabian Wolff
69c8573ab5 Bless UI tests 2021-06-29 12:49:08 +02:00