bazelbuild / bazelbuild/rules_rust

error[E0599]: no method named `compute_size` found for reference `&Config` in the current scope

Open
#2,113 1 comment 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

rule_rust 0.26.0

https://github.com/bazelbuild/rules_rust/blob/0.26.0/examples/proto/basic/lib.rs

```txt
diff --git a/examples/proto/basic/lib.rs b/examples/proto/basic/lib.rs
index 2146b3c4..fa18d3ea 100644
--- a/examples/proto/basic/lib.rs
+++ b/examples/proto/basic/lib.rs
@@ -1,5 +1,6 @@
extern crate common_proto_rust;

pub fn do_something(_x: &common_proto_rust::Config) -> bool {
+ println!("compute_size[{}]", _x.compute_size());
true
}
```
when I run:
```bash
bazel run //proto/basic:common_bin
```

The following error occurred:
```txt
Compiling Rust rlib common_lib (1 files) failed: (Exit 1): process_wrapper failed: error executing command (from target //proto/basic:common_lib) bazel-out/k8-opt-exec-2B5CBBC6/bin/external/rules_rust/util/process_wrapper/process_wrapper --arg-file ... (remaining 30 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
error[E0599]: no method named `compute_size` found for reference `&Config` in the current scope
--> proto/basic/lib.rs:4:37
|
4 | println!("compute_size[{}]", _x.compute_size());
| ^^^^^^^^^^^^ method not found in `&Config`
|
= help: items from traits can only be used if the trait is in scope
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.