Why are rust executable binaries obtained at different times different in the same compiler environment(linux system)

The main.rs

use actix_web::{web, App, Responder, HttpServer};

async fn index() -> impl Responder {
    "Hello world!"

async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
            web::scope("/app").route("/index.html", web::get().to(index)),


name = "test1"
version = "0.1.0"
authors = [""]
edition = "2018"

actix-web = {version = "=2.0.0", features=["rust-tls"] }
actix-rt = "=1.0.0"

The place that causes the binary executable file to be different may be the following code:


impl<F, Io> InternalServiceFactory for StreamNewService<F, Io>
    F: ServiceFactory<Io>,
    Io: FromStream + Send + 'static,
    fn name(&self, _: Token) -> &str {

    fn clone_factory(&self) -> Box<dyn InternalServiceFactory> {
        Box::new(Self {
            name: self.name.clone(),
            inner: self.inner.clone(),
            token: self.token,
            addr: self.addr,
            _t: PhantomData,

    fn create(&self) -> LocalBoxFuture<'static, Result<Vec<(Token, BoxedServerService)>, ()>> {
        let token = self.token;
            .map_err(|_| ())
            .map_ok(move |inner| {
                let service: BoxedServerService = Box::new(StreamService::new(inner));
                vec![(token, service)]

This line let service: BoxedServerService = Box::new(StreamService::new(inner));,when i remove it,i got same binary executable file at the different time.

What do you mean by "got same file at different time"?

Complier the code twice,and compare the first executable file and second file by the "Beyond Compare",there has a difference.When i remove the line let service: BoxedServerService = Box::new(StreamService::new(inner));,the two executable file has no difference.

it's because Rust hasn't reproductible build yet. it's WIP though, needed for security audit and embedded (on phone so no link, sorry :))

Known bug:


1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.