Delay a bug and mark precise_capturing as not incomplete

This commit is contained in:
Michael Goulet 2024-06-16 22:07:23 -04:00
parent 579bc3c0e8
commit 227374714f
36 changed files with 53 additions and 230 deletions

View file

@ -1385,7 +1385,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
None None
} }
// Ignore `use` syntax since that is not valid in objects. // Ignore `use` syntax since that is not valid in objects.
GenericBound::Use(..) => None, GenericBound::Use(_, span) => {
this.dcx()
.span_delayed_bug(*span, "use<> not allowed in dyn types");
None
}
})); }));
let lifetime_bound = let lifetime_bound =
lifetime_bound.unwrap_or_else(|| this.elided_dyn_bound(t.span)); lifetime_bound.unwrap_or_else(|| this.elided_dyn_bound(t.span));

View file

@ -568,7 +568,7 @@ declare_features! (
/// Allows postfix match `expr.match { ... }` /// Allows postfix match `expr.match { ... }`
(unstable, postfix_match, "1.79.0", Some(121618)), (unstable, postfix_match, "1.79.0", Some(121618)),
/// Allows `use<'a, 'b, A, B>` in `impl Trait + use<...>` for precise capture of generic args. /// Allows `use<'a, 'b, A, B>` in `impl Trait + use<...>` for precise capture of generic args.
(incomplete, precise_capturing, "1.79.0", Some(123432)), (unstable, precise_capturing, "1.79.0", Some(123432)),
/// Allows macro attributes on expressions, statements and non-inline modules. /// Allows macro attributes on expressions, statements and non-inline modules.
(unstable, proc_macro_hygiene, "1.30.0", Some(54727)), (unstable, proc_macro_hygiene, "1.30.0", Some(54727)),
/// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions. /// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions.

View file

@ -1,5 +1,5 @@
error[E0282]: type annotations needed error[E0282]: type annotations needed
--> $DIR/call_method_ambiguous.rs:29:13 --> $DIR/call_method_ambiguous.rs:28:13
| |
LL | let mut iter = foo(n - 1, m); LL | let mut iter = foo(n - 1, m);
| ^^^^^^^^ | ^^^^^^^^

View file

@ -3,7 +3,6 @@
//@[current] run-pass //@[current] run-pass
#![feature(precise_capturing)] #![feature(precise_capturing)]
#![allow(incomplete_features)]
trait Get { trait Get {
fn get(&mut self) -> u32; fn get(&mut self) -> u32;
@ -24,7 +23,7 @@ where
} }
} }
fn foo(n: usize, m: &mut ()) -> impl use<'_> Get { fn foo(n: usize, m: &mut ()) -> impl Get + use<'_> {
if n > 0 { if n > 0 {
let mut iter = foo(n - 1, m); let mut iter = foo(n - 1, m);
//[next]~^ type annotations needed //[next]~^ type annotations needed

View file

@ -1,5 +1,4 @@
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn hello(_: impl Sized + use<>) {} fn hello(_: impl Sized + use<>) {}
//~^ ERROR `use<...>` precise capturing syntax not allowed in argument-position `impl Trait` //~^ ERROR `use<...>` precise capturing syntax not allowed in argument-position `impl Trait`

View file

@ -1,17 +1,8 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/apit.rs:1:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: `use<...>` precise capturing syntax not allowed in argument-position `impl Trait` error: `use<...>` precise capturing syntax not allowed in argument-position `impl Trait`
--> $DIR/apit.rs:4:26 --> $DIR/apit.rs:3:26
| |
LL | fn hello(_: impl Sized + use<>) {} LL | fn hello(_: impl Sized + use<>) {}
| ^^^^^ | ^^^^^
error: aborting due to 1 previous error; 1 warning emitted error: aborting due to 1 previous error

View file

@ -1,5 +1,4 @@
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn no_elided_lt() -> impl Sized + use<'_> {} fn no_elided_lt() -> impl Sized + use<'_> {}
//~^ ERROR missing lifetime specifier //~^ ERROR missing lifetime specifier

View file

@ -1,5 +1,5 @@
error[E0106]: missing lifetime specifier error[E0106]: missing lifetime specifier
--> $DIR/bad-lifetimes.rs:4:39 --> $DIR/bad-lifetimes.rs:3:39
| |
LL | fn no_elided_lt() -> impl Sized + use<'_> {} LL | fn no_elided_lt() -> impl Sized + use<'_> {}
| ^^ expected named lifetime parameter | ^^ expected named lifetime parameter
@ -11,35 +11,26 @@ LL | fn no_elided_lt() -> impl Sized + use<'static> {}
| ~~~~~~~ | ~~~~~~~
error[E0261]: use of undeclared lifetime name `'missing` error[E0261]: use of undeclared lifetime name `'missing`
--> $DIR/bad-lifetimes.rs:11:37 --> $DIR/bad-lifetimes.rs:10:37
| |
LL | fn missing_lt() -> impl Sized + use<'missing> {} LL | fn missing_lt() -> impl Sized + use<'missing> {}
| - ^^^^^^^^ undeclared lifetime | - ^^^^^^^^ undeclared lifetime
| | | |
| help: consider introducing lifetime `'missing` here: `<'missing>` | help: consider introducing lifetime `'missing` here: `<'missing>`
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/bad-lifetimes.rs:1:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: expected lifetime parameter in `use<...>` precise captures list, found `'_` error: expected lifetime parameter in `use<...>` precise captures list, found `'_`
--> $DIR/bad-lifetimes.rs:4:39 --> $DIR/bad-lifetimes.rs:3:39
| |
LL | fn no_elided_lt() -> impl Sized + use<'_> {} LL | fn no_elided_lt() -> impl Sized + use<'_> {}
| ^^ | ^^
error: expected lifetime parameter in `use<...>` precise captures list, found `'static` error: expected lifetime parameter in `use<...>` precise captures list, found `'static`
--> $DIR/bad-lifetimes.rs:8:36 --> $DIR/bad-lifetimes.rs:7:36
| |
LL | fn static_lt() -> impl Sized + use<'static> {} LL | fn static_lt() -> impl Sized + use<'static> {}
| ^^^^^^^ | ^^^^^^^
error: aborting due to 4 previous errors; 1 warning emitted error: aborting due to 4 previous errors
Some errors have detailed explanations: E0106, E0261. Some errors have detailed explanations: E0106, E0261.
For more information about an error, try `rustc --explain E0106`. For more information about an error, try `rustc --explain E0106`.

View file

@ -1,5 +1,4 @@
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn missing() -> impl Sized + use<T> {} fn missing() -> impl Sized + use<T> {}
//~^ ERROR cannot find type `T` in this scope //~^ ERROR cannot find type `T` in this scope

View file

@ -1,5 +1,5 @@
error[E0412]: cannot find type `T` in this scope error[E0412]: cannot find type `T` in this scope
--> $DIR/bad-params.rs:4:34 --> $DIR/bad-params.rs:3:34
| |
LL | fn missing() -> impl Sized + use<T> {} LL | fn missing() -> impl Sized + use<T> {}
| ^ not found in this scope | ^ not found in this scope
@ -10,24 +10,15 @@ LL | fn missing<T>() -> impl Sized + use<T> {}
| +++ | +++
error[E0411]: cannot find type `Self` in this scope error[E0411]: cannot find type `Self` in this scope
--> $DIR/bad-params.rs:7:39 --> $DIR/bad-params.rs:6:39
| |
LL | fn missing_self() -> impl Sized + use<Self> {} LL | fn missing_self() -> impl Sized + use<Self> {}
| ------------ ^^^^ `Self` is only available in impls, traits, and type definitions | ------------ ^^^^ `Self` is only available in impls, traits, and type definitions
| | | |
| `Self` not allowed in a function | `Self` not allowed in a function
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/bad-params.rs:1:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: `Self` can't be captured in `use<...>` precise captures list, since it is an alias error: `Self` can't be captured in `use<...>` precise captures list, since it is an alias
--> $DIR/bad-params.rs:12:48 --> $DIR/bad-params.rs:11:48
| |
LL | impl MyType { LL | impl MyType {
| ----------- `Self` is not a generic argument, but an alias to the type of the implementation | ----------- `Self` is not a generic argument, but an alias to the type of the implementation
@ -35,12 +26,12 @@ LL | fn self_is_not_param() -> impl Sized + use<Self> {}
| ^^^^ | ^^^^
error: expected type or const parameter in `use<...>` precise captures list, found function error: expected type or const parameter in `use<...>` precise captures list, found function
--> $DIR/bad-params.rs:16:32 --> $DIR/bad-params.rs:15:32
| |
LL | fn hello() -> impl Sized + use<hello> {} LL | fn hello() -> impl Sized + use<hello> {}
| ^^^^^ | ^^^^^
error: aborting due to 4 previous errors; 1 warning emitted error: aborting due to 4 previous errors
Some errors have detailed explanations: E0411, E0412. Some errors have detailed explanations: E0411, E0412.
For more information about an error, try `rustc --explain E0411`. For more information about an error, try `rustc --explain E0411`.

View file

@ -1,5 +1,4 @@
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
trait Tr { trait Tr {
type Assoc; type Assoc;

View file

@ -1,14 +1,5 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/capture-parent-arg.rs:1:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list
--> $DIR/capture-parent-arg.rs:28:31 --> $DIR/capture-parent-arg.rs:27:31
| |
LL | impl<'a> W<'a> { LL | impl<'a> W<'a> {
| -- this lifetime parameter is captured | -- this lifetime parameter is captured
@ -16,12 +7,12 @@ LL | fn bad1() -> impl Into<<W<'a> as Tr>::Assoc> + use<> {}
| -------------^^------------------------ lifetime captured due to being mentioned in the bounds of the `impl Trait` | -------------^^------------------------ lifetime captured due to being mentioned in the bounds of the `impl Trait`
error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list
--> $DIR/capture-parent-arg.rs:34:18 --> $DIR/capture-parent-arg.rs:33:18
| |
LL | impl<'a> W<'a> { LL | impl<'a> W<'a> {
| -- this lifetime parameter is captured | -- this lifetime parameter is captured
LL | fn bad2() -> impl Into<<Self as Tr>::Assoc> + use<> {} LL | fn bad2() -> impl Into<<Self as Tr>::Assoc> + use<> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime captured due to being mentioned in the bounds of the `impl Trait` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime captured due to being mentioned in the bounds of the `impl Trait`
error: aborting due to 2 previous errors; 1 warning emitted error: aborting due to 2 previous errors

View file

@ -1,11 +0,0 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/duplicated-use.rs:4:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted

View file

@ -1,17 +1,8 @@
error: duplicate `use<...>` precise capturing syntax error: duplicate `use<...>` precise capturing syntax
--> $DIR/duplicated-use.rs:8:32 --> $DIR/duplicated-use.rs:7:32
| |
LL | fn hello<'a>() -> impl Sized + use<'a> + use<'a> {} LL | fn hello<'a>() -> impl Sized + use<'a> + use<'a> {}
| ^^^^^^^ ------- second `use<...>` here | ^^^^^^^ ------- second `use<...>` here
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes error: aborting due to 1 previous error
--> $DIR/duplicated-use.rs:4:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: aborting due to 1 previous error; 1 warning emitted

View file

@ -2,7 +2,6 @@
//@[pre_expansion] check-pass //@[pre_expansion] check-pass
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
#[cfg(real)] #[cfg(real)]
fn hello<'a>() -> impl Sized + use<'a> + use<'a> {} fn hello<'a>() -> impl Sized + use<'a> + use<'a> {}

View file

@ -1,7 +1,6 @@
//@ check-pass //@ check-pass
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn elided(x: &()) -> impl Sized + use<'_> { x } fn elided(x: &()) -> impl Sized + use<'_> { x }

View file

@ -1,11 +0,0 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/elided.rs:3:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted

View file

@ -1,5 +1,4 @@
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn constant<const C: usize>() -> impl Sized + use<> {} fn constant<const C: usize>() -> impl Sized + use<> {}
//~^ ERROR `impl Trait` must mention all const parameters in scope //~^ ERROR `impl Trait` must mention all const parameters in scope

View file

@ -1,14 +1,5 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/forgot-to-capture-const.rs:1:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: `impl Trait` must mention all const parameters in scope in `use<...>` error: `impl Trait` must mention all const parameters in scope in `use<...>`
--> $DIR/forgot-to-capture-const.rs:4:34 --> $DIR/forgot-to-capture-const.rs:3:34
| |
LL | fn constant<const C: usize>() -> impl Sized + use<> {} LL | fn constant<const C: usize>() -> impl Sized + use<> {}
| -------------- ^^^^^^^^^^^^^^^^^^ | -------------- ^^^^^^^^^^^^^^^^^^
@ -17,5 +8,5 @@ LL | fn constant<const C: usize>() -> impl Sized + use<> {}
| |
= note: currently, all const parameters are required to be mentioned in the precise captures list = note: currently, all const parameters are required to be mentioned in the precise captures list
error: aborting due to 1 previous error; 1 warning emitted error: aborting due to 1 previous error

View file

@ -1,5 +1,4 @@
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn lifetime_in_bounds<'a>(x: &'a ()) -> impl Into<&'a ()> + use<> { x } fn lifetime_in_bounds<'a>(x: &'a ()) -> impl Into<&'a ()> + use<> { x }
//~^ ERROR `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list //~^ ERROR `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list

View file

@ -1,14 +1,5 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/forgot-to-capture-lifetime.rs:1:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list
--> $DIR/forgot-to-capture-lifetime.rs:4:52 --> $DIR/forgot-to-capture-lifetime.rs:3:52
| |
LL | fn lifetime_in_bounds<'a>(x: &'a ()) -> impl Into<&'a ()> + use<> { x } LL | fn lifetime_in_bounds<'a>(x: &'a ()) -> impl Into<&'a ()> + use<> { x }
| -- -----------^^------------ | -- -----------^^------------
@ -17,7 +8,7 @@ LL | fn lifetime_in_bounds<'a>(x: &'a ()) -> impl Into<&'a ()> + use<> { x }
| this lifetime parameter is captured | this lifetime parameter is captured
error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
--> $DIR/forgot-to-capture-lifetime.rs:7:62 --> $DIR/forgot-to-capture-lifetime.rs:6:62
| |
LL | fn lifetime_in_hidden<'a>(x: &'a ()) -> impl Sized + use<> { x } LL | fn lifetime_in_hidden<'a>(x: &'a ()) -> impl Sized + use<> { x }
| -- ------------------ ^ | -- ------------------ ^
@ -30,6 +21,6 @@ help: to declare that `impl Sized` captures `'a`, you can add an explicit `'a` l
LL | fn lifetime_in_hidden<'a>(x: &'a ()) -> impl Sized + use<> + 'a { x } LL | fn lifetime_in_hidden<'a>(x: &'a ()) -> impl Sized + use<> + 'a { x }
| ++++ | ++++
error: aborting due to 2 previous errors; 1 warning emitted error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0700`. For more information about this error, try `rustc --explain E0700`.

View file

@ -1,5 +1,4 @@
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn type_param<T>() -> impl Sized + use<> {} fn type_param<T>() -> impl Sized + use<> {}
//~^ ERROR `impl Trait` must mention all type parameters in scope //~^ ERROR `impl Trait` must mention all type parameters in scope

View file

@ -1,14 +1,5 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/forgot-to-capture-type.rs:1:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: `impl Trait` must mention all type parameters in scope in `use<...>` error: `impl Trait` must mention all type parameters in scope in `use<...>`
--> $DIR/forgot-to-capture-type.rs:4:23 --> $DIR/forgot-to-capture-type.rs:3:23
| |
LL | fn type_param<T>() -> impl Sized + use<> {} LL | fn type_param<T>() -> impl Sized + use<> {}
| - ^^^^^^^^^^^^^^^^^^ | - ^^^^^^^^^^^^^^^^^^
@ -18,7 +9,7 @@ LL | fn type_param<T>() -> impl Sized + use<> {}
= note: currently, all type parameters are required to be mentioned in the precise captures list = note: currently, all type parameters are required to be mentioned in the precise captures list
error: `impl Trait` must mention the `Self` type of the trait in `use<...>` error: `impl Trait` must mention the `Self` type of the trait in `use<...>`
--> $DIR/forgot-to-capture-type.rs:8:17 --> $DIR/forgot-to-capture-type.rs:7:17
| |
LL | trait Foo { LL | trait Foo {
| --------- `Self` type parameter is implicitly captured by this `impl Trait` | --------- `Self` type parameter is implicitly captured by this `impl Trait`
@ -27,5 +18,5 @@ LL | fn bar() -> impl Sized + use<>;
| |
= note: currently, all type parameters are required to be mentioned in the precise captures list = note: currently, all type parameters are required to be mentioned in the precise captures list
error: aborting due to 2 previous errors; 1 warning emitted error: aborting due to 2 previous errors

View file

@ -3,7 +3,6 @@
// Show how precise captures allow us to skip capturing a higher-ranked lifetime // Show how precise captures allow us to skip capturing a higher-ranked lifetime
#![feature(lifetime_capture_rules_2024, precise_capturing)] #![feature(lifetime_capture_rules_2024, precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
trait Trait<'a> { trait Trait<'a> {
type Item; type Item;

View file

@ -1,11 +0,0 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/higher-ranked.rs:5:41
|
LL | #![feature(lifetime_capture_rules_2024, precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted

View file

@ -1,11 +0,0 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/illegal-positions.rs:5:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted

View file

@ -1,66 +1,57 @@
error: `use<...>` precise capturing syntax not allowed in supertrait bounds error: `use<...>` precise capturing syntax not allowed in supertrait bounds
--> $DIR/illegal-positions.rs:9:12 --> $DIR/illegal-positions.rs:8:12
| |
LL | trait Foo: use<> { LL | trait Foo: use<> {
| ^^^^^ | ^^^^^
error: `use<...>` precise capturing syntax not allowed in bounds error: `use<...>` precise capturing syntax not allowed in bounds
--> $DIR/illegal-positions.rs:11:33 --> $DIR/illegal-positions.rs:10:33
| |
LL | type Assoc: use<> where (): use<>; LL | type Assoc: use<> where (): use<>;
| ^^^^^ | ^^^^^
error: `use<...>` precise capturing syntax not allowed in bounds error: `use<...>` precise capturing syntax not allowed in bounds
--> $DIR/illegal-positions.rs:11:17 --> $DIR/illegal-positions.rs:10:17
| |
LL | type Assoc: use<> where (): use<>; LL | type Assoc: use<> where (): use<>;
| ^^^^^ | ^^^^^
error: `use<...>` precise capturing syntax not allowed in bounds error: `use<...>` precise capturing syntax not allowed in bounds
--> $DIR/illegal-positions.rs:17:11 --> $DIR/illegal-positions.rs:16:11
| |
LL | fn fun<T: use<>>(_: impl use<>) where (): use<> {} LL | fn fun<T: use<>>(_: impl use<>) where (): use<> {}
| ^^^^^ | ^^^^^
error: `use<...>` precise capturing syntax not allowed in bounds error: `use<...>` precise capturing syntax not allowed in bounds
--> $DIR/illegal-positions.rs:17:43 --> $DIR/illegal-positions.rs:16:43
| |
LL | fn fun<T: use<>>(_: impl use<>) where (): use<> {} LL | fn fun<T: use<>>(_: impl use<>) where (): use<> {}
| ^^^^^ | ^^^^^
error: at least one trait must be specified error: at least one trait must be specified
--> $DIR/illegal-positions.rs:17:21 --> $DIR/illegal-positions.rs:16:21
| |
LL | fn fun<T: use<>>(_: impl use<>) where (): use<> {} LL | fn fun<T: use<>>(_: impl use<>) where (): use<> {}
| ^^^^^^^^^^ | ^^^^^^^^^^
error: `use<...>` precise capturing syntax not allowed in `dyn` trait object bounds error: `use<...>` precise capturing syntax not allowed in `dyn` trait object bounds
--> $DIR/illegal-positions.rs:24:25 --> $DIR/illegal-positions.rs:23:25
| |
LL | fn dynamic() -> Box<dyn use<>> {} LL | fn dynamic() -> Box<dyn use<>> {}
| ^^^^^ | ^^^^^
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/illegal-positions.rs:5:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: `use<...>` precise capturing syntax not allowed in argument-position `impl Trait` error: `use<...>` precise capturing syntax not allowed in argument-position `impl Trait`
--> $DIR/illegal-positions.rs:17:26 --> $DIR/illegal-positions.rs:16:26
| |
LL | fn fun<T: use<>>(_: impl use<>) where (): use<> {} LL | fn fun<T: use<>>(_: impl use<>) where (): use<> {}
| ^^^^^ | ^^^^^
error[E0224]: at least one trait is required for an object type error[E0224]: at least one trait is required for an object type
--> $DIR/illegal-positions.rs:24:21 --> $DIR/illegal-positions.rs:23:21
| |
LL | fn dynamic() -> Box<dyn use<>> {} LL | fn dynamic() -> Box<dyn use<>> {}
| ^^^^^^^^^ | ^^^^^^^^^
error: aborting due to 9 previous errors; 1 warning emitted error: aborting due to 9 previous errors
For more information about this error, try `rustc --explain E0224`. For more information about this error, try `rustc --explain E0224`.

View file

@ -3,7 +3,6 @@
//@ edition: 2021 //@ edition: 2021
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
#[cfg(real)] #[cfg(real)]
trait Foo: use<> { trait Foo: use<> {

View file

@ -1,5 +1,4 @@
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn lt<'a>() -> impl Sized + use<'a, 'a> {} fn lt<'a>() -> impl Sized + use<'a, 'a> {}
//~^ ERROR cannot capture parameter `'a` twice //~^ ERROR cannot capture parameter `'a` twice

View file

@ -1,37 +1,28 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/ordering.rs:1:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: cannot capture parameter `'a` twice error: cannot capture parameter `'a` twice
--> $DIR/ordering.rs:4:33 --> $DIR/ordering.rs:3:33
| |
LL | fn lt<'a>() -> impl Sized + use<'a, 'a> {} LL | fn lt<'a>() -> impl Sized + use<'a, 'a> {}
| ^^ -- parameter captured again here | ^^ -- parameter captured again here
error: cannot capture parameter `T` twice error: cannot capture parameter `T` twice
--> $DIR/ordering.rs:7:32 --> $DIR/ordering.rs:6:32
| |
LL | fn ty<T>() -> impl Sized + use<T, T> {} LL | fn ty<T>() -> impl Sized + use<T, T> {}
| ^ - parameter captured again here | ^ - parameter captured again here
error: cannot capture parameter `N` twice error: cannot capture parameter `N` twice
--> $DIR/ordering.rs:10:45 --> $DIR/ordering.rs:9:45
| |
LL | fn ct<const N: usize>() -> impl Sized + use<N, N> {} LL | fn ct<const N: usize>() -> impl Sized + use<N, N> {}
| ^ - parameter captured again here | ^ - parameter captured again here
error: lifetime parameter `'a` must be listed before non-lifetime parameters error: lifetime parameter `'a` must be listed before non-lifetime parameters
--> $DIR/ordering.rs:13:45 --> $DIR/ordering.rs:12:45
| |
LL | fn ordering<'a, T>() -> impl Sized + use<T, 'a> {} LL | fn ordering<'a, T>() -> impl Sized + use<T, 'a> {}
| - ^^ | - ^^
| | | |
| move the lifetime before this parameter | move the lifetime before this parameter
error: aborting due to 4 previous errors; 1 warning emitted error: aborting due to 4 previous errors

View file

@ -3,7 +3,6 @@
// Show that precise captures allow us to skip a lifetime param for outlives // Show that precise captures allow us to skip a lifetime param for outlives
#![feature(lifetime_capture_rules_2024, precise_capturing)] #![feature(lifetime_capture_rules_2024, precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn hello<'a: 'a, 'b: 'b>() -> impl Sized + use<'a> { } fn hello<'a: 'a, 'b: 'b>() -> impl Sized + use<'a> { }

View file

@ -1,11 +0,0 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/outlives.rs:5:41
|
LL | #![feature(lifetime_capture_rules_2024, precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted

View file

@ -2,7 +2,6 @@
//@ check-pass //@ check-pass
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
fn hello<'a>() -> impl Sized + use<'a> {} fn hello<'a>() -> impl Sized + use<'a> {}
//~^ WARN all possible in-scope parameters are already captured //~^ WARN all possible in-scope parameters are already captured

View file

@ -1,14 +1,5 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/redundant.rs:4:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
--> $DIR/redundant.rs:7:19 --> $DIR/redundant.rs:6:19
| |
LL | fn hello<'a>() -> impl Sized + use<'a> {} LL | fn hello<'a>() -> impl Sized + use<'a> {}
| ^^^^^^^^^^^^^------- | ^^^^^^^^^^^^^-------
@ -18,7 +9,7 @@ LL | fn hello<'a>() -> impl Sized + use<'a> {}
= note: `#[warn(impl_trait_redundant_captures)]` on by default = note: `#[warn(impl_trait_redundant_captures)]` on by default
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
--> $DIR/redundant.rs:12:27 --> $DIR/redundant.rs:11:27
| |
LL | fn inherent(&self) -> impl Sized + use<'_> {} LL | fn inherent(&self) -> impl Sized + use<'_> {}
| ^^^^^^^^^^^^^------- | ^^^^^^^^^^^^^-------
@ -26,7 +17,7 @@ LL | fn inherent(&self) -> impl Sized + use<'_> {}
| help: remove the `use<...>` syntax | help: remove the `use<...>` syntax
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
--> $DIR/redundant.rs:17:22 --> $DIR/redundant.rs:16:22
| |
LL | fn in_trait() -> impl Sized + use<'a, Self>; LL | fn in_trait() -> impl Sized + use<'a, Self>;
| ^^^^^^^^^^^^^------------- | ^^^^^^^^^^^^^-------------
@ -34,12 +25,12 @@ LL | fn in_trait() -> impl Sized + use<'a, Self>;
| help: remove the `use<...>` syntax | help: remove the `use<...>` syntax
warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant warning: all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
--> $DIR/redundant.rs:21:22 --> $DIR/redundant.rs:20:22
| |
LL | fn in_trait() -> impl Sized + use<'a> {} LL | fn in_trait() -> impl Sized + use<'a> {}
| ^^^^^^^^^^^^^------- | ^^^^^^^^^^^^^-------
| | | |
| help: remove the `use<...>` syntax | help: remove the `use<...>` syntax
warning: 5 warnings emitted warning: 4 warnings emitted

View file

@ -1,7 +1,6 @@
//@ check-pass //@ check-pass
#![feature(precise_capturing)] #![feature(precise_capturing)]
//~^ WARN the feature `precise_capturing` is incomplete
trait Foo { trait Foo {
fn bar<'a>() -> impl Sized + use<Self>; fn bar<'a>() -> impl Sized + use<Self>;

View file

@ -1,11 +0,0 @@
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/self-capture.rs:3:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted