Skip to content

Add internal_features lint#108955

Merged
bors merged 1 commit intorust-lang:masterfrom
Noratrieb:dont-use-me-pls
Aug 4, 2023
Merged

Add internal_features lint#108955
bors merged 1 commit intorust-lang:masterfrom
Noratrieb:dont-use-me-pls

Conversation

@Noratrieb
Copy link
Member

@Noratrieb Noratrieb commented Mar 9, 2023

Implements rust-lang/compiler-team#596

Also requires some more test blessing for codegen tests etc

@jyn514 had the idea of just allowing the lint by default in the test suite. I'm not sure whether this is a good idea, but it's definitely one worth considering. Additional input encouraged.

@Noratrieb Noratrieb marked this pull request as draft March 9, 2023 21:38
@rustbot
Copy link
Collaborator

rustbot commented Mar 9, 2023

r? @oli-obk

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 9, 2023
Copy link
Member

@jyn514 jyn514 left a comment

Choose a reason for hiding this comment

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

❤️ ❤️

@bors
Copy link
Collaborator

bors commented Mar 12, 2023

☔ The latest upstream changes (presumably #108682) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 19, 2023

Does this affect any tools or backends? (modulo their tests, I just mean the tool/backend code)

@Noratrieb
Copy link
Member Author

From a quick skim over them the tools and backends look fine as they don't use any features I classified as internal, but I'll make sure that they're fine when marking this as ready.

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Mar 19, 2023
@Noratrieb Noratrieb removed A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels Mar 19, 2023
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels Mar 19, 2023
@rust-log-analyzer

This comment has been minimized.

@Noratrieb Noratrieb removed A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels Mar 19, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jul 8, 2023

The Miri subtree was changed

cc @rust-lang/miri

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 17, 2023

☔ The latest upstream changes (presumably #113686) made this pull request unmergeable. Please resolve the merge conflicts.

@Noratrieb
Copy link
Member Author

@rustbot ready

Copy link
Member

Choose a reason for hiding this comment

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

shouldn't compiler_builtins be internal as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah there are many that could be internal too, I was mostly concerned with the ones that will cause ICEs if used incorectly
I added it too. But I don't think it's important to get this entirely right on this PR, we can always change things later. The most important thing is that lang_items, intrinsics, custom_mir and friends are marked as internal.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 31, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 31, 2023

📌 Commit d56a73f75430fa8ae92e97beb8a0e21713289ba5 has been approved by oli-obk

It is now in the queue for this repository.

@Noratrieb
Copy link
Member Author

@bors rollup=iffy
my hopes that it passes first time are low

@bors
Copy link
Collaborator

bors commented Aug 1, 2023

⌛ Testing commit d56a73f75430fa8ae92e97beb8a0e21713289ba5 with merge 7b04a87c8d6942e2d3ff9651fa8d3f7ee1344859...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Aug 1, 2023

💔 Test failed - checks-actions

@Noratrieb
Copy link
Member Author

Blocked on the next cargo sync

@weihanglo
Copy link
Member

Cargo update is live now.
#114364

It lints against features that are inteded to be internal to the
compiler and standard library. Implements MCP rust-lang#596.

We allow `internal_features` in the standard library and compiler as those
use many features and this _is_ the standard library from the "internal to the compiler and
standard library" after all.

Marking some features as internal wasn't exactly the most scientific approach, I just marked some
mostly obvious features. While there is a categorization in the macro,
it's not very well upheld (should probably be fixed in another PR).

We always pass `-Ainternal_features` in the testsuite
About 400 UI tests and several other tests use internal features.
Instead of throwing the attribute on each one, just always allow them.
There's nothing wrong with testing internal features^^
@Noratrieb
Copy link
Member Author

rebased (although that's technically unnecessary as the merge commit is tested)
@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Aug 3, 2023

📌 Commit 5830ca2 has been approved by oli-obk

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Aug 3, 2023

⌛ Testing commit 5830ca2 with merge 1fe3846...

@bors
Copy link
Collaborator

bors commented Aug 4, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 1fe3846 to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1fe3846): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.4% [1.7%, 3.7%] 5
Regressions ❌
(secondary)
2.3% [1.4%, 3.2%] 2
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
-1.7% [-1.8%, -1.7%] 2
All ❌✅ (primary) 1.6% [-2.6%, 3.7%] 6

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 649.938s -> 648.71s (-0.19%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-lang Relevant to the language team

Projects

None yet

Development

Successfully merging this pull request may close these issues.