8000 Rollup of 9 pull requests by Centril · Pull Request #65804 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 9 pull requests #65804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Oct 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ff1860a
Fix the start/end byte positions in the compiler JSON output
Rantanen Oct 3, 2019
0b5ee56
PlaceElem<'tcx> should be Copy
spastorino Oct 11, 2019
2705412
Move as_local impl to from Place to PlaceRef
spastorino Oct 21, 2019
c787fe3
Fix check of `statx`
oxalica Oct 22, 2019
190802c
Pattern match over PlaceRef rather than Place
spastorino Oct 20, 2019
a19aed2
Add intern table for `List<PlaceElem<'tcx>>`
spastorino Oct 11, 2019
d32c286
Intern place projection
spastorino Oct 20, 2019
180fc41
Move Place::elem methods and friends to TyCtxt
spastorino Oct 21, 2019
5f5903d
Add ignore-tidy-filelength on ty/context
spastorino Oct 22, 2019
10f1bc7
Some tweaks
oxalica Oct 22, 2019
18ae175
Prevent unnecessary allocation in PathBuf::set_extension.
m-ou-se Oct 23, 2019
01a1bcb
Fix default "disable-shortcuts" feature value
GuillaumeGomez Oct 23, 2019
d7f6ba8
move panictry! to where it is used.
Centril Oct 11, 2019
0a5b38f
move Attribute::with_desugared_doc to librustdoc
Centril Oct 11, 2019
5ff7349
move report_invalid_macro_expansion_item to item.rs
Centril Oct 25, 2019
e0590ea
RFC 2008: Stabilization
davidtwco Sep 20, 2019
9e3e3a4
with_desugared_doc: correctly refer to `attr` instead of `self`
Centril Oct 25, 2019
959b6e3
Rollup merge of #64639 - davidtwco:rfc-2008-stabilization, r=Centril
Centril Oct 25, 2019
1f93be1
Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad
Centril Oct 25, 2019
8bb039f
Rollup merge of #65315 - spastorino:intern-place-projection, r=oli-obk
Centril Oct 25, 2019
f1d747a
Rollup merge of #65685 - oxalica:statx-eperm, r=alexcrichton
Centril Oct 25, 2019
3e3f21c
Rollup merge of #65731 - fusion-engineering-forks:set-extension, r=dt…
Centril Oct 25, 2019
07b5c2a
Rollup merge of #65740 - GuillaumeGomez:fix-disable-shortcut-feature,…
Centril Oct 25, 2019
0bfe483
Rollup merge of #65787 - Centril:panictry, r=davidtwco
Centril Oct 25, 2019
cbcbba2
Rollup merge of #65789 - Centril:with-desugared-doc, r=davidtwco
Centril Oct 25, 2019
c0bbb4b
Rollup merge of #65790 - Centril:move-report-invalid, r=davidtwco
Centril Oct 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
RFC 2008: Stabilization
This commit stabilizes RFC 2008 (#44109) by removing the feature gate.

Signed-off-by: David Wood <david@davidtw.co>
  • Loading branch information
davidtwco committed Oct 25, 2019
commit e0590ea76f528357add6fd6615a82cf49e44f271
76 changes: 0 additions & 76 deletions src/doc/unstable-book/src/language-features/non-exhaustive.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
#![feature(hexagon_target_feature)]
#![feature(const_int_conversion)]
#![feature(const_transmute)]
#![feature(non_exhaustive)]
#![cfg_attr(bootstrap, feature(non_exhaustive))]
#![feature(structural_match)]
< E864 /td> #![feature(abi_unadjusted)]
#![feature(adx_target_feature)]
Expand Down
2 changes: 1 addition & 1 deletion src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#![feature(extern_types)]
#![feature(in_band_lifetimes)]
#![feature(optin_builtin_traits)]
#![feature(non_exhaustive)]
#![cfg_attr(bootstrap, feature(non_exhaustive))]
#![feature(rustc_attrs)]
#![feature(specialization)]

Expand Down
2 changes: 0 additions & 2 deletions src/librustc/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2105,8 +2105,6 @@ on something other than a struct or enum.
Examples of erroneous code:

```compile_fail,E0701
# #![feature(non_exhaustive)]

#[non_exhaustive]
trait Foo { }
```
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#![feature(overlapping_marker_traits)]
#![feature(extern_types)]
#![feature(nll)]
#![feature(non_exhaustive)]
#![cfg_attr(bootstrap, feature(non_exhaustive))]
#![feature(optin_builtin_traits)]
#![feature(option_expect_none)]
#![feature(range_is_empty)]
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
#![feature(needs_panic_runtime)]
#![feature(never_type)]
#![feature(nll)]
#![feature(non_exhaustive)]
#![cfg_attr(bootstrap, feature(non_exhaustive))]
#![feature(on_unimplemented)]
#![feature(optin_builtin_traits)]
#![feature(panic_info_message)]
Expand Down
4 changes: 3 additions & 1 deletion src/libsyntax/feature_gate/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ declare_features! (
(accepted, bind_by_move_pattern_guards, "1.39.0", Some(15287), None),
/// Allows attributes in formal function parameters.
(accepted, param_attrs, "1.39.0", Some(60406), None),
// Allows macro invocations in `extern {}` blocks.
/// Allows macro invocations in `extern {}` blocks.
(accepted, macros_in_extern, "1.40.0", Some(49476), None),
/// Allows future-proofing enums/structs with the `#[non_exhaustive]` attribute (RFC 2008).
(accepted, non_exhaustive, "1.40.0", Some(44109), None),

// -------------------------------------------------------------------------
// feature-group-end: accepted features
Expand Down
3 changes: 0 additions & 3 deletions src/libsyntax/feature_gate/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,6 @@ declare_features! (
/// Allows `#[doc(include = "some-file")]`.
(active, external_doc, "1.22.0", Some(44732), None),

/// Allows future-proofing enums/structs with the `#[non_exhaustive]` attribute (RFC 2008).
(active, non_exhaustive, "1.22.0", Some(44109), None),

/// Allows using `crate` as visibility modifier, synonymous with `pub(crate)`.
(active, crate_visibility_modifier, "1.23.0", Some(53120), None),

Expand Down
4 changes: 1 addition & 3 deletions src/libsyntax/feature_gate/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
ungated!(path, Normal, template!(NameValueStr: "file")),
ungated!(no_std, CrateLevel, template!(Word)),
ungated!(no_implicit_prelude, Normal, template!(Word)),
ungated!(non_exhaustive, Whitelisted, template!(Word)),

// Runtime
ungated!(windows_subsystem, Whitelisted, template!(NameValueStr: "windows|console")),
Expand Down Expand Up @@ -314,9 +315,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
test_runner, CrateLevel, template!(List: "path"), custom_test_frameworks,
"custom test frameworks are an unstable feature",
),

// RFC #2008
gated!(non_exhaustive, Whitelisted, template!(Word), experimental!(non_exhaustive)),
// RFC #1268
gated!(marker, Normal, template!(Word), marker_trait_attr, experimental!(marker)),
gated!(
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax_pos/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#![feature(const_fn)]
#![feature(crate_visibility_modifier)]
#![feature(nll)]
#![feature(non_exhaustive)]
#![cfg_attr(bootstrap, feature(non_exhaustive))]
#![feature(optin_builtin_traits)]
#![feature(rustc_attrs)]
#![cfg_attr(bootstrap, feature(proc_macro_hygiene))]
Expand Down
10 changes: 0 additions & 10 deletions src/test/ui/feature-gates/feature-gate-non_exhaustive.rs

This file was deleted.

12 changes: 0 additions & 12 deletions src/test/ui/feature-gates/feature-gate-non_exhaustive.stderr

This file was deleted.

1 change: 0 additions & 1 deletion src/test/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![crate_type = "rlib"]
#![feature(non_exhaustive)]

#[non_exhaustive]
pub enum NonExhaustiveEnum {
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/rfc-2008-non-exhaustive/auxiliary/structs.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(non_exhaustive)]

#[non_exhaustive]
pub struct NormalStruct {
pub first_field: u16,
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/rfc-2008-non-exhaustive/auxiliary/variants.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![crate_type = "rlib"]
#![feature(non_exhaustive)]

pub enum NonExhaustiveVariants {
#[non_exhaustive] Unit,
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/rfc-2008-non-exhaustive/enum_same_crate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// run-pass

#![feature(non_exhaustive)]

#[non_exhaustive]
pub enum NonExhaustiveEnum {
Unit,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(non_exhaustive)]

#[non_exhaustive]
#[repr(C)]
pub enum NonExhaustiveEnum {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// check-pass
#![feature(non_exhaustive)]
#![deny(improper_ctypes)]

// This test checks that non-exhaustive types with `#[repr(C)]` are considered proper within
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(non_exhaustive)]

#[non_exhaustive(anything)]
//~^ ERROR malformed `non_exhaustive` attribute
struct Foo;
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: malformed `non_exhaustive` attribute input
--> $DIR/invalid-attribute.rs:3:1
--> $DIR/invalid-attribute.rs:1:1
|
LL | #[non_exhaustive(anything)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[non_exhaustive]`

error[E0701]: attribute can only be applied to a struct or enum
--> $DIR/invalid-attribute.rs:7:1
--> $DIR/invalid-attribute.rs:5:1
|
LL | #[non_exhaustive]
| ^^^^^^^^^^^^^^^^^
Expand All @@ -14,7 +14,7 @@ LL | trait Bar { }
| ------------- not a struct or enum

error[E0701]: attribute can only be applied to a struct or enum
--> $DIR/invalid-attribute.rs:11:1
--> $DIR/invalid-attribute.rs:9:1
|
LL | #[non_exhaustive]
| ^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2008-non-exhaustive/struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ error[E0603]: tuple struct constructor `TupleStruct` is private
LL | let ts_explicit = structs::TupleStruct(640, 480);
| ^^^^^^^^^^^
|
::: $DIR/auxiliary/structs.rs:13:24
::: $DIR/auxiliary/structs.rs:11:24
|
LL | pub struct TupleStruct(pub u16, pub u16);
| ---------------- a constructor is private if any of the fields is private
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/rfc-2008-non-exhaustive/structs_same_crate.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// run-pass

#![allow(unused_variables)]
#![feature(non_exhaustive)]

#[non_exhaustive]
pub struct NormalStruct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![crate_type = "rlib"]
#![feature(never_type)]
#![feature(non_exhaustive)]

#[non_exhaustive]
pub enum UninhabitedEnum {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(never_type)]
#![feature(non_exhaustive)]

#[non_exhaustive]
pub enum UninhabitedEnum {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/coercions_same_crate.rs:31:5
--> $DIR/coercions_same_crate.rs:30:5
|
LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A {
| - expected `A` because of return type
Expand All @@ -10,7 +10,7 @@ LL | x
found type `UninhabitedEnum`

error[E0308]: mismatched types
--> $DIR/coercions_same_crate.rs:35:5
--> $DIR/coercions_same_crate.rs:34:5
|
LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A {
| - expected `A` because of return type
Expand All @@ -21,7 +21,7 @@ LL | x
found type `UninhabitedTupleStruct`

error[E0308]: mismatched types
--> $DIR/coercions_same_crate.rs:39:5
--> $DIR/coercions_same_crate.rs:38:5
|
LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A {
| - expected `A` because of return type
Expand All @@ -32,7 +32,7 @@ LL | x
found type `UninhabitedStruct`

error[E0308]: mismatched types
--> $DIR/coercions_same_crate.rs:43:5
--> $DIR/coercions_same_crate.rs:42:5
|
LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A {
| - expected `A` because of return type
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(never_type)]
#![feature(non_exhaustive)]

#[non_exhaustive]
pub enum UninhabitedEnum {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedEnum` of type `IndirectUninhabitedEnum` is not handled
--> $DIR/indirect_match_same_crate.rs:35:11
--> $DIR/indirect_match_same_crate.rs:34:11
|
LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum);
| ----------------------------------------------------
Expand All @@ -13,7 +13,7 @@ LL | match x {}
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedStruct` of type `IndirectUninhabitedStruct` is not handled
--> $DIR/indirect_match_same_crate.rs:39:11
--> $DIR/indirect_match_same_crate.rs:38:11
|
LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct);
| --------------------------------------------------------
Expand All @@ -27,7 +27,7 @@ LL | match x {}
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedTupleStruct` of type `IndirectUninhabitedTupleStruct` is not handled
--> $DIR/indirect_match_same_crate.rs:43:11
--> $DIR/indirect_match_same_crate.rs:42:11
|
LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct);
| ------------------------------------------------------------------
Expand All @@ -41,7 +41,7 @@ LL | match x {}
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: pattern `IndirectUninhabitedVariants` of type `IndirectUninhabitedVariants` is not handled
--> $DIR/indirect_match_same_crate.rs:49:11
--> $DIR/indirect_match_same_crate.rs:48:11
|
LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants);
| ------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#![deny(unreachable_patterns)]
#![feature(exhaustive_patterns)]
#![feature(never_type)]
#![feature(non_exhaustive)]

#[non_exhaustive]
pub enum UninhabitedEnum {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// aux-build:uninhabited.rs
#![deny(unreachable_patterns)]
#![feature(never_type)]
#![feature(non_exhaustive)]

extern crate uninhabited;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: unreachable pattern
--> $DIR/issue-65157-repeated-match-arm.rs:16:9
--> $DIR/issue-65157-repeated-match-arm.rs:15:9
|
LL | PartiallyInhabitedVariants::Struct { .. } => {},
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![feature(never_type)]
#![feature(non_exhaustive)]

#[non_exhaustive]
pub enum UninhabitedEnum {
Expand Down
Loading
0