Skip to content

Commit 555abc1

Browse files
JonathanBrouwercuviper
authored andcommitted
Add regression test for link_section targets
(cherry picked from commit 1589c6c)
1 parent 15843ff commit 555abc1

File tree

2 files changed

+110
-75
lines changed

2 files changed

+110
-75
lines changed

tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,32 @@ mod link_section {
687687
//~| WARN previously accepted
688688
//~| HELP can be applied to
689689
//~| HELP remove the attribute
690+
691+
#[link_section = "1800"]
692+
//~^ WARN attribute cannot be used on
693+
//~| WARN previously accepted
694+
//~| HELP can be applied to
695+
//~| HELP remove the attribute
696+
trait Tr {
697+
#[link_section = "1800"]
698+
fn inside_tr_no_default(&self);
699+
700+
#[link_section = "1800"]
701+
fn inside_tr_default(&self) { }
702+
}
703+
704+
impl S {
705+
#[link_section = "1800"]
706+
fn inside_abc_123(&self) { }
707+
}
708+
709+
impl Tr for S {
710+
#[link_section = "1800"]
711+
fn inside_tr_no_default(&self) { }
712+
}
713+
714+
#[link_section = "1800"]
715+
fn should_always_link() { }
690716
}
691717

692718

0 commit comments

Comments
 (0)