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

error on any invalid target combination #117

Merged
merged 1 commit into from
Oct 2, 2019

Conversation

hazelutf8
Copy link
Contributor

@hazelutf8 hazelutf8 commented Oct 2, 2019

Only allow exactly one target "feature" to be set at any time, as discussed in #112 and discord.
Otherwise a compile-time error message will be given.

Is the "greater than one target specified" case useful to error on as well?
The "zero target specified" case has a confusing message about missing imports and methods, but the compiler has a message which might already be close enough.

error[E0252]: the name `pac` is defined multiple times
   --> src\lib.rs:104:9
    |
101 | pub use stm32f1::stm32f100 as pac;
    |         ------------------------- previous import of the module `pac` here
...
104 | pub use stm32f1::stm32f101 as pac;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ `pac` reimported here
    |
    = note: `pac` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
    |
104 | pub use stm32f1::stm32f101 as other_pac;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

Is only the first "zero targets specified" error message wanted?
Feedback is welcome.

Copy link
Member

@therealprof therealprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as it, thanks!

@therealprof therealprof merged commit dfa2eba into stm32-rs:master Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants