Skip to content

Extraneous "parameter never used" error #35075

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

Closed
alexcrichton opened this issue Jul 27, 2016 · 0 comments
Closed

Extraneous "parameter never used" error #35075

alexcrichton opened this issue Jul 27, 2016 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@alexcrichton
Copy link
Member

When compiling this code:

struct Foo<T> {      
    inner: Bar<T>,   
}                    

the compiler emits:

error[E0412]: type name `Bar` is undefined or not in scope                                                          
 --> foo.rs:2:12                                                                                                    
  |                                                                                                                 
2 |     inner: Bar<T>,                                                                                              
  |            ^^^^^^ undefined or not in scope                                                                     
  |                                                                                                                 
  = help: no candidates by the name of `Bar` found in your project; maybe you misspelled the name or forgot to import an external crate?                                                                                                

error: main function not found                                                                                      

error[E0392]: parameter `T` is never used                                                                           
 --> foo.rs:1:12                                                                                                    
  |                                                                                                                 
1 | struct Foo<T> {                                                                                                 
  |            ^                                                                                                    
  |                                                                                                                 
  = help: consider removing `T` or using a marker such as `std::marker::PhantomData`                                

error: aborting due to previous error                                                                               

The second error here isn't actually relevant and should be turned off because the first error was emitted.

cc @nrc
cc @jonathandturner

@alexcrichton alexcrichton added the A-diagnostics Area: Messages for errors, warnings, and lints label Jul 27, 2016
bors added a commit that referenced this issue Aug 1, 2016
Suppress unused type parameter error when type has error field

Fix #35075.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

1 participant