Commit Graph

348 Commits

Author SHA1 Message Date
Maybe Waffle
c1a2db3372 Move/rename lazy::Sync{OnceCell,Lazy} to sync::{Once,Lazy}Lock 2022-06-16 19:54:42 +04:00
Jacob Pratt
fb05b53745
Remove rustc_deprecated diagnostics 2022-06-14 19:46:13 -04:00
Dylan DPC
d8333a7b59
Rollup merge of #97948 - davidtwco:diagnostic-translation-lints, r=oli-obk
lint: add diagnostic translation migration lints

Introduce allow-by-default lints for checking whether diagnostics are written in
`SessionDiagnostic` or `AddSubdiagnostic` impls and whether diagnostics are translatable. These lints can be denied for modules once they are fully migrated to impls and translation.

These lints are intended to be temporary - once all diagnostics have been changed then we can just change the APIs we have and that will enforce these constraints thereafter.

r? `````@oli-obk`````
2022-06-14 10:35:31 +02:00
Matthias Krüger
f758b4f4a0
Rollup merge of #97999 - compiler-errors:type_changin_struct_update_is_probably_complete, r=oli-obk
Make `type_changing_struct_update` no longer an incomplete feature

After #97705, I don't see what would make it incomplete anymore. `check_expr_struct_fields` seems to now implement the RFC to the letter.

r? ``````@nikomatsakis``````
cc ``````@rust-lang/types``````
2022-06-13 21:35:56 +02:00
Matthias Krüger
89249b199e
Rollup merge of #97875 - JohnTitor:rm-infer-static-outlives-requirements, r=pnkfelix
Remove the `infer_static_outlives_requirements` feature

Closes #54185
r? ``@pnkfelix``
2022-06-13 21:35:54 +02:00
Michael Goulet
2f923c4d37 Make type_changing_struct_update no longer incomplete 2022-06-11 11:15:44 -07:00
Dylan DPC
f1f44b9e4d
Rollup merge of #96868 - nrc:turbo-stable, r=jhpratt,nbdd0121,nagisa
Stabilize explicit_generic_args_with_impl_trait

This is a stabilisation PR for `explicit_generic_args_with_impl_trait`.

