Merge pull request #454 from dtolnay/externcxx

Enforce use of extern "C++" as the ABI string
This commit is contained in:
David Tolnay 2020-11-11 11:33:37 -08:00 committed by GitHub
commit 1126426ab7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -285,9 +285,9 @@ fn parse_lang(abi: &Abi) -> Result<Lang> {
}
};
match name.value().as_str() {
"C" | "C++" => Ok(Lang::Cxx),
"C++" => Ok(Lang::Cxx),
"Rust" => Ok(Lang::Rust),
_ => Err(Error::new_spanned(abi, "unrecognized ABI")),
_ => Err(Error::new_spanned(abi, "unrecognized ABI, requires either \"C++\" or \"Rust\"")),
}
}

View File

@ -4,7 +4,7 @@ error: struct with generic parameters is not supported yet
3 | struct Monad<T>;
| ^^^^^^^^^^^^^^^
error: unrecognized ABI
error: unrecognized ABI, requires either "C++" or "Rust"
--> $DIR/multiple_parse_error.rs:5:5
|
5 | extern "Haskell" {}