-
Notifications
You must be signed in to change notification settings - Fork 382
Closed
Description
Hi, I encountered this after upgrading the cxxbridge-cmd to 0.5.6:
// lib.rs
#[cxx::bridge(namespace = rust_part)]
mod ffi {
extern "C++" {
type Person;
fn get_name(person: &Person) -> &CxxString;
}
}
Run cxxbridge:
cxxbridge lib.rs --header
cxxbridge lib.rs
And get the header:
#pragma once
#include <string>
namespace rust_part {
using Person = ::rust_part::Person;
}
and source:
#include <string>
namespace rust_part {
using Person = ::rust_part::Person;
}
namespace rust_part {
extern "C" {
const ::std::string *rust_part$cxxbridge05$get_name(const ::rust_part::Person &person) noexcept {
const ::std::string &(*get_name$)(const ::rust_part::Person &) = ::rust_part::get_name;
return &get_name$(person);
}
} // extern "C"
} // namespace rust_part
I suppose the Person
should not be in rust_part
namespace, in fact (at least) in 0.5.2 it yields the following code and compiles for me.
#pragma once
#include <string>
namespace rust_part {
using Person = Person;
} // namespace rust_part
Am I missing something? This also relates to the problem discussed #434
Metadata
Metadata
Assignees
Labels
No labels