* [tracking issue](https://github.com/rust-lang/rust/issues/83701)
  - [Stabilisation report](https://github.com/rust-lang/rust/issues/83701#issuecomment-1109949897)
  - [FCP entered](https://github.com/rust-lang/rust/issues/83701#issuecomment-1120285703)
* [implementation PR](https://github.com/rust-lang/rust/pull/86176)
* [Reference PR](https://github.com/rust-lang/reference/pull/1212)
* There is no mention of using the turbofish operator in the book (other than an entry in the operator list in the appendix), so there is no documentation to change/add there, unless we felt like we should add a section on using turbofish, but that seems orthogonal to `explicit_generic_args_with_impl_trait`
2022-06-11 07:42:12 +02:00
David Wood
5ba81faba6 lint: add diagnostic translation migration lints
Introduce allow-by-default lints for checking whether diagnostics are
written in `SessionDiagnostic`/`AddSubdiagnostic` impls and whether
diagnostics are translatable. These lints can be denied for modules once
they are fully migrated to impls and translation.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-10 15:50:06 +01:00
Vadim Petrochenkov
a8ee1f3a4f Stabilize the bundle native library modifier 2022-06-09 23:12:58 +04:00
Yuki Okushi
153f01e42c
Remove the infer_static_outlives_requirements feature 2022-06-08 21:11:15 +09:00
bors
91cacb3faf Auto merge of #97512 - scottmcm:add-coldcc, r=nagisa,lcnr
Add support for emitting functions with `coldcc` to LLVM

The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps.
2022-06-07 08:12:45 +00:00
Nick Cameron
640a461388 Deactivate feature gate explicit_generic_args_with_impl_trait
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2022-06-06 12:21:49 +01:00
Jack Huey
410dcc9674 Fully stabilize NLL 2022-06-03 17:16:41 -04:00
bors
44e9516c85 Auto merge of #97654 - Dylan-DPC:rollup-w6zrzxf, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #97420 (Be a little nicer with casts when formatting `fn` pointers)
 - #97450 ([RFC 2011] Basic compiler infrastructure)
 - #97599 (Fix JSON reexport ICE)
 - #97617 (Rustdoc anonymous reexports)
 - #97636 (Revert #96682.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-02 16:04:42 +00:00
Caio
aa115eba12 Basic compiler infra 2022-06-02 09:00:04 -03:00
est31
cfc21deebd Add #[rustc_box]
This commit adds an alternative content boxing syntax,
and uses it inside alloc.

The usage inside the very performance relevant code in
liballoc is the only remaining relevant usage of box syntax
in the compiler (outside of tests, which are comparatively
easy to port).

box syntax was originally designed to be used by all Rust
developers. This introduces a replacement syntax more tailored
to only being used inside the Rust compiler, and with it,
lays the groundwork for eventually removing box syntax.
2022-06-01 02:28:34 +02:00
bors
5c780b98d1 Auto merge of #96964 - oli-obk:const_trait_mvp, r=compiler-errors
Replace `#[default_method_body_is_const]` with `#[const_trait]`

pulled out of #96077

related issues:  #67792 and #92158

cc `@fee1-dead`

This is groundwork to only allowing `impl const Trait` for traits that are marked with `#[const_trait]`. This is necessary to prevent adding a new default method from becoming a breaking change (as it could be a non-const fn).
2022-05-30 09:19:03 +00:00
Deadbeef
257f06587c Remove #[default..] and add #[const_trait] 2022-05-30 08:52:24 +00:00
Scott McMurray
e90be842fb Add support for emitting functions with coldcc in LLVM
The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps.
2022-05-30 00:19:23 -07:00
bors
bef2b7cd1c Auto merge of #97214 - Mark-Simulacrum:stage0-bump, r=pietroalbini
Finish bumping stage0

It looks like the last time had left some remaining cfg's -- which made me think
that the stage0 bump was actually successful. This brings us to a released 1.62
beta though.

This now brings us to cfg-clean, with the exception of check-cfg-features in bootstrap;
I'd prefer to leave that for a separate PR at this time since it's likely to be more tricky.

cc https://github.com/rust-lang/rust/pull/97147#issuecomment-1132845061

r? `@pietroalbini`
2022-05-29 16:28:21 +00:00
Guillaume Gomez
239287f013
Rollup merge of #97028 - ridwanabdillahi:pretty-printer, r=michaelwoerister
Add support for embedding pretty printers via `#[debugger_visualizer]` attribute

Initial support for [RFC 3191](https://github.com/rust-lang/rfcs/pull/3191) in PR https://github.com/rust-lang/rust/pull/91779 was scoped to supporting embedding NatVis files using a new attribute. This PR implements the pretty printer support as stated in the RFC mentioned above.

This change includes embedding pretty printers in the `.debug_gdb_scripts` just as the pretty printers for rustc are embedded today. Also added additional tests for embedded pretty printers. Additionally cleaned up error checking so all error checking is done up front regardless of the current target.

RFC: https://github.com/rust-lang/rfcs/pull/3191
2022-05-29 01:12:30 +02:00
Mark Rousskov
b454991ac4 Finish bumping stage0
It looks like the last time had left some remaining cfg's -- which made me think
that the stage0 bump was actually successful. This brings us to a released 1.62
beta though.
2022-05-27 07:36:17 -04:00
Dylan DPC
c12a36adc6
Rollup merge of #96913 - Urgau:rfc3239-part2, r=petrochenkov
RFC3239: Implement `cfg(target)` - Part 2

This pull-request implements the compact `cfg(target(..))` part of [RFC 3239](https://github.com/rust-lang/rust/issues/96901).

I recommend reviewing this PR on a per commit basics, because of some moving parts.

cc `@GuillaumeGomez`
r? `@petrochenkov`
2022-05-25 10:48:28 +02:00
ridwanabdillahi
60458b97e7 Add support for embedding pretty printers via the #[debugger_visualizer] attribute. Add tests for embedding pretty printers and update documentation.
Ensure all error checking for `#[debugger_visualizer]` is done up front and not when the `debugger_visualizer` query is run.

Clean up potential ODR violations when embedding pretty printers into the `__rustc_debug_gdb_scripts_section__` section.

Respond to PR comments and update documentation.
2022-05-24 11:14:48 -07:00
Loïc BRANSTETT
8345571cd0 RFC3239: Implement compact cfg(target(..)) 2022-05-24 13:51:36 +02:00
Jacob Pratt
8cece636b2
Remove feature: crate visibility modifier 2022-05-21 14:22:06 -04:00
lcnr
7cf9f1ab91 change some attrs to only_local 2022-05-10 12:07:36 +02:00
lcnr
6c8265dc56 only_local: always check for misuse 2022-05-10 12:07:35 +02:00
lcnr
fc128b6764 add check and don't encode #[inline] 2022-05-10 08:09:37 +02:00
lcnr
74b6d296db don't encode only locally used attrs 2022-05-10 08:09:37 +02:00
bors
8a2fe75d0e Auto merge of #95960 - jhpratt:remove-rustc_deprecated, r=compiler-errors
Remove `#[rustc_deprecated]`

This removes `#[rustc_deprecated]` and introduces diagnostics to help users to the right direction (that being `#[deprecated]`). All uses of `#[rustc_deprecated]` have been converted. CI is expected to fail initially; this requires #95958, which includes converting `stdarch`.

I plan on following up in a short while (maybe a bootstrap cycle?) removing the diagnostics, as they're only intended to be short-term.
2022-05-09 04:47:30 +00:00
Arseniy Pendryak
02ac4a4e02 Remove adx_target_feature feature from active features list
The feature was stabilized in https://github.com/rust-lang/rust/pull/93745
2022-05-06 13:12:45 +03:00
bors
74cea9fdb9 Auto merge of #96520 - lcnr:general-incoherent-impls, r=petrochenkov
generalize "incoherent impls" impl for user defined types

To allow the move of `trait Error` into core.

continues the work from #94963, finishes https://github.com/rust-lang/compiler-team/issues/487

r? `@petrochenkov` cc `@yaahc`
2022-05-05 23:24:36 +00:00
lcnr
209dd2cb0a generalize "incoherent impls" impl for custom types 2022-05-05 10:53:00 +02:00
ridwanabdillahi
175a4eab84 Add support for a new attribute #[debugger_visualizer] to support embedding debugger visualizers into a generated PDB.
Cleanup `DebuggerVisualizerFile` type and other minor cleanup of queries.

Merge the queries for debugger visualizers into a single query.

Revert move of `resolve_path` to `rustc_builtin_macros`. Update dependencies in Cargo.toml for `rustc_passes`.

Respond to PR comments. Load visualizer files into opaque bytes `Vec<u8>`. Debugger visualizers for dynamically linked crates should not be embedded in the current crate.

Update the unstable book with the new feature. Add the tracking issue for the debugger_visualizer feature.

Respond to PR comments and minor cleanups.
2022-05-03 10:53:54 -07:00
Scott McMurray
e094ee5f10 Add do yeet expressions to allow experimentation in nightly
Using an obviously-placeholder syntax.  An RFC would still be needed before this could have any chance at stabilization, and it might be removed at any point.

But I'd really like to have it in nightly at least to ensure it works well with try_trait_v2, especially as we refactor the traits.
2022-04-30 17:40:27 -07:00
Dylan DPC
27e2d811e6
Rollup merge of #94457 - jhpratt:stabilize-derive_default_enum, r=davidtwco
Stabilize `derive_default_enum`

This stabilizes `#![feature(derive_default_enum)]`, as proposed in [RFC 3107](https://github.com/rust-lang/rfcs/pull/3107) and tracked in #87517. In short, it permits you to `#[derive(Default)]` on `enum`s, indicating what the default should be by placing a `#[default]` attribute on the desired variant (which must be a unit variant in the interest of forward compatibility).

```````@rustbot``````` label +S-waiting-on-review +T-lang
2022-04-15 20:50:43 +02:00
Jacob Pratt
0b3db4e4ee
Use native duplicate attribute check 2022-04-14 21:19:48 -04:00
Eric Huss
be23ead9a4 Fix crate_type attribute to not warn on duplicates 2022-04-10 16:35:37 -07:00
niluxv
98a4834237 Split fuzzy_provenance_casts into lossy and fuzzy, feature gate and test it
* split `fuzzy_provenance_casts` into a ptr2int and a int2ptr lint
* feature gate both lints
* update documentation to be more realistic short term
* add tests for these lints
2022-04-08 17:41:28 +02:00
Jacob Pratt
abf2b4c04d
Stabilize derive_default_enum 2022-04-07 20:03:19 -04:00
Dylan DPC
e08ab08a2e
Rollup merge of #94869 - jackh726:gats_extended, r=compiler-errors
Add the generic_associated_types_extended feature

Right now, this only ignore obligations that reference new placeholders in `poly_project_and_unify_type`. In the future, this might do other things, like allowing object-safe GATs.

**This feature is *incomplete* and quite likely unsound. This is mostly just for testing out potential future APIs using a "relaxed" set of rules until we figure out *proper* rules.**

Also drive by cleanup of adding a `ProjectAndUnifyResult` enum instead of using a `Result<Result<Option>>`.

r? `@nikomatsakis`
2022-03-31 00:26:29 +02:00
Jack Huey
4e570a68a1 Add the generic_associated_types_extended feature 2022-03-30 17:41:11 -04:00
Vadim Petrochenkov
1004783ef9 Stabilize native library modifier syntax and the whole-archive modifier specifically 2022-03-30 23:53:21 +03:00
lcnr
bef6f3e895 rework implementation for inherent impls for builtin types 2022-03-30 11:23:58 +02:00
lcnr
e8890aad62 move adt_const_params to its own tracking issue 2022-03-21 16:33:42 +01:00
Dylan DPC
0c73b252eb
Rollup merge of #94982 - skippy10110:deprecated_safe, r=Dylan-DPC
Add deprecated_safe feature gate and attribute, cc #94978
2022-03-17 22:55:06 +01:00
skippy10110
e4f1179fa6 Add deprecated_safe feature gate and attribute, cc #94978 2022-03-15 19:48:52 -03:00
Tony Arcieri
78567df575 Stabilize ADX target feature
This is a continuation of #60109, which noted that while the ADX
intrinsics were stabilized, the corresponding target feature never was.

This PR follows the same general structure and stabilizes the ADX target
feature.
2022-03-14 18:56:39 -06:00
Matthias Krüger
0e423932f8
Rollup merge of #90621 - adamgemmell:dev/stabilise-target-feature, r=Amanieu
Stabilise `aarch64_target_feature`

This PR stabilises `aarch64_target_feature` - see https://github.com/rust-lang/rust/issues/90620
2022-03-14 17:24:56 +01:00