Skip to content

Only look for main at the crate level - #6119

Closed
brson wants to merge 3 commits into
rust-lang:incomingfrom
brson:main
Closed

brson wants to merge 3 commits into
rust-lang:incomingfrom
brson:main

Conversation

@brson

@brson brson commented Apr 30, 2013

Copy link
Copy Markdown
Contributor

r? @ILyoan

This pulls all the logic for discovering the crate entry point into a new pass (out of resolve and typeck), then changes it so that main is only looked for at the crate level (#[main] can still be used anywhere).

I don't understand the special android logic here and worry that I may have broken it.

brson added 2 commits April 29, 2013 14:56
It doesn't have anything to do with resolve and the logic will likely get
more involved in the future, after rust-lang#4433
@brson

brson commented May 7, 2013

Copy link
Copy Markdown
Contributor Author

OK, @ILyoan I think this is fixed for Android. Can you re-review?

@ILyoan

ILyoan commented May 8, 2013

Copy link
Copy Markdown
Contributor

@brson Thank you! This is looking good to me
@yichoi Could you take a look to confirm this?

@yichoi

yichoi commented May 8, 2013

Copy link
Copy Markdown
Contributor

@ILyoan +1

@ILyoan

ILyoan commented May 8, 2013

Copy link
Copy Markdown
Contributor

Failed on two compile-fail test cases.

  • src/test/compile-fail/tag-variant-disr-dup.rs
  • src/test/compile-fail/issue-2995.rs

expecting other error messages, but got 'main function not found'

otherwise it's good.

I don't understand what this logic is doing
@brson

brson commented May 8, 2013

Copy link
Copy Markdown
Contributor Author

Thanks for the help @ILyoan and @yichoi

bors added a commit that referenced this pull request May 8, 2013
r? @ILyoan

This pulls all the logic for discovering the crate entry point into a new pass (out of resolve and typeck), then changes it so that main is only looked for at the crate level (`#[main]` can still be used anywhere).

I don't understand the special android logic here and worry that I may have broken it.
@bors bors closed this May 8, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 20, 2020
Add a case to `lint_search_is_some` to handle searching strings

Fixes: rust-lang#6010

This adds a lint which recommends using `contains()` instead of `find()` followed by `is_some()` on strings as suggested in rust-lang#6010.

This was added as an additional case to
https://github.com/rust-lang/rust-clippy/blob/5af88e3c2d8cc4fb74a0e455381669930ee3a31a/clippy_lints/src/methods/mod.rs#L3037

I would really appreciate any comments/suggestions for my code!

changelog: Added case to `lint_search_is_some` to handle searching strings
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.

4 participants