Skip to content

Commit 7205474

Browse files
committed
Make GATs no longer incomplete
1 parent 857cb4d commit 7205474

File tree

128 files changed

+181
-548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+181
-548
lines changed

compiler/rustc_feature/src/active.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,6 @@ declare_features! (
666666
pub const INCOMPLETE_FEATURES: &[Symbol] = &[
667667
sym::if_let_guard,
668668
sym::impl_trait_in_bindings,
669-
sym::generic_associated_types,
670669
sym::const_generics,
671670
sym::let_chains,
672671
sym::raw_dylib,

compiler/rustc_lint/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ declare_lint! {
22682268
/// ### Example
22692269
///
22702270
/// ```rust
2271-
/// #![feature(generic_associated_types)]
2271+
/// #![feature(const_generics)]
22722272
/// ```
22732273
///
22742274
/// {{produces}}

src/test/ui/generic-associated-types/collections-project-default.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![allow(incomplete_features)]
21
#![feature(generic_associated_types)]
32
#![feature(associated_type_defaults)]
43

src/test/ui/generic-associated-types/collections-project-default.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/collections-project-default.rs:60:5
2+
--> $DIR/collections-project-default.rs:59:5
33
|
44
LL | fn floatify_sibling<C>(ints: &C) -> <C as Collection<i32>>::Sibling<f32>
55
| ------------------------------------ expected `<C as Collection<i32>>::Sibling<f32>` because of return type

src/test/ui/generic-associated-types/collections.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![allow(incomplete_features)]
21
#![feature(generic_associated_types)]
32
#![feature(associated_type_defaults)]
43

src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
#![feature(generic_associated_types)]
3-
#![allow(incomplete_features)]
43

54
// This test unsures that with_opt_const_param returns the
65
// def_id of the N param in the Foo::Assoc GAT.

src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
#![feature(generic_associated_types)]
3-
#![allow(incomplete_features)]
43

54
// This test unsures that with_opt_const_param returns the
65
// def_id of the N param in the Foo::Assoc GAT.

src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
#![feature(generic_associated_types)]
3-
#![allow(incomplete_features)]
43

54
// This test unsures that with_opt_const_param returns the
65
// def_id of the N param in the Bar::Assoc GAT.

src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Test that correct syntax is used in suggestion to constrain associated type
22

33
#![feature(generic_associated_types)]
4-
//~^ WARNING the feature `generic_associated_types` is incomplete
54

65
trait X {
76
type Y<T>;
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
2-
--> $DIR/constraint-assoc-type-suggestion.rs:3:12
3-
|
4-
LL | #![feature(generic_associated_types)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= note: `#[warn(incomplete_features)]` on by default
8-
= note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
9-
101
error[E0308]: mismatched types
11-
--> $DIR/constraint-assoc-type-suggestion.rs:13:23
2+
--> $DIR/constraint-assoc-type-suggestion.rs:12:23
123
|
134
LL | let b: Vec<i32> = a;
145
| -------- ^ expected struct `Vec`, found associated type
@@ -22,6 +13,6 @@ help: consider constraining the associated type `<T as X>::Y<i32>` to `Vec<i32>`
2213
LL | fn f<T: X<Y<i32> = Vec<i32>>>(a: T::Y<i32>) {
2314
| ^^^^^^^^^^^^^^^^^^^
2415

25-
error: aborting due to previous error; 1 warning emitted
16+
error: aborting due to previous error
2617

2718
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)