-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Document some safety constraints and use more safe wrappers #135549
Merged
Merged
Conversation
This file contains 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
7465121
to
adb21b5
Compare
This comment has been minimized.
This comment has been minimized.
adb21b5
to
81ed7dc
Compare
☔ The latest upstream changes (presumably #135947) made this pull request unmergeable. Please resolve the merge conflicts. |
81ed7dc
to
0a8da9b
Compare
r? compiler |
compiler-errors
approved these changes
Feb 6, 2025
@bors r+ |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Feb 6, 2025
…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
Feb 6, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#133925 (disallow `repr()` on invalid items) - rust-lang#135549 (Document some safety constraints and use more safe wrappers) - rust-lang#136069 (Simplify slice indexing in next trait solver) - rust-lang#136152 (Stabilize `map_many_mut` feature) - rust-lang#136219 (Misc. `rustc_hir` cleanups 🧹) - rust-lang#136580 (Couple of changes to run rustc in miri) - rust-lang#136636 (Couple of minor cleanups to the diagnostic infrastructure) - rust-lang#136645 (Clippy subtree update) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- |
oli-obk
commented
Feb 11, 2025
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops 🙈
0a8da9b
to
dcf1e4d
Compare
@bors r=compiler-errors |
fmease
added a commit
to fmease/rust
that referenced
this pull request
Feb 11, 2025
…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
Feb 11, 2025
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
Feb 11, 2025
…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
Feb 12, 2025
…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` and `cold_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
Feb 12, 2025
…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` and `cold_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
Feb 12, 2025
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.