Commit Graph

637 Commits

Author SHA1 Message Date
Nadrieril
886108b9fe Add feature gate 2024-01-24 23:52:03 +01:00
Oli Scherer
9a20cf1697 Revert "Auto merge of #118133 - Urgau:stabilize_trait_upcasting, r=WaffleLapkin"
This reverts commit 6d2b84b3ed, reversing
changes made to 73bc12199e.
2024-01-22 14:24:31 +00:00
George Bateman
7924c9bcdf
Split remaining offset_of features into new tracking issues 2024-01-19 21:13:11 +00:00
George Bateman
615946db4f
Stabilize simple offset_of 2024-01-19 20:38:51 +00:00
Andrew Zhogin
8507f5105b Improved collapse_debuginfo attribute, added command-line flag (no|external|yes) 2024-01-17 23:18:14 +07:00
Matthias Krüger
d61ac868f7
Rollup merge of #119866 - smoelius:patch-2, r=compiler-errors
Convert `effects` description to doc comment

So that it is visible here: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_feature/unstable/struct.Features.html#structfield.effects

r? `@fee1-dead`
2024-01-12 08:23:59 +01:00
Eduardo Sánchez Muñoz
c03808f53b Set c_str_literals stabilization version back to CURRENT_RUSTC_VERSION
`c_str_literals`'s stabilization has been delayed to 1.77 (https://github.com/rust-lang/rust/pull/119528).
2024-01-11 20:46:02 +01:00
Samuel Moelius
7aec5def5a
Convert effects description to doc comment
So that it is visible here: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_feature/unstable/struct.Features.html#structfield.effects
2024-01-11 13:51:36 -05:00
Matthias Krüger
ea6129084e
Rollup merge of #119354 - fmease:negative_bounds-fixes, r=compiler-errors
Make `negative_bounds` internal & fix some of its issues

r? compiler-errors
2024-01-05 20:39:51 +01:00
Gary Guo
86bd81fe83 Update tracking issue of naked_functions
The original tracking issue was superseded by a new one
(constrainted naked functions) and therefore is closed.
2023-12-31 17:09:46 +00:00
León Orell Valerian Liehr
5f56465621
Make feature negative_bounds internal 2023-12-28 00:43:35 +01:00
Michael Goulet
50e380c8f3
Rollup merge of #119235 - Urgau:missing-feature-gate-sanitizer-cfi-cfgs, r=Nilstrieb
Add missing feature gate for sanitizer CFI cfgs

Found during the review of https://github.com/rust-lang/rust/pull/118494 in https://github.com/rust-lang/rust/pull/118494#discussion_r1416079288.

cc `@rcvalle`
2023-12-26 13:29:13 -05:00
bors
495203bf61 Auto merge of #119211 - rust-lang:pa-master-1.77, r=Mark-Simulacrum
Bump stage0 to 1.76 beta

r? `@Mark-Simulacrum`
2023-12-23 00:26:47 +00:00
Urgau
cc6cbaad4b Add missing CFI sanitizer cfgs feature gate 2023-12-23 00:52:42 +01:00
Pietro Albini
c00486c9bb
update version placeholders 2023-12-22 11:01:42 +01:00
Eric Holk
97df0d3657
Desugar for await loops 2023-12-19 12:26:27 -08:00
Eric Holk
27d6539a46
Plumb awaitness of for loops 2023-12-19 12:26:20 -08:00
Eric Huss
f481596ee4 Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
bors
b9068315db Auto merge of #116952 - compiler-errors:lifetime_capture_rules_2024, r=TaKO8Ki
Implement 2024-edition lifetime capture rules RFC

Implements rust-lang/rfcs#3498.
2023-12-10 15:51:39 +00:00
bors
f32d29837d Auto merge of #118605 - fee1-dead-contrib:rm-rustc_host, r=compiler-errors
Remove `#[rustc_host]`, use internal desugaring

Also removed a way for users to explicitly specify the host param since that isn't particularly useful. This should eliminate any pain with encoding attributes across crates and etc.

r? `@compiler-errors`
2023-12-06 16:00:24 +00:00
Michael Goulet
0ad160a585 Add lifetime_capture_rules_2024 2023-12-05 19:53:59 +00:00
Michael Goulet
19bf749560
Rollup merge of #118123 - RalfJung:internal-lib-features, r=compiler-errors
Add support for making lib features internal

We have the notion of an "internal" lang feature: a feature that is never intended to be stabilized, and using which can cause ICEs and other issues without that being considered a bug.

This extends that idea to lib features as well. It is an alternative to https://github.com/rust-lang/rust/pull/115623: instead of using an attribute to declare lib features internal, we simply do this based on the name. Everything ending in `_internals` or `_internal` is considered internal.

Then we rename `core_intrinsics` to `core_intrinsics_internal`, which fixes https://github.com/rust-lang/rust/issues/115597.
2023-12-05 14:52:41 -05:00
Matthias Krüger
81b6263dd0
Rollup merge of #118598 - Nadrieril:remove_precise_pointer_size_matching, r=davidtwco
Remove the `precise_pointer_size_matching` feature gate

`usize` and `isize` are special for pattern matching because their range might depend on the platform. To make code portable across platforms, the following is never considered exhaustive:
```rust
let x: usize = ...;
match x {
    0..=18446744073709551615 => {}
}
```
Because of how rust handles constants, this also unfortunately counts `0..=usize::MAX` as non-exhaustive. The [`precise_pointer_size_matching`](https://github.com/rust-lang/rust/issues/56354) feature gate was introduced both for this convenience and for the possibility that the lang team could decide to allow the above.

Since then, [half-open range patterns](https://github.com/rust-lang/rust/issues/67264) have been implemented, and since #116692 they correctly support `usize`/`isize`:
```rust
match 0usize { // exhaustive!
    0..5 => {}
    5.. => {}
}
```
I believe this subsumes all the use cases of the feature gate. Moreover no attempt has been made to stabilize it in the 5 years of its existence. I therefore propose we retire this feature gate.

Closes https://github.com/rust-lang/rust/issues/56354
2023-12-05 16:08:35 +01:00
Deadbeef
65212a07e7 Remove #[rustc_host], use internal desugaring 2023-12-05 01:15:21 +00:00
Nadrieril
5e470db05c Remove the precise_pointer_size_matching feature gate 2023-12-04 11:56:21 +01:00
bors
2da59b8676 Auto merge of #118470 - nnethercote:cleanup-error-handlers, r=compiler-errors
Cleanup error handlers

Mostly by making function naming more consistent. More to do after this, but this is enough for one PR.

r? compiler-errors
2023-12-02 02:48:34 +00:00
Nicholas Nethercote
5d1d384443 Rename HandlerInner::delay_span_bug as HandlerInner::span_delayed_bug.
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug`
follows the pattern used everywhere else: `span_err`, `span_warning`,
etc.
2023-12-02 09:01:19 +11:00
bors
63d16b5a98 Auto merge of #117472 - jmillikin:stable-c-str-literals, r=Nilstrieb
Stabilize C string literals

RFC: https://rust-lang.github.io/rfcs/3348-c-str-literal.html

Tracking issue: https://github.com/rust-lang/rust/issues/105723

Documentation PR (reference manual): https://github.com/rust-lang/reference/pull/1423

# Stabilization report

Stabilizes C string and raw C string literals (`c"..."` and `cr#"..."#`), which are expressions of type [`&CStr`](https://doc.rust-lang.org/stable/core/ffi/struct.CStr.html). Both new literals require Rust edition 2021 or later.

```rust
const HELLO: &core::ffi::CStr = c"Hello, world!";
```

C strings may contain any byte other than `NUL` (`b'\x00'`), and their in-memory representation is guaranteed to end with `NUL`.

## Implementation

Originally implemented by PR https://github.com/rust-lang/rust/pull/108801, which was reverted due to unintentional changes to lexer behavior in Rust editions < 2021.

The current implementation landed in PR https://github.com/rust-lang/rust/pull/113476, which restricts C string literals to Rust edition >= 2021.

## Resolutions to open questions from the RFC

* Adding C character literals (`c'.'`) of type `c_char` is not part of this feature.
  * Support for `c"..."` literals does not prevent `c'.'` literals from being added in the future.
* C string literals should not be blocked on making `&CStr` a thin pointer.
  * It's possible to declare constant expressions of type `&'static CStr` in stable Rust (as of v1.59), so C string literals are not adding additional coupling on the internal representation of `CStr`.
* The unstable `concat_bytes!` macro should not accept `c"..."` literals.
  * C strings have two equally valid `&[u8]` representations (with or without terminal `NUL`), so allowing them to be used in `concat_bytes!` would be ambiguous.
* Adding a type to represent C strings containing valid UTF-8 is not part of this feature.
  * Support for a hypothetical `&Utf8CStr` may be explored in the future, should such a type be added to Rust.
2023-12-01 13:33:55 +00:00
zetanumbers
f7617c1cd4 Enable link-arg link kind inside of #[link] attribute
- Implement link-arg as an attribute
- Apply suggestions from review
  - Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
- Add unstable book entry
2023-11-30 08:26:13 -08:00
Matthias Krüger
c03f8917ee
Rollup merge of #118157 - Nadrieril:never_pat-feature-gate, r=compiler-errors
Add `never_patterns` feature gate

This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (https://github.com/rust-lang/rust/issues/118155) for details on the experiment.

`@scottmcm` has agreed to be my lang-team liaison for this experiment.
2023-11-29 12:34:47 +01:00
Nadrieril
a3838c8550 Add never_patterns feature gate 2023-11-29 03:58:29 +01:00
Mark Rousskov
1487bd6a17 Cut code size for feature hashing
This locally cuts ~32 kB of .text instructions.
2023-11-26 22:34:17 -05:00
Vadim Petrochenkov
edf6c9c223 Add an experimental feature gate for function delegation
In accordance with the [process](https://github.com/rust-lang/lang-team/blob/master/src/how_to/experiment.md).

Detailed description of the feature can be found in the RFC repo - https://github.com/rust-lang/rfcs/pull/3530.
2023-11-23 17:27:31 +03:00
Matthias Krüger
9e944c8c1a
Rollup merge of #118167 - RalfJung:unadjusted-abi-is-internal, r=petrochenkov
make the 'abi_unadjusted' feature internal

As [suggested](https://github.com/rust-lang/rust/pull/118127#issuecomment-1820736389) by `@bjorn3.`
2023-11-23 07:06:31 +01:00
Ralf Jung
74834a9d74 also make 'core_intrinsics' internal 2023-11-22 20:00:56 +01:00
Urgau
4c2d6de70e Stabilize RFC3324 dyn upcasting coercion
Aka trait_upcasting feature.

And also adjust the `deref_into_dyn_supertrait` lint.
2023-11-22 13:56:36 +01:00
Ralf Jung
32fc54e5fa make the 'abi_unadjusted' feature internal 2023-11-22 07:25:27 +01:00
Ralf Jung
d1583eba66 lib features ending in '_internals?' are internal 2023-11-21 08:00:26 +01:00
Mark Rousskov
db3e2bacb6 Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
Mark Rousskov
efe54e24aa Substitute version placeholders 2023-11-15 19:40:51 -05:00
bors
992943dbae Auto merge of #117537 - GKFX:offset-of-enum-feature, r=cjgillot
Feature gate enums in offset_of

As requested at https://github.com/rust-lang/rust/issues/106655#issuecomment-1790815262, put enums in offset_of behind their own feature gate.

`@rustbot` label F-offset_of
2023-11-05 13:44:59 +00:00
Nicholas Nethercote
5c462a32bd Remove support for compiler plugins.
They've been deprecated for four years.

This commit includes the following changes.
- It eliminates the `rustc_plugin_impl` crate.
- It changes the language used for lints in
  `compiler/rustc_driver_impl/src/lib.rs` and
  `compiler/rustc_lint/src/context.rs`. External lints are now called
  "loaded" lints, rather than "plugins" to avoid confusion with the old
  plugins. This only has a tiny effect on the output of `-W help`.
- E0457 and E0498 are no longer used.
- E0463 is narrowed, now only relating to unfound crates, not plugins.
- The `plugin` feature was moved from "active" to "removed".
- It removes the entire plugins chapter from the unstable book.
- It removes quite a few tests, mostly all of those in
  `tests/ui-fulldeps/plugin/`.

Closes #29597.
2023-11-04 08:50:46 +11:00
George Bateman
7c09b99ebb
Feature gate enums in offset_of 2023-11-03 13:16:47 +00:00
John Millikin
0f41bc21b9 Stabilize C string literals 2023-11-01 09:16:34 +09:00
Nicholas Nethercote
8ff624a9f2 Clean up rustc_*/Cargo.toml.
- Sort dependencies and features sections.
- Add `tidy` markers to the sorted sections so they stay sorted.
- Remove empty `[lib`] sections.
- Remove "See more keys..." comments.

Excluded files:
- rustc_codegen_{cranelift,gcc}, because they're external.
- rustc_lexer, because it has external use.
- stable_mir, because it has external use.
2023-10-30 08:46:02 +11:00
Oli Scherer
638d2d6fc1 Feature gate gen blocks, even in 2024 edition 2023-10-27 13:05:48 +00:00
Matthias Krüger
84f0befac5
Rollup merge of #116943 - heiher:target-features, r=wesleywiser
Add target features for LoongArch
2023-10-24 19:29:55 +02:00
WANG Rui
cb618162b1 compiler: Add target features for LoongArch 2023-10-24 09:36:47 +08:00
Michael Goulet
a387a3cf9d Let's see what those opaque types actually are 2023-10-23 16:18:35 -04:00
Yotam Ofek
a6c2481a36 Fix suggestion for renamed coroutines feature 2023-10-23 09:16:13 +00:00