Skip to content

Add a rustdoc test #11032

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

Merged
merged 2 commits into from
Dec 19, 2013
Merged

Add a rustdoc test #11032

merged 2 commits into from
Dec 19, 2013

Conversation

emberian
Copy link
Member

This is just a smoke test which verifies that the expected files are
generated.

@@ -678,7 +678,13 @@ impl Context {
// using a rwarc makes this parallelizable in the future
local_data::set(cache_key, Arc::new(cache));

self.item(item);
let mut work = ~[(self.clone(), item)];
Copy link
Member

Choose a reason for hiding this comment

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

No need to clone initially, this could just be ~[(self, item)]

This is just a smoke test which verifies that the expected files are
generated. Also makes the rmake tests have the right deps.
bors added a commit that referenced this pull request Dec 18, 2013
This is just a smoke test which verifies that the expected files are
generated.
@bors bors closed this Dec 19, 2013
@bors bors merged commit 21bec4f into rust-lang:master Dec 19, 2013
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2024
…, r=Jarcho

lint when calling the blanket `Into` impl from a `From` impl

Closes rust-lang#11150
```
warning: function cannot return without recursing
  --> x.rs:9:9
   |
9  | /         fn from(value: f32) -> Self {
10 | |             value.into()
11 | |         }
   | |_________^
   |
note: recursive call site
  --> x.rs:10:13
   |
10 |             value.into()
   |             ^^^^^^^^^^^^
```

I'm also thinking that we can probably generalize this lint to rust-lang#11032 at some point (instead of hardcoding a bunch of impls), like how rustc's `unconditional_recursion` works, at least up to one indirect call, but this still seems useful for now :)

I've also noticed that we use `fn_def_id` in a bunch of lints and then try to get the node args of the call in a separate step, so I made a helper function that does both in one. I intend to refactor a bunch of uses of `fn_def_id` to use this later

I can add more test cases, but this is already using much of the same logic that exists for the other impls that this lint looks for (e.g. making sure that there are no conditional returns).

changelog: [`unconditional_recursion`]: emit a warning inside of `From::from` when unconditionally calling the blanket `.into()` impl
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.

3 participants