Skip to content

Commit 1589c6c

Browse files
Add regression test for link_section targets
1 parent 4787834 commit 1589c6c

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
@@ -705,6 +705,32 @@ mod link_section {
705705
//~| WARN previously accepted
706706
//~| HELP can be applied to
707707
//~| HELP remove the attribute
708+
709+
#[link_section = "1800"]
710+
//~^ WARN attribute cannot be used on
711+
//~| WARN previously accepted
712+
//~| HELP can be applied to
713+
//~| HELP remove the attribute
714+
trait Tr {
715+
#[link_section = "1800"]
716+
fn inside_tr_no_default(&self);
717+
718+
#[link_section = "1800"]
719+
fn inside_tr_default(&self) { }
720+
}
721+
722+
impl S {
723+
#[link_section = "1800"]
724+
fn inside_abc_123(&self) { }
725+
}
726+
727+
impl Tr for S {
728+
#[link_section = "1800"]
729+
fn inside_tr_no_default(&self) { }
730+
}
731+
732+
#[link_section = "1800"]
733+
fn should_always_link() { }
708734
}
709735

710736

0 commit comments

Comments
 (0)