Skip to content

Conversation

klensy
Copy link
Contributor

@klensy klensy commented Dec 2, 2024

replaced code same as in

fn parse(
cgcx: &CodegenContext<LlvmCodegenBackend>,
name: &CStr,
buffer: &[u8],
dcx: DiagCtxtHandle<'_>,
) -> Result<Self, FatalError> {
unsafe {
let llcx = llvm::LLVMRustContextCreate(cgcx.fewer_names);
let llmod_raw = back::lto::parse_module(llcx, name, buffer, dcx)?;
let tm_factory_config = TargetMachineFactoryConfig::new(cgcx, name.to_str().unwrap());
let tm = match (cgcx.tm_factory)(tm_factory_config) {
Ok(m) => m,
Err(e) => {
return Err(dcx.emit_almost_fatal(ParseTargetMachineConfig(e)));
}
};
Ok(ModuleLlvm { llmod_raw, llcx, tm: ManuallyDrop::new(tm) })
}
}

except before error message was emitted via write::llvm_err, which returned other error kind, but it still ok?

@rustbot
Copy link
Collaborator

rustbot commented Dec 2, 2024

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
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 rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 2, 2024
@BoxyUwU
Copy link
Member

BoxyUwU commented Dec 5, 2024

r? compiler

@rustbot rustbot assigned fee1-dead and unassigned BoxyUwU Dec 5, 2024
@fee1-dead
Copy link
Member

r? compiler

@rustbot rustbot assigned chenyukang and unassigned fee1-dead Dec 7, 2024
@chenyukang
Copy link
Member

r? compiler

@rustbot rustbot assigned davidtwco and unassigned chenyukang Jan 12, 2025
@davidtwco
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 13, 2025

📌 Commit 694950d has been approved by davidtwco

It is now in the queue for this repository.

@bors 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 Jan 13, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 13, 2025
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#133752 (replace copypasted ModuleLlvm::parse)
 - rust-lang#135245 (rustc_feature: Avoid unsafe `std::env::set_var()` in `UnstableFeatures` tests)
 - rust-lang#135405 (path: Move is_absolute check to sys::path)
 - rust-lang#135426 (Assert that `Instance::try_resolve` is only used on body-like things)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 13, 2025
Rollup of 4 pull requests

Successful merges:

 - rust-lang#133752 (replace copypasted ModuleLlvm::parse)
 - rust-lang#135245 (rustc_feature: Avoid unsafe `std::env::set_var()` in `UnstableFeatures` tests)
 - rust-lang#135405 (path: Move is_absolute check to sys::path)
 - rust-lang#135426 (Assert that `Instance::try_resolve` is only used on body-like things)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: x86_64-mingw-1
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 14, 2025
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#133752 (replace copypasted ModuleLlvm::parse)
 - rust-lang#135245 (rustc_feature: Avoid unsafe `std::env::set_var()` in `UnstableFeatures` tests)
 - rust-lang#135405 (path: Move is_absolute check to sys::path)
 - rust-lang#135426 (Assert that `Instance::try_resolve` is only used on body-like things)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: x86_64-mingw-1
@bors bors merged commit 448bad9 into rust-lang:master Jan 14, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 14, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 14, 2025
Rollup merge of rust-lang#133752 - klensy:cp, r=davidtwco

replace copypasted ModuleLlvm::parse

replaced code same as in https://github.com/rust-lang/rust/blob/bd36e69d2533ee750e2d805915b8ca88d2825e0f/compiler/rustc_codegen_llvm/src/lib.rs#L426-L445

except before error message was emitted via `write::llvm_err`, which returned other error kind, but it still ok?
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants