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

Fix staticlib outputs linking to blank archives #12379

Merged
merged 1 commit into from
Feb 19, 2014

Conversation

alexcrichton
Copy link
Member

When creating a staticlib, it unzips all static archives it finds and then
inserts the files manually into the output file. This process is done through
ar, and ar doesn't like if you specify you want to add files and you don't
give it any files.

This case arose whenever you linked to an archive that didn't have any contents
or all of the contents were filtered out. This just involved ignoring the case
where the number of inputs we have is 0, because we don't have any files to add
anyway.

When creating a staticlib, it unzips all static archives it finds and then
inserts the files manually into the output file. This process is done through
`ar`, and `ar` doesn't like if you specify you want to add files and you don't
give it any files.

This case arose whenever you linked to an archive that didn't have any contents
or all of the contents were filtered out. This just involved ignoring the case
where the number of inputs we have is 0, because we don't have any files to add
anyway.
bors added a commit that referenced this pull request Feb 19, 2014
When creating a staticlib, it unzips all static archives it finds and then
inserts the files manually into the output file. This process is done through
`ar`, and `ar` doesn't like if you specify you want to add files and you don't
give it any files.

This case arose whenever you linked to an archive that didn't have any contents
or all of the contents were filtered out. This just involved ignoring the case
where the number of inputs we have is 0, because we don't have any files to add
anyway.
@bors bors closed this Feb 19, 2014
@bors bors merged commit 2eacc72 into rust-lang:master Feb 19, 2014
@alexcrichton alexcrichton deleted the fix-ar-thing branch February 20, 2014 07:27
flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 7, 2024
…-of-core, r=Alexendoo

Dedup std_instead_of_core by using first segment span for uniqueness

Relates to rust-lang#12379.

Instead of checking that the paths have an identical span, it checks that the relevant `std` part of the path segment's span is identical. Added a multiline test, because my first implementation was worse and failed that, then I realized that you could grab the span off the first_segment `Ident`.

I did find another bug that isn't addressed by this, and that exists on master as well.

The path:
```Rust
use std::{io::Write, fmt::Display};
```

Will get fixed into:
```Rust
use core::{io::Write, fmt::Display};
```

Which doesn't compile since `io::Write` isn't in `core`, if any of those paths are present in `core` it'll do the replace and cause a miscompilation. Do you think I should file a separate bug for that? Since `rustfmt` default splits those up it isn't that big of a deal.

Rustfmt:
```Rust
// Pre
use std::{io::Write, fmt::Display};
// Post
use std::fmt::Display;
use std::io::Write;
```
---

changelog: [`std_instead_of_core`]: Fix duplicated output on multiple imports
flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 7, 2024
…ors, r=Alexendoo

[`identity_op`]: Fix duplicate diagnostics

Relates to rust-lang#12379

In the `identity_op` lint, the following diagnostic was emitted two times

```
  --> tests/ui/identity_op.rs:156:5
   |
LL |     1 * 1;
   |     ^^^^^ help: consider reducing it to: `1`
   |
```

because both of the left operand and the right operand are the identity element of the multiplication.

This PR fixes the issue so that if a diagnostic is created for an operand, the check of the other operand will be skipped. It's fine because the result is always the same in the affected operators.

---

changelog: [`identity_op`]: Fix duplicate diagnostics
flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 7, 2024
[`misrefactored_assign_op`]: Fix duplicate diagnostics

Relate to rust-lang#12379

The following diagnostics appear twice
```
  --> tests/ui/assign_ops2.rs:26:5
   |
LL |     a *= a * a;
   |     ^^^^^^^^^^
   |
help: did you mean `a = a * a` or `a = a * a * a`? Consider replacing it with
```

because `a` (lhs) appears in both left operand and right operand in the right hand side.
This PR fixes the issue so that if a diagnostic is created for an operand, the check of the other operand will be skipped. It's fine because the result is always the same in the affected operators.

changelog: [`misrefactored_assign_op`]: Fix duplicate diagnostics
flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 7, 2024
…blyxyas

Remove double expr lint

Related to rust-lang#12379.

Previously the code manually checked nested binop exprs in unary exprs, but those were caught anyway by `check_expr`. Removed that code path, the path is used in the tests.

---

changelog: [`nonminimal_bool`] Remove duplicate output on nested Binops in Unary exprs.
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2024
…gs, r=Alexendoo

[`no_effect_replace`]: Fix duplicate diagnostics

Relates to rust-lang#12379

Fixes `no_effect_replace` duplicate diagnostics

---

changelog: [`no_effect_replace`]: Fix duplicate diagnostics
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2024
…r=y21

[`mut_mut`]: Fix duplicate diags

Relates to rust-lang#12379

The `mut_mut` lint produced two diagnostics for each `mut mut` pattern in `ty` inside  `block`s because `MutVisitor::visit_ty` was called from `MutMut::check_ty` and  `MutMut::check_block` independently. This PR fixes the issue.

---

changelog: [`mut_mut`]: Fix duplicate diagnostics
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2024
[`single_match`]: Fix duplicate diagnostics

Relates to rust-lang#12379

edit two test file
`tests/ui/single_match_else.rs`
`tests/ui/single_match.rs`

those two test file point to the same lint

---

changelog: [`single_match`] Fix duplicate diagnostics
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2024
[`manual_retain`]: Fix duplicate diagnostics

Relates to: rust-lang#12379

The first lint guard executed in `LateLintPass::check_expr` was testing if the parent was of type `ExprKind::Assign`.  This meant the lint emitted on both sides of the assignment operator when `check_expr` is called on either `Expr`.  The guard in the fix only lints once when the `Expr` is of kind `Assign`.

changelog:  Fix duplicate lint diagnostic emission from [`manual_retain`]
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2024
…=dswij

[`else_if_without_else`]: Fix duplicate diagnostics

Relates to: rust-lang#12379

changelog:  Fix duplicate lint diagnostic emission from [`else_if_without_else`]
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2024
…r=llogiq

[`option_option`]: Fix duplicate diagnostics

Relates to rust-lang#12379

This `option_option` lint change skips checks against `ty`s inside `field_def`s defined by external macro to prevent duplicate diagnostics to the same span `ty` by multiple `Struct` definitions.

---

changelog: [`option_option`]: Fix duplicate diagnostics
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 2, 2024
…licate_errors, r=xFrednet

[`type_complexity`]: Fix duplicate errors

Relates to rust-lang#12379

Following message was duplicated:
```
LL |     fn def_method(&self, p: Vec<Vec<Box<(u32, u32, u32, u32)>>>) {}
   |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: very complex type used. Consider factoring parts into `type` definitions
  --> tests/ui/type_complexity.rs:55:15
```

Methods `check_trait_item` and `check_fn` were both checking method named def_method.
Now `check_trait_item` only checks methods without body.

---
changelog: [`type_complexity`]: Fix duplicate diagnostics
bors added a commit to rust-lang-ci/rust that referenced this pull request May 30, 2024
… r=Alexendoo

[`many_single_char_names`]: Deduplicate diagnostics

Relates to rust-lang#12379

Fix `many_single_char_names` lint so that it doesn't emit diagnostics when the current level of the scope doesn't contain any single character name.

```rust
let (a, b, c, d): (i32, i32, i32, i32);
match 1 {
  1 => (),
  e => {},
}
```
produced the exact same MANY_SINGLE_CHAR_NAMES diagnostic at each of the Arm `e => {}` and the Block `{}`.

---

changelog: [`many_single_char_names`]: Fix duplicate diagnostics
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 13, 2024
…archo

Dedup nonminimal_bool_methods diags

Relates to rust-lang#12379

Fix `nonminimal_bool` lint so that it doesn't check the same span multiple times.

`NotSimplificationVisitor` was called for each expression from `NonminimalBoolVisitor` whereas `NotSimplificationVisitor` also recursively checked all expressions.

---

changelog: [`nonminimal_bool`]: Fix duplicate diagnostics
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