Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
b3827e4f3728b77bd3e60587487ebfc3cc8d901b
rust/tests/ui/lint/dead-code/closure-bang.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
143 B
Rust
Raw Normal View History

Add some tests for closures that return `!`
2014-08-30 20:37:11 +12:00
#![deny(unreachable_code)]
fn main() {
Unignore closure-bang. This test was ignored long ago in https://github.com/rust-lang/rust/pull/20578/ when the syntax for closures was changed. The current status is that a closure with an explicit `!` return type will trigger the `unreachable_code` lint which appears to be the original intent of the test (https://github.com/rust-lang/rust/pull/16836). A closure without a return type won't trigger the lint since the `!` type isn't inferred (AFAIK). This restores the test to its original form.
2023-04-15 14:43:20 -07:00
let x = || -> ! { panic!() };
Add some tests for closures that return `!`
2014-08-30 20:37:11 +12:00
x();
Update dead-code-closure-bang This stdlib function went away, so update it to use current syntax.
2015-06-12 14:15:57 -04:00
println!("Foo bar"); //~ ERROR: unreachable statement
Add some tests for closures that return `!`
2014-08-30 20:37:11 +12:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 4377ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API