Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

rustup #2078

Merged
merged 1 commit into from
Apr 20, 2022
Merged

rustup #2078

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
27af5175497936ea3413bef5816e7c0172514b9c
51ea9bb29b07d76c5a7167d054b54f4eb7f5b44e
15 changes: 9 additions & 6 deletions tests/compile-fail/never_transmute_void.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
#![feature(never_type)]
#![allow(unused, invalid_value)]

enum Void {}
mod m {
enum VoidI {}
pub struct Void(VoidI);

fn f(v: Void) -> ! {
match v {} //~ ERROR entering unreachable code
pub fn f(v: Void) -> ! {
match v.0 {} //~ ERROR entering unreachable code
}
}

fn main() {
let v: Void = unsafe {
std::mem::transmute::<(), Void>(())
let v = unsafe {
std::mem::transmute::<(), m::Void>(())
};
f(v); //~ inside `main`
m::f(v); //~ inside `main`
}
2 changes: 1 addition & 1 deletion tests/run-pass/async-fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn never() -> Never {
}

async fn includes_never(crash: bool, x: u32) -> u32 {
let mut result = async { x * x }.await;
let result = async { x * x }.await;
if !crash {
return result;
}
Expand Down