Document some safety constraints and use more safe wrappers by oli-obk · Pull Request #135549 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation10 Commits3 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Lots of unsafe codegen_llvm code has safe wrappers already, so I used some of them and added some where applicable. I stopped here because this diff is large enough and should probably be reviewed independently of other changes.
r? @cjgillot
rustbot has assigned @cjgillot.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r?
to explicitly pick a reviewer
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
This comment has been minimized.
📌 Commit 0a8da9b has been approved by compiler-errors
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…ler-errors
Document some safety constraints and use more safe wrappers
Lots of unsafe codegen_llvm code has safe wrappers already, so I used some of them and added some where applicable. I stopped here because this diff is large enough and should probably be reviewed independently of other changes.
bors added a commit to rust-lang-ci/rust that referenced this pull request
bors added S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels
Comment on lines 1102 to 1095
llvm::get_linkage(val) == llvm::Linkage::ExternalLinkage |
---|
&& llvm::LLVMIsDeclaration(val) == 0 |
}) |
.filter_map(|val |
// Exclude some symbols that we know are not Rust symbols. |
let name = llvm::get_value_name(val); |
if ignored(name) { None } else { Some((val, name)) } |
}) |
.map(move |(val, name) |
let mut imp_name = prefix.as_bytes().to_vec(); |
imp_name.extend(name); |
let imp_name = CString::new(imp_name).unwrap(); |
(imp_name, val) |
}) |
.collect::<Vec<_>>(); |
let ptr_ty = Type::ptr_llcx(llcx); |
let globals = base::iter_globals(llmod) |
.filter(|&val |
llvm::get_linkage(val) == llvm::Linkage::ExternalLinkage && llvm::is_declaration(val) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops 🙈
📌 Commit dcf1e4d has been approved by compiler-errors
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
fmease added a commit to fmease/rust that referenced this pull request
…ler-errors
Document some safety constraints and use more safe wrappers
Lots of unsafe codegen_llvm code has safe wrappers already, so I used some of them and added some where applicable. I stopped here because this diff is large enough and should probably be reviewed independently of other changes.
bors added a commit to rust-lang-ci/rust that referenced this pull request
Rollup of 7 pull requests
Successful merges:
- rust-lang#134090 (Stabilize target_feature_11)
- rust-lang#134999 (Add cygwin target.)
- rust-lang#135025 (Cast allocas to default address space)
- rust-lang#135408 (x86: make SSE2 required for i686 hardfloat targets and use it to pass SIMD types)
- rust-lang#135549 (Document some safety constraints and use more safe wrappers)
- rust-lang#136193 (Implement pattern type ffi checks)
- rust-lang#136699 (std: replace the
FromInner
implementation for addresses with private conversion functions)
Failed merges:
- rust-lang#136758 (tests:
-Copt-level=3
instead of-O
in assembly tests)
r? @ghost
@rustbot
modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…ler-errors
Document some safety constraints and use more safe wrappers
Lots of unsafe codegen_llvm code has safe wrappers already, so I used some of them and added some where applicable. I stopped here because this diff is large enough and should probably be reviewed independently of other changes.
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 8 pull requests
Successful merges:
- rust-lang#135549 (Document some safety constraints and use more safe wrappers)
- rust-lang#135965 (In "specify type" suggestion, skip type params that are already known)
- rust-lang#136193 (Implement pattern type ffi checks)
- rust-lang#136646 (Add a TyPat in the AST to reuse the generic arg lowering logic)
- rust-lang#136699 (std: replace the
FromInner
implementation for addresses with private conversion functions) - rust-lang#136874 (Change the issue number for
likely_unlikely
andcold_path
) - rust-lang#136884 (Lower fn items as ZST valtrees and delay a bug)
- rust-lang#136885 (i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 8 pull requests
Successful merges:
- rust-lang#135549 (Document some safety constraints and use more safe wrappers)
- rust-lang#135965 (In "specify type" suggestion, skip type params that are already known)
- rust-lang#136193 (Implement pattern type ffi checks)
- rust-lang#136646 (Add a TyPat in the AST to reuse the generic arg lowering logic)
- rust-lang#136874 (Change the issue number for
likely_unlikely
andcold_path
) - rust-lang#136884 (Lower fn items as ZST valtrees and delay a bug)
- rust-lang#136885 (i686-linux-android: increase CPU baseline to Pentium 4 (without an actual change)
- rust-lang#136891 (Check sig for errors before checking for unconstrained anonymous lifetime)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#135549 - oli-obk:push-tmxtpnrloyqu, r=compiler-errors
Document some safety constraints and use more safe wrappers
Lots of unsafe codegen_llvm code has safe wrappers already, so I used some of them and added some where applicable. I stopped here because this diff is large enough and should probably be reviewed independently of other changes.
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.