-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #129202 - matthiaskrgr:rollup-wev7uur, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #128989 (Emit an error for invalid use of the linkage attribute) - #129167 (mir/pretty: use `Option` instead of `Either<Once, Empty>`) - #129168 (Return correct HirId when finding body owner in diagnostics) - #129191 (rustdoc-json: Clean up serialization and printing.) - #129192 (Remove useless attributes in merged doctest generated code) - #129196 (Remove a useless ref/id/ref round-trip from `pattern_from_hir`) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
15 changed files
with
357 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#![feature(linkage)] | ||
#![feature(stmt_expr_attributes)] | ||
#![deny(unused_attributes)] | ||
#![allow(dead_code)] | ||
|
||
#[linkage = "weak"] //~ ERROR attribute should be applied to a function or static | ||
type InvalidTy = (); | ||
|
||
#[linkage = "weak"] //~ ERROR attribute should be applied to a function or static | ||
mod invalid_module {} | ||
|
||
#[linkage = "weak"] //~ ERROR attribute should be applied to a function or static | ||
struct F; | ||
|
||
#[linkage = "weak"] //~ ERROR attribute should be applied to a function or static | ||
impl F { | ||
#[linkage = "weak"] | ||
fn valid(&self) {} | ||
} | ||
|
||
#[linkage = "weak"] | ||
fn f() { | ||
#[linkage = "weak"] | ||
{ | ||
1 | ||
}; | ||
//~^^^^ ERROR attribute should be applied to a function or static | ||
} | ||
|
||
extern "C" { | ||
#[linkage = "weak"] | ||
static A: *const (); | ||
|
||
#[linkage = "weak"] | ||
fn bar(); | ||
} | ||
|
||
fn main() { | ||
let _ = #[linkage = "weak"] | ||
(|| 1); | ||
//~^^ ERROR attribute should be applied to a function or static | ||
} |
Oops, something went wrong.