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

Add a default value for the 'package_id' meta attribute for library crates #10368

Merged
merged 5 commits into from
Nov 9, 2013
Merged

Add a default value for the 'package_id' meta attribute for library crates #10368

merged 5 commits into from
Nov 9, 2013

Conversation

tautologico
Copy link
Contributor

This Fixes #10265 and paves the way for fixing #9543. It works by adding a 'package_id' attribute by default for library crates that don't specify it. This is necessary to use the 'extern mod foo = "bar"' form instead of 'extern mod foo(name="bar") (as per #9543), because the former adds a required package_id when trying to link with the bar crate. I added a simple test to ensure that the default package_id value is being generated, and also added an explicit package_id in the link attribute in all rust libs to avoid getting warnings about default package_id values when building rust.

bors added a commit that referenced this pull request Nov 9, 2013
This Fixes #10265 and paves the way for fixing #9543. It works by adding a 'package_id' attribute by default for library crates that don't specify it. This is necessary to use the 'extern mod foo = "bar"' form instead of 'extern mod foo(name="bar") (as per #9543), because the former adds a required package_id when trying to link with the bar crate. I added a simple test to ensure that the default package_id value is being generated, and also added an explicit package_id in the link attribute in all rust libs to avoid getting warnings about default package_id values when building rust.
@bors bors closed this Nov 9, 2013
@bors bors merged commit ca22e94 into rust-lang:master Nov 9, 2013
@tautologico tautologico deleted the default_pkgid branch November 18, 2013 15:21
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Feb 26, 2023
[significant_drop_tightening] Evaluate the return expression of a block

For whatever reason, the return expression of a block is not contained inside the slice of statements and because of that the lint wasn't evaluating things that could potentially block the release of a lock.

```rust
pub fn example() -> i32 {
    let mutex = Mutex::new(1);
    let lock = mutex.lock().unwrap();
    let _ = *lock;
    let _ = *lock;
   do_heavy_computation_that_takes_time_and_returns_i32()
}
```

---

changelog: none
<!-- changelog_checked -->
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.

'extern mod foo(name = "bar")' is not equivalent to 'extern mod foo = "bar"'
2 participants