summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/cargo/manifest.py3
-rw-r--r--unittests/cargotests.py2
2 files changed, 1 insertions, 4 deletions
diff --git a/mesonbuild/cargo/manifest.py b/mesonbuild/cargo/manifest.py
index b7862be20..5440437c1 100644
--- a/mesonbuild/cargo/manifest.py
+++ b/mesonbuild/cargo/manifest.py
@@ -346,14 +346,13 @@ class Library(BuildTarget):
"""Representation of a Cargo Library Entry."""
- proc_macro: bool = False
-
@classmethod
def from_raw(cls, raw: raw.LibTarget, pkg: Package) -> Self:
name = raw.get('name', fixup_meson_varname(pkg.name))
# If proc_macro is True, it takes precedence and sets crate_type to proc-macro
proc_macro = raw.get('proc-macro', False)
return _raw_to_dataclass(raw, cls, f'Library entry {name}',
+ ignored_fields=['proc-macro'],
name=DefaultValue(name),
path=DefaultValue('src/lib.rs'),
edition=DefaultValue(pkg.edition),
diff --git a/unittests/cargotests.py b/unittests/cargotests.py
index e9e779c1e..3dd809dca 100644
--- a/unittests/cargotests.py
+++ b/unittests/cargotests.py
@@ -429,7 +429,6 @@ class CargoTomlTest(unittest.TestCase):
self.assertEqual(manifest.lib.name, 'bits')
self.assertEqual(manifest.lib.crate_type, ['proc-macro'])
self.assertEqual(manifest.lib.path, 'src/lib.rs')
- self.assertEqual(manifest.lib.proc_macro, True)
def test_cargo_toml_targets(self) -> None:
with tempfile.TemporaryDirectory() as tmpdir:
@@ -450,7 +449,6 @@ class CargoTomlTest(unittest.TestCase):
self.assertEqual(manifest.lib.edition, '2021')
self.assertEqual(manifest.lib.required_features, [])
self.assertEqual(manifest.lib.plugin, False)
- self.assertEqual(manifest.lib.proc_macro, False)
self.assertEqual(len(manifest.test), 1)
self.assertEqual(manifest.test[0].name, 'check_gir')