-
Notifications
You must be signed in to change notification settings - Fork 13.4k
regression: error[E0277]: the trait bound Entity: AdapterExt
is not satisfied
#142424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I am unable to reproduce this error on my computer. The code in this crate is doing something extremely weird with macros, and I suspect that the error is nondeterministic. The relevant code is: #[derive(LeanBufferWrite)]
pub struct Entity {
x: String,
y: i64,
}
include!(concat!(env!("OUT_DIR"), "/Entity_lb_gen.rs")); The My guess for the cause of the error is: for some reason, the I am unfortunately unable to verify if this guess is correct. @rustbot labels +A-macros +A-proc-macros |
I think I have verified the above guess. I created a workspace containing the following: build.rs // Do nothing. This exists so OUT_DIR is set.
fn main() {} src/lib.rs: #![allow(dead_code)]
#[derive(bar::MyDerive)]
struct Thing;
include!(concat!(env!("OUT_DIR"), "/data"));
#[test]
fn wut() {
println!("{}", X);
} bar/src/lib.rs use std::{env, fs, path::PathBuf};
use proc_macro::TokenStream;
#[proc_macro_derive(MyDerive)]
pub fn my_derive(_: TokenStream) -> TokenStream {
let out_dir = env::var_os("OUT_DIR").unwrap();
let out_file = PathBuf::from(out_dir).join("data");
let contents = "\n".repeat(1000000) + "const X: i32 = 1;";
fs::write(out_file, contents).unwrap();
TokenStream::new()
} Zipped code of all the files for your convenience: repro.zip I then repeatedly compiled the code with the following command: while true; do cargo clean && cargo +beta test --no-run || break; done If you leave that running for a while, it will eventually produce an error with "cannot find value The same behavior also occurs when compiling with stable rust instead of beta. I conclude that the error found by crater isn't a regression. It is actually a nondeterministic error that rarely occurs. |
incredible |
It still kinda bugs me that I can't reliably reproduce this with a |
The text was updated successfully, but these errors were encountered: