-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
In Issue #48227 I've seen code compiled with "-C passes=lint", I've used it on some of my code and I've found few problems, reduced below:
fn foo(_: &u32, _: &u32) {}
fn main() {
let a = 0;
foo(&a, &a);
}
...>rustc -C passes=lint test1.rs
Unusual: noalias argument aliases another argument
call void @_ZN4bug13foo17h2a852a9d6b40f8a0E(i32* noalias readonly dereferenceable(4) %1, i32* noalias readonly dereferenceable(4) %1)
fn main() {
(1 .. 9).take_while(|i| i * i <= 10).any(|_| true);
}
...>rustc -C passes=lint test2.rs
Unusual: noalias argument aliases another argument
%3 = call i32 @"_ZN86_$LT$$RF$$u27$b$u20$i32$u20$as$u20$core..ops..arith..Mul$LT$$RF$$u27$a$u20$i32$GT$$GT$3mul17hdb3638dfdb52b819E"(i32* noalias readonly dereferenceab
le(4) %1, i32* noalias readonly dereferenceable(4) %1)
fn main() {
(1 .. 9).filter(|_| true).sum::<u32>();
}
...>rustc -C passes=lint test3.rs
Unusual: Return statement in function with noreturn attribute
ret void
matthiaskrgr and scottmcm
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.