Add more tests for the optimize attribute#157297
Conversation
|
rustbot has assigned @dingxiangfei2009. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| @@ -55,6 +55,8 @@ | |||
| //~^ ERROR malformed | |||
| #[optimize] | |||
| //~^ ERROR malformed | |||
| #[optimize(none, speed)] | |||
| //~^ ERROR malformed | |||
There was a problem hiding this comment.
Suggestion: can you also add a duplicate-value case? I.e.
#[optimize(none, none)]There was a problem hiding this comment.
Suggestion: can you add coverage for #[optimize] on an impl block fn? I.e.
impl G {
#[optimize(speed)]
fn g() {}
}| trait Foo { | ||
| #[optimize(speed)] //~ ERROR attribute cannot be used on | ||
| fn invalid(); | ||
| } |
There was a problem hiding this comment.
Question: wait, but this attr can be used with a trait method w/ a body right? I.e. can you add coverage for
trait Foo {
#[optimize(speed)]
fn valid() {}
}|
Reminder, once the PR becomes ready for a review, use |
There was a problem hiding this comment.
Remark: I feel like we should probably hoist the optimize attr ones into a separate test, this test is kinda of an abomination of everything
|
☔ The latest upstream changes (presumably #157303) made this pull request unmergeable. Please resolve the merge conflicts. |
Tracking issue: #54882
Stabilization PR: #157273