dtolnay/cxx

Smarter handling of illegal names

オープン

#110 opened on 2020/04/12

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (253 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (4,472 個のスター)
PR merge metrics
 (平均マージ 8m) (30d で 3 merged PRs)

説明

We should sanitize where possible (function argument names) and produce diagnostics otherwise (function names, type names, field names).

mod ffi {
    extern "C" {
        // sanitize the variable name somehow instead of emitting invalid C++
        fn f(operator: usize);
    }

    extern "Rust" {
        // reject; ask the user to reimport the Rust fn under a different name
        fn operator();
    }
}

Currently the above all emit invalid C++ code, which is not nice.

コントリビューターガイド