Skip to content

Visitor pattern example doesn't compile. #481

Description

@DzikaMandarynka

Trying to compile Visitor pattern example on the current rust version returns an following error

error[E0432]: unresolved import `ast`
  --> src/main.rs:21:9
   |
21 |     use ast::*;
   |         ^^^
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>
help: a similar path exists
   |
21 |     use crate::ast::*;
   |         +++++++

warning: unused variable: `n`
  --> src/main.rs:36:30
   |
36 |     fn visit_name(&mut self, n: &Name) -> i64 {
   |                              ^ help: if this is intentional, prefix it with an underscore: `_n`
   |
   = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

For more information about this error, try `rustc --explain E0432`.

It also produces a warning about a unused variable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions