Rollup merge of #132978 - WaffleLapkin:very-semantic-change-kind, r=compiler-errors

Mention both release *and* edition breakage for never type lints

This PR makes ~~two changes~~ a change to the never type lints (`dependency_on_unit_never_type_fallback` and `never_type_fallback_flowing_into_unsafe`):
1.  Change the wording of the note to mention that the breaking change will be made in an edition _and_ in a future release
2. ~~Make these warnings be reported in deps (hopefully the lints are matured enough)~~

r? ``@compiler-errors``
cc ``@ehuss``
closes #132930
This commit is contained in:
Guillaume Gomez 2024-11-15 23:38:10 +01:00 committed by GitHub
commit b3e2981ff7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 120 additions and 114 deletions

View File

@ -4185,7 +4185,7 @@ declare_lint! {
Warn, Warn,
"never type fallback affecting unsafe function calls", "never type fallback affecting unsafe function calls",
@future_incompatible = FutureIncompatibleInfo { @future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseSemanticsChange, reason: FutureIncompatibilityReason::EditionAndFutureReleaseSemanticsChange(Edition::Edition2024),
reference: "issue #123748 <https://github.com/rust-lang/rust/issues/123748>", reference: "issue #123748 <https://github.com/rust-lang/rust/issues/123748>",
}; };
@edition Edition2024 => Deny; @edition Edition2024 => Deny;
@ -4239,7 +4239,7 @@ declare_lint! {
Warn, Warn,
"never type fallback affecting unsafe function calls", "never type fallback affecting unsafe function calls",
@future_incompatible = FutureIncompatibleInfo { @future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps, reason: FutureIncompatibilityReason::EditionAndFutureReleaseError(Edition::Edition2024),
reference: "issue #123748 <https://github.com/rust-lang/rust/issues/123748>", reference: "issue #123748 <https://github.com/rust-lang/rust/issues/123748>",
}; };
report_in_external_macro report_in_external_macro

View File

@ -381,6 +381,8 @@ pub enum FutureIncompatibilityReason {
/// hard errors (and the lint removed). Preferably when there is some /// hard errors (and the lint removed). Preferably when there is some
/// confidence that the number of impacted projects is very small (few /// confidence that the number of impacted projects is very small (few
/// should have a broken dependency in their dependency tree). /// should have a broken dependency in their dependency tree).
///
/// [`EditionAndFutureReleaseError`]: FutureIncompatibilityReason::EditionAndFutureReleaseError
FutureReleaseErrorReportInDeps, FutureReleaseErrorReportInDeps,
/// Code that changes meaning in some way in a /// Code that changes meaning in some way in a
/// future release. /// future release.
@ -419,6 +421,28 @@ pub enum FutureIncompatibilityReason {
/// slightly changes the text of the diagnostic, but is otherwise the /// slightly changes the text of the diagnostic, but is otherwise the
/// same. /// same.
EditionSemanticsChange(Edition), EditionSemanticsChange(Edition),
/// This will be an error in the provided edition *and* in a future
/// release.
///
/// This variant a combination of [`FutureReleaseErrorDontReportInDeps`]
/// and [`EditionError`]. This is useful in rare cases when we
/// want to have "preview" of a breaking change in an edition, but do a
/// breaking change later on all editions anyway.
///
/// [`EditionError`]: FutureIncompatibilityReason::EditionError
/// [`FutureReleaseErrorDontReportInDeps`]: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps
EditionAndFutureReleaseError(Edition),
/// This will change meaning in the provided edition *and* in a future
/// release.
///
/// This variant a combination of [`FutureReleaseSemanticsChange`]
/// and [`EditionSemanticsChange`]. This is useful in rare cases when we
/// want to have "preview" of a breaking change in an edition, but do a
/// breaking change later on all editions anyway.
///
/// [`EditionSemanticsChange`]: FutureIncompatibilityReason::EditionSemanticsChange
/// [`FutureReleaseSemanticsChange`]: FutureIncompatibilityReason::FutureReleaseSemanticsChange
EditionAndFutureReleaseSemanticsChange(Edition),
/// A custom reason. /// A custom reason.
/// ///
/// Choose this variant if the built-in text of the diagnostic of the /// Choose this variant if the built-in text of the diagnostic of the
@ -431,9 +455,15 @@ pub enum FutureIncompatibilityReason {
impl FutureIncompatibilityReason { impl FutureIncompatibilityReason {
pub fn edition(self) -> Option<Edition> { pub fn edition(self) -> Option<Edition> {
match self { match self {
Self::EditionError(e) => Some(e), Self::EditionError(e)
Self::EditionSemanticsChange(e) => Some(e), | Self::EditionSemanticsChange(e)
_ => None, | Self::EditionAndFutureReleaseError(e)
| Self::EditionAndFutureReleaseSemanticsChange(e) => Some(e),
FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps
| FutureIncompatibilityReason::FutureReleaseErrorReportInDeps
| FutureIncompatibilityReason::FutureReleaseSemanticsChange
| FutureIncompatibilityReason::Custom(_) => None,
} }
} }
} }

View File

@ -382,6 +382,17 @@ pub fn lint_level(
FutureIncompatibilityReason::EditionSemanticsChange(edition) => { FutureIncompatibilityReason::EditionSemanticsChange(edition) => {
format!("this changes meaning in Rust {edition}") format!("this changes meaning in Rust {edition}")
} }
FutureIncompatibilityReason::EditionAndFutureReleaseError(edition) => {
format!(
"this was previously accepted by the compiler but is being phased out; \
it will become a hard error in Rust {edition} and in a future release in all editions!"
)
}
FutureIncompatibilityReason::EditionAndFutureReleaseSemanticsChange(edition) => {
format!(
"this changes meaning in Rust {edition} and in a future release in all editions!"
)
}
FutureIncompatibilityReason::Custom(reason) => reason.to_owned(), FutureIncompatibilityReason::Custom(reason) => reason.to_owned(),
}; };

View File

@ -10,15 +10,11 @@ mod opaque {
mod to_reuse { mod to_reuse {
use super::Trait; use super::Trait;
pub fn opaque_ret() -> impl Trait { unimplemented!() } pub fn opaque_ret() -> impl Trait { () }
//~^ warn: this function depends on never type fallback being `()`
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
} }
trait ToReuse { trait ToReuse {
fn opaque_ret() -> impl Trait { unimplemented!() } fn opaque_ret() -> impl Trait { () }
//~^ warn: this function depends on never type fallback being `()`
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
} }
// FIXME: Inherited `impl Trait`s create query cycles when used inside trait impls. // FIXME: Inherited `impl Trait`s create query cycles when used inside trait impls.

View File

@ -1,74 +1,43 @@
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:25:5: 25:24>::{synthetic#0}` error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:21:5: 21:24>::{synthetic#0}`
--> $DIR/unsupported.rs:26:25 --> $DIR/unsupported.rs:22:25
| |
LL | reuse to_reuse::opaque_ret; LL | reuse to_reuse::opaque_ret;
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process... note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
--> $DIR/unsupported.rs:26:25 --> $DIR/unsupported.rs:22:25
| |
LL | reuse to_reuse::opaque_ret; LL | reuse to_reuse::opaque_ret;
| ^^^^^^^^^^ | ^^^^^^^^^^
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:25:5: 25:24>::{synthetic#0}`, completing the cycle = note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:21:5: 21:24>::{synthetic#0}`, completing the cycle
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:25:5: 25:24>` is well-formed note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:21:5: 21:24>` is well-formed
--> $DIR/unsupported.rs:25:5 --> $DIR/unsupported.rs:21:5
| |
LL | impl ToReuse for u8 { LL | impl ToReuse for u8 {
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
warning: this function depends on never type fallback being `()` error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:24:5: 24:25>::{synthetic#0}`
--> $DIR/unsupported.rs:13:9 --> $DIR/unsupported.rs:25:24
|
LL | pub fn opaque_ret() -> impl Trait { unimplemented!() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly
note: in edition 2024, the requirement `!: opaque::Trait` will fail
--> $DIR/unsupported.rs:13:32
|
LL | pub fn opaque_ret() -> impl Trait { unimplemented!() }
| ^^^^^^^^^^
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
warning: this function depends on never type fallback being `()`
--> $DIR/unsupported.rs:19:9
|
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly
note: in edition 2024, the requirement `!: opaque::Trait` will fail
--> $DIR/unsupported.rs:19:28
|
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
| ^^^^^^^^^^
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:28:5: 28:25>::{synthetic#0}`
--> $DIR/unsupported.rs:29:24
| |
LL | reuse ToReuse::opaque_ret; LL | reuse ToReuse::opaque_ret;
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process... note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
--> $DIR/unsupported.rs:29:24 --> $DIR/unsupported.rs:25:24
| |
LL | reuse ToReuse::opaque_ret; LL | reuse ToReuse::opaque_ret;
| ^^^^^^^^^^ | ^^^^^^^^^^
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:28:5: 28:25>::{synthetic#0}`, completing the cycle = note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:24:5: 24:25>::{synthetic#0}`, completing the cycle
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:28:5: 28:25>` is well-formed note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:24:5: 24:25>` is well-formed
--> $DIR/unsupported.rs:28:5 --> $DIR/unsupported.rs:24:5
| |
LL | impl ToReuse for u16 { LL | impl ToReuse for u16 {
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
error: recursive delegation is not supported yet error: recursive delegation is not supported yet
--> $DIR/unsupported.rs:42:22 --> $DIR/unsupported.rs:38:22
| |
LL | pub reuse to_reuse2::foo; LL | pub reuse to_reuse2::foo;
| --- callee defined here | --- callee defined here
@ -77,14 +46,14 @@ LL | reuse to_reuse1::foo;
| ^^^ | ^^^
error[E0283]: type annotations needed error[E0283]: type annotations needed
--> $DIR/unsupported.rs:52:18 --> $DIR/unsupported.rs:48:18
| |
LL | reuse Trait::foo; LL | reuse Trait::foo;
| ^^^ cannot infer type | ^^^ cannot infer type
| |
= note: cannot satisfy `_: effects::Trait` = note: cannot satisfy `_: effects::Trait`
error: aborting due to 4 previous errors; 2 warnings emitted error: aborting due to 4 previous errors
Some errors have detailed explanations: E0283, E0391. Some errors have detailed explanations: E0283, E0391.
For more information about an error, try `rustc --explain E0283`. For more information about an error, try `rustc --explain E0283`.

View File

@ -16,7 +16,7 @@ fn main() {
fn m() { fn m() {
//[e2021]~^ this function depends on never type fallback being `()` //[e2021]~^ this function depends on never type fallback being `()`
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
let x: () = match true { let x: () = match true {
true => Default::default(), true => Default::default(),
//[e2024]~^ error: the trait bound `!: Default` is not satisfied //[e2024]~^ error: the trait bound `!: Default` is not satisfied
@ -28,7 +28,7 @@ fn m() {
fn q() -> Option<()> { fn q() -> Option<()> {
//[e2021]~^ this function depends on never type fallback being `()` //[e2021]~^ this function depends on never type fallback being `()`
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
fn deserialize<T: Default>() -> Option<T> { fn deserialize<T: Default>() -> Option<T> {
Some(T::default()) Some(T::default())
} }
@ -45,7 +45,7 @@ fn help<'a: 'a, T: Into<()>, U>(_: U) -> Result<T, ()> {
} }
fn meow() -> Result<(), ()> { fn meow() -> Result<(), ()> {
//[e2021]~^ this function depends on never type fallback being `()` //[e2021]~^ this function depends on never type fallback being `()`
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
help::<(), _>(1)?; help::<(), _>(1)?;
//[e2024]~^ error: the trait bound `(): From<!>` is not satisfied //[e2024]~^ error: the trait bound `(): From<!>` is not satisfied
Ok(()) Ok(())

View File

@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
LL | fn m() { LL | fn m() {
| ^^^^^^ | ^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: Default` will fail note: in edition 2024, the requirement `!: Default` will fail
@ -24,7 +24,7 @@ warning: this function depends on never type fallback being `()`
LL | fn q() -> Option<()> { LL | fn q() -> Option<()> {
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: Default` will fail note: in edition 2024, the requirement `!: Default` will fail
@ -43,7 +43,7 @@ warning: this function depends on never type fallback being `()`
LL | fn meow() -> Result<(), ()> { LL | fn meow() -> Result<(), ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `(): From<!>` will fail note: in edition 2024, the requirement `(): From<!>` will fail

View File

@ -16,7 +16,7 @@ fn main() {
fn m() { fn m() {
//[e2021]~^ this function depends on never type fallback being `()` //[e2021]~^ this function depends on never type fallback being `()`
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
let x = match true { let x = match true {
true => Default::default(), true => Default::default(),
//[e2024]~^ error: the trait bound `!: Default` is not satisfied //[e2024]~^ error: the trait bound `!: Default` is not satisfied
@ -28,7 +28,7 @@ fn m() {
fn q() -> Option<()> { fn q() -> Option<()> {
//[e2021]~^ this function depends on never type fallback being `()` //[e2021]~^ this function depends on never type fallback being `()`
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
fn deserialize<T: Default>() -> Option<T> { fn deserialize<T: Default>() -> Option<T> {
Some(T::default()) Some(T::default())
} }
@ -45,7 +45,7 @@ fn help<'a: 'a, T: Into<()>, U>(_: U) -> Result<T, ()> {
} }
fn meow() -> Result<(), ()> { fn meow() -> Result<(), ()> {
//[e2021]~^ this function depends on never type fallback being `()` //[e2021]~^ this function depends on never type fallback being `()`
//[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[e2021]~| this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
help(1)?; help(1)?;
//[e2024]~^ error: the trait bound `(): From<!>` is not satisfied //[e2024]~^ error: the trait bound `(): From<!>` is not satisfied
Ok(()) Ok(())

View File

@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
LL | fn smeg() { LL | fn smeg() {
| ^^^^^^^^^ | ^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: ImplementedForUnitButNotNever` will fail note: in edition 2024, the requirement `!: ImplementedForUnitButNotNever` will fail

View File

@ -27,7 +27,7 @@ fn foo<T: ImplementedForUnitButNotNever>(_t: T) {}
//[fallback]~| NOTE required by a bound in `foo` //[fallback]~| NOTE required by a bound in `foo`
fn smeg() { fn smeg() {
//[nofallback]~^ warn: this function depends on never type fallback being `()` //[nofallback]~^ warn: this function depends on never type fallback being `()`
//[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
let _x = return; let _x = return;
foo(_x); foo(_x);
//[fallback]~^ ERROR the trait bound //[fallback]~^ ERROR the trait bound

View File

@ -7,7 +7,7 @@ fn main() {
fn def() { fn def() {
//~^ warn: this function depends on never type fallback being `()` //~^ warn: this function depends on never type fallback being `()`
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
match true { match true {
false => <_>::default(), false => <_>::default(),
true => return, true => return,
@ -18,7 +18,7 @@ fn def() {
// <https://github.com/rust-lang/rust/issues/39216> // <https://github.com/rust-lang/rust/issues/39216>
fn question_mark() -> Result<(), ()> { fn question_mark() -> Result<(), ()> {
//~^ warn: this function depends on never type fallback being `()` //~^ warn: this function depends on never type fallback being `()`
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
deserialize()?; deserialize()?;
Ok(()) Ok(())
} }

View File

@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
LL | fn def() { LL | fn def() {
| ^^^^^^^^ | ^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: Default` will fail note: in edition 2024, the requirement `!: Default` will fail
@ -24,7 +24,7 @@ warning: this function depends on never type fallback being `()`
LL | fn question_mark() -> Result<(), ()> { LL | fn question_mark() -> Result<(), ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: Default` will fail note: in edition 2024, the requirement `!: Default` will fail

View File

@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
LL | fn assignment() { LL | fn assignment() {
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: UnitDefault` will fail note: in edition 2024, the requirement `!: UnitDefault` will fail
@ -24,7 +24,7 @@ warning: this function depends on never type fallback being `()`
LL | fn assignment_rev() { LL | fn assignment_rev() {
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: UnitDefault` will fail note: in edition 2024, the requirement `!: UnitDefault` will fail

View File

@ -29,7 +29,7 @@ impl UnitDefault for () {
fn assignment() { fn assignment() {
//[nofallback]~^ warn: this function depends on never type fallback being `()` //[nofallback]~^ warn: this function depends on never type fallback being `()`
//[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
let x; let x;
if true { if true {
@ -41,7 +41,7 @@ fn assignment() {
fn assignment_rev() { fn assignment_rev() {
//[nofallback]~^ warn: this function depends on never type fallback being `()` //[nofallback]~^ warn: this function depends on never type fallback being `()`
//[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
let x; let x;
if true { if true {

View File

@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
LL | fn main() { LL | fn main() {
| ^^^^^^^^^ | ^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: Test` will fail note: in edition 2024, the requirement `!: Test` will fail

View File

@ -13,7 +13,7 @@ fn unconstrained_arg<T: Test>(_: T) {}
fn main() { fn main() {
//[nofallback]~^ warn: this function depends on never type fallback being `()` //[nofallback]~^ warn: this function depends on never type fallback being `()`
//[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
// Here the type variable falls back to `!`, // Here the type variable falls back to `!`,
// and hence we get a type error. // and hence we get a type error.

View File

@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
LL | fn main() { LL | fn main() {
| ^^^^^^^^^ | ^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: UnitReturn` will fail note: in edition 2024, the requirement `!: UnitReturn` will fail

View File

@ -27,7 +27,7 @@ fn unconstrained_return<T: UnitReturn>() -> T {
fn main() { fn main() {
//[nofallback]~^ warn: this function depends on never type fallback being `()` //[nofallback]~^ warn: this function depends on never type fallback being `()`
//[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
// In Ye Olde Days, the `T` parameter of `unconstrained_return` // In Ye Olde Days, the `T` parameter of `unconstrained_return`
// winds up "entangled" with the `!` type that results from // winds up "entangled" with the `!` type that results from

View File

@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
LL | fn main() { LL | fn main() {
| ^^^^^^^^^ | ^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: Bar` will fail note: in edition 2024, the requirement `!: Bar` will fail

View File

@ -20,6 +20,6 @@ fn foo<R: Bar>(_: impl Fn() -> R) {}
fn main() { fn main() {
//[nofallback]~^ warn: this function depends on never type fallback being `()` //[nofallback]~^ warn: this function depends on never type fallback being `()`
//[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //[nofallback]~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
foo(|| panic!()); foo(|| panic!());
} }

View File

@ -7,6 +7,6 @@ impl T for () {}
fn should_ret_unit() -> impl T { fn should_ret_unit() -> impl T {
//~^ warn: this function depends on never type fallback being `()` //~^ warn: this function depends on never type fallback being `()`
//~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //~| warn: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
panic!() panic!()
} }

View File

@ -4,7 +4,7 @@ warning: this function depends on never type fallback being `()`
LL | fn should_ret_unit() -> impl T { LL | fn should_ret_unit() -> impl T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the types explicitly = help: specify the types explicitly
note: in edition 2024, the requirement `!: T` will fail note: in edition 2024, the requirement `!: T` will fail

View File

@ -4,7 +4,7 @@ warning: never type fallback affects this call to an `unsafe` function
LL | unsafe { mem::zeroed() } LL | unsafe { mem::zeroed() }
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
= note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default
@ -19,7 +19,7 @@ warning: never type fallback affects this call to an `unsafe` function
LL | core::mem::transmute(Zst) LL | core::mem::transmute(Zst)
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -33,7 +33,7 @@ warning: never type fallback affects this union access
LL | unsafe { Union { a: () }.b } LL | unsafe { Union { a: () }.b }
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
@ -43,7 +43,7 @@ warning: never type fallback affects this raw pointer dereference
LL | unsafe { *ptr::from_ref(&()).cast() } LL | unsafe { *ptr::from_ref(&()).cast() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -57,7 +57,7 @@ warning: never type fallback affects this call to an `unsafe` function
LL | unsafe { internally_create(x) } LL | unsafe { internally_create(x) }
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -71,7 +71,7 @@ warning: never type fallback affects this call to an `unsafe` function
LL | unsafe { zeroed() } LL | unsafe { zeroed() }
| ^^^^^^^^ | ^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -85,7 +85,7 @@ warning: never type fallback affects this `unsafe` function
LL | let zeroed = mem::zeroed; LL | let zeroed = mem::zeroed;
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -99,7 +99,7 @@ warning: never type fallback affects this `unsafe` function
LL | let f = internally_create; LL | let f = internally_create;
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -113,7 +113,7 @@ warning: never type fallback affects this call to an `unsafe` method
LL | S(marker::PhantomData).create_out_of_thin_air() LL | S(marker::PhantomData).create_out_of_thin_air()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
@ -126,7 +126,7 @@ LL | match send_message::<_ /* ?0 */>() {
LL | msg_send!(); LL | msg_send!();
| ----------- in this macro invocation | ----------- in this macro invocation
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
= note: this warning originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this warning originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,7 +4,7 @@ error: never type fallback affects this call to an `unsafe` function
LL | unsafe { mem::zeroed() } LL | unsafe { mem::zeroed() }
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
= note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default = note: `#[deny(never_type_fallback_flowing_into_unsafe)]` on by default
@ -19,7 +19,7 @@ error: never type fallback affects this call to an `unsafe` function
LL | core::mem::transmute(Zst) LL | core::mem::transmute(Zst)
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -33,7 +33,7 @@ error: never type fallback affects this union access
LL | unsafe { Union { a: () }.b } LL | unsafe { Union { a: () }.b }
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
@ -43,7 +43,7 @@ error: never type fallback affects this raw pointer dereference
LL | unsafe { *ptr::from_ref(&()).cast() } LL | unsafe { *ptr::from_ref(&()).cast() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -57,7 +57,7 @@ error: never type fallback affects this call to an `unsafe` function
LL | unsafe { internally_create(x) } LL | unsafe { internally_create(x) }
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -71,7 +71,7 @@ error: never type fallback affects this call to an `unsafe` function
LL | unsafe { zeroed() } LL | unsafe { zeroed() }
| ^^^^^^^^ | ^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -85,7 +85,7 @@ error: never type fallback affects this `unsafe` function
LL | let zeroed = mem::zeroed; LL | let zeroed = mem::zeroed;
| ^^^^^^^^^^^ | ^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -99,7 +99,7 @@ error: never type fallback affects this `unsafe` function
LL | let f = internally_create; LL | let f = internally_create;
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
help: use `()` annotations to avoid fallback changes help: use `()` annotations to avoid fallback changes
@ -113,7 +113,7 @@ error: never type fallback affects this call to an `unsafe` method
LL | S(marker::PhantomData).create_out_of_thin_air() LL | S(marker::PhantomData).create_out_of_thin_air()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
@ -126,7 +126,7 @@ LL | match send_message::<_ /* ?0 */>() {
LL | msg_send!(); LL | msg_send!();
| ----------- in this macro invocation | ----------- in this macro invocation
| |
= warning: this will change its meaning in a future release! = warning: this changes meaning in Rust 2024 and in a future release in all editions!
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748> = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
= help: specify the type explicitly = help: specify the type explicitly
= note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -13,7 +13,7 @@ fn _zero() {
unsafe { mem::zeroed() } unsafe { mem::zeroed() }
//[e2015]~^ warn: never type fallback affects this call to an `unsafe` function //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function
//[e2024]~^^ error: never type fallback affects this call to an `unsafe` function //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
//[e2024]~| warning: the type `!` does not permit zero-initialization //[e2024]~| warning: the type `!` does not permit zero-initialization
} else { } else {
return; return;
@ -30,7 +30,7 @@ fn _trans() {
core::mem::transmute(Zst) core::mem::transmute(Zst)
//[e2015]~^ warn: never type fallback affects this call to an `unsafe` function //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function
//[e2024]~^^ error: never type fallback affects this call to an `unsafe` function //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
} }
} else { } else {
return; return;
@ -47,7 +47,7 @@ fn _union() {
unsafe { Union { a: () }.b } unsafe { Union { a: () }.b }
//[e2015]~^ warn: never type fallback affects this union access //[e2015]~^ warn: never type fallback affects this union access
//[e2024]~^^ error: never type fallback affects this union access //[e2024]~^^ error: never type fallback affects this union access
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
} else { } else {
return; return;
}; };
@ -58,7 +58,7 @@ fn _deref() {
unsafe { *ptr::from_ref(&()).cast() } unsafe { *ptr::from_ref(&()).cast() }
//[e2015]~^ warn: never type fallback affects this raw pointer dereference //[e2015]~^ warn: never type fallback affects this raw pointer dereference
//[e2024]~^^ error: never type fallback affects this raw pointer dereference //[e2024]~^^ error: never type fallback affects this raw pointer dereference
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
} else { } else {
return; return;
}; };
@ -79,7 +79,7 @@ fn _only_generics() {
unsafe { internally_create(x) } unsafe { internally_create(x) }
//[e2015]~^ warn: never type fallback affects this call to an `unsafe` function //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function
//[e2024]~^^ error: never type fallback affects this call to an `unsafe` function //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
x.unwrap() x.unwrap()
} else { } else {
@ -92,12 +92,12 @@ fn _stored_function() {
let zeroed = mem::zeroed; let zeroed = mem::zeroed;
//[e2015]~^ warn: never type fallback affects this `unsafe` function //[e2015]~^ warn: never type fallback affects this `unsafe` function
//[e2024]~^^ error: never type fallback affects this `unsafe` function //[e2024]~^^ error: never type fallback affects this `unsafe` function
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
unsafe { zeroed() } unsafe { zeroed() }
//[e2015]~^ warn: never type fallback affects this call to an `unsafe` function //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function
//[e2024]~^^ error: never type fallback affects this call to an `unsafe` function //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
} else { } else {
return; return;
}; };
@ -115,7 +115,7 @@ fn _only_generics_stored_function() {
let f = internally_create; let f = internally_create;
//[e2015]~^ warn: never type fallback affects this `unsafe` function //[e2015]~^ warn: never type fallback affects this `unsafe` function
//[e2024]~^^ error: never type fallback affects this `unsafe` function //[e2024]~^^ error: never type fallback affects this `unsafe` function
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
unsafe { f(x) } unsafe { f(x) }
@ -140,7 +140,7 @@ fn _method() {
S(marker::PhantomData).create_out_of_thin_air() S(marker::PhantomData).create_out_of_thin_air()
//[e2015]~^ warn: never type fallback affects this call to an `unsafe` method //[e2015]~^ warn: never type fallback affects this call to an `unsafe` method
//[e2024]~^^ error: never type fallback affects this call to an `unsafe` method //[e2024]~^^ error: never type fallback affects this call to an `unsafe` method
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
} }
} else { } else {
return; return;
@ -158,7 +158,7 @@ fn _objc() {
match send_message::<_ /* ?0 */>() { match send_message::<_ /* ?0 */>() {
//[e2015]~^ warn: never type fallback affects this call to an `unsafe` function //[e2015]~^ warn: never type fallback affects this call to an `unsafe` function
//[e2024]~^^ error: never type fallback affects this call to an `unsafe` function //[e2024]~^^ error: never type fallback affects this call to an `unsafe` function
//~| warn: this will change its meaning in a future release! //~| warn: this changes meaning in Rust 2024 and in a future release in all editions!
Ok(x) => x, Ok(x) => x,
Err(_) => loop {}, Err(_) => loop {},
} }