Auto merge of #121859 - matthiaskrgr:rollup-i724wpm, r=matthiaskrgr
Rollup of 12 pull requests Successful merges: - #120646 (Fix incorrect suggestion for uninitialized binding in pattern) - #121416 (Improve error messages for generics with default parameters) - #121475 (Add tidy check for .stderr/.stdout files for non-existent test revisions) - #121580 (make unused_imports less assertive in test modules) - #121736 (Remove `Mutex::unlock` Function) - #121784 (Make the success arms of `if lhs || rhs` meet up in a separate block) - #121818 (CFI: Remove unused `typeid_for_fnsig`) - #121819 (Handle stashing of delayed bugs) - #121828 (Remove unused fluent messages) - #121831 (Fix typo in comment) - #121850 (Make `ZeroablePrimitive` trait unsafe.) - #121853 (normalizes-to: handle negative impls) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
2dceda4f32
56 changed files with 510 additions and 833 deletions
|
@ -19,7 +19,7 @@ fn test_complex() -> () {
|
|||
bb0: {
|
||||
StorageLive(_1);
|
||||
StorageLive(_2);
|
||||
_2 = E::f() -> [return: bb1, unwind: bb37];
|
||||
_2 = E::f() -> [return: bb1, unwind: bb38];
|
||||
}
|
||||
|
||||
bb1: {
|
||||
|
@ -34,7 +34,7 @@ fn test_complex() -> () {
|
|||
}
|
||||
|
||||
bb3: {
|
||||
goto -> bb22;
|
||||
goto -> bb23;
|
||||
}
|
||||
|
||||
bb4: {
|
||||
|
@ -51,7 +51,7 @@ fn test_complex() -> () {
|
|||
|
||||
bb7: {
|
||||
StorageLive(_4);
|
||||
_4 = always_true() -> [return: bb8, unwind: bb37];
|
||||
_4 = always_true() -> [return: bb8, unwind: bb38];
|
||||
}
|
||||
|
||||
bb8: {
|
||||
|
@ -73,7 +73,7 @@ fn test_complex() -> () {
|
|||
}
|
||||
|
||||
bb11: {
|
||||
drop(_7) -> [return: bb13, unwind: bb37];
|
||||
drop(_7) -> [return: bb13, unwind: bb38];
|
||||
}
|
||||
|
||||
bb12: {
|
||||
|
@ -83,11 +83,11 @@ fn test_complex() -> () {
|
|||
bb13: {
|
||||
StorageDead(_7);
|
||||
StorageDead(_6);
|
||||
goto -> bb19;
|
||||
goto -> bb20;
|
||||
}
|
||||
|
||||
bb14: {
|
||||
drop(_7) -> [return: bb15, unwind: bb37];
|
||||
drop(_7) -> [return: bb15, unwind: bb38];
|
||||
}
|
||||
|
||||
bb15: {
|
||||
|
@ -107,106 +107,110 @@ fn test_complex() -> () {
|
|||
}
|
||||
|
||||
bb17: {
|
||||
drop(_10) -> [return: bb19, unwind: bb37];
|
||||
drop(_10) -> [return: bb19, unwind: bb38];
|
||||
}
|
||||
|
||||
bb18: {
|
||||
goto -> bb20;
|
||||
goto -> bb21;
|
||||
}
|
||||
|
||||
bb19: {
|
||||
StorageDead(_10);
|
||||
StorageDead(_9);
|
||||
_1 = const ();
|
||||
goto -> bb23;
|
||||
goto -> bb20;
|
||||
}
|
||||
|
||||
bb20: {
|
||||
drop(_10) -> [return: bb21, unwind: bb37];
|
||||
_1 = const ();
|
||||
goto -> bb24;
|
||||
}
|
||||
|
||||
bb21: {
|
||||
StorageDead(_10);
|
||||
StorageDead(_9);
|
||||
goto -> bb22;
|
||||
drop(_10) -> [return: bb22, unwind: bb38];
|
||||
}
|
||||
|
||||
bb22: {
|
||||
_1 = const ();
|
||||
StorageDead(_10);
|
||||
StorageDead(_9);
|
||||
goto -> bb23;
|
||||
}
|
||||
|
||||
bb23: {
|
||||
_1 = const ();
|
||||
goto -> bb24;
|
||||
}
|
||||
|
||||
bb24: {
|
||||
StorageDead(_8);
|
||||
StorageDead(_5);
|
||||
StorageDead(_4);
|
||||
StorageDead(_2);
|
||||
StorageDead(_1);
|
||||
StorageLive(_11);
|
||||
_11 = always_true() -> [return: bb24, unwind: bb37];
|
||||
}
|
||||
|
||||
bb24: {
|
||||
switchInt(move _11) -> [0: bb26, otherwise: bb25];
|
||||
_11 = always_true() -> [return: bb25, unwind: bb38];
|
||||
}
|
||||
|
||||
bb25: {
|
||||
goto -> bb35;
|
||||
switchInt(move _11) -> [0: bb27, otherwise: bb26];
|
||||
}
|
||||
|
||||
bb26: {
|
||||
goto -> bb27;
|
||||
goto -> bb36;
|
||||
}
|
||||
|
||||
bb27: {
|
||||
StorageLive(_12);
|
||||
_12 = E::f() -> [return: bb28, unwind: bb37];
|
||||
goto -> bb28;
|
||||
}
|
||||
|
||||
bb28: {
|
||||
PlaceMention(_12);
|
||||
_13 = discriminant(_12);
|
||||
switchInt(move _13) -> [1: bb32, otherwise: bb30];
|
||||
StorageLive(_12);
|
||||
_12 = E::f() -> [return: bb29, unwind: bb38];
|
||||
}
|
||||
|
||||
bb29: {
|
||||
PlaceMention(_12);
|
||||
_13 = discriminant(_12);
|
||||
switchInt(move _13) -> [1: bb33, otherwise: bb31];
|
||||
}
|
||||
|
||||
bb30: {
|
||||
FakeRead(ForMatchedPlace(None), _12);
|
||||
unreachable;
|
||||
}
|
||||
|
||||
bb30: {
|
||||
goto -> bb35;
|
||||
}
|
||||
|
||||
bb31: {
|
||||
goto -> bb29;
|
||||
goto -> bb36;
|
||||
}
|
||||
|
||||
bb32: {
|
||||
falseEdge -> [real: bb34, imaginary: bb30];
|
||||
}
|
||||
|
||||
bb33: {
|
||||
goto -> bb30;
|
||||
}
|
||||
|
||||
bb33: {
|
||||
falseEdge -> [real: bb35, imaginary: bb31];
|
||||
}
|
||||
|
||||
bb34: {
|
||||
_0 = const ();
|
||||
goto -> bb36;
|
||||
goto -> bb31;
|
||||
}
|
||||
|
||||
bb35: {
|
||||
_0 = const ();
|
||||
goto -> bb36;
|
||||
goto -> bb37;
|
||||
}
|
||||
|
||||
bb36: {
|
||||
_0 = const ();
|
||||
goto -> bb37;
|
||||
}
|
||||
|
||||
bb37: {
|
||||
StorageDead(_11);
|
||||
StorageDead(_12);
|
||||
return;
|
||||
}
|
||||
|
||||
bb37 (cleanup): {
|
||||
bb38 (cleanup): {
|
||||
resume;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ fn test_or() -> () {
|
|||
}
|
||||
|
||||
bb1: {
|
||||
drop(_3) -> [return: bb3, unwind: bb12];
|
||||
drop(_3) -> [return: bb3, unwind: bb13];
|
||||
}
|
||||
|
||||
bb2: {
|
||||
|
@ -30,11 +30,11 @@ fn test_or() -> () {
|
|||
bb3: {
|
||||
StorageDead(_3);
|
||||
StorageDead(_2);
|
||||
goto -> bb8;
|
||||
goto -> bb9;
|
||||
}
|
||||
|
||||
bb4: {
|
||||
drop(_3) -> [return: bb5, unwind: bb12];
|
||||
drop(_3) -> [return: bb5, unwind: bb13];
|
||||
}
|
||||
|
||||
bb5: {
|
||||
|
@ -50,38 +50,42 @@ fn test_or() -> () {
|
|||
}
|
||||
|
||||
bb6: {
|
||||
drop(_6) -> [return: bb8, unwind: bb12];
|
||||
drop(_6) -> [return: bb8, unwind: bb13];
|
||||
}
|
||||
|
||||
bb7: {
|
||||
goto -> bb9;
|
||||
goto -> bb10;
|
||||
}
|
||||
|
||||
bb8: {
|
||||
StorageDead(_6);
|
||||
StorageDead(_5);
|
||||
_0 = const ();
|
||||
goto -> bb11;
|
||||
goto -> bb9;
|
||||
}
|
||||
|
||||
bb9: {
|
||||
drop(_6) -> [return: bb10, unwind: bb12];
|
||||
_0 = const ();
|
||||
goto -> bb12;
|
||||
}
|
||||
|
||||
bb10: {
|
||||
StorageDead(_6);
|
||||
StorageDead(_5);
|
||||
_0 = const ();
|
||||
goto -> bb11;
|
||||
drop(_6) -> [return: bb11, unwind: bb13];
|
||||
}
|
||||
|
||||
bb11: {
|
||||
StorageDead(_6);
|
||||
StorageDead(_5);
|
||||
_0 = const ();
|
||||
goto -> bb12;
|
||||
}
|
||||
|
||||
bb12: {
|
||||
StorageDead(_4);
|
||||
StorageDead(_1);
|
||||
return;
|
||||
}
|
||||
|
||||
bb12 (cleanup): {
|
||||
bb13 (cleanup): {
|
||||
resume;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
error: return type notation uses `()` instead of `(..)` for elided arguments
|
||||
--> $DIR/bad-inputs-and-output.rs:20:24
|
||||
|
|
||||
LL | fn baz<T: Trait<method(..): Send>>() {}
|
||||
| ^^ help: remove the `..`
|
||||
|
||||
error[E0658]: associated type bounds are unstable
|
||||
--> $DIR/bad-inputs-and-output.rs:12:17
|
||||
|
|
||||
LL | fn foo<T: Trait<method(i32): Send>>() {}
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
|
||||
= help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: associated type bounds are unstable
|
||||
--> $DIR/bad-inputs-and-output.rs:16:17
|
||||
|
|
||||
LL | fn bar<T: Trait<method() -> (): Send>>() {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
|
||||
= help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable
|
||||
|
||||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/bad-inputs-and-output.rs:5:12
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: argument types not allowed with return type notation
|
||||
--> $DIR/bad-inputs-and-output.rs:12:23
|
||||
|
|
||||
LL | fn foo<T: Trait<method(i32): Send>>() {}
|
||||
| ^^^^^ help: remove the input types: `()`
|
||||
|
||||
error: return type not allowed with return type notation
|
||||
--> $DIR/bad-inputs-and-output.rs:16:25
|
||||
|
|
||||
LL | fn bar<T: Trait<method() -> (): Send>>() {}
|
||||
| ^^^^^^ help: remove the return type
|
||||
|
||||
error: aborting due to 5 previous errors; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
|
@ -1,48 +0,0 @@
|
|||
error: return type notation uses `()` instead of `(..)` for elided arguments
|
||||
--> $DIR/bad-inputs-and-output.rs:20:24
|
||||
|
|
||||
LL | fn baz<T: Trait<method(..): Send>>() {}
|
||||
| ^^ help: remove the `..`
|
||||
|
||||
error[E0658]: associated type bounds are unstable
|
||||
--> $DIR/bad-inputs-and-output.rs:12:17
|
||||
|
|
||||
LL | fn foo<T: Trait<method(i32): Send>>() {}
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
|
||||
= help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable
|
||||
|
||||
error[E0658]: associated type bounds are unstable
|
||||
--> $DIR/bad-inputs-and-output.rs:16:17
|
||||
|
|
||||
LL | fn bar<T: Trait<method() -> (): Send>>() {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #52662 <https://github.com/rust-lang/rust/issues/52662> for more information
|
||||
= help: add `#![feature(associated_type_bounds)]` to the crate attributes to enable
|
||||
|
||||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/bad-inputs-and-output.rs:5:12
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: argument types not allowed with return type notation
|
||||
--> $DIR/bad-inputs-and-output.rs:12:23
|
||||
|
|
||||
LL | fn foo<T: Trait<method(i32): Send>>() {}
|
||||
| ^^^^^ help: remove the input types: `()`
|
||||
|
||||
error: return type not allowed with return type notation
|
||||
--> $DIR/bad-inputs-and-output.rs:16:25
|
||||
|
|
||||
LL | fn bar<T: Trait<method() -> (): Send>>() {}
|
||||
| ^^^^^^ help: remove the return type
|
||||
|
||||
error: aborting due to 5 previous errors; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
|
@ -1,11 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/basic.rs:8:12
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/basic.rs:8:12
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: future cannot be sent between threads safely
|
||||
--> $DIR/basic.rs:26:13
|
||||
|
|
||||
LL | is_send(foo::<T>());
|
||||
| ^^^^^^^^^^ future returned by `foo` is not `Send`
|
||||
|
|
||||
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>>`
|
||||
note: future is not `Send` as it awaits another future which is not `Send`
|
||||
--> $DIR/basic.rs:16:5
|
||||
|
|
||||
LL | T::method().await?;
|
||||
| ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>>`, which is not `Send`
|
||||
note: required by a bound in `is_send`
|
||||
--> $DIR/basic.rs:20:20
|
||||
|
|
||||
LL | fn is_send(_: impl Send) {}
|
||||
| ^^^^ required by this bound in `is_send`
|
||||
|
||||
error: aborting due to 1 previous error; 1 warning emitted
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/basic.rs:8:12
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/basic.rs:8:12
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: future cannot be sent between threads safely
|
||||
--> $DIR/basic.rs:26:13
|
||||
|
|
||||
LL | is_send(foo::<T>());
|
||||
| ^^^^^^^^^^ future returned by `foo` is not `Send`
|
||||
|
|
||||
= help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>>`
|
||||
note: future is not `Send` as it awaits another future which is not `Send`
|
||||
--> $DIR/basic.rs:16:5
|
||||
|
|
||||
LL | T::method().await?;
|
||||
| ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>>`, which is not `Send`
|
||||
note: required by a bound in `is_send`
|
||||
--> $DIR/basic.rs:20:20
|
||||
|
|
||||
LL | fn is_send(_: impl Send) {}
|
||||
| ^^^^ required by this bound in `is_send`
|
||||
|
||||
error: aborting due to 1 previous error; 1 warning emitted
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/issue-110963-early.rs:6:12
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-110963-early.rs:17:5
|
||||
|
|
||||
LL | / spawn(async move {
|
||||
LL | | let mut hc = hc;
|
||||
LL | | if !hc.check().await {
|
||||
LL | | log_health_check_failure().await;
|
||||
LL | | }
|
||||
LL | | });
|
||||
| |______^ one type is more general than the other
|
||||
|
|
||||
= note: expected trait `Send`
|
||||
found trait `for<'a> Send`
|
||||
note: the lifetime requirement is introduced here
|
||||
--> $DIR/issue-110963-early.rs:37:17
|
||||
|
|
||||
LL | F: Future + Send + 'static,
|
||||
| ^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-110963-early.rs:17:5
|
||||
|
|
||||
LL | / spawn(async move {
|
||||
LL | | let mut hc = hc;
|
||||
LL | | if !hc.check().await {
|
||||
LL | | log_health_check_failure().await;
|
||||
LL | | }
|
||||
LL | | });
|
||||
| |______^ one type is more general than the other
|
||||
|
|
||||
= note: expected trait `Send`
|
||||
found trait `for<'a> Send`
|
||||
note: the lifetime requirement is introduced here
|
||||
--> $DIR/issue-110963-early.rs:37:17
|
||||
|
|
||||
LL | F: Future + Send + 'static,
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
|
@ -1,50 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/issue-110963-early.rs:6:12
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-110963-early.rs:17:5
|
||||
|
|
||||
LL | / spawn(async move {
|
||||
LL | | let mut hc = hc;
|
||||
LL | | if !hc.check().await {
|
||||
LL | | log_health_check_failure().await;
|
||||
LL | | }
|
||||
LL | | });
|
||||
| |______^ one type is more general than the other
|
||||
|
|
||||
= note: expected trait `Send`
|
||||
found trait `for<'a> Send`
|
||||
note: the lifetime requirement is introduced here
|
||||
--> $DIR/issue-110963-early.rs:37:17
|
||||
|
|
||||
LL | F: Future + Send + 'static,
|
||||
| ^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-110963-early.rs:17:5
|
||||
|
|
||||
LL | / spawn(async move {
|
||||
LL | | let mut hc = hc;
|
||||
LL | | if !hc.check().await {
|
||||
LL | | log_health_check_failure().await;
|
||||
LL | | }
|
||||
LL | | });
|
||||
| |______^ one type is more general than the other
|
||||
|
|
||||
= note: expected trait `Send`
|
||||
found trait `for<'a> Send`
|
||||
note: the lifetime requirement is introduced here
|
||||
--> $DIR/issue-110963-early.rs:37:17
|
||||
|
|
||||
LL | F: Future + Send + 'static,
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
|
@ -1,11 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/issue-110963-late.rs:6:12
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/super-method-bound.rs:6:31
|
||||
|
|
||||
LL | #![feature(return_type_notation)] | ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/supertrait-bound.rs:5:49
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/supertrait-bound.rs:5:49
|
||||
|
|
||||
LL | #![feature(return_type_notation)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/ty-or-ct-params.rs:5:31
|
||||
|
|
||||
LL | #![feature(return_type_notation)] | ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: return type notation is not allowed for functions that have type parameters
|
||||
--> $DIR/ty-or-ct-params.rs:16:12
|
||||
|
|
||||
LL | async fn bar<T>() {}
|
||||
| - type parameter declared here
|
||||
...
|
||||
LL | T: Foo<bar(): Send, baz(): Send>,
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: return type notation is not allowed for functions that have const parameters
|
||||
--> $DIR/ty-or-ct-params.rs:16:25
|
||||
|
|
||||
LL | async fn baz<const N: usize>() {}
|
||||
| -------------- const parameter declared here
|
||||
...
|
||||
LL | T: Foo<bar(): Send, baz(): Send>,
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/ty-or-ct-params.rs:5:31
|
||||
|
|
||||
LL | #![feature(return_type_notation)] | ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= note: `#[warn(incomplete_features)]` on by default
|
||||
|
||||
error: return type notation is not allowed for functions that have type parameters
|
||||
--> $DIR/ty-or-ct-params.rs:16:12
|
||||
|
|
||||
LL | async fn bar<T>() {}
|
||||
| - type parameter declared here
|
||||
...
|
||||
LL | T: Foo<bar(): Send, baz(): Send>,
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: return type notation is not allowed for functions that have const parameters
|
||||
--> $DIR/ty-or-ct-params.rs:16:25
|
||||
|
|
||||
LL | async fn baz<const N: usize>() {}
|
||||
| -------------- const parameter declared here
|
||||
...
|
||||
LL | T: Foo<bar(): Send, baz(): Send>,
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors; 1 warning emitted
|
||||
|
|
@ -3,4 +3,17 @@ fn foo(x: isize) { println!("{}", x); }
|
|||
fn main() {
|
||||
let x: isize;
|
||||
foo(x); //~ ERROR E0381
|
||||
|
||||
// test for #120634
|
||||
struct A(u8);
|
||||
struct B { d: u8 }
|
||||
let (a, );
|
||||
let [b, ];
|
||||
let A(c);
|
||||
let B { d };
|
||||
let _: (u8, u8, u8, u8) = (a, b, c, d);
|
||||
//~^ ERROR used binding `a`
|
||||
//~| ERROR used binding `b`
|
||||
//~| ERROR used binding `c`
|
||||
//~| ERROR used binding `d`
|
||||
}
|
||||
|
|
|
@ -11,6 +11,41 @@ help: consider assigning a value
|
|||
LL | let x: isize = 0;
|
||||
| +++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error[E0381]: used binding `a` isn't initialized
|
||||
--> $DIR/borrowck-uninit.rs:14:32
|
||||
|
|
||||
LL | let (a, );
|
||||
| - binding declared here but left uninitialized
|
||||
...
|
||||
LL | let _: (u8, u8, u8, u8) = (a, b, c, d);
|
||||
| ^ `a` used here but it isn't initialized
|
||||
|
||||
error[E0381]: used binding `b` isn't initialized
|
||||
--> $DIR/borrowck-uninit.rs:14:35
|
||||
|
|
||||
LL | let [b, ];
|
||||
| - binding declared here but left uninitialized
|
||||
...
|
||||
LL | let _: (u8, u8, u8, u8) = (a, b, c, d);
|
||||
| ^ `b` used here but it isn't initialized
|
||||
|
||||
error[E0381]: used binding `c` isn't initialized
|
||||
--> $DIR/borrowck-uninit.rs:14:38
|
||||
|
|
||||
LL | let A(c);
|
||||
| - binding declared here but left uninitialized
|
||||
LL | let B { d };
|
||||
LL | let _: (u8, u8, u8, u8) = (a, b, c, d);
|
||||
| ^ `c` used here but it isn't initialized
|
||||
|
||||
error[E0381]: used binding `d` isn't initialized
|
||||
--> $DIR/borrowck-uninit.rs:14:41
|
||||
|
|
||||
LL | let B { d };
|
||||
| - binding declared here but left uninitialized
|
||||
LL | let _: (u8, u8, u8, u8) = (a, b, c, d);
|
||||
| ^ `d` used here but it isn't initialized
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0381`.
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
error[E0658]: return type notation is experimental
|
||||
--> $DIR/feature-gate-return_type_notation.rs:17:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= help: add `#![feature(return_type_notation)]` to the crate attributes to enable
|
||||
|
||||
error: parenthesized generic arguments cannot be used in associated type constraints
|
||||
--> $DIR/feature-gate-return_type_notation.rs:17:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^--
|
||||
| |
|
||||
| help: remove these parentheses
|
||||
|
||||
error[E0220]: associated type `m` not found for `Trait`
|
||||
--> $DIR/feature-gate-return_type_notation.rs:17:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^ associated type `m` not found
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0220, E0658.
|
||||
For more information about an error, try `rustc --explain E0220`.
|
|
@ -1,27 +0,0 @@
|
|||
error[E0658]: return type notation is experimental
|
||||
--> $DIR/feature-gate-return_type_notation.rs:17:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= help: add `#![feature(return_type_notation)]` to the crate attributes to enable
|
||||
|
||||
error: parenthesized generic arguments cannot be used in associated type constraints
|
||||
--> $DIR/feature-gate-return_type_notation.rs:17:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^--
|
||||
| |
|
||||
| help: remove these parentheses
|
||||
|
||||
error[E0220]: associated type `m` not found for `Trait`
|
||||
--> $DIR/feature-gate-return_type_notation.rs:17:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^ associated type `m` not found
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0220, E0658.
|
||||
For more information about an error, try `rustc --explain E0220`.
|
|
@ -1,13 +0,0 @@
|
|||
warning: return type notation is experimental
|
||||
--> $DIR/feature-gate-return_type_notation.rs:17:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= help: add `#![feature(return_type_notation)]` to the crate attributes to enable
|
||||
= warning: unstable syntax can change at any point in the future, causing a hard error!
|
||||
= note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
warning: return type notation is experimental
|
||||
--> $DIR/feature-gate-return_type_notation.rs:17:17
|
||||
|
|
||||
LL | fn foo<T: Trait<m(): Send>>() {}
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
|
||||
= help: add `#![feature(return_type_notation)]` to the crate attributes to enable
|
||||
= warning: unstable syntax can change at any point in the future, causing a hard error!
|
||||
= note: for more information, see issue #65860 <https://github.com/rust-lang/rust/issues/65860>
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-71955.rs:54:5
|
||||
|
|
||||
LL | foo(bar, "string", |s| s.len() == 5);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
||||
|
|
||||
= note: expected type `for<'r, 's> FnOnce<(&'r &'s str,)>`
|
||||
found type `for<'r> FnOnce<(&'r &str,)>`
|
||||
note: this closure does not fulfill the lifetime requirements
|
||||
--> $DIR/issue-71955.rs:54:24
|
||||
|
|
||||
LL | foo(bar, "string", |s| s.len() == 5);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
note: the lifetime requirement is introduced here
|
||||
--> $DIR/issue-71955.rs:34:9
|
||||
|
|
||||
LL | F2: FnOnce(&<F1 as Parser>::Output) -> bool
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-71955.rs:54:5
|
||||
|
|
||||
LL | foo(bar, "string", |s| s.len() == 5);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
||||
|
|
||||
= note: expected type `FnOnce<(&&str,)>`
|
||||
found type `for<'r> FnOnce<(&'r &str,)>`
|
||||
note: this closure does not fulfill the lifetime requirements
|
||||
--> $DIR/issue-71955.rs:54:24
|
||||
|
|
||||
LL | foo(bar, "string", |s| s.len() == 5);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
note: the lifetime requirement is introduced here
|
||||
--> $DIR/issue-71955.rs:34:44
|
||||
|
|
||||
LL | F2: FnOnce(&<F1 as Parser>::Output) -> bool
|
||||
| ^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-71955.rs:58:5
|
||||
|
|
||||
LL | foo(baz, "string", |s| s.0.len() == 5);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
||||
|
|
||||
= note: expected type `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
|
||||
found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
|
||||
note: this closure does not fulfill the lifetime requirements
|
||||
--> $DIR/issue-71955.rs:58:24
|
||||
|
|
||||
LL | foo(baz, "string", |s| s.0.len() == 5);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: the lifetime requirement is introduced here
|
||||
--> $DIR/issue-71955.rs:34:9
|
||||
|
|
||||
LL | F2: FnOnce(&<F1 as Parser>::Output) -> bool
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-71955.rs:58:5
|
||||
|
|
||||
LL | foo(baz, "string", |s| s.0.len() == 5);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
||||
|
|
||||
= note: expected type `FnOnce<(&Wrapper<'_>,)>`
|
||||
found type `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
|
||||
note: this closure does not fulfill the lifetime requirements
|
||||
--> $DIR/issue-71955.rs:58:24
|
||||
|
|
||||
LL | foo(baz, "string", |s| s.0.len() == 5);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
note: the lifetime requirement is introduced here
|
||||
--> $DIR/issue-71955.rs:34:44
|
||||
|
|
||||
LL | F2: FnOnce(&<F1 as Parser>::Output) -> bool
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
|
@ -16,7 +16,7 @@ error: unused import: `super::a`
|
|||
LL | use super::a;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
help: consider adding a `#[cfg(test)]` to the containing module
|
||||
help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
|
||||
--> $DIR/unused-imports-in-test-module.rs:8:1
|
||||
|
|
||||
LL | mod test {
|
||||
|
@ -28,7 +28,7 @@ error: unused import: `super::a`
|
|||
LL | use super::a;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
help: consider adding a `#[cfg(test)]` to the containing module
|
||||
help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
|
||||
--> $DIR/unused-imports-in-test-module.rs:18:1
|
||||
|
|
||||
LL | mod tests {
|
||||
|
@ -40,7 +40,7 @@ error: unused import: `super::a`
|
|||
LL | use super::a;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
help: consider adding a `#[cfg(test)]` to the containing module
|
||||
help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
|
||||
--> $DIR/unused-imports-in-test-module.rs:28:1
|
||||
|
|
||||
LL | mod test_a {
|
||||
|
@ -52,7 +52,7 @@ error: unused import: `super::a`
|
|||
LL | use super::a;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
help: consider adding a `#[cfg(test)]` to the containing module
|
||||
help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
|
||||
--> $DIR/unused-imports-in-test-module.rs:38:1
|
||||
|
|
||||
LL | mod a_test {
|
||||
|
@ -64,7 +64,7 @@ error: unused import: `super::a`
|
|||
LL | use super::a;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
help: consider adding a `#[cfg(test)]` to the containing module
|
||||
help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
|
||||
--> $DIR/unused-imports-in-test-module.rs:48:1
|
||||
|
|
||||
LL | mod tests_a {
|
||||
|
@ -76,7 +76,7 @@ error: unused import: `super::a`
|
|||
LL | use super::a;
|
||||
| ^^^^^^^^
|
||||
|
|
||||
help: consider adding a `#[cfg(test)]` to the containing module
|
||||
help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
|
||||
--> $DIR/unused-imports-in-test-module.rs:58:1
|
||||
|
|
||||
LL | mod a_tests {
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
error: captured variable cannot escape `FnMut` closure body
|
||||
--> $DIR/issue-40510-1.rs:11:9
|
||||
|
|
||||
LL | || {
|
||||
| - inferred to be a `FnMut` closure
|
||||
LL | &mut x
|
||||
| ^^^^^^ returns a reference to a captured variable which escapes the closure body
|
||||
|
|
||||
= note: `FnMut` closures only have access to their captured variables while they are executing...
|
||||
= note: ...therefore, they cannot allow references to captured variables to escape
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
error: captured variable cannot escape `FnMut` closure body
|
||||
--> $DIR/issue-40510-3.rs:11:9
|
||||
|
|
||||
LL | || {
|
||||
| - inferred to be a `FnMut` closure
|
||||
LL | / || {
|
||||
LL | | x.push(())
|
||||
LL | | }
|
||||
| |_________^ returns a closure that contains a reference to a captured variable, which then escapes the closure body
|
||||
|
|
||||
= note: `FnMut` closures only have access to their captured variables while they are executing...
|
||||
= note: ...therefore, they cannot allow references to captured variables to escape
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
error[E0308]: `match` arms have incompatible types
|
||||
--> $DIR/old-lub-glb-hr-noteq1.rs:17:14
|
||||
|
|
||||
LL | let z = match 22 {
|
||||
| _____________-
|
||||
LL | | 0 => x,
|
||||
| | - this is found to be of type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
|
||||
LL | | _ => y,
|
||||
| | ^ one type is more general than the other
|
||||
LL | |
|
||||
... |
|
||||
LL | |
|
||||
LL | | };
|
||||
| |_____- `match` arms have incompatible types
|
||||
|
|
||||
= note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
|
||||
found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
|
@ -1,12 +0,0 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/old-lub-glb-hr-noteq1.rs:17:14
|
||||
|
|
||||
LL | _ => y,
|
||||
| ^ one type is more general than the other
|
||||
|
|
||||
= note: expected fn pointer `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
|
||||
found fn pointer `for<'a> fn(&'a u8, &'a u8) -> &'a u8`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
|
@ -0,0 +1,22 @@
|
|||
//@ revisions: current next
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
//@ check-pass
|
||||
|
||||
// Check that negative impls for traits with associated types
|
||||
// do not result in an ICE when trying to normalize.
|
||||
#![feature(negative_impls)]
|
||||
trait Trait {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
struct Local<T>(T);
|
||||
impl !Trait for Local<u32> {}
|
||||
impl Trait for Local<i32> {
|
||||
type Assoc = i32;
|
||||
}
|
||||
|
||||
trait NoOverlap {}
|
||||
impl<T: Trait<Assoc = u32>> NoOverlap for T {}
|
||||
impl<T> NoOverlap for Local<T> {}
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,11 @@
|
|||
struct What<W = usize, X = Vec<W>>(W, X);
|
||||
|
||||
fn main() {
|
||||
let mut b: What<usize> = What(5, vec![1, 2, 3]);
|
||||
let c: What<usize, String> = What(1, String::from("meow"));
|
||||
b = c; //~ ERROR mismatched types
|
||||
|
||||
let mut f: What<usize, Vec<String>> = What(1, vec![String::from("meow")]);
|
||||
let e: What<usize> = What(5, vec![1, 2, 3]);
|
||||
f = e; //~ ERROR mismatched types
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/clarify-error-for-generics-with-default-issue-120785.rs:6:9
|
||||
|
|
||||
LL | let mut b: What<usize> = What(5, vec![1, 2, 3]);
|
||||
| ----------- expected due to this type
|
||||
LL | let c: What<usize, String> = What(1, String::from("meow"));
|
||||
LL | b = c;
|
||||
| ^ expected `What`, found `What<usize, String>`
|
||||
|
|
||||
= note: expected struct `What<_, Vec<usize>>`
|
||||
found struct `What<_, String>`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/clarify-error-for-generics-with-default-issue-120785.rs:10:9
|
||||
|
|
||||
LL | let mut f: What<usize, Vec<String>> = What(1, vec![String::from("meow")]);
|
||||
| ------------------------ expected due to this type
|
||||
LL | let e: What<usize> = What(5, vec![1, 2, 3]);
|
||||
LL | f = e;
|
||||
| ^ expected `What<usize, Vec<String>>`, found `What`
|
||||
|
|
||||
= note: expected struct `What<_, Vec<String>>`
|
||||
found struct `What<_, Vec<usize>>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
8
tests/ui/typeck/invalid-stashed-level-issue-121812.rs
Normal file
8
tests/ui/typeck/invalid-stashed-level-issue-121812.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
union U {
|
||||
a: u16,
|
||||
b: [u8; 3],
|
||||
}
|
||||
|
||||
fn main() {
|
||||
_ = U { b: [()] }; //~ ERROR mismatched types
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/invalid-stashed-level-issue-121812.rs:7:17
|
||||
|
|
||||
LL | _ = U { b: [()] };
|
||||
| ^^ expected `u8`, found `()`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
Loading…
Add table
Add a link
Reference in a new issue