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

Update some comment/docs related to "extern intrinsic" removal #139490

Merged
merged 3 commits into from
Apr 8, 2025

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Apr 7, 2025

Follow-up to #139455.

r? @oli-obk

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 7, 2025

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Apr 7, 2025
@RalfJung RalfJung changed the title unstable-book/intrinsics: wordsmith MIR-lowering intrinsic docs Update some comment/docs related to "extern intrinsic" removal Apr 7, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Apr 7, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 7, 2025

📌 Commit a7400a8 has been approved by oli-obk

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 Apr 7, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 7, 2025
… r=oli-obk

Update some comment/docs related to "extern intrinsic" removal

Follow-up to rust-lang#139455.

r? `@oli-obk`
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 7, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#139124 (compiler: report error when trait object type param reference self)
 - rust-lang#139346 (Don't construct preds w escaping bound vars in `diagnostic_hir_wf_check`)
 - rust-lang#139379 (Use delayed bug for normalization errors in drop elaboration)
 - rust-lang#139421 (Fix trait upcasting to dyn type with no principal when there are projections)
 - rust-lang#139468 (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 - rust-lang#139476 (rm `RegionInferenceContext::var_infos`)
 - rust-lang#139490 (Update some comment/docs related to "extern intrinsic" removal)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 7, 2025
… r=oli-obk

Update some comment/docs related to "extern intrinsic" removal

Follow-up to rust-lang#139455.

r? ``@oli-obk``
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 8, 2025
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#139124 (compiler: report error when trait object type param reference self)
 - rust-lang#139346 (Don't construct preds w escaping bound vars in `diagnostic_hir_wf_check`)
 - rust-lang#139421 (Fix trait upcasting to dyn type with no principal when there are projections)
 - rust-lang#139468 (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 - rust-lang#139476 (rm `RegionInferenceContext::var_infos`)
 - rust-lang#139490 (Update some comment/docs related to "extern intrinsic" removal)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 8, 2025
… r=oli-obk

Update some comment/docs related to "extern intrinsic" removal

Follow-up to rust-lang#139455.

r? ```@oli-obk```
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 8, 2025
…errors

Rollup of 19 pull requests

Successful merges:

 - rust-lang#138676 (Implement overflow for infinite implied lifetime bounds)
 - rust-lang#139024 (Make error message for missing fields with `..` and without `..` more consistent)
 - rust-lang#139098 (Tell LLVM about impossible niche tags)
 - rust-lang#139124 (compiler: report error when trait object type param reference self)
 - rust-lang#139321 (Update to new rinja version (askama))
 - rust-lang#139346 (Don't construct preds w escaping bound vars in `diagnostic_hir_wf_check`)
 - rust-lang#139386 (make it possible to use stage0 libtest on compiletest)
 - rust-lang#139421 (Fix trait upcasting to dyn type with no principal when there are projections)
 - rust-lang#139468 (Don't call `Span::with_parent` on the good path in `has_stashed_diagnostic`)
 - rust-lang#139476 (rm `RegionInferenceContext::var_infos`)
 - rust-lang#139481 (Add job summary links to post-merge report)
 - rust-lang#139485 (compiletest: Stricter parsing for diagnostic kinds)
 - rust-lang#139490 (Update some comment/docs related to "extern intrinsic" removal)
 - rust-lang#139491 (Update books)
 - rust-lang#139496 (Revert r-a changes of rust-lang#139455)
 - rust-lang#139500 (document panic behavior of Vec::resize and Vec::resize_with)
 - rust-lang#139501 (Fix stack overflow in exhaustiveness due to recursive HIR opaque hidden types)
 - rust-lang#139504 (add missing word in doc comment)
 - rust-lang#139507 (compiletest: Trim whitespace from environment variable names)

r? `@ghost`
`@rustbot` modify labels: rollup
@@ -53,7 +53,8 @@ Various intrinsics have native MIR operations that they correspond to. Instead o
backends to implement both the intrinsic and the MIR operation, the `lower_intrinsics` pass
will convert the calls to the MIR operation. Backends do not need to know about these intrinsics
at all. These intrinsics only make sense without a body, and can be declared as a `#[rustc_intrinsic]`.
The body is never used, as calls to the intrinsic do not exist anymore after MIR analyses.
The body is never used as the lowering pass implements support for all backends, so we never have to
use the fallback logic.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-lang/rust-analyzer I guess this PR will fail to land since RA has a copy of this file for the hover_feature test. How can I adjust the test to not require such a hard-to-maintain full copy?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a feature that won't really ever change maybe that we can just swap to?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah well, replacing the hover test with

#[test]
fn hover_feature() {
    let (analysis, position) = fixture::position(r#"#![feature(intrinsics$0)]"#);
    analysis
        .hover(
            &HoverConfig { links_in_hover: true, ..HOVER_BASE_CONFIG },
            FileRange { file_id: position.file_id, range: TextRange::empty(position.offset) },
        )
        .unwrap()
        .unwrap();
}

should suffice

Copy link
Member Author

@RalfJung RalfJung Apr 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As someone who has ran into tests relying on "surely this unstable feature will never change" about a dozen times over the years, and each time had to do a frustrating search for what this test actually cared about and what was entirely incidental reliance on a feature -- I'd prefer if we didn't go down that route. Why does the test need to compare the full string for equality? There's no reason for that that I can think of.

If absolutely necessary we could probably have a dedicated feature that exists solely for the purpose of testing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah well, replacing the hover test with

Ah, that's great, thanks a lot. :)

@rustbot
Copy link
Collaborator

rustbot commented Apr 8, 2025

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@RalfJung
Copy link
Member Author

RalfJung commented Apr 8, 2025

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Apr 8, 2025

📌 Commit 742b378 has been approved by oli-obk

It is now in the queue for this repository.

@RalfJung
Copy link
Member Author

RalfJung commented Apr 8, 2025

@bors rollup=iffy

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 8, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang#138676 (Implement overflow for infinite implied lifetime bounds)
 - rust-lang#139024 (Make error message for missing fields with `..` and without `..` more consistent)
 - rust-lang#139098 (Tell LLVM about impossible niche tags)
 - rust-lang#139124 (compiler: report error when trait object type param reference self)
 - rust-lang#139321 (Update to new rinja version (askama))
 - rust-lang#139346 (Don't construct preds w escaping bound vars in `diagnostic_hir_wf_check`)
 - rust-lang#139386 (make it possible to use stage0 libtest on compiletest)
 - rust-lang#139421 (Fix trait upcasting to dyn type with no principal when there are projections)
 - rust-lang#139464 (Allow for reparsing failure when reparsing a pasted metavar.)
 - rust-lang#139490 (Update some comment/docs related to "extern intrinsic" removal)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 42fdd7d into rust-lang:master Apr 8, 2025
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 8, 2025
Rollup merge of rust-lang#139490 - RalfJung:unstable-intrinsics-docs, r=oli-obk

Update some comment/docs related to "extern intrinsic" removal

Follow-up to rust-lang#139455.

r? `@oli-obk`
@rustbot rustbot added this to the 1.88.0 milestone Apr 8, 2025
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-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants