Skip to content
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

cargo example1 page 11 #10272

Closed
lsatenstein opened this issue Jan 7, 2022 · 8 comments
Closed

cargo example1 page 11 #10272

lsatenstein opened this issue Jan 7, 2022 · 8 comments
Labels
C-bug Category: bug

Comments

@lsatenstein
Copy link

Problem

First example that is supposed to compile cleanly

$ git clone https://github.com/rust-lang/regex.git
$ cd regex

$ cargo build
Compiling regex v1.5.0 (file:///path/to/package/regex)

leslie@Fed35 ~$ cd regex/
leslie@Fed35 regex$ cargo build
GOT
Updating crates.io index
Compiling memchr v2.4.1
Compiling regex-syntax v0.6.25 (/home/leslie/regex/regex-syntax)
Compiling aho-corasick v0.7.18
warning: field is never read: printer
--> regex-syntax/src/ast/print.rs:66:5
|
66 | printer: &'p mut Printer,
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(dead_code)] on by default

warning: field is never read: printer
--> regex-syntax/src/hir/print.rs:74:5
|
74 | printer: &'p mut Printer,
| ^^^^^^^^^^^^^^^^^^^^^^^^

Compiling regex v1.5.4 (/home/leslie/regex)
warning: regex-syntax (lib) generated 2 warnings
Finished dev [unoptimized + debuginfo] target(s) in 5.10s

Steps

refer to listing

Possible Solution(s)

Please correct syntax errors so cloned example compiles cleanly

Notes

No response

Version

cargo --version
cargo 1.57.0 (b2e52d7ca 2021-10-21)
@lsatenstein lsatenstein added the C-bug Category: bug label Jan 7, 2022
@Eh2406
Copy link
Contributor

Eh2406 commented Jan 8, 2022

What research have you done? Why do you think this is a problem with cargo as opposed to a problem with regex?

@lsatenstein
Copy link
Author

lsatenstein commented Jan 10, 2022 via email

@Eh2406
Copy link
Contributor

Eh2406 commented Jan 11, 2022

Welcome to the community! I'm sorry you're having trouble.

Which guide were you following?

@lsatenstein
Copy link
Author

lsatenstein commented Jan 11, 2022 via email

@Eh2406
Copy link
Contributor

Eh2406 commented Jan 11, 2022

by "the book" do you mean "The Rust Programming Language"? If so I don't have a print copy of the current edition so do not know what is on page 11.

Step 1 .. Step2 ... step3

I am guessing you are referring to https://doc.rust-lang.org/book/ch01-03-hello-cargo.html but that no where mentions regex.

If you are having a problem with the book it is maintained at https://github.com/rust-lang/book
If you are having a problem with the regex it is maintained at https://github.com/rust-lang/regex

Cargo is a package manager, we can not be responsible for keeping all rust code working even when the code is build with Cargo.

@ehuss
Copy link
Contributor

ehuss commented Jan 11, 2022

@Eh2406 I think they are referring to https://doc.rust-lang.org/cargo/guide/working-on-an-existing-project.html

@lsatenstein Thanks for opening this issue! I think it is not unusual for projects to start to have warnings with newer versions of the compiler. I believe this particular issue was introduced by rust-lang/rust#85200. Indeed those fields appear to be unused. I don't have time to try to develop a PR to fix it, but if you want to write an issue at https://github.com/rust-lang/regex, that would be helpful. Or, if you are feeling adventurous, you can work on a PR to fix the warnings.

I'm going to close, as I think the example in the documentation is fine. Real-world projects will have warnings like this, and I don't think it is anything to be particularly concerned about.

I'm going to close as this is more of an issue with the regex project.

@ehuss ehuss closed this as completed Jan 11, 2022
@lsatenstein
Copy link
Author

Thank you all for the prompt response. I am doing my frst pass through Rustland. On the second pass, I will do the deep learning and on the third pass, I will write some code that I will share.

Again thank you!!
Leslie

@lsatenstein
Copy link
Author

If you are wondering why 3 passes to learn, it comes from my teaching / learning experience.
First step I am going to tell you what I am going to tell you, And I peruse the manuals and youtube videos.
2nd step I am telling you what I said I would tell you in more detail. Do you remember the contents from step 1?
3rd step This is what I told you, now go out into Rustland and make use of your learned knowledge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants