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

Crate metadata matching should consider a target architecture #10814

Closed
alexcrichton opened this issue Dec 5, 2013 · 2 comments
Closed

Crate metadata matching should consider a target architecture #10814

alexcrichton opened this issue Dec 5, 2013 · 2 comments
Labels
A-metadata Area: Crate metadata E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@alexcrichton
Copy link
Member

Let's say you have a compiler for both 32-bit linux and 64-bit linux targets. You compile a library which links against the 32-bit libstd, but you then compile a 64-bit library which links against the 32-bit library you generated. This generates a mismatch between the 32-bit libstd and the 64-bit libstd metadata which you're looking at.

Right now rustc dies horribly about an unknown node ID, but it would be much more graceful if rustc inserted the target architecture into the metadata of the crate attributes and then matched against it as well.

@huonw
Copy link
Member

huonw commented Nov 10, 2014

Do you know how one might drive rustc to do the "compile a 64-bit library which links against the 32-bit library you generated" step?

(triage.)

@huonw
Copy link
Member

huonw commented Nov 10, 2014

Ah, I'm just silly; it's simple:

// lib10814.rs
#![no_std]
#![crate_type = "lib"]
extern crate lib10814;
$ rustc lib10814.rs --target=i686-unknown-linux-gnu
$ rustc 10814.rs -L .
10814.rs:1:1: 1:23 error: found incorrect triple for crate `lib10814`
10814.rs:1 extern crate lib10814;
           ^~~~~~~~~~~~~~~~~~~~~~
10814.rs:1:1: 1:23 note: expected triple of x86_64-unknown-linux-gnu
10814.rs:1 extern crate lib10814;
           ^~~~~~~~~~~~~~~~~~~~~~
10814.rs:1:23: 1:23 note: crate `lib10814` path #1, triple i686-unknown-linux-gnu: .../triage/liblib10814.rlib
error: aborting due to previous error

So this bug is fixed, I'm adding a test now.

@alexcrichton alexcrichton added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Nov 10, 2014
@huonw huonw closed this as completed in ceff2ca Nov 14, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
new lint: `explicit_into_iter_fn_arg`

Closes rust-lang#10743.
This adds a lint that looks for `.into_iter()` calls in a call expression to a function that already expects an `IntoIterator`. In those cases, explicitly calling `.into_iter()` is unnecessary.
There were a few instances of this in clippy itself so I fixed those as well in this PR.

changelog: new lint [`explicit_into_iter_fn_arg`]
flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 17, 2023
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes rust-lang#11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes rust-lang/rust-clippy#11065 (comment)).
It *also* makes sure that the expression is not part of a macro call (fixes rust-lang/rust-clippy#11065 (comment)). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed rust-lang#10814, which introduced these issues)
flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 17, 2023
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes rust-lang#11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes rust-lang/rust-clippy#11065 (comment)).
It *also* makes sure that the expression is not part of a macro call (fixes rust-lang/rust-clippy#11065 (comment)). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed rust-lang#10814, which introduced these issues)
flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 24, 2023
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes rust-lang#11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes rust-lang/rust-clippy#11065 (comment)).
It *also* makes sure that the expression is not part of a macro call (fixes rust-lang/rust-clippy#11065 (comment)). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed rust-lang#10814, which introduced these issues)
flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 24, 2023
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes rust-lang#11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes rust-lang/rust-clippy#11065 (comment)).
It *also* makes sure that the expression is not part of a macro call (fixes rust-lang/rust-clippy#11065 (comment)). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed rust-lang#10814, which introduced these issues)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metadata Area: Crate metadata E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

No branches or pull requests

2 participants