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

Move #[do_not_recommend] to the #[diagnostic] namespace #125326

Merged

Conversation

weiznich
Copy link
Contributor

This commit moves the #[do_not_recommend] attribute to the #[diagnostic] namespace. It still requires
#![feature(do_not_recommend)] to work.

r? @compiler-errors

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative labels May 20, 2024
@rustbot
Copy link
Collaborator

rustbot commented May 20, 2024

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

Comment on lines 386 to 388
.get_attrs_by_path(impl_def_id, &[sym::diagnostic, sym::do_not_recommend])
.next()
.is_some()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be worth to introduce a .has_attrs() method for this?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, could you do that? has_attrs_by_path? (or has_attrs_with_path)?

pub fn name_or_empty(&self) -> Symbol {
self.ident().unwrap_or_else(Ident::empty).name
}

pub fn path(&self) -> Vec<Symbol> {
Copy link
Member

Choose a reason for hiding this comment

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

Can you use a SmallVec<[Symbol; 1]>

sym::target_feature => self.check_target_feature(hir_id, attr, span, target, attrs),
sym::thread_local => self.check_thread_local(attr, span, target),
sym::track_caller => {
match attr.path().as_slice() {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this should just be a nested match? 🤷

@compiler-errors
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 20, 2024
@compiler-errors
Copy link
Member

Let's test it in this state tho

bors added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2024
…ganostic_namespace, r=<try>

Move `#[do_not_recommend]` to the `#[diagnostic]` namespace

This commit moves the `#[do_not_recommend]` attribute to the `#[diagnostic]` namespace. It still requires
`#![feature(do_not_recommend)]` to work.

r? `@compiler-errors`
@bors
Copy link
Contributor

bors commented May 20, 2024

⌛ Trying commit 7bdea9a with merge 347462c...

@bors
Copy link
Contributor

bors commented May 20, 2024

☀️ Try build successful - checks-actions
Build commit: 347462c (347462cb8c1895dfeb2a789892c644bb2739dddd)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (347462c): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.4% [0.4%, 0.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.1%, secondary 2.4%)

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)
1.9% [1.7%, 2.2%] 2
Regressions ❌
(secondary)
2.4% [2.4%, 2.4%] 1
Improvements ✅
(primary)
-2.0% [-2.4%, -1.7%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-2.4%, 2.2%] 4

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: 671.145s -> 671.106s (-0.01%)
Artifact size: 316.05 MiB -> 316.07 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 20, 2024
This commit moves the `#[do_not_recommend]` attribute to the
`#[diagnostic]` namespace. It still requires
`#![feature(do_not_recommend)]` to work.
@weiznich weiznich force-pushed the move/do_not_recommend_to_diganostic_namespace branch from 7bdea9a to 2cff3e9 Compare May 21, 2024 11:15
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 21, 2024

📌 Commit 2cff3e9 has been approved by compiler-errors

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 May 21, 2024
@bors
Copy link
Contributor

bors commented May 22, 2024

⌛ Testing commit 2cff3e9 with merge b54dd08...

@bors
Copy link
Contributor

bors commented May 22, 2024

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing b54dd08 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 22, 2024
@bors bors merged commit b54dd08 into rust-lang:master May 22, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 22, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b54dd08): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.1%)

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.1% [2.1%, 2.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [2.1%, 2.1%] 1

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: 673.377s -> 672.666s (-0.11%)
Artifact size: 316.17 MiB -> 315.47 MiB (-0.22%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants