| author | bors <bors@rust-lang.org> 2026-02-04 13:54:17 UTC |
| committer | bors <bors@rust-lang.org> 2026-02-04 13:54:17 UTC |
| log | 8bccf1224deab49b54694c9090e577bfe90a94e6 |
| tree | d0a240a96c11fec2181b150683e825c5e82a0e34 |
| parent | 930ecbcdf8905c5c8549056c73fcabdd8d6e1b3d |
| parent | cf0e19b0b4c213bc64ce0e9724721afe4db6fe79 |
Rollup of 12 pull requests
Successful merges:
- rust-lang/rust#150992 (link modifier `export-symbols`: export all global symbols from selected uptream c static libraries)
- rust-lang/rust#151534 (target: fix destabilising target-spec-json)
- rust-lang/rust#152088 (rustbook/README.md: add missing `)`)
- rust-lang/rust#151526 (Fix autodiff codegen tests)
- rust-lang/rust#151810 (citool: report debuginfo test statistics)
- rust-lang/rust#151952 (Revert doc attribute parsing errors to future warnings)
- rust-lang/rust#152065 (Convert to inline diagnostics in `rustc_ty_utils`)
- rust-lang/rust#152066 (Convert to inline diagnostics in `rustc_session`)
- rust-lang/rust#152069 (Convert to inline diagnostics in `rustc_privacy`)
- rust-lang/rust#152072 (Convert to inline diagnostics in `rustc_monomorphize`)
- rust-lang/rust#152083 (Fix set_times_nofollow for directory on windows)
- rust-lang/rust#152102 (Convert to inline diagnostics in all codegen backends)
Failed merges:
- rust-lang/rust#152068 (Convert to inline diagnostics in `rustc_resolve`)
- rust-lang/rust#152070 (Convert to inline diagnostics in `rustc_pattern_analysis`)119 files changed, 1373 insertions(+), 1171 deletions(-)
Cargo.lock-8| ... | ... | @@ -3635,7 +3635,6 @@ dependencies = [ |
| 3635 | 3635 | "rustc_codegen_ssa", |
| 3636 | 3636 | "rustc_data_structures", |
| 3637 | 3637 | "rustc_errors", |
| 3638 | "rustc_fluent_macro", | |
| 3639 | 3638 | "rustc_fs_util", |
| 3640 | 3639 | "rustc_hashes", |
| 3641 | 3640 | "rustc_hir", |
| ... | ... | @@ -3799,18 +3798,15 @@ dependencies = [ |
| 3799 | 3798 | "rustc_middle", |
| 3800 | 3799 | "rustc_mir_build", |
| 3801 | 3800 | "rustc_mir_transform", |
| 3802 | "rustc_monomorphize", | |
| 3803 | 3801 | "rustc_parse", |
| 3804 | 3802 | "rustc_passes", |
| 3805 | 3803 | "rustc_pattern_analysis", |
| 3806 | "rustc_privacy", | |
| 3807 | 3804 | "rustc_public", |
| 3808 | 3805 | "rustc_resolve", |
| 3809 | 3806 | "rustc_session", |
| 3810 | 3807 | "rustc_span", |
| 3811 | 3808 | "rustc_target", |
| 3812 | 3809 | "rustc_trait_selection", |
| 3813 | "rustc_ty_utils", | |
| 3814 | 3810 | "serde_json", |
| 3815 | 3811 | "shlex", |
| 3816 | 3812 | "tracing", |
| ... | ... | @@ -4373,7 +4369,6 @@ dependencies = [ |
| 4373 | 4369 | "rustc_abi", |
| 4374 | 4370 | "rustc_data_structures", |
| 4375 | 4371 | "rustc_errors", |
| 4376 | "rustc_fluent_macro", | |
| 4377 | 4372 | "rustc_hir", |
| 4378 | 4373 | "rustc_index", |
| 4379 | 4374 | "rustc_macros", |
| ... | ... | @@ -4486,7 +4481,6 @@ dependencies = [ |
| 4486 | 4481 | "rustc_ast", |
| 4487 | 4482 | "rustc_data_structures", |
| 4488 | 4483 | "rustc_errors", |
| 4489 | "rustc_fluent_macro", | |
| 4490 | 4484 | "rustc_hir", |
| 4491 | 4485 | "rustc_macros", |
| 4492 | 4486 | "rustc_middle", |
| ... | ... | @@ -4641,7 +4635,6 @@ dependencies = [ |
| 4641 | 4635 | "rustc_data_structures", |
| 4642 | 4636 | "rustc_errors", |
| 4643 | 4637 | "rustc_feature", |
| 4644 | "rustc_fluent_macro", | |
| 4645 | 4638 | "rustc_fs_util", |
| 4646 | 4639 | "rustc_hashes", |
| 4647 | 4640 | "rustc_hir", |
| ... | ... | @@ -4797,7 +4790,6 @@ dependencies = [ |
| 4797 | 4790 | "rustc_abi", |
| 4798 | 4791 | "rustc_data_structures", |
| 4799 | 4792 | "rustc_errors", |
| 4800 | "rustc_fluent_macro", | |
| 4801 | 4793 | "rustc_hashes", |
| 4802 | 4794 | "rustc_hir", |
| 4803 | 4795 | "rustc_index", |
compiler/rustc_attr_parsing/src/attributes/doc.rs+83-17| ... | ... | @@ -70,6 +70,42 @@ fn check_attr_crate_level<S: Stage>(cx: &mut AcceptContext<'_, '_, S>, span: Spa |
| 70 | 70 | true |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | // FIXME: To be removed once merged and replace with `cx.expected_name_value(span, _name)`. | |
| 74 | fn expected_name_value<S: Stage>( | |
| 75 | cx: &mut AcceptContext<'_, '_, S>, | |
| 76 | span: Span, | |
| 77 | _name: Option<Symbol>, | |
| 78 | ) { | |
| 79 | cx.emit_lint( | |
| 80 | rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, | |
| 81 | AttributeLintKind::ExpectedNameValue, | |
| 82 | span, | |
| 83 | ); | |
| 84 | } | |
| 85 | ||
| 86 | // FIXME: remove this method once merged and use `cx.expected_no_args(span)` instead. | |
| 87 | fn expected_no_args<S: Stage>(cx: &mut AcceptContext<'_, '_, S>, span: Span) { | |
| 88 | cx.emit_lint( | |
| 89 | rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, | |
| 90 | AttributeLintKind::ExpectedNoArgs, | |
| 91 | span, | |
| 92 | ); | |
| 93 | } | |
| 94 | ||
| 95 | // FIXME: remove this method once merged and use `cx.expected_no_args(span)` instead. | |
| 96 | // cx.expected_string_literal(span, _actual_literal); | |
| 97 | fn expected_string_literal<S: Stage>( | |
| 98 | cx: &mut AcceptContext<'_, '_, S>, | |
| 99 | span: Span, | |
| 100 | _actual_literal: Option<&MetaItemLit>, | |
| 101 | ) { | |
| 102 | cx.emit_lint( | |
| 103 | rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, | |
| 104 | AttributeLintKind::MalformedDoc, | |
| 105 | span, | |
| 106 | ); | |
| 107 | } | |
| 108 | ||
| 73 | 109 | fn parse_keyword_and_attribute<S: Stage>( |
| 74 | 110 | cx: &mut AcceptContext<'_, '_, S>, |
| 75 | 111 | path: &OwnedPathParser, |
| ... | ... | @@ -78,12 +114,12 @@ fn parse_keyword_and_attribute<S: Stage>( |
| 78 | 114 | attr_name: Symbol, |
| 79 | 115 | ) { |
| 80 | 116 | let Some(nv) = args.name_value() else { |
| 81 | cx.expected_name_value(args.span().unwrap_or(path.span()), path.word_sym()); | |
| 117 | expected_name_value(cx, args.span().unwrap_or(path.span()), path.word_sym()); | |
| 82 | 118 | return; |
| 83 | 119 | }; |
| 84 | 120 | |
| 85 | 121 | let Some(value) = nv.value_as_str() else { |
| 86 | cx.expected_string_literal(nv.value_span, Some(nv.value_as_lit())); | |
| 122 | expected_string_literal(cx, nv.value_span, Some(nv.value_as_lit())); | |
| 87 | 123 | return; |
| 88 | 124 | }; |
| 89 | 125 | |
| ... | ... | @@ -127,12 +163,21 @@ impl DocParser { |
| 127 | 163 | match path.word_sym() { |
| 128 | 164 | Some(sym::no_crate_inject) => { |
| 129 | 165 | if let Err(span) = args.no_args() { |
| 130 | cx.expected_no_args(span); | |
| 166 | expected_no_args(cx, span); | |
| 131 | 167 | return; |
| 132 | 168 | } |
| 133 | 169 | |
| 134 | if self.attribute.no_crate_inject.is_some() { | |
| 135 | cx.duplicate_key(path.span(), sym::no_crate_inject); | |
| 170 | if let Some(used_span) = self.attribute.no_crate_inject { | |
| 171 | let unused_span = path.span(); | |
| 172 | cx.emit_lint( | |
| 173 | rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, | |
| 174 | AttributeLintKind::UnusedDuplicate { | |
| 175 | this: unused_span, | |
| 176 | other: used_span, | |
| 177 | warning: true, | |
| 178 | }, | |
| 179 | unused_span, | |
| 180 | ); | |
| 136 | 181 | return; |
| 137 | 182 | } |
| 138 | 183 | |
| ... | ... | @@ -144,7 +189,14 @@ impl DocParser { |
| 144 | 189 | } |
| 145 | 190 | Some(sym::attr) => { |
| 146 | 191 | let Some(list) = args.list() else { |
| 147 | cx.expected_list(cx.attr_span, args); | |
| 192 | // FIXME: remove this method once merged and uncomment the line below instead. | |
| 193 | // cx.expected_list(cx.attr_span, args); | |
| 194 | let span = cx.attr_span; | |
| 195 | cx.emit_lint( | |
| 196 | rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, | |
| 197 | AttributeLintKind::MalformedDoc, | |
| 198 | span, | |
| 199 | ); | |
| 148 | 200 | return; |
| 149 | 201 | }; |
| 150 | 202 | |
| ... | ... | @@ -246,7 +298,7 @@ impl DocParser { |
| 246 | 298 | inline: DocInline, |
| 247 | 299 | ) { |
| 248 | 300 | if let Err(span) = args.no_args() { |
| 249 | cx.expected_no_args(span); | |
| 301 | expected_no_args(cx, span); | |
| 250 | 302 | return; |
| 251 | 303 | } |
| 252 | 304 | |
| ... | ... | @@ -328,7 +380,14 @@ impl DocParser { |
| 328 | 380 | match sub_item.args() { |
| 329 | 381 | a @ (ArgParser::NoArgs | ArgParser::NameValue(_)) => { |
| 330 | 382 | let Some(name) = sub_item.path().word_sym() else { |
| 331 | cx.expected_identifier(sub_item.path().span()); | |
| 383 | // FIXME: remove this method once merged and uncomment the line | |
| 384 | // below instead. | |
| 385 | // cx.expected_identifier(sub_item.path().span()); | |
| 386 | cx.emit_lint( | |
| 387 | rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, | |
| 388 | AttributeLintKind::MalformedDoc, | |
| 389 | sub_item.path().span(), | |
| 390 | ); | |
| 332 | 391 | continue; |
| 333 | 392 | }; |
| 334 | 393 | if let Ok(CfgEntry::NameValue { name, value, .. }) = |
| ... | ... | @@ -391,7 +450,7 @@ impl DocParser { |
| 391 | 450 | macro_rules! no_args { |
| 392 | 451 | ($ident: ident) => {{ |
| 393 | 452 | if let Err(span) = args.no_args() { |
| 394 | cx.expected_no_args(span); | |
| 453 | expected_no_args(cx, span); | |
| 395 | 454 | return; |
| 396 | 455 | } |
| 397 | 456 | |
| ... | ... | @@ -410,7 +469,7 @@ impl DocParser { |
| 410 | 469 | macro_rules! no_args_and_not_crate_level { |
| 411 | 470 | ($ident: ident) => {{ |
| 412 | 471 | if let Err(span) = args.no_args() { |
| 413 | cx.expected_no_args(span); | |
| 472 | expected_no_args(cx, span); | |
| 414 | 473 | return; |
| 415 | 474 | } |
| 416 | 475 | let span = path.span(); |
| ... | ... | @@ -423,7 +482,7 @@ impl DocParser { |
| 423 | 482 | macro_rules! no_args_and_crate_level { |
| 424 | 483 | ($ident: ident) => {{ |
| 425 | 484 | if let Err(span) = args.no_args() { |
| 426 | cx.expected_no_args(span); | |
| 485 | expected_no_args(cx, span); | |
| 427 | 486 | return; |
| 428 | 487 | } |
| 429 | 488 | let span = path.span(); |
| ... | ... | @@ -436,12 +495,12 @@ impl DocParser { |
| 436 | 495 | macro_rules! string_arg_and_crate_level { |
| 437 | 496 | ($ident: ident) => {{ |
| 438 | 497 | let Some(nv) = args.name_value() else { |
| 439 | cx.expected_name_value(args.span().unwrap_or(path.span()), path.word_sym()); | |
| 498 | expected_name_value(cx, args.span().unwrap_or(path.span()), path.word_sym()); | |
| 440 | 499 | return; |
| 441 | 500 | }; |
| 442 | 501 | |
| 443 | 502 | let Some(s) = nv.value_as_str() else { |
| 444 | cx.expected_string_literal(nv.value_span, Some(nv.value_as_lit())); | |
| 503 | expected_string_literal(cx, nv.value_span, Some(nv.value_as_lit())); | |
| 445 | 504 | return; |
| 446 | 505 | }; |
| 447 | 506 | |
| ... | ... | @@ -512,7 +571,14 @@ impl DocParser { |
| 512 | 571 | self.parse_single_test_doc_attr_item(cx, mip); |
| 513 | 572 | } |
| 514 | 573 | MetaItemOrLitParser::Lit(lit) => { |
| 515 | cx.unexpected_literal(lit.span); | |
| 574 | // FIXME: remove this method once merged and uncomment the line | |
| 575 | // below instead. | |
| 576 | // cx.unexpected_literal(lit.span); | |
| 577 | cx.emit_lint( | |
| 578 | rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, | |
| 579 | AttributeLintKind::MalformedDoc, | |
| 580 | lit.span, | |
| 581 | ); | |
| 516 | 582 | } |
| 517 | 583 | } |
| 518 | 584 | } |
| ... | ... | @@ -582,7 +648,7 @@ impl DocParser { |
| 582 | 648 | let suggestions = cx.suggestions(); |
| 583 | 649 | let span = cx.attr_span; |
| 584 | 650 | cx.emit_lint( |
| 585 | rustc_session::lint::builtin::ILL_FORMED_ATTRIBUTE_INPUT, | |
| 651 | rustc_session::lint::builtin::INVALID_DOC_ATTRIBUTES, | |
| 586 | 652 | AttributeLintKind::IllFormedAttributeInput { suggestions, docs: None }, |
| 587 | 653 | span, |
| 588 | 654 | ); |
| ... | ... | @@ -595,14 +661,14 @@ impl DocParser { |
| 595 | 661 | self.parse_single_doc_attr_item(cx, mip); |
| 596 | 662 | } |
| 597 | 663 | MetaItemOrLitParser::Lit(lit) => { |
| 598 | cx.expected_name_value(lit.span, None); | |
| 664 | expected_name_value(cx, lit.span, None); | |
| 599 | 665 | } |
| 600 | 666 | } |
| 601 | 667 | } |
| 602 | 668 | } |
| 603 | 669 | ArgParser::NameValue(nv) => { |
| 604 | 670 | if nv.value_as_str().is_none() { |
| 605 | cx.expected_string_literal(nv.value_span, Some(nv.value_as_lit())); | |
| 671 | expected_string_literal(cx, nv.value_span, Some(nv.value_as_lit())); | |
| 606 | 672 | } else { |
| 607 | 673 | unreachable!( |
| 608 | 674 | "Should have been handled at the same time as sugar-syntaxed doc comments" |
compiler/rustc_attr_parsing/src/attributes/link_attrs.rs+16-5| ... | ... | @@ -12,10 +12,10 @@ use super::prelude::*; |
| 12 | 12 | use super::util::parse_single_integer; |
| 13 | 13 | use crate::attributes::cfg::parse_cfg_entry; |
| 14 | 14 | use crate::session_diagnostics::{ |
| 15 | AsNeededCompatibility, BundleNeedsStatic, EmptyLinkName, ImportNameTypeRaw, ImportNameTypeX86, | |
| 16 | IncompatibleWasmLink, InvalidLinkModifier, LinkFrameworkApple, LinkOrdinalOutOfRange, | |
| 17 | LinkRequiresName, MultipleModifiers, NullOnLinkSection, RawDylibNoNul, RawDylibOnlyWindows, | |
| 18 | WholeArchiveNeedsStatic, | |
| 15 | AsNeededCompatibility, BundleNeedsStatic, EmptyLinkName, ExportSymbolsNeedsStatic, | |
| 16 | ImportNameTypeRaw, ImportNameTypeX86, IncompatibleWasmLink, InvalidLinkModifier, | |
| 17 | LinkFrameworkApple, LinkOrdinalOutOfRange, LinkRequiresName, MultipleModifiers, | |
| 18 | NullOnLinkSection, RawDylibNoNul, RawDylibOnlyWindows, WholeArchiveNeedsStatic, | |
| 19 | 19 | }; |
| 20 | 20 | |
| 21 | 21 | pub(crate) struct LinkNameParser; |
| ... | ... | @@ -165,6 +165,14 @@ impl<S: Stage> CombineAttributeParser<S> for LinkParser { |
| 165 | 165 | cx.emit_err(BundleNeedsStatic { span }); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | (sym::export_symbols, Some(NativeLibKind::Static { export_symbols, .. })) => { | |
| 169 | assign_modifier(export_symbols) | |
| 170 | } | |
| 171 | ||
| 172 | (sym::export_symbols, _) => { | |
| 173 | cx.emit_err(ExportSymbolsNeedsStatic { span }); | |
| 174 | } | |
| 175 | ||
| 168 | 176 | (sym::verbatim, _) => assign_modifier(&mut verbatim), |
| 169 | 177 | |
| 170 | 178 | ( |
| ... | ... | @@ -190,6 +198,7 @@ impl<S: Stage> CombineAttributeParser<S> for LinkParser { |
| 190 | 198 | span, |
| 191 | 199 | &[ |
| 192 | 200 | sym::bundle, |
| 201 | sym::export_symbols, | |
| 193 | 202 | sym::verbatim, |
| 194 | 203 | sym::whole_dash_archive, |
| 195 | 204 | sym::as_dash_needed, |
| ... | ... | @@ -285,7 +294,9 @@ impl LinkParser { |
| 285 | 294 | }; |
| 286 | 295 | |
| 287 | 296 | let link_kind = match link_kind { |
| 288 | kw::Static => NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 297 | kw::Static => { | |
| 298 | NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None } | |
| 299 | } | |
| 289 | 300 | sym::dylib => NativeLibKind::Dylib { as_needed: None }, |
| 290 | 301 | sym::framework => { |
| 291 | 302 | if !sess.target.is_like_darwin { |
compiler/rustc_attr_parsing/src/session_diagnostics.rs+8-1| ... | ... | @@ -909,7 +909,7 @@ pub(crate) struct RawDylibOnlyWindows { |
| 909 | 909 | |
| 910 | 910 | #[derive(Diagnostic)] |
| 911 | 911 | #[diag( |
| 912 | "invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed" | |
| 912 | "invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed, export-symbols" | |
| 913 | 913 | )] |
| 914 | 914 | pub(crate) struct InvalidLinkModifier { |
| 915 | 915 | #[primary_span] |
| ... | ... | @@ -938,6 +938,13 @@ pub(crate) struct BundleNeedsStatic { |
| 938 | 938 | pub span: Span, |
| 939 | 939 | } |
| 940 | 940 | |
| 941 | #[derive(Diagnostic)] | |
| 942 | #[diag("linking modifier `export-symbols` is only compatible with `static` linking kind")] | |
| 943 | pub(crate) struct ExportSymbolsNeedsStatic { | |
| 944 | #[primary_span] | |
| 945 | pub span: Span, | |
| 946 | } | |
| 947 | ||
| 941 | 948 | #[derive(Diagnostic)] |
| 942 | 949 | #[diag("linking modifier `whole-archive` is only compatible with `static` linking kind")] |
| 943 | 950 | pub(crate) struct WholeArchiveNeedsStatic { |
compiler/rustc_codegen_cranelift/src/lib.rs-5| ... | ... | @@ -125,11 +125,6 @@ pub struct CraneliftCodegenBackend { |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | impl CodegenBackend for CraneliftCodegenBackend { |
| 128 | fn locale_resource(&self) -> &'static str { | |
| 129 | // FIXME(rust-lang/rust#100717) - cranelift codegen backend is not yet translated | |
| 130 | "" | |
| 131 | } | |
| 132 | ||
| 133 | 128 | fn name(&self) -> &'static str { |
| 134 | 129 | "cranelift" |
| 135 | 130 | } |
compiler/rustc_codegen_gcc/messages.ftl deleted-8| ... | ... | @@ -1,8 +0,0 @@ |
| 1 | codegen_gcc_unwinding_inline_asm = | |
| 2 | GCC backend does not support unwinding from inline asm | |
| 3 | ||
| 4 | codegen_gcc_copy_bitcode = failed to copy bitcode to object file: {$err} | |
| 5 | ||
| 6 | codegen_gcc_lto_bitcode_from_rlib = failed to get bitcode from object file for LTO ({$gcc_err}) | |
| 7 | ||
| 8 | codegen_gcc_explicit_tail_calls_unsupported = explicit tail calls with the 'become' keyword are not implemented in the GCC backend |
compiler/rustc_codegen_gcc/src/errors.rs+4-4| ... | ... | @@ -2,24 +2,24 @@ use rustc_macros::Diagnostic; |
| 2 | 2 | use rustc_span::Span; |
| 3 | 3 | |
| 4 | 4 | #[derive(Diagnostic)] |
| 5 | #[diag(codegen_gcc_unwinding_inline_asm)] | |
| 5 | #[diag("GCC backend does not support unwinding from inline asm")] | |
| 6 | 6 | pub(crate) struct UnwindingInlineAsm { |
| 7 | 7 | #[primary_span] |
| 8 | 8 | pub span: Span, |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | #[derive(Diagnostic)] |
| 12 | #[diag(codegen_gcc_copy_bitcode)] | |
| 12 | #[diag("failed to copy bitcode to object file: {$err}")] | |
| 13 | 13 | pub(crate) struct CopyBitcode { |
| 14 | 14 | pub err: std::io::Error, |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | #[derive(Diagnostic)] |
| 18 | #[diag(codegen_gcc_lto_bitcode_from_rlib)] | |
| 18 | #[diag("failed to get bitcode from object file for LTO ({$gcc_err})")] | |
| 19 | 19 | pub(crate) struct LtoBitcodeFromRlib { |
| 20 | 20 | pub gcc_err: String, |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | #[derive(Diagnostic)] |
| 24 | #[diag(codegen_gcc_explicit_tail_calls_unsupported)] | |
| 24 | #[diag("explicit tail calls with the 'become' keyword are not implemented in the GCC backend")] | |
| 25 | 25 | pub(crate) struct ExplicitTailCallsUnsupported; |
compiler/rustc_codegen_gcc/src/lib.rs-7| ... | ... | @@ -27,7 +27,6 @@ extern crate rustc_ast; |
| 27 | 27 | extern crate rustc_codegen_ssa; |
| 28 | 28 | extern crate rustc_data_structures; |
| 29 | 29 | extern crate rustc_errors; |
| 30 | extern crate rustc_fluent_macro; | |
| 31 | 30 | extern crate rustc_fs_util; |
| 32 | 31 | extern crate rustc_hir; |
| 33 | 32 | extern crate rustc_index; |
| ... | ... | @@ -105,8 +104,6 @@ use tempfile::TempDir; |
| 105 | 104 | use crate::back::lto::ModuleBuffer; |
| 106 | 105 | use crate::gcc_util::{target_cpu, to_gcc_features}; |
| 107 | 106 | |
| 108 | rustc_fluent_macro::fluent_messages! { "../messages.ftl" } | |
| 109 | ||
| 110 | 107 | pub struct PrintOnPanic<F: Fn() -> String>(pub F); |
| 111 | 108 | |
| 112 | 109 | impl<F: Fn() -> String> Drop for PrintOnPanic<F> { |
| ... | ... | @@ -197,10 +194,6 @@ fn load_libgccjit_if_needed(libgccjit_target_lib_file: &Path) { |
| 197 | 194 | } |
| 198 | 195 | |
| 199 | 196 | impl CodegenBackend for GccCodegenBackend { |
| 200 | fn locale_resource(&self) -> &'static str { | |
| 201 | crate::DEFAULT_LOCALE_RESOURCE | |
| 202 | } | |
| 203 | ||
| 204 | 197 | fn name(&self) -> &'static str { |
| 205 | 198 | "gcc" |
| 206 | 199 | } |
compiler/rustc_codegen_llvm/Cargo.toml-1| ... | ... | @@ -23,7 +23,6 @@ rustc_ast = { path = "../rustc_ast" } |
| 23 | 23 | rustc_codegen_ssa = { path = "../rustc_codegen_ssa" } |
| 24 | 24 | rustc_data_structures = { path = "../rustc_data_structures" } |
| 25 | 25 | rustc_errors = { path = "../rustc_errors" } |
| 26 | rustc_fluent_macro = { path = "../rustc_fluent_macro" } | |
| 27 | 26 | rustc_fs_util = { path = "../rustc_fs_util" } |
| 28 | 27 | rustc_hashes = { path = "../rustc_hashes" } |
| 29 | 28 | rustc_hir = { path = "../rustc_hir" } |
compiler/rustc_codegen_llvm/messages.ftl deleted-75| ... | ... | @@ -1,75 +0,0 @@ |
| 1 | codegen_llvm_autodiff_component_missing = autodiff backend not found in the sysroot: {$err} | |
| 2 | .note = it will be distributed via rustup in the future | |
| 3 | ||
| 4 | codegen_llvm_autodiff_component_unavailable = failed to load our autodiff backend: {$err} | |
| 5 | ||
| 6 | codegen_llvm_autodiff_without_enable = using the autodiff feature requires -Z autodiff=Enable | |
| 7 | codegen_llvm_autodiff_without_lto = using the autodiff feature requires setting `lto="fat"` in your Cargo.toml | |
| 8 | ||
| 9 | codegen_llvm_copy_bitcode = failed to copy bitcode to object file: {$err} | |
| 10 | ||
| 11 | codegen_llvm_fixed_x18_invalid_arch = the `-Zfixed-x18` flag is not supported on the `{$arch}` architecture | |
| 12 | ||
| 13 | codegen_llvm_from_llvm_diag = {$message} | |
| 14 | ||
| 15 | codegen_llvm_from_llvm_optimization_diag = {$filename}:{$line}:{$column} {$pass_name} ({$kind}): {$message} | |
| 16 | ||
| 17 | codegen_llvm_load_bitcode = failed to load bitcode of module "{$name}" | |
| 18 | codegen_llvm_load_bitcode_with_llvm_err = failed to load bitcode of module "{$name}": {$llvm_err} | |
| 19 | ||
| 20 | codegen_llvm_lto_bitcode_from_rlib = failed to get bitcode from object file for LTO ({$err}) | |
| 21 | ||
| 22 | codegen_llvm_mismatch_data_layout = | |
| 23 | data-layout for target `{$rustc_target}`, `{$rustc_layout}`, differs from LLVM target's `{$llvm_target}` default layout, `{$llvm_layout}` | |
| 24 | ||
| 25 | codegen_llvm_offload_bundleimages_failed = call to BundleImages failed, `host.out` was not created | |
| 26 | codegen_llvm_offload_embed_failed = call to EmbedBufferInModule failed, `host.o` was not created | |
| 27 | codegen_llvm_offload_no_abs_path = using the `-Z offload=Host=/absolute/path/to/host.out` flag requires an absolute path | |
| 28 | codegen_llvm_offload_no_host_out = using the `-Z offload=Host=/absolute/path/to/host.out` flag must point to a `host.out` file | |
| 29 | codegen_llvm_offload_nonexisting = the given path/file to `host.out` does not exist. Did you forget to run the device compilation first? | |
| 30 | codegen_llvm_offload_without_enable = using the offload feature requires -Z offload=<Device or Host=/absolute/path/to/host.out> | |
| 31 | codegen_llvm_offload_without_fat_lto = using the offload feature requires -C lto=fat | |
| 32 | ||
| 33 | codegen_llvm_parse_bitcode = failed to parse bitcode for LTO module | |
| 34 | codegen_llvm_parse_bitcode_with_llvm_err = failed to parse bitcode for LTO module: {$llvm_err} | |
| 35 | ||
| 36 | codegen_llvm_parse_target_machine_config = | |
| 37 | failed to parse target machine config to target machine: {$error} | |
| 38 | ||
| 39 | codegen_llvm_prepare_autodiff = failed to prepare autodiff: src: {$src}, target: {$target}, {$error} | |
| 40 | codegen_llvm_prepare_autodiff_with_llvm_err = failed to prepare autodiff: {$llvm_err}, src: {$src}, target: {$target}, {$error} | |
| 41 | codegen_llvm_prepare_thin_lto_context = failed to prepare thin LTO context | |
| 42 | codegen_llvm_prepare_thin_lto_context_with_llvm_err = failed to prepare thin LTO context: {$llvm_err} | |
| 43 | ||
| 44 | codegen_llvm_prepare_thin_lto_module = failed to prepare thin LTO module | |
| 45 | codegen_llvm_prepare_thin_lto_module_with_llvm_err = failed to prepare thin LTO module: {$llvm_err} | |
| 46 | ||
| 47 | codegen_llvm_run_passes = failed to run LLVM passes | |
| 48 | codegen_llvm_run_passes_with_llvm_err = failed to run LLVM passes: {$llvm_err} | |
| 49 | ||
| 50 | codegen_llvm_sanitizer_kcfi_arity_requires_llvm_21_0_0 = `-Zsanitizer-kcfi-arity` requires LLVM 21.0.0 or later. | |
| 51 | ||
| 52 | codegen_llvm_sanitizer_memtag_requires_mte = | |
| 53 | `-Zsanitizer=memtag` requires `-Ctarget-feature=+mte` | |
| 54 | ||
| 55 | codegen_llvm_serialize_module = failed to serialize module {$name} | |
| 56 | codegen_llvm_serialize_module_with_llvm_err = failed to serialize module {$name}: {$llvm_err} | |
| 57 | ||
| 58 | codegen_llvm_symbol_already_defined = | |
| 59 | symbol `{$symbol_name}` is already defined | |
| 60 | ||
| 61 | codegen_llvm_target_machine = could not create LLVM TargetMachine for triple: {$triple} | |
| 62 | codegen_llvm_target_machine_with_llvm_err = could not create LLVM TargetMachine for triple: {$triple}: {$llvm_err} | |
| 63 | ||
| 64 | codegen_llvm_unknown_debuginfo_compression = unknown debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo | |
| 65 | ||
| 66 | codegen_llvm_write_bytecode = failed to write bytecode to {$path}: {$err} | |
| 67 | ||
| 68 | codegen_llvm_write_ir = failed to write LLVM IR to {$path} | |
| 69 | codegen_llvm_write_ir_with_llvm_err = failed to write LLVM IR to {$path}: {$llvm_err} | |
| 70 | ||
| 71 | codegen_llvm_write_output = could not write output to {$path} | |
| 72 | codegen_llvm_write_output_with_llvm_err = could not write output to {$path}: {$llvm_err} | |
| 73 | ||
| 74 | codegen_llvm_write_thinlto_key = error while writing ThinLTO key data: {$err} | |
| 75 | codegen_llvm_write_thinlto_key_with_llvm_err = error while writing ThinLTO key data: {$err}: {$llvm_err} |
compiler/rustc_codegen_llvm/src/errors.rs+74-50| ... | ... | @@ -2,14 +2,12 @@ use std::ffi::CString; |
| 2 | 2 | use std::path::Path; |
| 3 | 3 | |
| 4 | 4 | use rustc_data_structures::small_c_str::SmallCStr; |
| 5 | use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level}; | |
| 5 | use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level, inline_fluent}; | |
| 6 | 6 | use rustc_macros::Diagnostic; |
| 7 | 7 | use rustc_span::Span; |
| 8 | 8 | |
| 9 | use crate::fluent_generated as fluent; | |
| 10 | ||
| 11 | 9 | #[derive(Diagnostic)] |
| 12 | #[diag(codegen_llvm_symbol_already_defined)] | |
| 10 | #[diag("symbol `{$symbol_name}` is already defined")] | |
| 13 | 11 | pub(crate) struct SymbolAlreadyDefined<'a> { |
| 14 | 12 | #[primary_span] |
| 15 | 13 | pub span: Span, |
| ... | ... | @@ -17,7 +15,7 @@ pub(crate) struct SymbolAlreadyDefined<'a> { |
| 17 | 15 | } |
| 18 | 16 | |
| 19 | 17 | #[derive(Diagnostic)] |
| 20 | #[diag(codegen_llvm_sanitizer_memtag_requires_mte)] | |
| 18 | #[diag("`-Zsanitizer=memtag` requires `-Ctarget-feature=+mte`")] | |
| 21 | 19 | pub(crate) struct SanitizerMemtagRequiresMte; |
| 22 | 20 | |
| 23 | 21 | pub(crate) struct ParseTargetMachineConfig<'a>(pub LlvmError<'a>); |
| ... | ... | @@ -27,89 +25,97 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for ParseTargetMachineConfig<'_> { |
| 27 | 25 | let diag: Diag<'_, G> = self.0.into_diag(dcx, level); |
| 28 | 26 | let (message, _) = diag.messages.first().expect("`LlvmError` with no message"); |
| 29 | 27 | let message = dcx.eagerly_translate_to_string(message.clone(), diag.args.iter()); |
| 30 | Diag::new(dcx, level, fluent::codegen_llvm_parse_target_machine_config) | |
| 31 | .with_arg("error", message) | |
| 28 | Diag::new( | |
| 29 | dcx, | |
| 30 | level, | |
| 31 | inline_fluent!("failed to parse target machine config to target machine: {$error}"), | |
| 32 | ) | |
| 33 | .with_arg("error", message) | |
| 32 | 34 | } |
| 33 | 35 | } |
| 34 | 36 | |
| 35 | 37 | #[derive(Diagnostic)] |
| 36 | #[diag(codegen_llvm_autodiff_component_unavailable)] | |
| 38 | #[diag("failed to load our autodiff backend: {$err}")] | |
| 37 | 39 | pub(crate) struct AutoDiffComponentUnavailable { |
| 38 | 40 | pub err: String, |
| 39 | 41 | } |
| 40 | 42 | |
| 41 | 43 | #[derive(Diagnostic)] |
| 42 | #[diag(codegen_llvm_autodiff_component_missing)] | |
| 43 | #[note] | |
| 44 | #[diag("autodiff backend not found in the sysroot: {$err}")] | |
| 45 | #[note("it will be distributed via rustup in the future")] | |
| 44 | 46 | pub(crate) struct AutoDiffComponentMissing { |
| 45 | 47 | pub err: String, |
| 46 | 48 | } |
| 47 | 49 | |
| 48 | 50 | #[derive(Diagnostic)] |
| 49 | #[diag(codegen_llvm_autodiff_without_lto)] | |
| 51 | #[diag("using the autodiff feature requires setting `lto=\"fat\"` in your Cargo.toml")] | |
| 50 | 52 | pub(crate) struct AutoDiffWithoutLto; |
| 51 | 53 | |
| 52 | 54 | #[derive(Diagnostic)] |
| 53 | #[diag(codegen_llvm_autodiff_without_enable)] | |
| 55 | #[diag("using the autodiff feature requires -Z autodiff=Enable")] | |
| 54 | 56 | pub(crate) struct AutoDiffWithoutEnable; |
| 55 | 57 | |
| 56 | 58 | #[derive(Diagnostic)] |
| 57 | #[diag(codegen_llvm_offload_without_enable)] | |
| 59 | #[diag("using the offload feature requires -Z offload=<Device or Host=/absolute/path/to/host.out>")] | |
| 58 | 60 | pub(crate) struct OffloadWithoutEnable; |
| 59 | 61 | |
| 60 | 62 | #[derive(Diagnostic)] |
| 61 | #[diag(codegen_llvm_offload_without_fat_lto)] | |
| 63 | #[diag("using the offload feature requires -C lto=fat")] | |
| 62 | 64 | pub(crate) struct OffloadWithoutFatLTO; |
| 63 | 65 | |
| 64 | 66 | #[derive(Diagnostic)] |
| 65 | #[diag(codegen_llvm_offload_no_abs_path)] | |
| 67 | #[diag("using the `-Z offload=Host=/absolute/path/to/host.out` flag requires an absolute path")] | |
| 66 | 68 | pub(crate) struct OffloadWithoutAbsPath; |
| 67 | 69 | |
| 68 | 70 | #[derive(Diagnostic)] |
| 69 | #[diag(codegen_llvm_offload_no_host_out)] | |
| 71 | #[diag( | |
| 72 | "using the `-Z offload=Host=/absolute/path/to/host.out` flag must point to a `host.out` file" | |
| 73 | )] | |
| 70 | 74 | pub(crate) struct OffloadWrongFileName; |
| 71 | 75 | |
| 72 | 76 | #[derive(Diagnostic)] |
| 73 | #[diag(codegen_llvm_offload_nonexisting)] | |
| 77 | #[diag( | |
| 78 | "the given path/file to `host.out` does not exist. Did you forget to run the device compilation first?" | |
| 79 | )] | |
| 74 | 80 | pub(crate) struct OffloadNonexistingPath; |
| 75 | 81 | |
| 76 | 82 | #[derive(Diagnostic)] |
| 77 | #[diag(codegen_llvm_offload_bundleimages_failed)] | |
| 83 | #[diag("call to BundleImages failed, `host.out` was not created")] | |
| 78 | 84 | pub(crate) struct OffloadBundleImagesFailed; |
| 79 | 85 | |
| 80 | 86 | #[derive(Diagnostic)] |
| 81 | #[diag(codegen_llvm_offload_embed_failed)] | |
| 87 | #[diag("call to EmbedBufferInModule failed, `host.o` was not created")] | |
| 82 | 88 | pub(crate) struct OffloadEmbedFailed; |
| 83 | 89 | |
| 84 | 90 | #[derive(Diagnostic)] |
| 85 | #[diag(codegen_llvm_lto_bitcode_from_rlib)] | |
| 91 | #[diag("failed to get bitcode from object file for LTO ({$err})")] | |
| 86 | 92 | pub(crate) struct LtoBitcodeFromRlib { |
| 87 | 93 | pub err: String, |
| 88 | 94 | } |
| 89 | 95 | |
| 90 | 96 | #[derive(Diagnostic)] |
| 91 | 97 | pub enum LlvmError<'a> { |
| 92 | #[diag(codegen_llvm_write_output)] | |
| 98 | #[diag("could not write output to {$path}")] | |
| 93 | 99 | WriteOutput { path: &'a Path }, |
| 94 | #[diag(codegen_llvm_target_machine)] | |
| 100 | #[diag("could not create LLVM TargetMachine for triple: {$triple}")] | |
| 95 | 101 | CreateTargetMachine { triple: SmallCStr }, |
| 96 | #[diag(codegen_llvm_run_passes)] | |
| 102 | #[diag("failed to run LLVM passes")] | |
| 97 | 103 | RunLlvmPasses, |
| 98 | #[diag(codegen_llvm_serialize_module)] | |
| 104 | #[diag("failed to serialize module {$name}")] | |
| 99 | 105 | SerializeModule { name: &'a str }, |
| 100 | #[diag(codegen_llvm_write_ir)] | |
| 106 | #[diag("failed to write LLVM IR to {$path}")] | |
| 101 | 107 | WriteIr { path: &'a Path }, |
| 102 | #[diag(codegen_llvm_prepare_thin_lto_context)] | |
| 108 | #[diag("failed to prepare thin LTO context")] | |
| 103 | 109 | PrepareThinLtoContext, |
| 104 | #[diag(codegen_llvm_load_bitcode)] | |
| 110 | #[diag("failed to load bitcode of module \"{$name}\"")] | |
| 105 | 111 | LoadBitcode { name: CString }, |
| 106 | #[diag(codegen_llvm_write_thinlto_key)] | |
| 112 | #[diag("error while writing ThinLTO key data: {$err}")] | |
| 107 | 113 | WriteThinLtoKey { err: std::io::Error }, |
| 108 | #[diag(codegen_llvm_prepare_thin_lto_module)] | |
| 114 | #[diag("failed to prepare thin LTO module")] | |
| 109 | 115 | PrepareThinLtoModule, |
| 110 | #[diag(codegen_llvm_parse_bitcode)] | |
| 116 | #[diag("failed to parse bitcode for LTO module")] | |
| 111 | 117 | ParseBitcode, |
| 112 | #[diag(codegen_llvm_prepare_autodiff)] | |
| 118 | #[diag("failed to prepare autodiff: src: {$src}, target: {$target}, {$error}")] | |
| 113 | 119 | PrepareAutoDiff { src: String, target: String, error: String }, |
| 114 | 120 | } |
| 115 | 121 | |
| ... | ... | @@ -119,17 +125,31 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for WithLlvmError<'_> { |
| 119 | 125 | fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> { |
| 120 | 126 | use LlvmError::*; |
| 121 | 127 | let msg_with_llvm_err = match &self.0 { |
| 122 | WriteOutput { .. } => fluent::codegen_llvm_write_output_with_llvm_err, | |
| 123 | CreateTargetMachine { .. } => fluent::codegen_llvm_target_machine_with_llvm_err, | |
| 124 | RunLlvmPasses => fluent::codegen_llvm_run_passes_with_llvm_err, | |
| 125 | SerializeModule { .. } => fluent::codegen_llvm_serialize_module_with_llvm_err, | |
| 126 | WriteIr { .. } => fluent::codegen_llvm_write_ir_with_llvm_err, | |
| 127 | PrepareThinLtoContext => fluent::codegen_llvm_prepare_thin_lto_context_with_llvm_err, | |
| 128 | LoadBitcode { .. } => fluent::codegen_llvm_load_bitcode_with_llvm_err, | |
| 129 | WriteThinLtoKey { .. } => fluent::codegen_llvm_write_thinlto_key_with_llvm_err, | |
| 130 | PrepareThinLtoModule => fluent::codegen_llvm_prepare_thin_lto_module_with_llvm_err, | |
| 131 | ParseBitcode => fluent::codegen_llvm_parse_bitcode_with_llvm_err, | |
| 132 | PrepareAutoDiff { .. } => fluent::codegen_llvm_prepare_autodiff_with_llvm_err, | |
| 128 | WriteOutput { .. } => inline_fluent!("could not write output to {$path}: {$llvm_err}"), | |
| 129 | CreateTargetMachine { .. } => inline_fluent!( | |
| 130 | "could not create LLVM TargetMachine for triple: {$triple}: {$llvm_err}" | |
| 131 | ), | |
| 132 | RunLlvmPasses => inline_fluent!("failed to run LLVM passes: {$llvm_err}"), | |
| 133 | SerializeModule { .. } => { | |
| 134 | inline_fluent!("failed to serialize module {$name}: {$llvm_err}") | |
| 135 | } | |
| 136 | WriteIr { .. } => inline_fluent!("failed to write LLVM IR to {$path}: {$llvm_err}"), | |
| 137 | PrepareThinLtoContext => { | |
| 138 | inline_fluent!("failed to prepare thin LTO context: {$llvm_err}") | |
| 139 | } | |
| 140 | LoadBitcode { .. } => { | |
| 141 | inline_fluent!("failed to load bitcode of module \"{$name}\": {$llvm_err}") | |
| 142 | } | |
| 143 | WriteThinLtoKey { .. } => { | |
| 144 | inline_fluent!("error while writing ThinLTO key data: {$err}: {$llvm_err}") | |
| 145 | } | |
| 146 | PrepareThinLtoModule => { | |
| 147 | inline_fluent!("failed to prepare thin LTO module: {$llvm_err}") | |
| 148 | } | |
| 149 | ParseBitcode => inline_fluent!("failed to parse bitcode for LTO module: {$llvm_err}"), | |
| 150 | PrepareAutoDiff { .. } => inline_fluent!( | |
| 151 | "failed to prepare autodiff: {$llvm_err}, src: {$src}, target: {$target}, {$error}" | |
| 152 | ), | |
| 133 | 153 | }; |
| 134 | 154 | self.0 |
| 135 | 155 | .into_diag(dcx, level) |
| ... | ... | @@ -139,7 +159,7 @@ impl<G: EmissionGuarantee> Diagnostic<'_, G> for WithLlvmError<'_> { |
| 139 | 159 | } |
| 140 | 160 | |
| 141 | 161 | #[derive(Diagnostic)] |
| 142 | #[diag(codegen_llvm_from_llvm_optimization_diag)] | |
| 162 | #[diag("{$filename}:{$line}:{$column} {$pass_name} ({$kind}): {$message}")] | |
| 143 | 163 | pub(crate) struct FromLlvmOptimizationDiag<'a> { |
| 144 | 164 | pub filename: &'a str, |
| 145 | 165 | pub line: std::ffi::c_uint, |
| ... | ... | @@ -150,32 +170,36 @@ pub(crate) struct FromLlvmOptimizationDiag<'a> { |
| 150 | 170 | } |
| 151 | 171 | |
| 152 | 172 | #[derive(Diagnostic)] |
| 153 | #[diag(codegen_llvm_from_llvm_diag)] | |
| 173 | #[diag("{$message}")] | |
| 154 | 174 | pub(crate) struct FromLlvmDiag { |
| 155 | 175 | pub message: String, |
| 156 | 176 | } |
| 157 | 177 | |
| 158 | 178 | #[derive(Diagnostic)] |
| 159 | #[diag(codegen_llvm_write_bytecode)] | |
| 179 | #[diag("failed to write bytecode to {$path}: {$err}")] | |
| 160 | 180 | pub(crate) struct WriteBytecode<'a> { |
| 161 | 181 | pub path: &'a Path, |
| 162 | 182 | pub err: std::io::Error, |
| 163 | 183 | } |
| 164 | 184 | |
| 165 | 185 | #[derive(Diagnostic)] |
| 166 | #[diag(codegen_llvm_copy_bitcode)] | |
| 186 | #[diag("failed to copy bitcode to object file: {$err}")] | |
| 167 | 187 | pub(crate) struct CopyBitcode { |
| 168 | 188 | pub err: std::io::Error, |
| 169 | 189 | } |
| 170 | 190 | |
| 171 | 191 | #[derive(Diagnostic)] |
| 172 | #[diag(codegen_llvm_unknown_debuginfo_compression)] | |
| 192 | #[diag( | |
| 193 | "unknown debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo" | |
| 194 | )] | |
| 173 | 195 | pub(crate) struct UnknownCompression { |
| 174 | 196 | pub algorithm: &'static str, |
| 175 | 197 | } |
| 176 | 198 | |
| 177 | 199 | #[derive(Diagnostic)] |
| 178 | #[diag(codegen_llvm_mismatch_data_layout)] | |
| 200 | #[diag( | |
| 201 | "data-layout for target `{$rustc_target}`, `{$rustc_layout}`, differs from LLVM target's `{$llvm_target}` default layout, `{$llvm_layout}`" | |
| 202 | )] | |
| 179 | 203 | pub(crate) struct MismatchedDataLayout<'a> { |
| 180 | 204 | pub rustc_target: &'a str, |
| 181 | 205 | pub rustc_layout: &'a str, |
| ... | ... | @@ -184,11 +208,11 @@ pub(crate) struct MismatchedDataLayout<'a> { |
| 184 | 208 | } |
| 185 | 209 | |
| 186 | 210 | #[derive(Diagnostic)] |
| 187 | #[diag(codegen_llvm_fixed_x18_invalid_arch)] | |
| 211 | #[diag("the `-Zfixed-x18` flag is not supported on the `{$arch}` architecture")] | |
| 188 | 212 | pub(crate) struct FixedX18InvalidArch<'a> { |
| 189 | 213 | pub arch: &'a str, |
| 190 | 214 | } |
| 191 | 215 | |
| 192 | 216 | #[derive(Diagnostic)] |
| 193 | #[diag(codegen_llvm_sanitizer_kcfi_arity_requires_llvm_21_0_0)] | |
| 217 | #[diag("`-Zsanitizer-kcfi-arity` requires LLVM 21.0.0 or later.")] | |
| 194 | 218 | pub(crate) struct SanitizerKcfiArityRequiresLLVM2100; |
compiler/rustc_codegen_llvm/src/lib.rs-6| ... | ... | @@ -74,8 +74,6 @@ mod typetree; |
| 74 | 74 | mod va_arg; |
| 75 | 75 | mod value; |
| 76 | 76 | |
| 77 | rustc_fluent_macro::fluent_messages! { "../messages.ftl" } | |
| 78 | ||
| 79 | 77 | pub(crate) use macros::TryFromU32; |
| 80 | 78 | |
| 81 | 79 | #[derive(Clone)] |
| ... | ... | @@ -241,10 +239,6 @@ impl LlvmCodegenBackend { |
| 241 | 239 | } |
| 242 | 240 | |
| 243 | 241 | impl CodegenBackend for LlvmCodegenBackend { |
| 244 | fn locale_resource(&self) -> &'static str { | |
| 245 | crate::DEFAULT_LOCALE_RESOURCE | |
| 246 | } | |
| 247 | ||
| 248 | 242 | fn name(&self) -> &'static str { |
| 249 | 243 | "llvm" |
| 250 | 244 | } |
compiler/rustc_codegen_ssa/src/back/link.rs+88-7| ... | ... | @@ -11,10 +11,11 @@ use std::{env, fmt, fs, io, mem, str}; |
| 11 | 11 | |
| 12 | 12 | use find_msvc_tools; |
| 13 | 13 | use itertools::Itertools; |
| 14 | use object::{Object, ObjectSection, ObjectSymbol}; | |
| 14 | 15 | use regex::Regex; |
| 15 | 16 | use rustc_arena::TypedArena; |
| 16 | 17 | use rustc_attr_parsing::eval_config_entry; |
| 17 | use rustc_data_structures::fx::FxIndexSet; | |
| 18 | use rustc_data_structures::fx::{FxHashSet, FxIndexSet}; | |
| 18 | 19 | use rustc_data_structures::memmap::Mmap; |
| 19 | 20 | use rustc_data_structures::temp_dir::MaybeTempDir; |
| 20 | 21 | use rustc_errors::{DiagCtxtHandle, LintDiagnostic}; |
| ... | ... | @@ -2185,6 +2186,71 @@ fn add_rpath_args( |
| 2185 | 2186 | } |
| 2186 | 2187 | } |
| 2187 | 2188 | |
| 2189 | fn add_c_staticlib_symbols( | |
| 2190 | sess: &Session, | |
| 2191 | lib: &NativeLib, | |
| 2192 | out: &mut Vec<(String, SymbolExportKind)>, | |
| 2193 | ) -> io::Result<()> { | |
| 2194 | let file_path = find_native_static_library(lib.name.as_str(), lib.verbatim, sess); | |
| 2195 | ||
| 2196 | let archive_map = unsafe { Mmap::map(File::open(&file_path)?)? }; | |
| 2197 | ||
| 2198 | let archive = object::read::archive::ArchiveFile::parse(&*archive_map) | |
| 2199 | .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; | |
| 2200 | ||
| 2201 | for member in archive.members() { | |
| 2202 | let member = member.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; | |
| 2203 | ||
| 2204 | let data = member | |
| 2205 | .data(&*archive_map) | |
| 2206 | .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; | |
| 2207 | ||
| 2208 | // clang LTO: raw LLVM bitcode | |
| 2209 | if data.starts_with(b"BC\xc0\xde") { | |
| 2210 | return Err(io::Error::new( | |
| 2211 | io::ErrorKind::InvalidData, | |
| 2212 | "LLVM bitcode object in C static library (LTO not supported)", | |
| 2213 | )); | |
| 2214 | } | |
| 2215 | ||
| 2216 | let object = object::File::parse(&*data) | |
| 2217 | .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; | |
| 2218 | ||
| 2219 | // gcc / clang ELF / Mach-O LTO | |
| 2220 | if object.sections().any(|s| { | |
| 2221 | s.name().map(|n| n.starts_with(".gnu.lto_") || n == ".llvm.lto").unwrap_or(false) | |
| 2222 | }) { | |
| 2223 | return Err(io::Error::new( | |
| 2224 | io::ErrorKind::InvalidData, | |
| 2225 | "LTO object in C static library is not supported", | |
| 2226 | )); | |
| 2227 | } | |
| 2228 | ||
| 2229 | for symbol in object.symbols() { | |
| 2230 | if symbol.scope() != object::SymbolScope::Dynamic { | |
| 2231 | continue; | |
| 2232 | } | |
| 2233 | ||
| 2234 | let name = match symbol.name() { | |
| 2235 | Ok(n) => n, | |
| 2236 | Err(_) => continue, | |
| 2237 | }; | |
| 2238 | ||
| 2239 | let export_kind = match symbol.kind() { | |
| 2240 | object::SymbolKind::Text => SymbolExportKind::Text, | |
| 2241 | object::SymbolKind::Data => SymbolExportKind::Data, | |
| 2242 | _ => continue, | |
| 2243 | }; | |
| 2244 | ||
| 2245 | // FIXME:The symbol mangle rules are slightly different in Windows(32-bit) and Apple. | |
| 2246 | // Need to be resolved. | |
| 2247 | out.push((name.to_string(), export_kind)); | |
| 2248 | } | |
| 2249 | } | |
| 2250 | ||
| 2251 | Ok(()) | |
| 2252 | } | |
| 2253 | ||
| 2188 | 2254 | /// Produce the linker command line containing linker path and arguments. |
| 2189 | 2255 | /// |
| 2190 | 2256 | /// When comments in the function say "order-(in)dependent" they mean order-dependence between |
| ... | ... | @@ -2217,6 +2283,25 @@ fn linker_with_args( |
| 2217 | 2283 | ); |
| 2218 | 2284 | let link_output_kind = link_output_kind(sess, crate_type); |
| 2219 | 2285 | |
| 2286 | let mut export_symbols = codegen_results.crate_info.exported_symbols[&crate_type].clone(); | |
| 2287 | ||
| 2288 | if crate_type == CrateType::Cdylib { | |
| 2289 | let mut seen = FxHashSet::default(); | |
| 2290 | ||
| 2291 | for lib in &codegen_results.crate_info.used_libraries { | |
| 2292 | if let NativeLibKind::Static { export_symbols: Some(true), .. } = lib.kind | |
| 2293 | && seen.insert((lib.name, lib.verbatim)) | |
| 2294 | { | |
| 2295 | if let Err(err) = add_c_staticlib_symbols(&sess, lib, &mut export_symbols) { | |
| 2296 | sess.dcx().fatal(format!( | |
| 2297 | "failed to process C static library `{}`: {}", | |
| 2298 | lib.name, err | |
| 2299 | )); | |
| 2300 | } | |
| 2301 | } | |
| 2302 | } | |
| 2303 | } | |
| 2304 | ||
| 2220 | 2305 | // ------------ Early order-dependent options ------------ |
| 2221 | 2306 | |
| 2222 | 2307 | // If we're building something like a dynamic library then some platforms |
| ... | ... | @@ -2224,11 +2309,7 @@ fn linker_with_args( |
| 2224 | 2309 | // dynamic library. |
| 2225 | 2310 | // Must be passed before any libraries to prevent the symbols to export from being thrown away, |
| 2226 | 2311 | // at least on some platforms (e.g. windows-gnu). |
| 2227 | cmd.export_symbols( | |
| 2228 | tmpdir, | |
| 2229 | crate_type, | |
| 2230 | &codegen_results.crate_info.exported_symbols[&crate_type], | |
| 2231 | ); | |
| 2312 | cmd.export_symbols(tmpdir, crate_type, &export_symbols); | |
| 2232 | 2313 | |
| 2233 | 2314 | // Can be used for adding custom CRT objects or overriding order-dependent options above. |
| 2234 | 2315 | // FIXME: In practice built-in target specs use this for arbitrary order-independent options, |
| ... | ... | @@ -2678,7 +2759,7 @@ fn add_native_libs_from_crate( |
| 2678 | 2759 | let name = lib.name.as_str(); |
| 2679 | 2760 | let verbatim = lib.verbatim; |
| 2680 | 2761 | match lib.kind { |
| 2681 | NativeLibKind::Static { bundle, whole_archive } => { | |
| 2762 | NativeLibKind::Static { bundle, whole_archive, .. } => { | |
| 2682 | 2763 | if link_static { |
| 2683 | 2764 | let bundle = bundle.unwrap_or(true); |
| 2684 | 2765 | let whole_archive = whole_archive == Some(true); |
compiler/rustc_codegen_ssa/src/traits/backend.rs-4| ... | ... | @@ -37,10 +37,6 @@ pub trait BackendTypes { |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | pub trait CodegenBackend { |
| 40 | /// Locale resources for diagnostic messages - a string the content of the Fluent resource. | |
| 41 | /// Called before `init` so that all other functions are able to emit translatable diagnostics. | |
| 42 | fn locale_resource(&self) -> &'static str; | |
| 43 | ||
| 44 | 40 | fn name(&self) -> &'static str; |
| 45 | 41 | |
| 46 | 42 | fn init(&self, _sess: &Session) {} |
compiler/rustc_driver_impl/Cargo.toml-3| ... | ... | @@ -33,18 +33,15 @@ rustc_metadata = { path = "../rustc_metadata" } |
| 33 | 33 | rustc_middle = { path = "../rustc_middle" } |
| 34 | 34 | rustc_mir_build = { path = "../rustc_mir_build" } |
| 35 | 35 | rustc_mir_transform = { path = "../rustc_mir_transform" } |
| 36 | rustc_monomorphize = { path = "../rustc_monomorphize" } | |
| 37 | 36 | rustc_parse = { path = "../rustc_parse" } |
| 38 | 37 | rustc_passes = { path = "../rustc_passes" } |
| 39 | 38 | rustc_pattern_analysis = { path = "../rustc_pattern_analysis" } |
| 40 | rustc_privacy = { path = "../rustc_privacy" } | |
| 41 | 39 | rustc_public = { path = "../rustc_public", features = ["rustc_internal"] } |
| 42 | 40 | rustc_resolve = { path = "../rustc_resolve" } |
| 43 | 41 | rustc_session = { path = "../rustc_session" } |
| 44 | 42 | rustc_span = { path = "../rustc_span" } |
| 45 | 43 | rustc_target = { path = "../rustc_target" } |
| 46 | 44 | rustc_trait_selection = { path = "../rustc_trait_selection" } |
| 47 | rustc_ty_utils = { path = "../rustc_ty_utils" } | |
| 48 | 45 | serde_json = "1.0.59" |
| 49 | 46 | shlex = "1.0" |
| 50 | 47 | tracing = { version = "0.1.35" } |
compiler/rustc_driver_impl/src/lib.rs-4| ... | ... | @@ -129,15 +129,11 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[ |
| 129 | 129 | rustc_middle::DEFAULT_LOCALE_RESOURCE, |
| 130 | 130 | rustc_mir_build::DEFAULT_LOCALE_RESOURCE, |
| 131 | 131 | rustc_mir_transform::DEFAULT_LOCALE_RESOURCE, |
| 132 | rustc_monomorphize::DEFAULT_LOCALE_RESOURCE, | |
| 133 | 132 | rustc_parse::DEFAULT_LOCALE_RESOURCE, |
| 134 | 133 | rustc_passes::DEFAULT_LOCALE_RESOURCE, |
| 135 | 134 | rustc_pattern_analysis::DEFAULT_LOCALE_RESOURCE, |
| 136 | rustc_privacy::DEFAULT_LOCALE_RESOURCE, | |
| 137 | 135 | rustc_resolve::DEFAULT_LOCALE_RESOURCE, |
| 138 | rustc_session::DEFAULT_LOCALE_RESOURCE, | |
| 139 | 136 | rustc_trait_selection::DEFAULT_LOCALE_RESOURCE, |
| 140 | rustc_ty_utils::DEFAULT_LOCALE_RESOURCE, | |
| 141 | 137 | // tidy-alphabetical-end |
| 142 | 138 | ]; |
| 143 | 139 |
compiler/rustc_hir/src/attrs/data_structures.rs+4-2| ... | ... | @@ -331,6 +331,8 @@ pub enum NativeLibKind { |
| 331 | 331 | bundle: Option<bool>, |
| 332 | 332 | /// Whether to link static library without throwing any object files away |
| 333 | 333 | whole_archive: Option<bool>, |
| 334 | /// Whether to export c static library symbols | |
| 335 | export_symbols: Option<bool>, | |
| 334 | 336 | }, |
| 335 | 337 | /// Dynamic library (e.g. `libfoo.so` on Linux) |
| 336 | 338 | /// or an import library corresponding to a dynamic library (e.g. `foo.lib` on Windows/MSVC). |
| ... | ... | @@ -363,8 +365,8 @@ pub enum NativeLibKind { |
| 363 | 365 | impl NativeLibKind { |
| 364 | 366 | pub fn has_modifiers(&self) -> bool { |
| 365 | 367 | match self { |
| 366 | NativeLibKind::Static { bundle, whole_archive } => { | |
| 367 | bundle.is_some() || whole_archive.is_some() | |
| 368 | NativeLibKind::Static { bundle, whole_archive, export_symbols } => { | |
| 369 | bundle.is_some() || whole_archive.is_some() || export_symbols.is_some() | |
| 368 | 370 | } |
| 369 | 371 | NativeLibKind::Dylib { as_needed } |
| 370 | 372 | | NativeLibKind::Framework { as_needed } |
compiler/rustc_interface/src/interface.rs+3-6| ... | ... | @@ -55,7 +55,7 @@ pub(crate) fn parse_cfg(dcx: DiagCtxtHandle<'_>, cfgs: Vec<String>) -> Cfg { |
| 55 | 55 | cfgs.into_iter() |
| 56 | 56 | .map(|s| { |
| 57 | 57 | let psess = ParseSess::emitter_with_note( |
| 58 | vec![rustc_parse::DEFAULT_LOCALE_RESOURCE, rustc_session::DEFAULT_LOCALE_RESOURCE], | |
| 58 | vec![rustc_parse::DEFAULT_LOCALE_RESOURCE], | |
| 59 | 59 | format!("this occurred on the command line: `--cfg={s}`"), |
| 60 | 60 | ); |
| 61 | 61 | let filename = FileName::cfg_spec_source_code(&s); |
| ... | ... | @@ -127,7 +127,7 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> Ch |
| 127 | 127 | |
| 128 | 128 | for s in specs { |
| 129 | 129 | let psess = ParseSess::emitter_with_note( |
| 130 | vec![rustc_parse::DEFAULT_LOCALE_RESOURCE, rustc_session::DEFAULT_LOCALE_RESOURCE], | |
| 130 | vec![rustc_parse::DEFAULT_LOCALE_RESOURCE], | |
| 131 | 131 | format!("this occurred on the command line: `--check-cfg={s}`"), |
| 132 | 132 | ); |
| 133 | 133 | let filename = FileName::cfg_spec_source_code(&s); |
| ... | ... | @@ -455,9 +455,6 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se |
| 455 | 455 | Err(e) => early_dcx.early_fatal(format!("failed to load fluent bundle: {e}")), |
| 456 | 456 | }; |
| 457 | 457 | |
| 458 | let mut locale_resources = config.locale_resources; | |
| 459 | locale_resources.push(codegen_backend.locale_resource()); | |
| 460 | ||
| 461 | 458 | let mut sess = rustc_session::build_session( |
| 462 | 459 | config.opts, |
| 463 | 460 | CompilerIO { |
| ... | ... | @@ -468,7 +465,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se |
| 468 | 465 | }, |
| 469 | 466 | bundle, |
| 470 | 467 | config.registry, |
| 471 | locale_resources, | |
| 468 | config.locale_resources, | |
| 472 | 469 | config.lint_caps, |
| 473 | 470 | target, |
| 474 | 471 | util::rustc_version_str().unwrap_or("unknown"), |
compiler/rustc_interface/src/tests.rs+9-9| ... | ... | @@ -379,7 +379,7 @@ fn test_native_libs_tracking_hash_different_values() { |
| 379 | 379 | NativeLib { |
| 380 | 380 | name: String::from("a"), |
| 381 | 381 | new_name: None, |
| 382 | kind: NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 382 | kind: NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None }, | |
| 383 | 383 | verbatim: None, |
| 384 | 384 | }, |
| 385 | 385 | NativeLib { |
| ... | ... | @@ -401,7 +401,7 @@ fn test_native_libs_tracking_hash_different_values() { |
| 401 | 401 | NativeLib { |
| 402 | 402 | name: String::from("a"), |
| 403 | 403 | new_name: None, |
| 404 | kind: NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 404 | kind: NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None }, | |
| 405 | 405 | verbatim: None, |
| 406 | 406 | }, |
| 407 | 407 | NativeLib { |
| ... | ... | @@ -423,13 +423,13 @@ fn test_native_libs_tracking_hash_different_values() { |
| 423 | 423 | NativeLib { |
| 424 | 424 | name: String::from("a"), |
| 425 | 425 | new_name: None, |
| 426 | kind: NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 426 | kind: NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None }, | |
| 427 | 427 | verbatim: None, |
| 428 | 428 | }, |
| 429 | 429 | NativeLib { |
| 430 | 430 | name: String::from("b"), |
| 431 | 431 | new_name: None, |
| 432 | kind: NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 432 | kind: NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None }, | |
| 433 | 433 | verbatim: None, |
| 434 | 434 | }, |
| 435 | 435 | NativeLib { |
| ... | ... | @@ -445,7 +445,7 @@ fn test_native_libs_tracking_hash_different_values() { |
| 445 | 445 | NativeLib { |
| 446 | 446 | name: String::from("a"), |
| 447 | 447 | new_name: None, |
| 448 | kind: NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 448 | kind: NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None }, | |
| 449 | 449 | verbatim: None, |
| 450 | 450 | }, |
| 451 | 451 | NativeLib { |
| ... | ... | @@ -467,7 +467,7 @@ fn test_native_libs_tracking_hash_different_values() { |
| 467 | 467 | NativeLib { |
| 468 | 468 | name: String::from("a"), |
| 469 | 469 | new_name: None, |
| 470 | kind: NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 470 | kind: NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None }, | |
| 471 | 471 | verbatim: None, |
| 472 | 472 | }, |
| 473 | 473 | NativeLib { |
| ... | ... | @@ -501,7 +501,7 @@ fn test_native_libs_tracking_hash_different_order() { |
| 501 | 501 | NativeLib { |
| 502 | 502 | name: String::from("a"), |
| 503 | 503 | new_name: None, |
| 504 | kind: NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 504 | kind: NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None }, | |
| 505 | 505 | verbatim: None, |
| 506 | 506 | }, |
| 507 | 507 | NativeLib { |
| ... | ... | @@ -528,7 +528,7 @@ fn test_native_libs_tracking_hash_different_order() { |
| 528 | 528 | NativeLib { |
| 529 | 529 | name: String::from("a"), |
| 530 | 530 | new_name: None, |
| 531 | kind: NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 531 | kind: NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None }, | |
| 532 | 532 | verbatim: None, |
| 533 | 533 | }, |
| 534 | 534 | NativeLib { |
| ... | ... | @@ -549,7 +549,7 @@ fn test_native_libs_tracking_hash_different_order() { |
| 549 | 549 | NativeLib { |
| 550 | 550 | name: String::from("a"), |
| 551 | 551 | new_name: None, |
| 552 | kind: NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 552 | kind: NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None }, | |
| 553 | 553 | verbatim: None, |
| 554 | 554 | }, |
| 555 | 555 | NativeLib { |
compiler/rustc_interface/src/util.rs-4| ... | ... | @@ -361,10 +361,6 @@ pub struct DummyCodegenBackend { |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | impl CodegenBackend for DummyCodegenBackend { |
| 364 | fn locale_resource(&self) -> &'static str { | |
| 365 | "" | |
| 366 | } | |
| 367 | ||
| 368 | 364 | fn name(&self) -> &'static str { |
| 369 | 365 | "dummy" |
| 370 | 366 | } |
compiler/rustc_lint/messages.ftl+12| ... | ... | @@ -326,6 +326,14 @@ lint_expectation = this lint expectation is unfulfilled |
| 326 | 326 | .note = the `unfulfilled_lint_expectations` lint can't be expected and will always produce this message |
| 327 | 327 | .rationale = {$rationale} |
| 328 | 328 | |
| 329 | lint_expected_name_value = | |
| 330 | expected this to be of the form `... = "..."` | |
| 331 | .warn = {-lint_previously_accepted} | |
| 332 | ||
| 333 | lint_expected_no_args = | |
| 334 | didn't expect any arguments here | |
| 335 | .warn = {-lint_previously_accepted} | |
| 336 | ||
| 329 | 337 | lint_for_loops_over_fallibles = |
| 330 | 338 | for loop over {$article} `{$ref_prefix}{$ty}`. This is more readably written as an `if let` statement |
| 331 | 339 | .suggestion = consider using `if let` to clear intent |
| ... | ... | @@ -558,6 +566,10 @@ lint_macro_expr_fragment_specifier_2024_migration = |
| 558 | 566 | |
| 559 | 567 | lint_malformed_attribute = malformed lint attribute input |
| 560 | 568 | |
| 569 | lint_malformed_doc = | |
| 570 | malformed `doc` attribute input | |
| 571 | .warn = {-lint_previously_accepted} | |
| 572 | ||
| 561 | 573 | lint_map_unit_fn = `Iterator::map` call that discard the iterator's values |
| 562 | 574 | .note = `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated |
| 563 | 575 | .function_label = this function returns `()`, which is likely not what you wanted |
compiler/rustc_lint/src/early/diagnostics.rs+6| ... | ... | @@ -428,5 +428,11 @@ pub fn decorate_attribute_lint( |
| 428 | 428 | sugg: suggested.map(|s| lints::UnknownCrateTypesSuggestion { span, snippet: s }), |
| 429 | 429 | } |
| 430 | 430 | .decorate_lint(diag), |
| 431 | ||
| 432 | &AttributeLintKind::MalformedDoc => lints::MalformedDoc.decorate_lint(diag), | |
| 433 | ||
| 434 | &AttributeLintKind::ExpectedNoArgs => lints::ExpectedNoArgs.decorate_lint(diag), | |
| 435 | ||
| 436 | &AttributeLintKind::ExpectedNameValue => lints::ExpectedNameValue.decorate_lint(diag), | |
| 431 | 437 | } |
| 432 | 438 | } |
compiler/rustc_lint/src/lints.rs+15| ... | ... | @@ -3185,6 +3185,21 @@ pub(crate) struct UnusedDuplicate { |
| 3185 | 3185 | pub warning: bool, |
| 3186 | 3186 | } |
| 3187 | 3187 | |
| 3188 | #[derive(LintDiagnostic)] | |
| 3189 | #[diag(lint_malformed_doc)] | |
| 3190 | #[warning] | |
| 3191 | pub(crate) struct MalformedDoc; | |
| 3192 | ||
| 3193 | #[derive(LintDiagnostic)] | |
| 3194 | #[diag(lint_expected_no_args)] | |
| 3195 | #[warning] | |
| 3196 | pub(crate) struct ExpectedNoArgs; | |
| 3197 | ||
| 3198 | #[derive(LintDiagnostic)] | |
| 3199 | #[diag(lint_expected_name_value)] | |
| 3200 | #[warning] | |
| 3201 | pub(crate) struct ExpectedNameValue; | |
| 3202 | ||
| 3188 | 3203 | #[derive(LintDiagnostic)] |
| 3189 | 3204 | #[diag(lint_unsafe_attr_outside_unsafe)] |
| 3190 | 3205 | pub(crate) struct UnsafeAttrOutsideUnsafeLint { |
compiler/rustc_lint_defs/src/builtin.rs+1-1| ... | ... | @@ -3458,7 +3458,7 @@ declare_lint! { |
| 3458 | 3458 | /// but this lint was introduced to avoid breaking any existing |
| 3459 | 3459 | /// crates which included them. |
| 3460 | 3460 | pub INVALID_DOC_ATTRIBUTES, |
| 3461 | Deny, | |
| 3461 | Warn, | |
| 3462 | 3462 | "detects invalid `#[doc(...)]` attributes", |
| 3463 | 3463 | } |
| 3464 | 3464 |
compiler/rustc_lint_defs/src/lib.rs+3| ... | ... | @@ -826,6 +826,9 @@ pub enum AttributeLintKind { |
| 826 | 826 | span: Span, |
| 827 | 827 | suggested: Option<Symbol>, |
| 828 | 828 | }, |
| 829 | MalformedDoc, | |
| 830 | ExpectedNoArgs, | |
| 831 | ExpectedNameValue, | |
| 829 | 832 | } |
| 830 | 833 | |
| 831 | 834 | pub type RegisteredTools = FxIndexSet<Ident>; |
compiler/rustc_metadata/src/native_libs.rs+1-1| ... | ... | @@ -161,7 +161,7 @@ fn find_bundled_library( |
| 161 | 161 | tcx: TyCtxt<'_>, |
| 162 | 162 | ) -> Option<Symbol> { |
| 163 | 163 | let sess = tcx.sess; |
| 164 | if let NativeLibKind::Static { bundle: Some(true) | None, whole_archive } = kind | |
| 164 | if let NativeLibKind::Static { bundle: Some(true) | None, whole_archive, .. } = kind | |
| 165 | 165 | && tcx.crate_types().iter().any(|t| matches!(t, &CrateType::Rlib | CrateType::StaticLib)) |
| 166 | 166 | && (sess.opts.unstable_opts.packed_bundled_libs || has_cfg || whole_archive == Some(true)) |
| 167 | 167 | { |
compiler/rustc_monomorphize/Cargo.toml-1| ... | ... | @@ -8,7 +8,6 @@ edition = "2024" |
| 8 | 8 | rustc_abi = { path = "../rustc_abi" } |
| 9 | 9 | rustc_data_structures = { path = "../rustc_data_structures" } |
| 10 | 10 | rustc_errors = { path = "../rustc_errors" } |
| 11 | rustc_fluent_macro = { path = "../rustc_fluent_macro" } | |
| 12 | 11 | rustc_hir = { path = "../rustc_hir" } |
| 13 | 12 | rustc_index = { path = "../rustc_index" } |
| 14 | 13 | rustc_macros = { path = "../rustc_macros" } |
compiler/rustc_monomorphize/messages.ftl deleted-82| ... | ... | @@ -1,82 +0,0 @@ |
| 1 | monomorphize_abi_error_disabled_vector_type = | |
| 2 | this function {$is_call -> | |
| 3 | [true] call | |
| 4 | *[false] definition | |
| 5 | } uses {$is_scalable -> | |
| 6 | [true] scalable | |
| 7 | *[false] SIMD | |
| 8 | } vector type `{$ty}` which (with the chosen ABI) requires the `{$required_feature}` target feature, which is not enabled{$is_call -> | |
| 9 | [true] {" "}in the caller | |
| 10 | *[false] {""} | |
| 11 | } | |
| 12 | .label = function {$is_call -> | |
| 13 | [true] called | |
| 14 | *[false] defined | |
| 15 | } here | |
| 16 | .help = consider enabling it globally (`-C target-feature=+{$required_feature}`) or locally (`#[target_feature(enable="{$required_feature}")]`) | |
| 17 | ||
| 18 | monomorphize_abi_error_unsupported_unsized_parameter = | |
| 19 | this function {$is_call -> | |
| 20 | [true] call | |
| 21 | *[false] definition | |
| 22 | } uses unsized type `{$ty}` which is not supported with the chosen ABI | |
| 23 | .label = function {$is_call -> | |
| 24 | [true] called | |
| 25 | *[false] defined | |
| 26 | } here | |
| 27 | .help = only rustic ABIs support unsized parameters | |
| 28 | ||
| 29 | monomorphize_abi_error_unsupported_vector_type = | |
| 30 | this function {$is_call -> | |
| 31 | [true] call | |
| 32 | *[false] definition | |
| 33 | } uses SIMD vector type `{$ty}` which is not currently supported with the chosen ABI | |
| 34 | .label = function {$is_call -> | |
| 35 | [true] called | |
| 36 | *[false] defined | |
| 37 | } here | |
| 38 | ||
| 39 | monomorphize_abi_required_target_feature = | |
| 40 | this function {$is_call -> | |
| 41 | [true] call | |
| 42 | *[false] definition | |
| 43 | } uses ABI "{$abi}" which requires the `{$required_feature}` target feature, which is not enabled{$is_call -> | |
| 44 | [true] {" "}in the caller | |
| 45 | *[false] {""} | |
| 46 | } | |
| 47 | .label = function {$is_call -> | |
| 48 | [true] called | |
| 49 | *[false] defined | |
| 50 | } here | |
| 51 | .help = consider enabling it globally (`-C target-feature=+{$required_feature}`) or locally (`#[target_feature(enable="{$required_feature}")]`) | |
| 52 | ||
| 53 | monomorphize_couldnt_dump_mono_stats = | |
| 54 | unexpected error occurred while dumping monomorphization stats: {$error} | |
| 55 | ||
| 56 | monomorphize_encountered_error_while_instantiating = | |
| 57 | the above error was encountered while instantiating `{$kind} {$instance}` | |
| 58 | ||
| 59 | monomorphize_encountered_error_while_instantiating_global_asm = | |
| 60 | the above error was encountered while instantiating `global_asm` | |
| 61 | ||
| 62 | monomorphize_large_assignments = | |
| 63 | moving {$size} bytes | |
| 64 | .label = value moved from here | |
| 65 | .note = the current maximum size is {$limit}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]` | |
| 66 | ||
| 67 | monomorphize_no_optimized_mir = | |
| 68 | missing optimized MIR for `{$instance}` in the crate `{$crate_name}` | |
| 69 | .note = missing optimized MIR for this item (was the crate `{$crate_name}` compiled with `--emit=metadata`?) | |
| 70 | ||
| 71 | monomorphize_recursion_limit = | |
| 72 | reached the recursion limit while instantiating `{$instance}` | |
| 73 | .note = `{$def_path_str}` defined here | |
| 74 | ||
| 75 | monomorphize_start_not_found = using `fn main` requires the standard library | |
| 76 | .help = use `#![no_main]` to bypass the Rust generated entrypoint and declare a platform specific entrypoint yourself, usually with `#[no_mangle]` | |
| 77 | ||
| 78 | monomorphize_static_initializer_cyclic = static initializer forms a cycle involving `{$head}` | |
| 79 | .label = part of this cycle | |
| 80 | .note = cyclic static initializers are not supported for target `{$target}` | |
| 81 | ||
| 82 | monomorphize_symbol_already_defined = symbol `{$symbol}` is already defined |
compiler/rustc_monomorphize/src/errors.rs+82-27| ... | ... | @@ -3,37 +3,41 @@ use rustc_middle::ty::{Instance, Ty}; |
| 3 | 3 | use rustc_span::{Span, Symbol}; |
| 4 | 4 | |
| 5 | 5 | #[derive(Diagnostic)] |
| 6 | #[diag(monomorphize_recursion_limit)] | |
| 6 | #[diag("reached the recursion limit while instantiating `{$instance}`")] | |
| 7 | 7 | pub(crate) struct RecursionLimit<'tcx> { |
| 8 | 8 | #[primary_span] |
| 9 | 9 | pub span: Span, |
| 10 | 10 | pub instance: Instance<'tcx>, |
| 11 | #[note] | |
| 11 | #[note("`{$def_path_str}` defined here")] | |
| 12 | 12 | pub def_span: Span, |
| 13 | 13 | pub def_path_str: String, |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | #[derive(Diagnostic)] |
| 17 | #[diag(monomorphize_no_optimized_mir)] | |
| 17 | #[diag("missing optimized MIR for `{$instance}` in the crate `{$crate_name}`")] | |
| 18 | 18 | pub(crate) struct NoOptimizedMir { |
| 19 | #[note] | |
| 19 | #[note( | |
| 20 | "missing optimized MIR for this item (was the crate `{$crate_name}` compiled with `--emit=metadata`?)" | |
| 21 | )] | |
| 20 | 22 | pub span: Span, |
| 21 | 23 | pub crate_name: Symbol, |
| 22 | 24 | pub instance: String, |
| 23 | 25 | } |
| 24 | 26 | |
| 25 | 27 | #[derive(LintDiagnostic)] |
| 26 | #[diag(monomorphize_large_assignments)] | |
| 27 | #[note] | |
| 28 | #[diag("moving {$size} bytes")] | |
| 29 | #[note( | |
| 30 | "the current maximum size is {$limit}, but it can be customized with the move_size_limit attribute: `#![move_size_limit = \"...\"]`" | |
| 31 | )] | |
| 28 | 32 | pub(crate) struct LargeAssignmentsLint { |
| 29 | #[label] | |
| 33 | #[label("value moved from here")] | |
| 30 | 34 | pub span: Span, |
| 31 | 35 | pub size: u64, |
| 32 | 36 | pub limit: u64, |
| 33 | 37 | } |
| 34 | 38 | |
| 35 | 39 | #[derive(Diagnostic)] |
| 36 | #[diag(monomorphize_symbol_already_defined)] | |
| 40 | #[diag("symbol `{$symbol}` is already defined")] | |
| 37 | 41 | pub(crate) struct SymbolAlreadyDefined { |
| 38 | 42 | #[primary_span] |
| 39 | 43 | pub span: Option<Span>, |
| ... | ... | @@ -41,13 +45,13 @@ pub(crate) struct SymbolAlreadyDefined { |
| 41 | 45 | } |
| 42 | 46 | |
| 43 | 47 | #[derive(Diagnostic)] |
| 44 | #[diag(monomorphize_couldnt_dump_mono_stats)] | |
| 48 | #[diag("unexpected error occurred while dumping monomorphization stats: {$error}")] | |
| 45 | 49 | pub(crate) struct CouldntDumpMonoStats { |
| 46 | 50 | pub error: String, |
| 47 | 51 | } |
| 48 | 52 | |
| 49 | 53 | #[derive(Diagnostic)] |
| 50 | #[diag(monomorphize_encountered_error_while_instantiating)] | |
| 54 | #[diag("the above error was encountered while instantiating `{$kind} {$instance}`")] | |
| 51 | 55 | pub(crate) struct EncounteredErrorWhileInstantiating<'tcx> { |
| 52 | 56 | #[primary_span] |
| 53 | 57 | pub span: Span, |
| ... | ... | @@ -56,23 +60,41 @@ pub(crate) struct EncounteredErrorWhileInstantiating<'tcx> { |
| 56 | 60 | } |
| 57 | 61 | |
| 58 | 62 | #[derive(Diagnostic)] |
| 59 | #[diag(monomorphize_encountered_error_while_instantiating_global_asm)] | |
| 63 | #[diag("the above error was encountered while instantiating `global_asm`")] | |
| 60 | 64 | pub(crate) struct EncounteredErrorWhileInstantiatingGlobalAsm { |
| 61 | 65 | #[primary_span] |
| 62 | 66 | pub span: Span, |
| 63 | 67 | } |
| 64 | 68 | |
| 65 | 69 | #[derive(Diagnostic)] |
| 66 | #[diag(monomorphize_start_not_found)] | |
| 67 | #[help] | |
| 70 | #[diag("using `fn main` requires the standard library")] | |
| 71 | #[help( | |
| 72 | "use `#![no_main]` to bypass the Rust generated entrypoint and declare a platform specific entrypoint yourself, usually with `#[no_mangle]`" | |
| 73 | )] | |
| 68 | 74 | pub(crate) struct StartNotFound; |
| 69 | 75 | |
| 70 | 76 | #[derive(Diagnostic)] |
| 71 | #[diag(monomorphize_abi_error_disabled_vector_type)] | |
| 72 | #[help] | |
| 77 | #[diag("this function {$is_call -> | |
| 78 | [true] call | |
| 79 | *[false] definition | |
| 80 | } uses {$is_scalable -> | |
| 81 | [true] scalable | |
| 82 | *[false] SIMD | |
| 83 | } vector type `{$ty}` which (with the chosen ABI) requires the `{$required_feature}` target feature, which is not enabled{$is_call -> | |
| 84 | [true] {\" \"}in the caller | |
| 85 | *[false] {\"\"} | |
| 86 | }")] | |
| 87 | #[help( | |
| 88 | "consider enabling it globally (`-C target-feature=+{$required_feature}`) or locally (`#[target_feature(enable=\"{$required_feature}\")]`)" | |
| 89 | )] | |
| 73 | 90 | pub(crate) struct AbiErrorDisabledVectorType<'a> { |
| 74 | 91 | #[primary_span] |
| 75 | #[label] | |
| 92 | #[label( | |
| 93 | "function {$is_call -> | |
| 94 | [true] called | |
| 95 | *[false] defined | |
| 96 | } here" | |
| 97 | )] | |
| 76 | 98 | pub span: Span, |
| 77 | 99 | pub required_feature: &'a str, |
| 78 | 100 | pub ty: Ty<'a>, |
| ... | ... | @@ -83,11 +105,21 @@ pub(crate) struct AbiErrorDisabledVectorType<'a> { |
| 83 | 105 | } |
| 84 | 106 | |
| 85 | 107 | #[derive(Diagnostic)] |
| 86 | #[diag(monomorphize_abi_error_unsupported_unsized_parameter)] | |
| 87 | #[help] | |
| 108 | #[diag( | |
| 109 | "this function {$is_call -> | |
| 110 | [true] call | |
| 111 | *[false] definition | |
| 112 | } uses unsized type `{$ty}` which is not supported with the chosen ABI" | |
| 113 | )] | |
| 114 | #[help("only rustic ABIs support unsized parameters")] | |
| 88 | 115 | pub(crate) struct AbiErrorUnsupportedUnsizedParameter<'a> { |
| 89 | 116 | #[primary_span] |
| 90 | #[label] | |
| 117 | #[label( | |
| 118 | "function {$is_call -> | |
| 119 | [true] called | |
| 120 | *[false] defined | |
| 121 | } here" | |
| 122 | )] | |
| 91 | 123 | pub span: Span, |
| 92 | 124 | pub ty: Ty<'a>, |
| 93 | 125 | /// Whether this is a problem at a call site or at a declaration. |
| ... | ... | @@ -95,10 +127,20 @@ pub(crate) struct AbiErrorUnsupportedUnsizedParameter<'a> { |
| 95 | 127 | } |
| 96 | 128 | |
| 97 | 129 | #[derive(Diagnostic)] |
| 98 | #[diag(monomorphize_abi_error_unsupported_vector_type)] | |
| 130 | #[diag( | |
| 131 | "this function {$is_call -> | |
| 132 | [true] call | |
| 133 | *[false] definition | |
| 134 | } uses SIMD vector type `{$ty}` which is not currently supported with the chosen ABI" | |
| 135 | )] | |
| 99 | 136 | pub(crate) struct AbiErrorUnsupportedVectorType<'a> { |
| 100 | 137 | #[primary_span] |
| 101 | #[label] | |
| 138 | #[label( | |
| 139 | "function {$is_call -> | |
| 140 | [true] called | |
| 141 | *[false] defined | |
| 142 | } here" | |
| 143 | )] | |
| 102 | 144 | pub span: Span, |
| 103 | 145 | pub ty: Ty<'a>, |
| 104 | 146 | /// Whether this is a problem at a call site or at a declaration. |
| ... | ... | @@ -106,11 +148,24 @@ pub(crate) struct AbiErrorUnsupportedVectorType<'a> { |
| 106 | 148 | } |
| 107 | 149 | |
| 108 | 150 | #[derive(Diagnostic)] |
| 109 | #[diag(monomorphize_abi_required_target_feature)] | |
| 110 | #[help] | |
| 151 | #[diag("this function {$is_call -> | |
| 152 | [true] call | |
| 153 | *[false] definition | |
| 154 | } uses ABI \"{$abi}\" which requires the `{$required_feature}` target feature, which is not enabled{$is_call -> | |
| 155 | [true] {\" \"}in the caller | |
| 156 | *[false] {\"\"} | |
| 157 | }")] | |
| 158 | #[help( | |
| 159 | "consider enabling it globally (`-C target-feature=+{$required_feature}`) or locally (`#[target_feature(enable=\"{$required_feature}\")]`)" | |
| 160 | )] | |
| 111 | 161 | pub(crate) struct AbiRequiredTargetFeature<'a> { |
| 112 | 162 | #[primary_span] |
| 113 | #[label] | |
| 163 | #[label( | |
| 164 | "function {$is_call -> | |
| 165 | [true] called | |
| 166 | *[false] defined | |
| 167 | } here" | |
| 168 | )] | |
| 114 | 169 | pub span: Span, |
| 115 | 170 | pub required_feature: &'a str, |
| 116 | 171 | pub abi: &'a str, |
| ... | ... | @@ -119,12 +174,12 @@ pub(crate) struct AbiRequiredTargetFeature<'a> { |
| 119 | 174 | } |
| 120 | 175 | |
| 121 | 176 | #[derive(Diagnostic)] |
| 122 | #[diag(monomorphize_static_initializer_cyclic)] | |
| 123 | #[note] | |
| 177 | #[diag("static initializer forms a cycle involving `{$head}`")] | |
| 178 | #[note("cyclic static initializers are not supported for target `{$target}`")] | |
| 124 | 179 | pub(crate) struct StaticInitializerCyclic<'a> { |
| 125 | 180 | #[primary_span] |
| 126 | 181 | pub span: Span, |
| 127 | #[label] | |
| 182 | #[label("part of this cycle")] | |
| 128 | 183 | pub labels: Vec<Span>, |
| 129 | 184 | pub head: &'a str, |
| 130 | 185 | pub target: &'a str, |
compiler/rustc_monomorphize/src/lib.rs-2| ... | ... | @@ -20,8 +20,6 @@ mod mono_checks; |
| 20 | 20 | mod partitioning; |
| 21 | 21 | mod util; |
| 22 | 22 | |
| 23 | rustc_fluent_macro::fluent_messages! { "../messages.ftl" } | |
| 24 | ||
| 25 | 23 | fn custom_coerce_unsize_info<'tcx>( |
| 26 | 24 | tcx: TyCtxtAt<'tcx>, |
| 27 | 25 | source_ty: Ty<'tcx>, |
compiler/rustc_privacy/Cargo.toml-1| ... | ... | @@ -8,7 +8,6 @@ edition = "2024" |
| 8 | 8 | rustc_ast = { path = "../rustc_ast" } |
| 9 | 9 | rustc_data_structures = { path = "../rustc_data_structures" } |
| 10 | 10 | rustc_errors = { path = "../rustc_errors" } |
| 11 | rustc_fluent_macro = { path = "../rustc_fluent_macro" } | |
| 12 | 11 | rustc_hir = { path = "../rustc_hir" } |
| 13 | 12 | rustc_macros = { path = "../rustc_macros" } |
| 14 | 13 | rustc_middle = { path = "../rustc_middle" } |
compiler/rustc_privacy/messages.ftl deleted-39| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | privacy_field_is_private = | |
| 2 | {$len -> | |
| 3 | [1] field | |
| 4 | *[other] fields | |
| 5 | } {$field_names} of {$variant_descr} `{$def_path_str}` {$len -> | |
| 6 | [1] is | |
| 7 | *[other] are | |
| 8 | } private | |
| 9 | .label = in this type | |
| 10 | privacy_field_is_private_is_update_syntax_label = {$rest_len -> | |
| 11 | [1] field | |
| 12 | *[other] fields | |
| 13 | } {$rest_field_names} {$rest_len -> | |
| 14 | [1] is | |
| 15 | *[other] are | |
| 16 | } private | |
| 17 | privacy_field_is_private_label = private field | |
| 18 | ||
| 19 | privacy_from_private_dep_in_public_interface = | |
| 20 | {$kind} `{$descr}` from private dependency '{$krate}' in public interface | |
| 21 | ||
| 22 | privacy_in_public_interface = {$vis_descr} {$kind} `{$descr}` in public interface | |
| 23 | .label = can't leak {$vis_descr} {$kind} | |
| 24 | .visibility_label = `{$descr}` declared as {$vis_descr} | |
| 25 | ||
| 26 | privacy_item_is_private = {$kind} `{$descr}` is private | |
| 27 | .label = private {$kind} | |
| 28 | ||
| 29 | privacy_private_interface_or_bounds_lint = {$ty_kind} `{$ty_descr}` is more private than the item `{$item_descr}` | |
| 30 | .item_label = {$item_kind} `{$item_descr}` is reachable at visibility `{$item_vis_descr}` | |
| 31 | .ty_note = but {$ty_kind} `{$ty_descr}` is only usable at visibility `{$ty_vis_descr}` | |
| 32 | ||
| 33 | privacy_report_effective_visibility = {$descr} | |
| 34 | ||
| 35 | privacy_unnameable_types_lint = {$kind} `{$descr}` is reachable but cannot be named | |
| 36 | .label = reachable at visibility `{$reachable_vis}`, but can only be named at visibility `{$reexported_vis}` | |
| 37 | ||
| 38 | privacy_unnamed_item_is_private = {$kind} is private | |
| 39 | .label = private {$kind} |
compiler/rustc_privacy/src/errors.rs+33-17| ... | ... | @@ -4,11 +4,17 @@ use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; |
| 4 | 4 | use rustc_span::{Span, Symbol}; |
| 5 | 5 | |
| 6 | 6 | #[derive(Diagnostic)] |
| 7 | #[diag(privacy_field_is_private, code = E0451)] | |
| 7 | #[diag("{$len -> | |
| 8 | [1] field | |
| 9 | *[other] fields | |
| 10 | } {$field_names} of {$variant_descr} `{$def_path_str}` {$len -> | |
| 11 | [1] is | |
| 12 | *[other] are | |
| 13 | } private", code = E0451)] | |
| 8 | 14 | pub(crate) struct FieldIsPrivate { |
| 9 | 15 | #[primary_span] |
| 10 | 16 | pub span: MultiSpan, |
| 11 | #[label] | |
| 17 | #[label("in this type")] | |
| 12 | 18 | pub struct_span: Option<Span>, |
| 13 | 19 | pub field_names: String, |
| 14 | 20 | pub variant_descr: &'static str, |
| ... | ... | @@ -20,14 +26,22 @@ pub(crate) struct FieldIsPrivate { |
| 20 | 26 | |
| 21 | 27 | #[derive(Subdiagnostic)] |
| 22 | 28 | pub(crate) enum FieldIsPrivateLabel { |
| 23 | #[label(privacy_field_is_private_is_update_syntax_label)] | |
| 29 | #[label( | |
| 30 | "{$rest_len -> | |
| 31 | [1] field | |
| 32 | *[other] fields | |
| 33 | } {$rest_field_names} {$rest_len -> | |
| 34 | [1] is | |
| 35 | *[other] are | |
| 36 | } private" | |
| 37 | )] | |
| 24 | 38 | IsUpdateSyntax { |
| 25 | 39 | #[primary_span] |
| 26 | 40 | span: Span, |
| 27 | 41 | rest_field_names: String, |
| 28 | 42 | rest_len: usize, |
| 29 | 43 | }, |
| 30 | #[label(privacy_field_is_private_label)] | |
| 44 | #[label("private field")] | |
| 31 | 45 | Other { |
| 32 | 46 | #[primary_span] |
| 33 | 47 | span: Span, |
| ... | ... | @@ -35,17 +49,17 @@ pub(crate) enum FieldIsPrivateLabel { |
| 35 | 49 | } |
| 36 | 50 | |
| 37 | 51 | #[derive(Diagnostic)] |
| 38 | #[diag(privacy_item_is_private)] | |
| 52 | #[diag("{$kind} `{$descr}` is private")] | |
| 39 | 53 | pub(crate) struct ItemIsPrivate<'a> { |
| 40 | 54 | #[primary_span] |
| 41 | #[label] | |
| 55 | #[label("private {$kind}")] | |
| 42 | 56 | pub span: Span, |
| 43 | 57 | pub kind: &'a str, |
| 44 | 58 | pub descr: DiagArgFromDisplay<'a>, |
| 45 | 59 | } |
| 46 | 60 | |
| 47 | 61 | #[derive(Diagnostic)] |
| 48 | #[diag(privacy_unnamed_item_is_private)] | |
| 62 | #[diag("{$kind} is private")] | |
| 49 | 63 | pub(crate) struct UnnamedItemIsPrivate { |
| 50 | 64 | #[primary_span] |
| 51 | 65 | pub span: Span, |
| ... | ... | @@ -53,20 +67,20 @@ pub(crate) struct UnnamedItemIsPrivate { |
| 53 | 67 | } |
| 54 | 68 | |
| 55 | 69 | #[derive(Diagnostic)] |
| 56 | #[diag(privacy_in_public_interface, code = E0446)] | |
| 70 | #[diag("{$vis_descr} {$kind} `{$descr}` in public interface", code = E0446)] | |
| 57 | 71 | pub(crate) struct InPublicInterface<'a> { |
| 58 | 72 | #[primary_span] |
| 59 | #[label] | |
| 73 | #[label("can't leak {$vis_descr} {$kind}")] | |
| 60 | 74 | pub span: Span, |
| 61 | 75 | pub vis_descr: &'static str, |
| 62 | 76 | pub kind: &'a str, |
| 63 | 77 | pub descr: DiagArgFromDisplay<'a>, |
| 64 | #[label(privacy_visibility_label)] | |
| 78 | #[label("`{$descr}` declared as {$vis_descr}")] | |
| 65 | 79 | pub vis_span: Span, |
| 66 | 80 | } |
| 67 | 81 | |
| 68 | 82 | #[derive(Diagnostic)] |
| 69 | #[diag(privacy_report_effective_visibility)] | |
| 83 | #[diag("{$descr}")] | |
| 70 | 84 | pub(crate) struct ReportEffectiveVisibility { |
| 71 | 85 | #[primary_span] |
| 72 | 86 | pub span: Span, |
| ... | ... | @@ -74,7 +88,7 @@ pub(crate) struct ReportEffectiveVisibility { |
| 74 | 88 | } |
| 75 | 89 | |
| 76 | 90 | #[derive(LintDiagnostic)] |
| 77 | #[diag(privacy_from_private_dep_in_public_interface)] | |
| 91 | #[diag("{$kind} `{$descr}` from private dependency '{$krate}' in public interface")] | |
| 78 | 92 | pub(crate) struct FromPrivateDependencyInPublicInterface<'a> { |
| 79 | 93 | pub kind: &'a str, |
| 80 | 94 | pub descr: DiagArgFromDisplay<'a>, |
| ... | ... | @@ -82,9 +96,11 @@ pub(crate) struct FromPrivateDependencyInPublicInterface<'a> { |
| 82 | 96 | } |
| 83 | 97 | |
| 84 | 98 | #[derive(LintDiagnostic)] |
| 85 | #[diag(privacy_unnameable_types_lint)] | |
| 99 | #[diag("{$kind} `{$descr}` is reachable but cannot be named")] | |
| 86 | 100 | pub(crate) struct UnnameableTypesLint<'a> { |
| 87 | #[label] | |
| 101 | #[label( | |
| 102 | "reachable at visibility `{$reachable_vis}`, but can only be named at visibility `{$reexported_vis}`" | |
| 103 | )] | |
| 88 | 104 | pub span: Span, |
| 89 | 105 | pub kind: &'a str, |
| 90 | 106 | pub descr: DiagArgFromDisplay<'a>, |
| ... | ... | @@ -96,14 +112,14 @@ pub(crate) struct UnnameableTypesLint<'a> { |
| 96 | 112 | // They will replace private-in-public errors and compatibility lints in future. |
| 97 | 113 | // See https://rust-lang.github.io/rfcs/2145-type-privacy.html for more details. |
| 98 | 114 | #[derive(LintDiagnostic)] |
| 99 | #[diag(privacy_private_interface_or_bounds_lint)] | |
| 115 | #[diag("{$ty_kind} `{$ty_descr}` is more private than the item `{$item_descr}`")] | |
| 100 | 116 | pub(crate) struct PrivateInterfacesOrBoundsLint<'a> { |
| 101 | #[label(privacy_item_label)] | |
| 117 | #[label("{$item_kind} `{$item_descr}` is reachable at visibility `{$item_vis_descr}`")] | |
| 102 | 118 | pub item_span: Span, |
| 103 | 119 | pub item_kind: &'a str, |
| 104 | 120 | pub item_descr: DiagArgFromDisplay<'a>, |
| 105 | 121 | pub item_vis_descr: &'a str, |
| 106 | #[note(privacy_ty_note)] | |
| 122 | #[note("but {$ty_kind} `{$ty_descr}` is only usable at visibility `{$ty_vis_descr}`")] | |
| 107 | 123 | pub ty_span: Span, |
| 108 | 124 | pub ty_kind: &'a str, |
| 109 | 125 | pub ty_descr: DiagArgFromDisplay<'a>, |
compiler/rustc_privacy/src/lib.rs-2| ... | ... | @@ -39,8 +39,6 @@ use rustc_span::hygiene::Transparency; |
| 39 | 39 | use rustc_span::{Ident, Span, Symbol, sym}; |
| 40 | 40 | use tracing::debug; |
| 41 | 41 | |
| 42 | rustc_fluent_macro::fluent_messages! { "../messages.ftl" } | |
| 43 | ||
| 44 | 42 | //////////////////////////////////////////////////////////////////////////////// |
| 45 | 43 | // Generic infrastructure used to implement specific visitors below. |
| 46 | 44 | //////////////////////////////////////////////////////////////////////////////// |
compiler/rustc_session/Cargo.toml-1| ... | ... | @@ -12,7 +12,6 @@ rustc_ast = { path = "../rustc_ast" } |
| 12 | 12 | rustc_data_structures = { path = "../rustc_data_structures" } |
| 13 | 13 | rustc_errors = { path = "../rustc_errors" } |
| 14 | 14 | rustc_feature = { path = "../rustc_feature" } |
| 15 | rustc_fluent_macro = { path = "../rustc_fluent_macro" } | |
| 16 | 15 | rustc_fs_util = { path = "../rustc_fs_util" } |
| 17 | 16 | rustc_hashes = { path = "../rustc_hashes" } |
| 18 | 17 | rustc_hir = { path = "../rustc_hir" } |
compiler/rustc_session/messages.ftl deleted-149| ... | ... | @@ -1,149 +0,0 @@ |
| 1 | session_apple_deployment_target_invalid = | |
| 2 | failed to parse deployment target specified in {$env_var}: {$error} | |
| 3 | ||
| 4 | session_apple_deployment_target_too_low = | |
| 5 | deployment target in {$env_var} was set to {$version}, but the minimum supported by `rustc` is {$os_min} | |
| 6 | ||
| 7 | session_binary_float_literal_not_supported = binary float literal is not supported | |
| 8 | session_branch_protection_requires_aarch64 = `-Zbranch-protection` is only supported on aarch64 | |
| 9 | ||
| 10 | session_cannot_enable_crt_static_linux = sanitizer is incompatible with statically linked libc, disable it using `-C target-feature=-crt-static` | |
| 11 | ||
| 12 | session_cannot_mix_and_match_sanitizers = `-Zsanitizer={$first}` is incompatible with `-Zsanitizer={$second}` | |
| 13 | ||
| 14 | session_cli_feature_diagnostic_help = | |
| 15 | add `-Zcrate-attr="feature({$feature})"` to the command-line options to enable | |
| 16 | ||
| 17 | session_crate_name_empty = crate name must not be empty | |
| 18 | ||
| 19 | session_embed_source_insufficient_dwarf_version = `-Zembed-source=y` requires at least `-Z dwarf-version=5` but DWARF version is {$dwarf_version} | |
| 20 | ||
| 21 | session_embed_source_requires_debug_info = `-Zembed-source=y` requires debug information to be enabled | |
| 22 | ||
| 23 | session_expr_parentheses_needed = parentheses are required to parse this as an expression | |
| 24 | ||
| 25 | session_failed_to_create_profiler = failed to create profiler: {$err} | |
| 26 | ||
| 27 | session_feature_diagnostic_for_issue = | |
| 28 | see issue #{$n} <https://github.com/rust-lang/rust/issues/{$n}> for more information | |
| 29 | ||
| 30 | session_feature_diagnostic_help = | |
| 31 | add `#![feature({$feature})]` to the crate attributes to enable | |
| 32 | ||
| 33 | session_feature_diagnostic_suggestion = | |
| 34 | add `#![feature({$feature})]` to the crate attributes to enable | |
| 35 | ||
| 36 | session_feature_suggest_upgrade_compiler = | |
| 37 | this compiler was built on {$date}; consider upgrading it if it is out of date | |
| 38 | ||
| 39 | session_file_is_not_writeable = output file {$file} is not writeable -- check its permissions | |
| 40 | ||
| 41 | session_file_write_fail = failed to write `{$path}` due to error `{$err}` | |
| 42 | ||
| 43 | session_function_return_requires_x86_or_x86_64 = `-Zfunction-return` (except `keep`) is only supported on x86 and x86_64 | |
| 44 | ||
| 45 | session_function_return_thunk_extern_requires_non_large_code_model = `-Zfunction-return=thunk-extern` is only supported on non-large code models | |
| 46 | ||
| 47 | session_hexadecimal_float_literal_not_supported = hexadecimal float literal is not supported | |
| 48 | ||
| 49 | session_incompatible_linker_flavor = linker flavor `{$flavor}` is incompatible with the current target | |
| 50 | .note = compatible flavors are: {$compatible_list} | |
| 51 | ||
| 52 | session_indirect_branch_cs_prefix_requires_x86_or_x86_64 = `-Zindirect-branch-cs-prefix` is only supported on x86 and x86_64 | |
| 53 | ||
| 54 | session_instrumentation_not_supported = {$us} instrumentation is not supported for this target | |
| 55 | ||
| 56 | session_int_literal_too_large = integer literal is too large | |
| 57 | .note = value exceeds limit of `{$limit}` | |
| 58 | ||
| 59 | session_invalid_character_in_crate_name = invalid character {$character} in crate name: `{$crate_name}` | |
| 60 | ||
| 61 | session_invalid_float_literal_suffix = invalid suffix `{$suffix}` for float literal | |
| 62 | .label = invalid suffix `{$suffix}` | |
| 63 | .help = valid suffixes are `f32` and `f64` | |
| 64 | ||
| 65 | session_invalid_float_literal_width = invalid width `{$width}` for float literal | |
| 66 | .help = valid widths are 32 and 64 | |
| 67 | ||
| 68 | session_invalid_int_literal_width = invalid width `{$width}` for integer literal | |
| 69 | .help = valid widths are 8, 16, 32, 64 and 128 | |
| 70 | ||
| 71 | session_invalid_literal_suffix = suffixes on {$kind} literals are invalid | |
| 72 | .label = invalid suffix `{$suffix}` | |
| 73 | ||
| 74 | session_invalid_num_literal_base_prefix = invalid base prefix for number literal | |
| 75 | .note = base prefixes (`0xff`, `0b1010`, `0o755`) are lowercase | |
| 76 | .suggestion = try making the prefix lowercase | |
| 77 | ||
| 78 | session_invalid_num_literal_suffix = invalid suffix `{$suffix}` for number literal | |
| 79 | .label = invalid suffix `{$suffix}` | |
| 80 | .help = the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) | |
| 81 | ||
| 82 | session_linker_plugin_lto_windows_not_supported = linker plugin based LTO is not supported together with `-C prefer-dynamic` when targeting Windows-like targets | |
| 83 | ||
| 84 | session_must_be_name_of_associated_function = must be a name of an associated function | |
| 85 | ||
| 86 | session_not_circumvent_feature = `-Zunleash-the-miri-inside-of-you` may not be used to circumvent feature gates, except when testing error paths in the CTFE engine | |
| 87 | ||
| 88 | session_not_supported = not supported | |
| 89 | ||
| 90 | session_octal_float_literal_not_supported = octal float literal is not supported | |
| 91 | ||
| 92 | session_profile_sample_use_file_does_not_exist = file `{$path}` passed to `-C profile-sample-use` does not exist | |
| 93 | ||
| 94 | session_profile_use_file_does_not_exist = file `{$path}` passed to `-C profile-use` does not exist | |
| 95 | ||
| 96 | session_sanitizer_cfi_canonical_jump_tables_requires_cfi = `-Zsanitizer-cfi-canonical-jump-tables` requires `-Zsanitizer=cfi` | |
| 97 | ||
| 98 | session_sanitizer_cfi_generalize_pointers_requires_cfi = `-Zsanitizer-cfi-generalize-pointers` requires `-Zsanitizer=cfi` or `-Zsanitizer=kcfi` | |
| 99 | ||
| 100 | session_sanitizer_cfi_normalize_integers_requires_cfi = `-Zsanitizer-cfi-normalize-integers` requires `-Zsanitizer=cfi` or `-Zsanitizer=kcfi` | |
| 101 | ||
| 102 | session_sanitizer_cfi_requires_lto = `-Zsanitizer=cfi` requires `-Clto` or `-Clinker-plugin-lto` | |
| 103 | ||
| 104 | session_sanitizer_cfi_requires_single_codegen_unit = `-Zsanitizer=cfi` with `-Clto` requires `-Ccodegen-units=1` | |
| 105 | ||
| 106 | session_sanitizer_kcfi_arity_requires_kcfi = `-Zsanitizer-kcfi-arity` requires `-Zsanitizer=kcfi` | |
| 107 | ||
| 108 | session_sanitizer_kcfi_requires_panic_abort = `-Z sanitizer=kcfi` requires `-C panic=abort` | |
| 109 | ||
| 110 | session_sanitizer_not_supported = {$us} sanitizer is not supported for this target | |
| 111 | ||
| 112 | session_sanitizers_not_supported = {$us} sanitizers are not supported for this target | |
| 113 | ||
| 114 | session_skipping_const_checks = skipping const checks | |
| 115 | ||
| 116 | session_soft_float_deprecated = | |
| 117 | `-Csoft-float` is unsound and deprecated; use a corresponding *eabi target instead | |
| 118 | .note = it will be removed or ignored in a future version of Rust | |
| 119 | session_soft_float_deprecated_issue = see issue #129893 <https://github.com/rust-lang/rust/issues/129893> for more information | |
| 120 | ||
| 121 | session_soft_float_ignored = | |
| 122 | `-Csoft-float` is ignored on this target; it only has an effect on *eabihf targets | |
| 123 | .note = this may become a hard error in a future version of Rust | |
| 124 | ||
| 125 | session_split_debuginfo_unstable_platform = `-Csplit-debuginfo={$debuginfo}` is unstable on this platform | |
| 126 | ||
| 127 | session_split_lto_unit_requires_lto = `-Zsplit-lto-unit` requires `-Clto`, `-Clto=thin`, or `-Clinker-plugin-lto` | |
| 128 | ||
| 129 | session_target_requires_unwind_tables = target requires unwind tables, they cannot be disabled with `-C force-unwind-tables=no` | |
| 130 | ||
| 131 | session_target_small_data_threshold_not_supported = `-Z small-data-threshold` is not supported for target {$target_triple} and will be ignored | |
| 132 | ||
| 133 | session_target_stack_protector_not_supported = `-Z stack-protector={$stack_protector}` is not supported for target {$target_triple} and will be ignored | |
| 134 | ||
| 135 | session_unexpected_builtin_cfg = unexpected `--cfg {$cfg}` flag | |
| 136 | .controlled_by = config `{$cfg_name}` is only supposed to be controlled by `{$controlled_by}` | |
| 137 | .incoherent = manually setting a built-in cfg can and does create incoherent behaviors | |
| 138 | ||
| 139 | session_unleashed_feature_help_named = skipping check for `{$gate}` feature | |
| 140 | session_unleashed_feature_help_unnamed = skipping check that does not even have a feature gate | |
| 141 | ||
| 142 | session_unstable_virtual_function_elimination = `-Zvirtual-function-elimination` requires `-Clto` | |
| 143 | ||
| 144 | session_unsupported_dwarf_version = requested DWARF version {$dwarf_version} is not supported | |
| 145 | session_unsupported_dwarf_version_help = supported DWARF versions are 2, 3, 4 and 5 | |
| 146 | ||
| 147 | session_unsupported_reg_struct_return_arch = `-Zreg-struct-return` is only supported on x86 | |
| 148 | session_unsupported_regparm = `-Zregparm={$regparm}` is unsupported (valid values 0-3) | |
| 149 | session_unsupported_regparm_arch = `-Zregparm=N` is only supported on x86 |
compiler/rustc_session/src/config/native_libs.rs+12-3| ... | ... | @@ -53,7 +53,9 @@ fn parse_native_lib(cx: &ParseNativeLibCx<'_>, value: &str) -> NativeLib { |
| 53 | 53 | let NativeLibParts { kind, modifiers, name, new_name } = split_native_lib_value(value); |
| 54 | 54 | |
| 55 | 55 | let kind = kind.map_or(NativeLibKind::Unspecified, |kind| match kind { |
| 56 | "static" => NativeLibKind::Static { bundle: None, whole_archive: None }, | |
| 56 | "static" => { | |
| 57 | NativeLibKind::Static { bundle: None, whole_archive: None, export_symbols: None } | |
| 58 | } | |
| 57 | 59 | "dylib" => NativeLibKind::Dylib { as_needed: None }, |
| 58 | 60 | "framework" => NativeLibKind::Framework { as_needed: None }, |
| 59 | 61 | "link-arg" => { |
| ... | ... | @@ -105,7 +107,7 @@ fn parse_and_apply_modifier(cx: &ParseNativeLibCx<'_>, modifier: &str, native_li |
| 105 | 107 | Some(("-", m)) => (m, false), |
| 106 | 108 | _ => cx.early_dcx.early_fatal( |
| 107 | 109 | "invalid linking modifier syntax, expected '+' or '-' prefix \ |
| 108 | before one of: bundle, verbatim, whole-archive, as-needed", | |
| 110 | before one of: bundle, verbatim, whole-archive, as-needed, export-symbols", | |
| 109 | 111 | ), |
| 110 | 112 | }; |
| 111 | 113 | |
| ... | ... | @@ -125,6 +127,13 @@ fn parse_and_apply_modifier(cx: &ParseNativeLibCx<'_>, modifier: &str, native_li |
| 125 | 127 | ("bundle", _) => early_dcx |
| 126 | 128 | .early_fatal("linking modifier `bundle` is only compatible with `static` linking kind"), |
| 127 | 129 | |
| 130 | ("export-symbols", NativeLibKind::Static { export_symbols, .. }) => { | |
| 131 | assign_modifier(export_symbols) | |
| 132 | } | |
| 133 | ("export-symbols", _) => early_dcx.early_fatal( | |
| 134 | "linking modifier `export-symbols` is only compatible with `static` linking kind", | |
| 135 | ), | |
| 136 | ||
| 128 | 137 | ("verbatim", _) => assign_modifier(&mut native_lib.verbatim), |
| 129 | 138 | |
| 130 | 139 | ("whole-archive", NativeLibKind::Static { whole_archive, .. }) => { |
| ... | ... | @@ -151,7 +160,7 @@ fn parse_and_apply_modifier(cx: &ParseNativeLibCx<'_>, modifier: &str, native_li |
| 151 | 160 | |
| 152 | 161 | _ => early_dcx.early_fatal(format!( |
| 153 | 162 | "unknown linking modifier `{modifier}`, expected one \ |
| 154 | of: bundle, verbatim, whole-archive, as-needed" | |
| 163 | of: bundle, verbatim, whole-archive, as-needed, export-symbols" | |
| 155 | 164 | )), |
| 156 | 165 | } |
| 157 | 166 | } |
compiler/rustc_session/src/errors.rs+104-83| ... | ... | @@ -15,9 +15,11 @@ use crate::parse::ParseSess; |
| 15 | 15 | |
| 16 | 16 | #[derive(Diagnostic)] |
| 17 | 17 | pub(crate) enum AppleDeploymentTarget { |
| 18 | #[diag(session_apple_deployment_target_invalid)] | |
| 18 | #[diag("failed to parse deployment target specified in {$env_var}: {$error}")] | |
| 19 | 19 | Invalid { env_var: &'static str, error: ParseIntError }, |
| 20 | #[diag(session_apple_deployment_target_too_low)] | |
| 20 | #[diag( | |
| 21 | "deployment target in {$env_var} was set to {$version}, but the minimum supported by `rustc` is {$os_min}" | |
| 22 | )] | |
| 21 | 23 | TooLow { env_var: &'static str, version: String, os_min: String }, |
| 22 | 24 | } |
| 23 | 25 | |
| ... | ... | @@ -34,13 +36,13 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for FeatureGateError { |
| 34 | 36 | } |
| 35 | 37 | |
| 36 | 38 | #[derive(Subdiagnostic)] |
| 37 | #[note(session_feature_diagnostic_for_issue)] | |
| 39 | #[note("see issue #{$n} <https://github.com/rust-lang/rust/issues/{$n}> for more information")] | |
| 38 | 40 | pub(crate) struct FeatureDiagnosticForIssue { |
| 39 | 41 | pub(crate) n: NonZero<u32>, |
| 40 | 42 | } |
| 41 | 43 | |
| 42 | 44 | #[derive(Subdiagnostic)] |
| 43 | #[note(session_feature_suggest_upgrade_compiler)] | |
| 45 | #[note("this compiler was built on {$date}; consider upgrading it if it is out of date")] | |
| 44 | 46 | pub(crate) struct SuggestUpgradeCompiler { |
| 45 | 47 | date: &'static str, |
| 46 | 48 | } |
| ... | ... | @@ -58,14 +60,14 @@ impl SuggestUpgradeCompiler { |
| 58 | 60 | } |
| 59 | 61 | |
| 60 | 62 | #[derive(Subdiagnostic)] |
| 61 | #[help(session_feature_diagnostic_help)] | |
| 63 | #[help("add `#![feature({$feature})]` to the crate attributes to enable")] | |
| 62 | 64 | pub(crate) struct FeatureDiagnosticHelp { |
| 63 | 65 | pub(crate) feature: Symbol, |
| 64 | 66 | } |
| 65 | 67 | |
| 66 | 68 | #[derive(Subdiagnostic)] |
| 67 | 69 | #[suggestion( |
| 68 | session_feature_diagnostic_suggestion, | |
| 70 | "add `#![feature({$feature})]` to the crate attributes to enable", | |
| 69 | 71 | applicability = "maybe-incorrect", |
| 70 | 72 | code = "#![feature({feature})]\n" |
| 71 | 73 | )] |
| ... | ... | @@ -76,169 +78,181 @@ pub struct FeatureDiagnosticSuggestion { |
| 76 | 78 | } |
| 77 | 79 | |
| 78 | 80 | #[derive(Subdiagnostic)] |
| 79 | #[help(session_cli_feature_diagnostic_help)] | |
| 81 | #[help("add `-Zcrate-attr=\"feature({$feature})\"` to the command-line options to enable")] | |
| 80 | 82 | pub(crate) struct CliFeatureDiagnosticHelp { |
| 81 | 83 | pub(crate) feature: Symbol, |
| 82 | 84 | } |
| 83 | 85 | |
| 84 | 86 | #[derive(Diagnostic)] |
| 85 | #[diag(session_must_be_name_of_associated_function)] | |
| 87 | #[diag("must be a name of an associated function")] | |
| 86 | 88 | pub struct MustBeNameOfAssociatedFunction { |
| 87 | 89 | #[primary_span] |
| 88 | 90 | pub span: Span, |
| 89 | 91 | } |
| 90 | 92 | |
| 91 | 93 | #[derive(Diagnostic)] |
| 92 | #[diag(session_not_circumvent_feature)] | |
| 94 | #[diag( | |
| 95 | "`-Zunleash-the-miri-inside-of-you` may not be used to circumvent feature gates, except when testing error paths in the CTFE engine" | |
| 96 | )] | |
| 93 | 97 | pub(crate) struct NotCircumventFeature; |
| 94 | 98 | |
| 95 | 99 | #[derive(Diagnostic)] |
| 96 | #[diag(session_linker_plugin_lto_windows_not_supported)] | |
| 100 | #[diag( | |
| 101 | "linker plugin based LTO is not supported together with `-C prefer-dynamic` when targeting Windows-like targets" | |
| 102 | )] | |
| 97 | 103 | pub(crate) struct LinkerPluginToWindowsNotSupported; |
| 98 | 104 | |
| 99 | 105 | #[derive(Diagnostic)] |
| 100 | #[diag(session_profile_use_file_does_not_exist)] | |
| 106 | #[diag("file `{$path}` passed to `-C profile-use` does not exist")] | |
| 101 | 107 | pub(crate) struct ProfileUseFileDoesNotExist<'a> { |
| 102 | 108 | pub(crate) path: &'a std::path::Path, |
| 103 | 109 | } |
| 104 | 110 | |
| 105 | 111 | #[derive(Diagnostic)] |
| 106 | #[diag(session_profile_sample_use_file_does_not_exist)] | |
| 112 | #[diag("file `{$path}` passed to `-C profile-sample-use` does not exist")] | |
| 107 | 113 | pub(crate) struct ProfileSampleUseFileDoesNotExist<'a> { |
| 108 | 114 | pub(crate) path: &'a std::path::Path, |
| 109 | 115 | } |
| 110 | 116 | |
| 111 | 117 | #[derive(Diagnostic)] |
| 112 | #[diag(session_target_requires_unwind_tables)] | |
| 118 | #[diag("target requires unwind tables, they cannot be disabled with `-C force-unwind-tables=no`")] | |
| 113 | 119 | pub(crate) struct TargetRequiresUnwindTables; |
| 114 | 120 | |
| 115 | 121 | #[derive(Diagnostic)] |
| 116 | #[diag(session_instrumentation_not_supported)] | |
| 122 | #[diag("{$us} instrumentation is not supported for this target")] | |
| 117 | 123 | pub(crate) struct InstrumentationNotSupported { |
| 118 | 124 | pub(crate) us: String, |
| 119 | 125 | } |
| 120 | 126 | |
| 121 | 127 | #[derive(Diagnostic)] |
| 122 | #[diag(session_sanitizer_not_supported)] | |
| 128 | #[diag("{$us} sanitizer is not supported for this target")] | |
| 123 | 129 | pub(crate) struct SanitizerNotSupported { |
| 124 | 130 | pub(crate) us: String, |
| 125 | 131 | } |
| 126 | 132 | |
| 127 | 133 | #[derive(Diagnostic)] |
| 128 | #[diag(session_sanitizers_not_supported)] | |
| 134 | #[diag("{$us} sanitizers are not supported for this target")] | |
| 129 | 135 | pub(crate) struct SanitizersNotSupported { |
| 130 | 136 | pub(crate) us: String, |
| 131 | 137 | } |
| 132 | 138 | |
| 133 | 139 | #[derive(Diagnostic)] |
| 134 | #[diag(session_cannot_mix_and_match_sanitizers)] | |
| 140 | #[diag("`-Zsanitizer={$first}` is incompatible with `-Zsanitizer={$second}`")] | |
| 135 | 141 | pub(crate) struct CannotMixAndMatchSanitizers { |
| 136 | 142 | pub(crate) first: String, |
| 137 | 143 | pub(crate) second: String, |
| 138 | 144 | } |
| 139 | 145 | |
| 140 | 146 | #[derive(Diagnostic)] |
| 141 | #[diag(session_cannot_enable_crt_static_linux)] | |
| 147 | #[diag( | |
| 148 | "sanitizer is incompatible with statically linked libc, disable it using `-C target-feature=-crt-static`" | |
| 149 | )] | |
| 142 | 150 | pub(crate) struct CannotEnableCrtStaticLinux; |
| 143 | 151 | |
| 144 | 152 | #[derive(Diagnostic)] |
| 145 | #[diag(session_sanitizer_cfi_requires_lto)] | |
| 153 | #[diag("`-Zsanitizer=cfi` requires `-Clto` or `-Clinker-plugin-lto`")] | |
| 146 | 154 | pub(crate) struct SanitizerCfiRequiresLto; |
| 147 | 155 | |
| 148 | 156 | #[derive(Diagnostic)] |
| 149 | #[diag(session_sanitizer_cfi_requires_single_codegen_unit)] | |
| 157 | #[diag("`-Zsanitizer=cfi` with `-Clto` requires `-Ccodegen-units=1`")] | |
| 150 | 158 | pub(crate) struct SanitizerCfiRequiresSingleCodegenUnit; |
| 151 | 159 | |
| 152 | 160 | #[derive(Diagnostic)] |
| 153 | #[diag(session_sanitizer_cfi_canonical_jump_tables_requires_cfi)] | |
| 161 | #[diag("`-Zsanitizer-cfi-canonical-jump-tables` requires `-Zsanitizer=cfi`")] | |
| 154 | 162 | pub(crate) struct SanitizerCfiCanonicalJumpTablesRequiresCfi; |
| 155 | 163 | |
| 156 | 164 | #[derive(Diagnostic)] |
| 157 | #[diag(session_sanitizer_cfi_generalize_pointers_requires_cfi)] | |
| 165 | #[diag("`-Zsanitizer-cfi-generalize-pointers` requires `-Zsanitizer=cfi` or `-Zsanitizer=kcfi`")] | |
| 158 | 166 | pub(crate) struct SanitizerCfiGeneralizePointersRequiresCfi; |
| 159 | 167 | |
| 160 | 168 | #[derive(Diagnostic)] |
| 161 | #[diag(session_sanitizer_cfi_normalize_integers_requires_cfi)] | |
| 169 | #[diag("`-Zsanitizer-cfi-normalize-integers` requires `-Zsanitizer=cfi` or `-Zsanitizer=kcfi`")] | |
| 162 | 170 | pub(crate) struct SanitizerCfiNormalizeIntegersRequiresCfi; |
| 163 | 171 | |
| 164 | 172 | #[derive(Diagnostic)] |
| 165 | #[diag(session_sanitizer_kcfi_arity_requires_kcfi)] | |
| 173 | #[diag("`-Zsanitizer-kcfi-arity` requires `-Zsanitizer=kcfi`")] | |
| 166 | 174 | pub(crate) struct SanitizerKcfiArityRequiresKcfi; |
| 167 | 175 | |
| 168 | 176 | #[derive(Diagnostic)] |
| 169 | #[diag(session_sanitizer_kcfi_requires_panic_abort)] | |
| 177 | #[diag("`-Z sanitizer=kcfi` requires `-C panic=abort`")] | |
| 170 | 178 | pub(crate) struct SanitizerKcfiRequiresPanicAbort; |
| 171 | 179 | |
| 172 | 180 | #[derive(Diagnostic)] |
| 173 | #[diag(session_split_lto_unit_requires_lto)] | |
| 181 | #[diag("`-Zsplit-lto-unit` requires `-Clto`, `-Clto=thin`, or `-Clinker-plugin-lto`")] | |
| 174 | 182 | pub(crate) struct SplitLtoUnitRequiresLto; |
| 175 | 183 | |
| 176 | 184 | #[derive(Diagnostic)] |
| 177 | #[diag(session_unstable_virtual_function_elimination)] | |
| 185 | #[diag("`-Zvirtual-function-elimination` requires `-Clto`")] | |
| 178 | 186 | pub(crate) struct UnstableVirtualFunctionElimination; |
| 179 | 187 | |
| 180 | 188 | #[derive(Diagnostic)] |
| 181 | #[diag(session_unsupported_dwarf_version)] | |
| 182 | #[help(session_unsupported_dwarf_version_help)] | |
| 189 | #[diag("requested DWARF version {$dwarf_version} is not supported")] | |
| 190 | #[help("supported DWARF versions are 2, 3, 4 and 5")] | |
| 183 | 191 | pub(crate) struct UnsupportedDwarfVersion { |
| 184 | 192 | pub(crate) dwarf_version: u32, |
| 185 | 193 | } |
| 186 | 194 | |
| 187 | 195 | #[derive(Diagnostic)] |
| 188 | #[diag(session_embed_source_insufficient_dwarf_version)] | |
| 196 | #[diag( | |
| 197 | "`-Zembed-source=y` requires at least `-Z dwarf-version=5` but DWARF version is {$dwarf_version}" | |
| 198 | )] | |
| 189 | 199 | pub(crate) struct EmbedSourceInsufficientDwarfVersion { |
| 190 | 200 | pub(crate) dwarf_version: u32, |
| 191 | 201 | } |
| 192 | 202 | |
| 193 | 203 | #[derive(Diagnostic)] |
| 194 | #[diag(session_embed_source_requires_debug_info)] | |
| 204 | #[diag("`-Zembed-source=y` requires debug information to be enabled")] | |
| 195 | 205 | pub(crate) struct EmbedSourceRequiresDebugInfo; |
| 196 | 206 | |
| 197 | 207 | #[derive(Diagnostic)] |
| 198 | #[diag(session_target_stack_protector_not_supported)] | |
| 208 | #[diag( | |
| 209 | "`-Z stack-protector={$stack_protector}` is not supported for target {$target_triple} and will be ignored" | |
| 210 | )] | |
| 199 | 211 | pub(crate) struct StackProtectorNotSupportedForTarget<'a> { |
| 200 | 212 | pub(crate) stack_protector: StackProtector, |
| 201 | 213 | pub(crate) target_triple: &'a TargetTuple, |
| 202 | 214 | } |
| 203 | 215 | |
| 204 | 216 | #[derive(Diagnostic)] |
| 205 | #[diag(session_target_small_data_threshold_not_supported)] | |
| 217 | #[diag( | |
| 218 | "`-Z small-data-threshold` is not supported for target {$target_triple} and will be ignored" | |
| 219 | )] | |
| 206 | 220 | pub(crate) struct SmallDataThresholdNotSupportedForTarget<'a> { |
| 207 | 221 | pub(crate) target_triple: &'a TargetTuple, |
| 208 | 222 | } |
| 209 | 223 | |
| 210 | 224 | #[derive(Diagnostic)] |
| 211 | #[diag(session_branch_protection_requires_aarch64)] | |
| 225 | #[diag("`-Zbranch-protection` is only supported on aarch64")] | |
| 212 | 226 | pub(crate) struct BranchProtectionRequiresAArch64; |
| 213 | 227 | |
| 214 | 228 | #[derive(Diagnostic)] |
| 215 | #[diag(session_split_debuginfo_unstable_platform)] | |
| 229 | #[diag("`-Csplit-debuginfo={$debuginfo}` is unstable on this platform")] | |
| 216 | 230 | pub(crate) struct SplitDebugInfoUnstablePlatform { |
| 217 | 231 | pub(crate) debuginfo: SplitDebuginfo, |
| 218 | 232 | } |
| 219 | 233 | |
| 220 | 234 | #[derive(Diagnostic)] |
| 221 | #[diag(session_file_is_not_writeable)] | |
| 235 | #[diag("output file {$file} is not writeable -- check its permissions")] | |
| 222 | 236 | pub(crate) struct FileIsNotWriteable<'a> { |
| 223 | 237 | pub(crate) file: &'a std::path::Path, |
| 224 | 238 | } |
| 225 | 239 | |
| 226 | 240 | #[derive(Diagnostic)] |
| 227 | #[diag(session_file_write_fail)] | |
| 241 | #[diag("failed to write `{$path}` due to error `{$err}`")] | |
| 228 | 242 | pub(crate) struct FileWriteFail<'a> { |
| 229 | 243 | pub(crate) path: &'a std::path::Path, |
| 230 | 244 | pub(crate) err: String, |
| 231 | 245 | } |
| 232 | 246 | |
| 233 | 247 | #[derive(Diagnostic)] |
| 234 | #[diag(session_crate_name_empty)] | |
| 248 | #[diag("crate name must not be empty")] | |
| 235 | 249 | pub(crate) struct CrateNameEmpty { |
| 236 | 250 | #[primary_span] |
| 237 | 251 | pub(crate) span: Option<Span>, |
| 238 | 252 | } |
| 239 | 253 | |
| 240 | 254 | #[derive(Diagnostic)] |
| 241 | #[diag(session_invalid_character_in_crate_name)] | |
| 255 | #[diag("invalid character {$character} in crate name: `{$crate_name}`")] | |
| 242 | 256 | pub(crate) struct InvalidCharacterInCrateName { |
| 243 | 257 | #[primary_span] |
| 244 | 258 | pub(crate) span: Option<Span>, |
| ... | ... | @@ -247,7 +261,10 @@ pub(crate) struct InvalidCharacterInCrateName { |
| 247 | 261 | } |
| 248 | 262 | |
| 249 | 263 | #[derive(Subdiagnostic)] |
| 250 | #[multipart_suggestion(session_expr_parentheses_needed, applicability = "machine-applicable")] | |
| 264 | #[multipart_suggestion( | |
| 265 | "parentheses are required to parse this as an expression", | |
| 266 | applicability = "machine-applicable" | |
| 267 | )] | |
| 251 | 268 | pub struct ExprParenthesesNeeded { |
| 252 | 269 | #[suggestion_part(code = "(")] |
| 253 | 270 | left: Span, |
| ... | ... | @@ -262,7 +279,7 @@ impl ExprParenthesesNeeded { |
| 262 | 279 | } |
| 263 | 280 | |
| 264 | 281 | #[derive(Diagnostic)] |
| 265 | #[diag(session_skipping_const_checks)] | |
| 282 | #[diag("skipping const checks")] | |
| 266 | 283 | pub(crate) struct SkippingConstChecks { |
| 267 | 284 | #[subdiagnostic] |
| 268 | 285 | pub(crate) unleashed_features: Vec<UnleashedFeatureHelp>, |
| ... | ... | @@ -270,13 +287,13 @@ pub(crate) struct SkippingConstChecks { |
| 270 | 287 | |
| 271 | 288 | #[derive(Subdiagnostic)] |
| 272 | 289 | pub(crate) enum UnleashedFeatureHelp { |
| 273 | #[help(session_unleashed_feature_help_named)] | |
| 290 | #[help("skipping check for `{$gate}` feature")] | |
| 274 | 291 | Named { |
| 275 | 292 | #[primary_span] |
| 276 | 293 | span: Span, |
| 277 | 294 | gate: Symbol, |
| 278 | 295 | }, |
| 279 | #[help(session_unleashed_feature_help_unnamed)] | |
| 296 | #[help("skipping check that does not even have a feature gate")] | |
| 280 | 297 | Unnamed { |
| 281 | 298 | #[primary_span] |
| 282 | 299 | span: Span, |
| ... | ... | @@ -284,10 +301,10 @@ pub(crate) enum UnleashedFeatureHelp { |
| 284 | 301 | } |
| 285 | 302 | |
| 286 | 303 | #[derive(Diagnostic)] |
| 287 | #[diag(session_invalid_literal_suffix)] | |
| 304 | #[diag("suffixes on {$kind} literals are invalid")] | |
| 288 | 305 | struct InvalidLiteralSuffix<'a> { |
| 289 | 306 | #[primary_span] |
| 290 | #[label] | |
| 307 | #[label("invalid suffix `{$suffix}`")] | |
| 291 | 308 | span: Span, |
| 292 | 309 | // FIXME(#100717) |
| 293 | 310 | kind: &'a str, |
| ... | ... | @@ -295,8 +312,8 @@ struct InvalidLiteralSuffix<'a> { |
| 295 | 312 | } |
| 296 | 313 | |
| 297 | 314 | #[derive(Diagnostic)] |
| 298 | #[diag(session_invalid_int_literal_width)] | |
| 299 | #[help] | |
| 315 | #[diag("invalid width `{$width}` for integer literal")] | |
| 316 | #[help("valid widths are 8, 16, 32, 64 and 128")] | |
| 300 | 317 | struct InvalidIntLiteralWidth { |
| 301 | 318 | #[primary_span] |
| 302 | 319 | span: Span, |
| ... | ... | @@ -304,28 +321,32 @@ struct InvalidIntLiteralWidth { |
| 304 | 321 | } |
| 305 | 322 | |
| 306 | 323 | #[derive(Diagnostic)] |
| 307 | #[diag(session_invalid_num_literal_base_prefix)] | |
| 308 | #[note] | |
| 324 | #[diag("invalid base prefix for number literal")] | |
| 325 | #[note("base prefixes (`0xff`, `0b1010`, `0o755`) are lowercase")] | |
| 309 | 326 | struct InvalidNumLiteralBasePrefix { |
| 310 | 327 | #[primary_span] |
| 311 | #[suggestion(applicability = "maybe-incorrect", code = "{fixed}")] | |
| 328 | #[suggestion( | |
| 329 | "try making the prefix lowercase", | |
| 330 | applicability = "maybe-incorrect", | |
| 331 | code = "{fixed}" | |
| 332 | )] | |
| 312 | 333 | span: Span, |
| 313 | 334 | fixed: String, |
| 314 | 335 | } |
| 315 | 336 | |
| 316 | 337 | #[derive(Diagnostic)] |
| 317 | #[diag(session_invalid_num_literal_suffix)] | |
| 318 | #[help] | |
| 338 | #[diag("invalid suffix `{$suffix}` for number literal")] | |
| 339 | #[help("the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)")] | |
| 319 | 340 | struct InvalidNumLiteralSuffix { |
| 320 | 341 | #[primary_span] |
| 321 | #[label] | |
| 342 | #[label("invalid suffix `{$suffix}`")] | |
| 322 | 343 | span: Span, |
| 323 | 344 | suffix: String, |
| 324 | 345 | } |
| 325 | 346 | |
| 326 | 347 | #[derive(Diagnostic)] |
| 327 | #[diag(session_invalid_float_literal_width)] | |
| 328 | #[help] | |
| 348 | #[diag("invalid width `{$width}` for float literal")] | |
| 349 | #[help("valid widths are 32 and 64")] | |
| 329 | 350 | struct InvalidFloatLiteralWidth { |
| 330 | 351 | #[primary_span] |
| 331 | 352 | span: Span, |
| ... | ... | @@ -333,18 +354,18 @@ struct InvalidFloatLiteralWidth { |
| 333 | 354 | } |
| 334 | 355 | |
| 335 | 356 | #[derive(Diagnostic)] |
| 336 | #[diag(session_invalid_float_literal_suffix)] | |
| 337 | #[help] | |
| 357 | #[diag("invalid suffix `{$suffix}` for float literal")] | |
| 358 | #[help("valid suffixes are `f32` and `f64`")] | |
| 338 | 359 | struct InvalidFloatLiteralSuffix { |
| 339 | 360 | #[primary_span] |
| 340 | #[label] | |
| 361 | #[label("invalid suffix `{$suffix}`")] | |
| 341 | 362 | span: Span, |
| 342 | 363 | suffix: String, |
| 343 | 364 | } |
| 344 | 365 | |
| 345 | 366 | #[derive(Diagnostic)] |
| 346 | #[diag(session_int_literal_too_large)] | |
| 347 | #[note] | |
| 367 | #[diag("integer literal is too large")] | |
| 368 | #[note("value exceeds limit of `{$limit}`")] | |
| 348 | 369 | struct IntLiteralTooLarge { |
| 349 | 370 | #[primary_span] |
| 350 | 371 | span: Span, |
| ... | ... | @@ -352,26 +373,26 @@ struct IntLiteralTooLarge { |
| 352 | 373 | } |
| 353 | 374 | |
| 354 | 375 | #[derive(Diagnostic)] |
| 355 | #[diag(session_hexadecimal_float_literal_not_supported)] | |
| 376 | #[diag("hexadecimal float literal is not supported")] | |
| 356 | 377 | struct HexadecimalFloatLiteralNotSupported { |
| 357 | 378 | #[primary_span] |
| 358 | #[label(session_not_supported)] | |
| 379 | #[label("not supported")] | |
| 359 | 380 | span: Span, |
| 360 | 381 | } |
| 361 | 382 | |
| 362 | 383 | #[derive(Diagnostic)] |
| 363 | #[diag(session_octal_float_literal_not_supported)] | |
| 384 | #[diag("octal float literal is not supported")] | |
| 364 | 385 | struct OctalFloatLiteralNotSupported { |
| 365 | 386 | #[primary_span] |
| 366 | #[label(session_not_supported)] | |
| 387 | #[label("not supported")] | |
| 367 | 388 | span: Span, |
| 368 | 389 | } |
| 369 | 390 | |
| 370 | 391 | #[derive(Diagnostic)] |
| 371 | #[diag(session_binary_float_literal_not_supported)] | |
| 392 | #[diag("binary float literal is not supported")] | |
| 372 | 393 | struct BinaryFloatLiteralNotSupported { |
| 373 | 394 | #[primary_span] |
| 374 | #[label(session_not_supported)] | |
| 395 | #[label("not supported")] | |
| 375 | 396 | span: Span, |
| 376 | 397 | } |
| 377 | 398 | |
| ... | ... | @@ -457,60 +478,60 @@ pub fn create_lit_error(psess: &ParseSess, err: LitError, lit: token::Lit, span: |
| 457 | 478 | } |
| 458 | 479 | |
| 459 | 480 | #[derive(Diagnostic)] |
| 460 | #[diag(session_incompatible_linker_flavor)] | |
| 461 | #[note] | |
| 481 | #[diag("linker flavor `{$flavor}` is incompatible with the current target")] | |
| 482 | #[note("compatible flavors are: {$compatible_list}")] | |
| 462 | 483 | pub(crate) struct IncompatibleLinkerFlavor { |
| 463 | 484 | pub(crate) flavor: &'static str, |
| 464 | 485 | pub(crate) compatible_list: String, |
| 465 | 486 | } |
| 466 | 487 | |
| 467 | 488 | #[derive(Diagnostic)] |
| 468 | #[diag(session_function_return_requires_x86_or_x86_64)] | |
| 489 | #[diag("`-Zfunction-return` (except `keep`) is only supported on x86 and x86_64")] | |
| 469 | 490 | pub(crate) struct FunctionReturnRequiresX86OrX8664; |
| 470 | 491 | |
| 471 | 492 | #[derive(Diagnostic)] |
| 472 | #[diag(session_function_return_thunk_extern_requires_non_large_code_model)] | |
| 493 | #[diag("`-Zfunction-return=thunk-extern` is only supported on non-large code models")] | |
| 473 | 494 | pub(crate) struct FunctionReturnThunkExternRequiresNonLargeCodeModel; |
| 474 | 495 | |
| 475 | 496 | #[derive(Diagnostic)] |
| 476 | #[diag(session_indirect_branch_cs_prefix_requires_x86_or_x86_64)] | |
| 497 | #[diag("`-Zindirect-branch-cs-prefix` is only supported on x86 and x86_64")] | |
| 477 | 498 | pub(crate) struct IndirectBranchCsPrefixRequiresX86OrX8664; |
| 478 | 499 | |
| 479 | 500 | #[derive(Diagnostic)] |
| 480 | #[diag(session_unsupported_regparm)] | |
| 501 | #[diag("`-Zregparm={$regparm}` is unsupported (valid values 0-3)")] | |
| 481 | 502 | pub(crate) struct UnsupportedRegparm { |
| 482 | 503 | pub(crate) regparm: u32, |
| 483 | 504 | } |
| 484 | 505 | |
| 485 | 506 | #[derive(Diagnostic)] |
| 486 | #[diag(session_unsupported_regparm_arch)] | |
| 507 | #[diag("`-Zregparm=N` is only supported on x86")] | |
| 487 | 508 | pub(crate) struct UnsupportedRegparmArch; |
| 488 | 509 | |
| 489 | 510 | #[derive(Diagnostic)] |
| 490 | #[diag(session_unsupported_reg_struct_return_arch)] | |
| 511 | #[diag("`-Zreg-struct-return` is only supported on x86")] | |
| 491 | 512 | pub(crate) struct UnsupportedRegStructReturnArch; |
| 492 | 513 | |
| 493 | 514 | #[derive(Diagnostic)] |
| 494 | #[diag(session_failed_to_create_profiler)] | |
| 515 | #[diag("failed to create profiler: {$err}")] | |
| 495 | 516 | pub(crate) struct FailedToCreateProfiler { |
| 496 | 517 | pub(crate) err: String, |
| 497 | 518 | } |
| 498 | 519 | |
| 499 | 520 | #[derive(Diagnostic)] |
| 500 | #[diag(session_soft_float_ignored)] | |
| 501 | #[note] | |
| 521 | #[diag("`-Csoft-float` is ignored on this target; it only has an effect on *eabihf targets")] | |
| 522 | #[note("this may become a hard error in a future version of Rust")] | |
| 502 | 523 | pub(crate) struct SoftFloatIgnored; |
| 503 | 524 | |
| 504 | 525 | #[derive(Diagnostic)] |
| 505 | #[diag(session_soft_float_deprecated)] | |
| 506 | #[note] | |
| 507 | #[note(session_soft_float_deprecated_issue)] | |
| 526 | #[diag("`-Csoft-float` is unsound and deprecated; use a corresponding *eabi target instead")] | |
| 527 | #[note("it will be removed or ignored in a future version of Rust")] | |
| 528 | #[note("see issue #129893 <https://github.com/rust-lang/rust/issues/129893> for more information")] | |
| 508 | 529 | pub(crate) struct SoftFloatDeprecated; |
| 509 | 530 | |
| 510 | 531 | #[derive(LintDiagnostic)] |
| 511 | #[diag(session_unexpected_builtin_cfg)] | |
| 512 | #[note(session_controlled_by)] | |
| 513 | #[note(session_incoherent)] | |
| 532 | #[diag("unexpected `--cfg {$cfg}` flag")] | |
| 533 | #[note("config `{$cfg_name}` is only supposed to be controlled by `{$controlled_by}`")] | |
| 534 | #[note("manually setting a built-in cfg can and does create incoherent behaviors")] | |
| 514 | 535 | pub(crate) struct UnexpectedBuiltinCfg { |
| 515 | 536 | pub(crate) cfg: String, |
| 516 | 537 | pub(crate) cfg_name: Symbol, |
compiler/rustc_session/src/lib.rs-2| ... | ... | @@ -32,8 +32,6 @@ pub mod output; |
| 32 | 32 | |
| 33 | 33 | pub use getopts; |
| 34 | 34 | |
| 35 | rustc_fluent_macro::fluent_messages! { "../messages.ftl" } | |
| 36 | ||
| 37 | 35 | /// Requirements for a `StableHashingContext` to be used in this crate. |
| 38 | 36 | /// This is a hack to allow using the `HashStable_Generic` derive macro |
| 39 | 37 | /// instead of implementing everything in `rustc_middle`. |
compiler/rustc_span/src/symbol.rs+1| ... | ... | @@ -1002,6 +1002,7 @@ symbols! { |
| 1002 | 1002 | explicit_tail_calls, |
| 1003 | 1003 | export_name, |
| 1004 | 1004 | export_stable, |
| 1005 | export_symbols: "export-symbols", | |
| 1005 | 1006 | expr, |
| 1006 | 1007 | expr_2021, |
| 1007 | 1008 | expr_fragment_specifier_2024, |
compiler/rustc_target/src/spec/mod.rs+3| ... | ... | @@ -3363,6 +3363,9 @@ impl Target { |
| 3363 | 3363 | |
| 3364 | 3364 | Err(format!("could not find specification for target {target_tuple:?}")) |
| 3365 | 3365 | } |
| 3366 | TargetTuple::TargetJson { ref contents, .. } if !unstable_options => { | |
| 3367 | Err("custom targets are unstable and require `-Zunstable-options`".to_string()) | |
| 3368 | } | |
| 3366 | 3369 | TargetTuple::TargetJson { ref contents, .. } => Target::from_json(contents), |
| 3367 | 3370 | } |
| 3368 | 3371 | } |
compiler/rustc_ty_utils/Cargo.toml-1| ... | ... | @@ -9,7 +9,6 @@ itertools = "0.12" |
| 9 | 9 | rustc_abi = { path = "../rustc_abi" } |
| 10 | 10 | rustc_data_structures = { path = "../rustc_data_structures" } |
| 11 | 11 | rustc_errors = { path = "../rustc_errors" } |
| 12 | rustc_fluent_macro = { path = "../rustc_fluent_macro" } | |
| 13 | 12 | rustc_hashes = { path = "../rustc_hashes" } |
| 14 | 13 | rustc_hir = { path = "../rustc_hir" } |
| 15 | 14 | rustc_index = { path = "../rustc_index" } |
compiler/rustc_ty_utils/messages.ftl deleted-61| ... | ... | @@ -1,61 +0,0 @@ |
| 1 | ty_utils_address_and_deref_not_supported = dereferencing or taking the address is not supported in generic constants | |
| 2 | ||
| 3 | ty_utils_adt_not_supported = struct/enum construction is not supported in generic constants | |
| 4 | ||
| 5 | ty_utils_array_not_supported = array construction is not supported in generic constants | |
| 6 | ||
| 7 | ty_utils_assign_not_supported = assignment is not supported in generic constants | |
| 8 | ||
| 9 | ty_utils_binary_not_supported = unsupported binary operation in generic constants | |
| 10 | ||
| 11 | ty_utils_block_not_supported = blocks are not supported in generic constants | |
| 12 | ||
| 13 | ty_utils_borrow_not_supported = borrowing is not supported in generic constants | |
| 14 | ||
| 15 | ty_utils_box_not_supported = allocations are not allowed in generic constants | |
| 16 | ||
| 17 | ty_utils_by_use_not_supported = .use is not allowed in generic constants | |
| 18 | ||
| 19 | ty_utils_closure_and_return_not_supported = closures and function keywords are not supported in generic constants | |
| 20 | ||
| 21 | ty_utils_const_block_not_supported = const blocks are not supported in generic constants | |
| 22 | ||
| 23 | ty_utils_control_flow_not_supported = control flow is not supported in generic constants | |
| 24 | ||
| 25 | ty_utils_field_not_supported = field access is not supported in generic constants | |
| 26 | ||
| 27 | ty_utils_generic_constant_too_complex = overly complex generic constant | |
| 28 | .help = consider moving this anonymous constant into a `const` function | |
| 29 | .maybe_supported = this operation may be supported in the future | |
| 30 | ||
| 31 | ty_utils_impl_trait_duplicate_arg = non-defining opaque type use in defining scope | |
| 32 | .label = generic argument `{$arg}` used twice | |
| 33 | .note = for this opaque type | |
| 34 | ||
| 35 | ty_utils_impl_trait_not_param = non-defining opaque type use in defining scope | |
| 36 | .label = argument `{$arg}` is not a generic parameter | |
| 37 | .note = for this opaque type | |
| 38 | ||
| 39 | ty_utils_index_not_supported = indexing is not supported in generic constants | |
| 40 | ||
| 41 | ty_utils_inline_asm_not_supported = assembly is not supported in generic constants | |
| 42 | ||
| 43 | ty_utils_logical_op_not_supported = unsupported operation in generic constants, short-circuiting operations would imply control flow | |
| 44 | ||
| 45 | ty_utils_loop_not_supported = loops and loop control flow are not supported in generic constants | |
| 46 | ||
| 47 | ty_utils_needs_drop_overflow = overflow while checking whether `{$query_ty}` requires drop | |
| 48 | ||
| 49 | ty_utils_never_to_any_not_supported = coercing the `never` type is not supported in generic constants | |
| 50 | ||
| 51 | ty_utils_non_primitive_simd_type = monomorphising SIMD type `{$ty}` with a non-primitive-scalar (integer/float/pointer) element type `{$e_ty}` | |
| 52 | ||
| 53 | ty_utils_operation_not_supported = unsupported operation in generic constants | |
| 54 | ||
| 55 | ty_utils_pointer_not_supported = pointer casts are not allowed in generic constants | |
| 56 | ||
| 57 | ty_utils_tuple_not_supported = tuple construction is not supported in generic constants | |
| 58 | ||
| 59 | ty_utils_unexpected_fnptr_associated_item = `FnPtr` trait with unexpected associated item | |
| 60 | ||
| 61 | ty_utils_yield_not_supported = coroutine control flow is not allowed in generic constants |
compiler/rustc_ty_utils/src/errors.rs+38-34| ... | ... | @@ -6,18 +6,18 @@ use rustc_middle::ty::{GenericArg, Ty}; |
| 6 | 6 | use rustc_span::Span; |
| 7 | 7 | |
| 8 | 8 | #[derive(Diagnostic)] |
| 9 | #[diag(ty_utils_needs_drop_overflow)] | |
| 9 | #[diag("overflow while checking whether `{$query_ty}` requires drop")] | |
| 10 | 10 | pub(crate) struct NeedsDropOverflow<'tcx> { |
| 11 | 11 | pub query_ty: Ty<'tcx>, |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | #[derive(Diagnostic)] |
| 15 | #[diag(ty_utils_generic_constant_too_complex)] | |
| 16 | #[help] | |
| 15 | #[diag("overly complex generic constant")] | |
| 16 | #[help("consider moving this anonymous constant into a `const` function")] | |
| 17 | 17 | pub(crate) struct GenericConstantTooComplex { |
| 18 | 18 | #[primary_span] |
| 19 | 19 | pub span: Span, |
| 20 | #[note(ty_utils_maybe_supported)] | |
| 20 | #[note("this operation may be supported in the future")] | |
| 21 | 21 | pub maybe_supported: bool, |
| 22 | 22 | #[subdiagnostic] |
| 23 | 23 | pub sub: GenericConstantTooComplexSub, |
| ... | ... | @@ -25,84 +25,88 @@ pub(crate) struct GenericConstantTooComplex { |
| 25 | 25 | |
| 26 | 26 | #[derive(Subdiagnostic)] |
| 27 | 27 | pub(crate) enum GenericConstantTooComplexSub { |
| 28 | #[label(ty_utils_borrow_not_supported)] | |
| 28 | #[label("borrowing is not supported in generic constants")] | |
| 29 | 29 | BorrowNotSupported(#[primary_span] Span), |
| 30 | #[label(ty_utils_address_and_deref_not_supported)] | |
| 30 | #[label("dereferencing or taking the address is not supported in generic constants")] | |
| 31 | 31 | AddressAndDerefNotSupported(#[primary_span] Span), |
| 32 | #[label(ty_utils_array_not_supported)] | |
| 32 | #[label("array construction is not supported in generic constants")] | |
| 33 | 33 | ArrayNotSupported(#[primary_span] Span), |
| 34 | #[label(ty_utils_block_not_supported)] | |
| 34 | #[label("blocks are not supported in generic constants")] | |
| 35 | 35 | BlockNotSupported(#[primary_span] Span), |
| 36 | #[label(ty_utils_never_to_any_not_supported)] | |
| 36 | #[label("coercing the `never` type is not supported in generic constants")] | |
| 37 | 37 | NeverToAnyNotSupported(#[primary_span] Span), |
| 38 | #[label(ty_utils_tuple_not_supported)] | |
| 38 | #[label("tuple construction is not supported in generic constants")] | |
| 39 | 39 | TupleNotSupported(#[primary_span] Span), |
| 40 | #[label(ty_utils_index_not_supported)] | |
| 40 | #[label("indexing is not supported in generic constants")] | |
| 41 | 41 | IndexNotSupported(#[primary_span] Span), |
| 42 | #[label(ty_utils_field_not_supported)] | |
| 42 | #[label("field access is not supported in generic constants")] | |
| 43 | 43 | FieldNotSupported(#[primary_span] Span), |
| 44 | #[label(ty_utils_const_block_not_supported)] | |
| 44 | #[label("const blocks are not supported in generic constants")] | |
| 45 | 45 | ConstBlockNotSupported(#[primary_span] Span), |
| 46 | #[label(ty_utils_adt_not_supported)] | |
| 46 | #[label("struct/enum construction is not supported in generic constants")] | |
| 47 | 47 | AdtNotSupported(#[primary_span] Span), |
| 48 | #[label(ty_utils_pointer_not_supported)] | |
| 48 | #[label("pointer casts are not allowed in generic constants")] | |
| 49 | 49 | PointerNotSupported(#[primary_span] Span), |
| 50 | #[label(ty_utils_yield_not_supported)] | |
| 50 | #[label("coroutine control flow is not allowed in generic constants")] | |
| 51 | 51 | YieldNotSupported(#[primary_span] Span), |
| 52 | #[label(ty_utils_loop_not_supported)] | |
| 52 | #[label("loops and loop control flow are not supported in generic constants")] | |
| 53 | 53 | LoopNotSupported(#[primary_span] Span), |
| 54 | #[label(ty_utils_box_not_supported)] | |
| 54 | #[label("allocations are not allowed in generic constants")] | |
| 55 | 55 | BoxNotSupported(#[primary_span] Span), |
| 56 | #[label(ty_utils_binary_not_supported)] | |
| 56 | #[label("unsupported binary operation in generic constants")] | |
| 57 | 57 | BinaryNotSupported(#[primary_span] Span), |
| 58 | #[label(ty_utils_by_use_not_supported)] | |
| 58 | #[label(".use is not allowed in generic constants")] | |
| 59 | 59 | ByUseNotSupported(#[primary_span] Span), |
| 60 | #[label(ty_utils_logical_op_not_supported)] | |
| 60 | #[label( | |
| 61 | "unsupported operation in generic constants, short-circuiting operations would imply control flow" | |
| 62 | )] | |
| 61 | 63 | LogicalOpNotSupported(#[primary_span] Span), |
| 62 | #[label(ty_utils_assign_not_supported)] | |
| 64 | #[label("assignment is not supported in generic constants")] | |
| 63 | 65 | AssignNotSupported(#[primary_span] Span), |
| 64 | #[label(ty_utils_closure_and_return_not_supported)] | |
| 66 | #[label("closures and function keywords are not supported in generic constants")] | |
| 65 | 67 | ClosureAndReturnNotSupported(#[primary_span] Span), |
| 66 | #[label(ty_utils_control_flow_not_supported)] | |
| 68 | #[label("control flow is not supported in generic constants")] | |
| 67 | 69 | ControlFlowNotSupported(#[primary_span] Span), |
| 68 | #[label(ty_utils_inline_asm_not_supported)] | |
| 70 | #[label("assembly is not supported in generic constants")] | |
| 69 | 71 | InlineAsmNotSupported(#[primary_span] Span), |
| 70 | #[label(ty_utils_operation_not_supported)] | |
| 72 | #[label("unsupported operation in generic constants")] | |
| 71 | 73 | OperationNotSupported(#[primary_span] Span), |
| 72 | 74 | } |
| 73 | 75 | |
| 74 | 76 | #[derive(Diagnostic)] |
| 75 | #[diag(ty_utils_unexpected_fnptr_associated_item)] | |
| 77 | #[diag("`FnPtr` trait with unexpected associated item")] | |
| 76 | 78 | pub(crate) struct UnexpectedFnPtrAssociatedItem { |
| 77 | 79 | #[primary_span] |
| 78 | 80 | pub span: Span, |
| 79 | 81 | } |
| 80 | 82 | |
| 81 | 83 | #[derive(Diagnostic)] |
| 82 | #[diag(ty_utils_non_primitive_simd_type)] | |
| 84 | #[diag( | |
| 85 | "monomorphising SIMD type `{$ty}` with a non-primitive-scalar (integer/float/pointer) element type `{$e_ty}`" | |
| 86 | )] | |
| 83 | 87 | pub(crate) struct NonPrimitiveSimdType<'tcx> { |
| 84 | 88 | pub ty: Ty<'tcx>, |
| 85 | 89 | pub e_ty: Ty<'tcx>, |
| 86 | 90 | } |
| 87 | 91 | |
| 88 | 92 | #[derive(Diagnostic)] |
| 89 | #[diag(ty_utils_impl_trait_duplicate_arg)] | |
| 93 | #[diag("non-defining opaque type use in defining scope")] | |
| 90 | 94 | pub(crate) struct DuplicateArg<'tcx> { |
| 91 | 95 | pub arg: GenericArg<'tcx>, |
| 92 | 96 | #[primary_span] |
| 93 | #[label] | |
| 97 | #[label("generic argument `{$arg}` used twice")] | |
| 94 | 98 | pub span: Span, |
| 95 | #[note] | |
| 99 | #[note("for this opaque type")] | |
| 96 | 100 | pub opaque_span: Span, |
| 97 | 101 | } |
| 98 | 102 | |
| 99 | 103 | #[derive(Diagnostic)] |
| 100 | #[diag(ty_utils_impl_trait_not_param, code = E0792)] | |
| 104 | #[diag("non-defining opaque type use in defining scope", code = E0792)] | |
| 101 | 105 | pub(crate) struct NotParam<'tcx> { |
| 102 | 106 | pub arg: GenericArg<'tcx>, |
| 103 | 107 | #[primary_span] |
| 104 | #[label] | |
| 108 | #[label("argument `{$arg}` is not a generic parameter")] | |
| 105 | 109 | pub span: Span, |
| 106 | #[note] | |
| 110 | #[note("for this opaque type")] | |
| 107 | 111 | pub opaque_span: Span, |
| 108 | 112 | } |
compiler/rustc_ty_utils/src/lib.rs-2| ... | ... | @@ -31,8 +31,6 @@ pub mod sig_types; |
| 31 | 31 | mod structural_match; |
| 32 | 32 | mod ty; |
| 33 | 33 | |
| 34 | rustc_fluent_macro::fluent_messages! { "../messages.ftl" } | |
| 35 | ||
| 36 | 34 | pub fn provide(providers: &mut Providers) { |
| 37 | 35 | abi::provide(providers); |
| 38 | 36 | assoc::provide(providers); |
library/std/src/fs/tests.rs+51| ... | ... | @@ -2301,6 +2301,57 @@ fn test_fs_set_times() { |
| 2301 | 2301 | } |
| 2302 | 2302 | } |
| 2303 | 2303 | |
| 2304 | #[test] | |
| 2305 | fn test_fs_set_times_on_dir() { | |
| 2306 | #[cfg(target_vendor = "apple")] | |
| 2307 | use crate::os::darwin::fs::FileTimesExt; | |
| 2308 | #[cfg(windows)] | |
| 2309 | use crate::os::windows::fs::FileTimesExt; | |
| 2310 | ||
| 2311 | let tmp = tmpdir(); | |
| 2312 | let dir_path = tmp.join("testdir"); | |
| 2313 | fs::create_dir(&dir_path).unwrap(); | |
| 2314 | ||
| 2315 | let mut times = FileTimes::new(); | |
| 2316 | let accessed = SystemTime::UNIX_EPOCH + Duration::from_secs(12345); | |
| 2317 | let modified = SystemTime::UNIX_EPOCH + Duration::from_secs(54321); | |
| 2318 | times = times.set_accessed(accessed).set_modified(modified); | |
| 2319 | ||
| 2320 | #[cfg(any(windows, target_vendor = "apple"))] | |
| 2321 | let created = SystemTime::UNIX_EPOCH + Duration::from_secs(32123); | |
| 2322 | #[cfg(any(windows, target_vendor = "apple"))] | |
| 2323 | { | |
| 2324 | times = times.set_created(created); | |
| 2325 | } | |
| 2326 | ||
| 2327 | match fs::set_times(&dir_path, times) { | |
| 2328 | // Allow unsupported errors on platforms which don't support setting times. | |
| 2329 | #[cfg(not(any( | |
| 2330 | windows, | |
| 2331 | all( | |
| 2332 | unix, | |
| 2333 | not(any( | |
| 2334 | target_os = "android", | |
| 2335 | target_os = "redox", | |
| 2336 | target_os = "espidf", | |
| 2337 | target_os = "horizon" | |
| 2338 | )) | |
| 2339 | ) | |
| 2340 | )))] | |
| 2341 | Err(e) if e.kind() == ErrorKind::Unsupported => return, | |
| 2342 | Err(e) => panic!("error setting directory times: {e:?}"), | |
| 2343 | Ok(_) => {} | |
| 2344 | } | |
| 2345 | ||
| 2346 | let metadata = fs::metadata(&dir_path).unwrap(); | |
| 2347 | assert_eq!(metadata.accessed().unwrap(), accessed); | |
| 2348 | assert_eq!(metadata.modified().unwrap(), modified); | |
| 2349 | #[cfg(any(windows, target_vendor = "apple"))] | |
| 2350 | { | |
| 2351 | assert_eq!(metadata.created().unwrap(), created); | |
| 2352 | } | |
| 2353 | } | |
| 2354 | ||
| 2304 | 2355 | #[test] |
| 2305 | 2356 | fn test_fs_set_times_follows_symlink() { |
| 2306 | 2357 | #[cfg(target_vendor = "apple")] |
library/std/src/sys/fs/windows.rs+2-2| ... | ... | @@ -1556,7 +1556,7 @@ pub fn set_perm(p: &WCStr, perm: FilePermissions) -> io::Result<()> { |
| 1556 | 1556 | |
| 1557 | 1557 | pub fn set_times(p: &WCStr, times: FileTimes) -> io::Result<()> { |
| 1558 | 1558 | let mut opts = OpenOptions::new(); |
| 1559 | opts.write(true); | |
| 1559 | opts.access_mode(c::FILE_WRITE_ATTRIBUTES); | |
| 1560 | 1560 | opts.custom_flags(c::FILE_FLAG_BACKUP_SEMANTICS); |
| 1561 | 1561 | let file = File::open_native(p, &opts)?; |
| 1562 | 1562 | file.set_times(times) |
| ... | ... | @@ -1564,7 +1564,7 @@ pub fn set_times(p: &WCStr, times: FileTimes) -> io::Result<()> { |
| 1564 | 1564 | |
| 1565 | 1565 | pub fn set_times_nofollow(p: &WCStr, times: FileTimes) -> io::Result<()> { |
| 1566 | 1566 | let mut opts = OpenOptions::new(); |
| 1567 | opts.write(true); | |
| 1567 | opts.access_mode(c::FILE_WRITE_ATTRIBUTES); | |
| 1568 | 1568 | // `FILE_FLAG_OPEN_REPARSE_POINT` for no_follow behavior |
| 1569 | 1569 | opts.custom_flags(c::FILE_FLAG_BACKUP_SEMANTICS | c::FILE_FLAG_OPEN_REPARSE_POINT); |
| 1570 | 1570 | let file = File::open_native(p, &opts)?; |
src/build_helper/src/metrics.rs+23| ... | ... | @@ -111,6 +111,29 @@ pub struct JsonStepSystemStats { |
| 111 | 111 | pub cpu_utilization_percent: f64, |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | #[derive(Eq, Hash, PartialEq, Debug)] | |
| 115 | pub enum DebuggerKind { | |
| 116 | Gdb, | |
| 117 | Lldb, | |
| 118 | Cdb, | |
| 119 | } | |
| 120 | ||
| 121 | impl DebuggerKind { | |
| 122 | pub fn debuginfo_kind(name: &str) -> Option<DebuggerKind> { | |
| 123 | let name = name.to_ascii_lowercase(); | |
| 124 | ||
| 125 | if name.contains("debuginfo-gdb") { | |
| 126 | Some(DebuggerKind::Gdb) | |
| 127 | } else if name.contains("debuginfo-lldb") { | |
| 128 | Some(DebuggerKind::Lldb) | |
| 129 | } else if name.contains("debuginfo-cdb") { | |
| 130 | Some(DebuggerKind::Cdb) | |
| 131 | } else { | |
| 132 | None | |
| 133 | } | |
| 134 | } | |
| 135 | } | |
| 136 | ||
| 114 | 137 | fn null_as_f64_nan<'de, D: serde::Deserializer<'de>>(d: D) -> Result<f64, D::Error> { |
| 115 | 138 | use serde::Deserialize as _; |
| 116 | 139 | Option::<f64>::deserialize(d).map(|f| f.unwrap_or(f64::NAN)) |
src/ci/citool/src/analysis.rs+29-1| ... | ... | @@ -3,7 +3,7 @@ use std::fmt::Debug; |
| 3 | 3 | use std::time::Duration; |
| 4 | 4 | |
| 5 | 5 | use build_helper::metrics::{ |
| 6 | BuildStep, JsonRoot, TestOutcome, TestSuite, TestSuiteMetadata, escape_step_name, | |
| 6 | BuildStep, DebuggerKind, JsonRoot, TestOutcome, TestSuite, TestSuiteMetadata, escape_step_name, | |
| 7 | 7 | format_build_steps, |
| 8 | 8 | }; |
| 9 | 9 | |
| ... | ... | @@ -139,11 +139,39 @@ fn record_test_suites(metrics: &JsonRoot) { |
| 139 | 139 | let table = render_table(aggregated); |
| 140 | 140 | println!("\n# Test results\n"); |
| 141 | 141 | println!("{table}"); |
| 142 | report_debuginfo_statistics(&suites); | |
| 142 | 143 | } else { |
| 143 | 144 | eprintln!("No test suites found in metrics"); |
| 144 | 145 | } |
| 145 | 146 | } |
| 146 | 147 | |
| 148 | fn report_debuginfo_statistics(suites: &[&TestSuite]) { | |
| 149 | let mut debugger_test_record: HashMap<DebuggerKind, TestSuiteRecord> = HashMap::new(); | |
| 150 | for suite in suites { | |
| 151 | if let TestSuiteMetadata::Compiletest { .. } = suite.metadata { | |
| 152 | for test in &suite.tests { | |
| 153 | if let Some(kind) = DebuggerKind::debuginfo_kind(&test.name) { | |
| 154 | let record = | |
| 155 | debugger_test_record.entry(kind).or_insert(TestSuiteRecord::default()); | |
| 156 | match test.outcome { | |
| 157 | TestOutcome::Passed => record.passed += 1, | |
| 158 | TestOutcome::Ignored { .. } => record.ignored += 1, | |
| 159 | TestOutcome::Failed => record.failed += 1, | |
| 160 | } | |
| 161 | } | |
| 162 | } | |
| 163 | } | |
| 164 | } | |
| 165 | ||
| 166 | println!("## DebugInfo Test Statistics"); | |
| 167 | for (kind, record) in debugger_test_record { | |
| 168 | println!( | |
| 169 | "- {:?}: Passed ✅={}, Failed ❌={}, Ignored 🚫={}", | |
| 170 | kind, record.passed, record.failed, record.ignored | |
| 171 | ); | |
| 172 | } | |
| 173 | } | |
| 174 | ||
| 147 | 175 | fn render_table(suites: BTreeMap<String, TestSuiteRecord>) -> String { |
| 148 | 176 | use std::fmt::Write; |
| 149 | 177 |
src/ci/docker/scripts/rfl-build.sh+2-2| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | |
| 3 | 3 | set -euo pipefail |
| 4 | 4 | |
| 5 | # https://github.com/rust-lang/rust/pull/145974 | |
| 6 | LINUX_VERSION=842cfd8e5aff3157cb25481b2900b49c188d628a | |
| 5 | # https://github.com/rust-lang/rust/pull/151534 | |
| 6 | LINUX_VERSION=eb268c7972f65fa0b11b051c5ef2b92747bb2b62 | |
| 7 | 7 | |
| 8 | 8 | # Build rustc, rustdoc, cargo, clippy-driver and rustfmt |
| 9 | 9 | ../x.py build --stage 2 library rustdoc clippy rustfmt |
src/tools/rustbook/README.md+1-1| ... | ... | @@ -10,7 +10,7 @@ This is invoked automatically when building mdbook-style documentation, for exam |
| 10 | 10 | |
| 11 | 11 | ## Cargo workspace |
| 12 | 12 | |
| 13 | This package defines a separate cargo workspace from the main Rust workspace for a few reasons (ref [#127786](https://github.com/rust-lang/rust/pull/127786): | |
| 13 | This package defines a separate cargo workspace from the main Rust workspace for a few reasons (ref [#127786](https://github.com/rust-lang/rust/pull/127786)): | |
| 14 | 14 | |
| 15 | 15 | - Avoids requiring checking out submodules for developers who are not working on the documentation. Otherwise, some submodules such as those that have custom preprocessors would be required for cargo to find the dependencies. |
| 16 | 16 | - Avoids problems with updating dependencies. Unfortunately this workspace has a rather large set of dependencies, which can make coordinating updates difficult (see [#127890](https://github.com/rust-lang/rust/issues/127890)). |
tests/codegen-llvm/autodiff/abi_handling.rs+6-6| ... | ... | @@ -38,14 +38,14 @@ fn square(x: f32) -> f32 { |
| 38 | 38 | // CHECK-LABEL: ; abi_handling::df1 |
| 39 | 39 | // CHECK-NEXT: Function Attrs |
| 40 | 40 | // debug-NEXT: define internal { float, float } |
| 41 | // debug-SAME: (ptr align 4 %x, ptr align 4 %bx_0) | |
| 41 | // debug-SAME: (ptr {{.*}}%x, ptr {{.*}}%bx_0) | |
| 42 | 42 | // release-NEXT: define internal fastcc float |
| 43 | 43 | // release-SAME: (float %x.0.val, float %x.4.val) |
| 44 | 44 | |
| 45 | 45 | // CHECK-LABEL: ; abi_handling::f1 |
| 46 | 46 | // CHECK-NEXT: Function Attrs |
| 47 | 47 | // debug-NEXT: define internal float |
| 48 | // debug-SAME: (ptr align 4 %x) | |
| 48 | // debug-SAME: (ptr {{.*}}%x) | |
| 49 | 49 | // release-NEXT: define internal fastcc noundef float |
| 50 | 50 | // release-SAME: (float %x.0.val, float %x.4.val) |
| 51 | 51 | #[autodiff_forward(df1, Dual, Dual)] |
| ... | ... | @@ -58,7 +58,7 @@ fn f1(x: &[f32; 2]) -> f32 { |
| 58 | 58 | // CHECK-NEXT: Function Attrs |
| 59 | 59 | // debug-NEXT: define internal { float, float } |
| 60 | 60 | // debug-SAME: (ptr %f, float %x, float %dret) |
| 61 | // release-NEXT: define internal fastcc float | |
| 61 | // release-NEXT: define internal fastcc noundef float | |
| 62 | 62 | // release-SAME: (float noundef %x) |
| 63 | 63 | |
| 64 | 64 | // CHECK-LABEL: ; abi_handling::f2 |
| ... | ... | @@ -77,13 +77,13 @@ fn f2(f: fn(f32) -> f32, x: f32) -> f32 { |
| 77 | 77 | // CHECK-NEXT: Function Attrs |
| 78 | 78 | // debug-NEXT: define internal { float, float } |
| 79 | 79 | // debug-SAME: (ptr align 4 %x, ptr align 4 %bx_0, ptr align 4 %y, ptr align 4 %by_0) |
| 80 | // release-NEXT: define internal fastcc { float, float } | |
| 80 | // release-NEXT: define internal fastcc float | |
| 81 | 81 | // release-SAME: (float %x.0.val) |
| 82 | 82 | |
| 83 | 83 | // CHECK-LABEL: ; abi_handling::f3 |
| 84 | 84 | // CHECK-NEXT: Function Attrs |
| 85 | 85 | // debug-NEXT: define internal float |
| 86 | // debug-SAME: (ptr align 4 %x, ptr align 4 %y) | |
| 86 | // debug-SAME: (ptr {{.*}}%x, ptr {{.*}}%y) | |
| 87 | 87 | // release-NEXT: define internal fastcc noundef float |
| 88 | 88 | // release-SAME: (float %x.0.val) |
| 89 | 89 | #[autodiff_forward(df3, Dual, Dual, Dual)] |
| ... | ... | @@ -160,7 +160,7 @@ fn f6(i: NestedInput) -> f32 { |
| 160 | 160 | // CHECK-LABEL: ; abi_handling::f7 |
| 161 | 161 | // CHECK-NEXT: Function Attrs |
| 162 | 162 | // debug-NEXT: define internal float |
| 163 | // debug-SAME: (ptr align 4 %x.0, ptr align 4 %x.1) | |
| 163 | // debug-SAME: (ptr {{.*}}%x.0, ptr {{.*}}%x.1) | |
| 164 | 164 | // release-NEXT: define internal fastcc noundef float |
| 165 | 165 | // release-SAME: (float %x.0.0.val, float %x.1.0.val) |
| 166 | 166 | #[autodiff_forward(df7, Dual, Dual)] |
tests/codegen-llvm/autodiff/batched.rs+16-67| ... | ... | @@ -1,13 +1,11 @@ |
| 1 | 1 | //@ compile-flags: -Zautodiff=Enable,NoTT,NoPostopt -C opt-level=3 -Clto=fat |
| 2 | 2 | //@ no-prefer-dynamic |
| 3 | 3 | //@ needs-enzyme |
| 4 | // | |
| 5 | // In Enzyme, we test against a large range of LLVM versions (5+) and don't have overly many | |
| 6 | // breakages. One benefit is that we match the IR generated by Enzyme only after running it | |
| 7 | // through LLVM's O3 pipeline, which will remove most of the noise. | |
| 8 | // However, our integration test could also be affected by changes in how rustc lowers MIR into | |
| 9 | // LLVM-IR, which could cause additional noise and thus breakages. If that's the case, we should | |
| 10 | // reduce this test to only match the first lines and the ret instructions. | |
| 4 | ||
| 5 | // This test combines two features of Enzyme, automatic differentiation and batching. As such, it is | |
| 6 | // especially prone to breakages. I reduced it therefore to a minimal check matches argument/return | |
| 7 | // types. Based on the original batching author, implementing the batching feature over MLIR instead | |
| 8 | // of LLVM should give significantly more reliable performance. | |
| 11 | 9 | |
| 12 | 10 | #![feature(autodiff)] |
| 13 | 11 | |
| ... | ... | @@ -22,69 +20,20 @@ fn square(x: &f32) -> f32 { |
| 22 | 20 | x * x |
| 23 | 21 | } |
| 24 | 22 | |
| 23 | // The base ("scalar") case d_square3, without batching. | |
| 24 | // CHECK: define internal fastcc float @fwddiffesquare(float %x.0.val, float %"x'.0.val") | |
| 25 | // CHECK: %0 = fadd fast float %"x'.0.val", %"x'.0.val" | |
| 26 | // CHECK-NEXT: %1 = fmul fast float %0, %x.0.val | |
| 27 | // CHECK-NEXT: ret float %1 | |
| 28 | // CHECK-NEXT: } | |
| 29 | ||
| 25 | 30 | // d_square2 |
| 26 | // CHECK: define internal [4 x float] @fwddiffe4square(ptr noalias noundef readonly align 4 captures(none) dereferenceable(4) %x, [4 x ptr] %"x'") | |
| 27 | // CHECK-NEXT: start: | |
| 28 | // CHECK-NEXT: %0 = extractvalue [4 x ptr] %"x'", 0 | |
| 29 | // CHECK-NEXT: %"_2'ipl" = load float, ptr %0, align 4 | |
| 30 | // CHECK-NEXT: %1 = extractvalue [4 x ptr] %"x'", 1 | |
| 31 | // CHECK-NEXT: %"_2'ipl1" = load float, ptr %1, align 4 | |
| 32 | // CHECK-NEXT: %2 = extractvalue [4 x ptr] %"x'", 2 | |
| 33 | // CHECK-NEXT: %"_2'ipl2" = load float, ptr %2, align 4 | |
| 34 | // CHECK-NEXT: %3 = extractvalue [4 x ptr] %"x'", 3 | |
| 35 | // CHECK-NEXT: %"_2'ipl3" = load float, ptr %3, align 4 | |
| 36 | // CHECK-NEXT: %_2 = load float, ptr %x, align 4 | |
| 37 | // CHECK-NEXT: %4 = fmul fast float %"_2'ipl", %_2 | |
| 38 | // CHECK-NEXT: %5 = fmul fast float %"_2'ipl1", %_2 | |
| 39 | // CHECK-NEXT: %6 = fmul fast float %"_2'ipl2", %_2 | |
| 40 | // CHECK-NEXT: %7 = fmul fast float %"_2'ipl3", %_2 | |
| 41 | // CHECK-NEXT: %8 = fmul fast float %"_2'ipl", %_2 | |
| 42 | // CHECK-NEXT: %9 = fmul fast float %"_2'ipl1", %_2 | |
| 43 | // CHECK-NEXT: %10 = fmul fast float %"_2'ipl2", %_2 | |
| 44 | // CHECK-NEXT: %11 = fmul fast float %"_2'ipl3", %_2 | |
| 45 | // CHECK-NEXT: %12 = fadd fast float %4, %8 | |
| 46 | // CHECK-NEXT: %13 = insertvalue [4 x float] undef, float %12, 0 | |
| 47 | // CHECK-NEXT: %14 = fadd fast float %5, %9 | |
| 48 | // CHECK-NEXT: %15 = insertvalue [4 x float] %13, float %14, 1 | |
| 49 | // CHECK-NEXT: %16 = fadd fast float %6, %10 | |
| 50 | // CHECK-NEXT: %17 = insertvalue [4 x float] %15, float %16, 2 | |
| 51 | // CHECK-NEXT: %18 = fadd fast float %7, %11 | |
| 52 | // CHECK-NEXT: %19 = insertvalue [4 x float] %17, float %18, 3 | |
| 53 | // CHECK-NEXT: ret [4 x float] %19 | |
| 31 | // CHECK: define internal fastcc [4 x float] @fwddiffe4square(float %x.0.val, [4 x ptr] %"x'") | |
| 32 | // CHECK: ret [4 x float] | |
| 54 | 33 | // CHECK-NEXT: } |
| 55 | 34 | |
| 56 | // d_square3, the extra float is the original return value (x * x) | |
| 57 | // CHECK: define internal { float, [4 x float] } @fwddiffe4square.1(ptr noalias noundef readonly align 4 captures(none) dereferenceable(4) %x, [4 x ptr] %"x'") | |
| 58 | // CHECK-NEXT: start: | |
| 59 | // CHECK-NEXT: %0 = extractvalue [4 x ptr] %"x'", 0 | |
| 60 | // CHECK-NEXT: %"_2'ipl" = load float, ptr %0, align 4 | |
| 61 | // CHECK-NEXT: %1 = extractvalue [4 x ptr] %"x'", 1 | |
| 62 | // CHECK-NEXT: %"_2'ipl1" = load float, ptr %1, align 4 | |
| 63 | // CHECK-NEXT: %2 = extractvalue [4 x ptr] %"x'", 2 | |
| 64 | // CHECK-NEXT: %"_2'ipl2" = load float, ptr %2, align 4 | |
| 65 | // CHECK-NEXT: %3 = extractvalue [4 x ptr] %"x'", 3 | |
| 66 | // CHECK-NEXT: %"_2'ipl3" = load float, ptr %3, align 4 | |
| 67 | // CHECK-NEXT: %_2 = load float, ptr %x, align 4 | |
| 68 | // CHECK-NEXT: %_0 = fmul float %_2, %_2 | |
| 69 | // CHECK-NEXT: %4 = fmul fast float %"_2'ipl", %_2 | |
| 70 | // CHECK-NEXT: %5 = fmul fast float %"_2'ipl1", %_2 | |
| 71 | // CHECK-NEXT: %6 = fmul fast float %"_2'ipl2", %_2 | |
| 72 | // CHECK-NEXT: %7 = fmul fast float %"_2'ipl3", %_2 | |
| 73 | // CHECK-NEXT: %8 = fmul fast float %"_2'ipl", %_2 | |
| 74 | // CHECK-NEXT: %9 = fmul fast float %"_2'ipl1", %_2 | |
| 75 | // CHECK-NEXT: %10 = fmul fast float %"_2'ipl2", %_2 | |
| 76 | // CHECK-NEXT: %11 = fmul fast float %"_2'ipl3", %_2 | |
| 77 | // CHECK-NEXT: %12 = fadd fast float %4, %8 | |
| 78 | // CHECK-NEXT: %13 = insertvalue [4 x float] undef, float %12, 0 | |
| 79 | // CHECK-NEXT: %14 = fadd fast float %5, %9 | |
| 80 | // CHECK-NEXT: %15 = insertvalue [4 x float] %13, float %14, 1 | |
| 81 | // CHECK-NEXT: %16 = fadd fast float %6, %10 | |
| 82 | // CHECK-NEXT: %17 = insertvalue [4 x float] %15, float %16, 2 | |
| 83 | // CHECK-NEXT: %18 = fadd fast float %7, %11 | |
| 84 | // CHECK-NEXT: %19 = insertvalue [4 x float] %17, float %18, 3 | |
| 85 | // CHECK-NEXT: %20 = insertvalue { float, [4 x float] } undef, float %_0, 0 | |
| 86 | // CHECK-NEXT: %21 = insertvalue { float, [4 x float] } %20, [4 x float] %19, 1 | |
| 87 | // CHECK-NEXT: ret { float, [4 x float] } %21 | |
| 35 | // CHECK: define internal fastcc { float, [4 x float] } @fwddiffe4square.{{.*}}(float %x.0.val, [4 x ptr] %"x'") | |
| 36 | // CHECK: ret { float, [4 x float] } | |
| 88 | 37 | // CHECK-NEXT: } |
| 89 | 38 | |
| 90 | 39 | fn main() { |
tests/codegen-llvm/autodiff/generic.rs+28-15| ... | ... | @@ -1,6 +1,14 @@ |
| 1 | 1 | //@ compile-flags: -Zautodiff=Enable -Zautodiff=NoPostopt -C opt-level=3 -Clto=fat |
| 2 | 2 | //@ no-prefer-dynamic |
| 3 | 3 | //@ needs-enzyme |
| 4 | //@ revisions: F32 F64 Main | |
| 5 | ||
| 6 | // Here we verify that the function `square` can be differentiated over f64. | |
| 7 | // This is interesting to test, since the user never calls `square` with f64, so on it's own rustc | |
| 8 | // would have no reason to monomorphize it that way. However, Enzyme needs the f64 version of | |
| 9 | // `square` in order to be able to differentiate it, so we have logic to enforce the | |
| 10 | // monomorphization. Here, we test this logic. | |
| 11 | ||
| 4 | 12 | #![feature(autodiff)] |
| 5 | 13 | |
| 6 | 14 | use std::autodiff::autodiff_reverse; |
| ... | ... | @@ -12,32 +20,37 @@ fn square<T: std::ops::Mul<Output = T> + Copy>(x: &T) -> T { |
| 12 | 20 | } |
| 13 | 21 | |
| 14 | 22 | // Ensure that `d_square::<f32>` code is generated |
| 15 | // | |
| 16 | // CHECK: ; generic::square | |
| 17 | // CHECK-NEXT: ; Function Attrs: {{.*}} | |
| 18 | // CHECK-NEXT: define internal {{.*}} float | |
| 19 | // CHECK-NEXT: start: | |
| 20 | // CHECK-NOT: ret | |
| 21 | // CHECK: fmul float | |
| 23 | ||
| 24 | // F32-LABEL: ; generic::square::<f32> | |
| 25 | // F32-NEXT: ; Function Attrs: {{.*}} | |
| 26 | // F32-NEXT: define internal {{.*}} float | |
| 27 | // F32-NEXT: start: | |
| 28 | // F32-NOT: ret | |
| 29 | // F32: fmul float | |
| 22 | 30 | |
| 23 | 31 | // Ensure that `d_square::<f64>` code is generated even if `square::<f64>` was never called |
| 24 | // | |
| 25 | // CHECK: ; generic::square | |
| 26 | // CHECK-NEXT: ; Function Attrs: | |
| 27 | // CHECK-NEXT: define internal {{.*}} double | |
| 28 | // CHECK-NEXT: start: | |
| 29 | // CHECK-NOT: ret | |
| 30 | // CHECK: fmul double | |
| 32 | ||
| 33 | // F64-LABEL: ; generic::d_square::<f64> | |
| 34 | // F64-NEXT: ; Function Attrs: {{.*}} | |
| 35 | // F64-NEXT: define internal {{.*}} void | |
| 36 | // F64-NEXT: start: | |
| 37 | // F64-NEXT: {{(tail )?}}call {{(fastcc )?}}void @diffe_{{.*}}(double {{.*}}, ptr {{.*}}) | |
| 38 | // F64-NEXT: ret void | |
| 39 | ||
| 40 | // Main-LABEL: ; generic::main | |
| 41 | // Main: ; call generic::square::<f32> | |
| 42 | // Main: ; call generic::d_square::<f64> | |
| 31 | 43 | |
| 32 | 44 | fn main() { |
| 33 | 45 | let xf32: f32 = std::hint::black_box(3.0); |
| 34 | 46 | let xf64: f64 = std::hint::black_box(3.0); |
| 47 | let seed: f64 = std::hint::black_box(1.0); | |
| 35 | 48 | |
| 36 | 49 | let outputf32 = square::<f32>(&xf32); |
| 37 | 50 | assert_eq!(9.0, outputf32); |
| 38 | 51 | |
| 39 | 52 | let mut df_dxf64: f64 = std::hint::black_box(0.0); |
| 40 | 53 | |
| 41 | let output_f64 = d_square::<f64>(&xf64, &mut df_dxf64, 1.0); | |
| 54 | let output_f64 = d_square::<f64>(&xf64, &mut df_dxf64, seed); | |
| 42 | 55 | assert_eq!(6.0, df_dxf64); |
| 43 | 56 | } |
tests/codegen-llvm/autodiff/identical_fnc.rs+4-4| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | // merged placeholder function anymore, and compilation would fail. We prevent this by disabling |
| 9 | 9 | // LLVM's merge_function pass before AD. Here we implicetely test that our solution keeps working. |
| 10 | 10 | // We also explicetly test that we keep running merge_function after AD, by checking for two |
| 11 | // identical function calls in the LLVM-IR, while having two different calls in the Rust code. | |
| 11 | // identical function calls in the LLVM-IR, despite having two different calls in the Rust code. | |
| 12 | 12 | #![feature(autodiff)] |
| 13 | 13 | |
| 14 | 14 | use std::autodiff::autodiff_reverse; |
| ... | ... | @@ -27,14 +27,14 @@ fn square2(x: &f64) -> f64 { |
| 27 | 27 | |
| 28 | 28 | // CHECK:; identical_fnc::main |
| 29 | 29 | // CHECK-NEXT:; Function Attrs: |
| 30 | // CHECK-NEXT:define internal void @_ZN13identical_fnc4main17h6009e4f751bf9407E() | |
| 30 | // CHECK-NEXT:define internal void | |
| 31 | 31 | // CHECK-NEXT:start: |
| 32 | 32 | // CHECK-NOT:br |
| 33 | 33 | // CHECK-NOT:ret |
| 34 | 34 | // CHECK:; call identical_fnc::d_square |
| 35 | // CHECK-NEXT:call fastcc void @_ZN13identical_fnc8d_square[[HASH:.+]](double %x.val, ptr noalias noundef align 8 dereferenceable(8) %dx1) | |
| 35 | // CHECK-NEXT:call fastcc void @[[HASH:.+]](double %x.val, ptr noalias noundef align 8 dereferenceable(8) %dx1) | |
| 36 | 36 | // CHECK:; call identical_fnc::d_square |
| 37 | // CHECK-NEXT:call fastcc void @_ZN13identical_fnc8d_square[[HASH]](double %x.val, ptr noalias noundef align 8 dereferenceable(8) %dx2) | |
| 37 | // CHECK-NEXT:call fastcc void @[[HASH]](double %x.val, ptr noalias noundef align 8 dereferenceable(8) %dx2) | |
| 38 | 38 | |
| 39 | 39 | fn main() { |
| 40 | 40 | let x = std::hint::black_box(3.0); |
tests/run-make/cdylib-export-c-library-symbols/foo.c created+1| ... | ... | @@ -0,0 +1 @@ |
| 1 | void my_function() {} |
tests/run-make/cdylib-export-c-library-symbols/foo.rs created+10| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | extern "C" { | |
| 2 | pub fn my_function(); | |
| 3 | } | |
| 4 | ||
| 5 | #[no_mangle] | |
| 6 | pub extern "C" fn rust_entry() { | |
| 7 | unsafe { | |
| 8 | my_function(); | |
| 9 | } | |
| 10 | } |
tests/run-make/cdylib-export-c-library-symbols/foo_export.rs created+10| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | extern "C" { | |
| 2 | fn my_function(); | |
| 3 | } | |
| 4 | ||
| 5 | #[no_mangle] | |
| 6 | pub extern "C" fn rust_entry() { | |
| 7 | unsafe { | |
| 8 | my_function(); | |
| 9 | } | |
| 10 | } |
tests/run-make/cdylib-export-c-library-symbols/rmake.rs created+36| ... | ... | @@ -0,0 +1,36 @@ |
| 1 | //@ ignore-nvptx64 | |
| 2 | //@ ignore-wasm | |
| 3 | //@ ignore-cross-compile | |
| 4 | // FIXME:The symbol mangle rules are slightly different in Windows(32-bit) and Apple. | |
| 5 | // Need to be resolved. | |
| 6 | //@ ignore-windows | |
| 7 | //@ ignore-apple | |
| 8 | // Reason: the compiled binary is executed | |
| 9 | ||
| 10 | use run_make_support::{build_native_static_lib, cc, dynamic_lib_name, is_darwin, llvm_nm, rustc}; | |
| 11 | ||
| 12 | fn main() { | |
| 13 | cc().input("foo.c").arg("-c").out_exe("foo.o").run(); | |
| 14 | build_native_static_lib("foo"); | |
| 15 | ||
| 16 | rustc().input("foo.rs").arg("-lstatic=foo").crate_type("cdylib").run(); | |
| 17 | ||
| 18 | let out = llvm_nm() | |
| 19 | .input(dynamic_lib_name("foo")) | |
| 20 | .run() | |
| 21 | .assert_stdout_not_contains_regex("T *my_function"); | |
| 22 | ||
| 23 | rustc().input("foo_export.rs").arg("-lstatic:+export-symbols=foo").crate_type("cdylib").run(); | |
| 24 | ||
| 25 | if is_darwin() { | |
| 26 | let out = llvm_nm() | |
| 27 | .input(dynamic_lib_name("foo_export")) | |
| 28 | .run() | |
| 29 | .assert_stdout_contains("T _my_function"); | |
| 30 | } else { | |
| 31 | let out = llvm_nm() | |
| 32 | .input(dynamic_lib_name("foo_export")) | |
| 33 | .run() | |
| 34 | .assert_stdout_contains("T my_function"); | |
| 35 | } | |
| 36 | } |
tests/run-make/rust-lld-custom-target/rmake.rs+5-1| ... | ... | @@ -15,7 +15,11 @@ fn main() { |
| 15 | 15 | // Compile to a custom target spec with rust-lld enabled by default. We'll check that by asking |
| 16 | 16 | // the linker to display its version number with a link-arg. |
| 17 | 17 | assert_rustc_uses_lld( |
| 18 | rustc().crate_type("cdylib").target("custom-target.json").input("lib.rs"), | |
| 18 | rustc() | |
| 19 | .crate_type("cdylib") | |
| 20 | .target("custom-target.json") | |
| 21 | .arg("-Zunstable-options") | |
| 22 | .input("lib.rs"), | |
| 19 | 23 | ); |
| 20 | 24 | |
| 21 | 25 | // But it can also be disabled via linker features. |
tests/run-make/rustdoc-target-spec-json-path/rmake.rs+7-1| ... | ... | @@ -5,8 +5,14 @@ use run_make_support::{cwd, rustc, rustdoc}; |
| 5 | 5 | |
| 6 | 6 | fn main() { |
| 7 | 7 | let out_dir = "rustdoc-target-spec-json-path"; |
| 8 | rustc().crate_type("lib").input("dummy_core.rs").target("target.json").run(); | |
| 8 | rustc() | |
| 9 | .arg("-Zunstable-options") | |
| 10 | .crate_type("lib") | |
| 11 | .input("dummy_core.rs") | |
| 12 | .target("target.json") | |
| 13 | .run(); | |
| 9 | 14 | rustdoc() |
| 15 | .arg("-Zunstable-options") | |
| 10 | 16 | .input("my_crate.rs") |
| 11 | 17 | .out_dir(out_dir) |
| 12 | 18 | .library_search_path(cwd()) |
tests/run-make/target-specs/rmake.rs+8-1| ... | ... | @@ -20,13 +20,20 @@ fn main() { |
| 20 | 20 | .target("my-incomplete-platform.json") |
| 21 | 21 | .run_fail() |
| 22 | 22 | .assert_stderr_contains("missing field `llvm-target`"); |
| 23 | let test_platform = rustc() | |
| 23 | let _ = rustc() | |
| 24 | 24 | .input("foo.rs") |
| 25 | 25 | .target("my-x86_64-unknown-linux-gnu-platform") |
| 26 | 26 | .crate_type("lib") |
| 27 | 27 | .emit("asm") |
| 28 | 28 | .run_fail() |
| 29 | 29 | .assert_stderr_contains("custom targets are unstable and require `-Zunstable-options`"); |
| 30 | let _ = rustc() | |
| 31 | .input("foo.rs") | |
| 32 | .target("my-awesome-platform.json") | |
| 33 | .crate_type("lib") | |
| 34 | .emit("asm") | |
| 35 | .run_fail() | |
| 36 | .assert_stderr_contains("custom targets are unstable and require `-Zunstable-options`"); | |
| 30 | 37 | rustc() |
| 31 | 38 | .arg("-Zunstable-options") |
| 32 | 39 | .env("RUST_TARGET_PATH", ".") |
tests/rustdoc-ui/bad-render-options.rs+19-18| ... | ... | @@ -1,29 +1,30 @@ |
| 1 | 1 | // regression test for https://github.com/rust-lang/rust/issues/149187 |
| 2 | #![deny(invalid_doc_attributes)] | |
| 2 | 3 | |
| 3 | 4 | #![doc(html_favicon_url)] |
| 4 | //~^ ERROR: malformed `doc` attribute | |
| 5 | //~| NOTE expected this to be of the form `html_favicon_url = "..."` | |
| 5 | //~^ ERROR | |
| 6 | //~| WARN | |
| 6 | 7 | #![doc(html_logo_url)] |
| 7 | //~^ ERROR: malformed `doc` attribute | |
| 8 | //~| NOTE expected this to be of the form `html_logo_url = "..."` | |
| 8 | //~^ ERROR | |
| 9 | //~| WARN | |
| 9 | 10 | #![doc(html_playground_url)] |
| 10 | //~^ ERROR: malformed `doc` attribute | |
| 11 | //~| NOTE expected this to be of the form `html_playground_url = "..."` | |
| 11 | //~^ ERROR | |
| 12 | //~| WARN | |
| 12 | 13 | #![doc(issue_tracker_base_url)] |
| 13 | //~^ ERROR: malformed `doc` attribute | |
| 14 | //~| NOTE expected this to be of the form `issue_tracker_base_url = "..."` | |
| 14 | //~^ ERROR | |
| 15 | //~| WARN | |
| 15 | 16 | #![doc(html_favicon_url = 1)] |
| 16 | //~^ ERROR malformed `doc` attribute | |
| 17 | //~| NOTE expected a string literal | |
| 17 | //~^ ERROR | |
| 18 | //~| WARN | |
| 18 | 19 | #![doc(html_logo_url = 2)] |
| 19 | //~^ ERROR malformed `doc` attribute | |
| 20 | //~| NOTE expected a string literal | |
| 20 | //~^ ERROR | |
| 21 | //~| WARN | |
| 21 | 22 | #![doc(html_playground_url = 3)] |
| 22 | //~^ ERROR malformed `doc` attribute | |
| 23 | //~| NOTE expected a string literal | |
| 23 | //~^ ERROR | |
| 24 | //~| WARN | |
| 24 | 25 | #![doc(issue_tracker_base_url = 4)] |
| 25 | //~^ ERROR malformed `doc` attribute | |
| 26 | //~| NOTE expected a string literal | |
| 26 | //~^ ERROR | |
| 27 | //~| WARN | |
| 27 | 28 | #![doc(html_no_source = "asdf")] |
| 28 | //~^ ERROR malformed `doc` attribute | |
| 29 | //~| NOTE didn't expect any arguments here | |
| 29 | //~^ ERROR | |
| 30 | //~| WARN |
tests/rustdoc-ui/bad-render-options.stderr+50-47| ... | ... | @@ -1,76 +1,79 @@ |
| 1 | error[E0539]: malformed `doc` attribute input | |
| 2 | --> $DIR/bad-render-options.rs:3:1 | |
| 1 | error: expected this to be of the form `... = "..."` | |
| 2 | --> $DIR/bad-render-options.rs:4:8 | |
| 3 | 3 | | |
| 4 | 4 | LL | #![doc(html_favicon_url)] |
| 5 | | ^^^^^^^----------------^^ | |
| 6 | | | | |
| 7 | | expected this to be of the form `html_favicon_url = "..."` | |
| 5 | | ^^^^^^^^^^^^^^^^ | |
| 6 | | | |
| 7 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 8 | note: the lint level is defined here | |
| 9 | --> $DIR/bad-render-options.rs:2:9 | |
| 10 | | | |
| 11 | LL | #![deny(invalid_doc_attributes)] | |
| 12 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 8 | 13 | |
| 9 | error[E0539]: malformed `doc` attribute input | |
| 10 | --> $DIR/bad-render-options.rs:6:1 | |
| 14 | error: expected this to be of the form `... = "..."` | |
| 15 | --> $DIR/bad-render-options.rs:7:8 | |
| 11 | 16 | | |
| 12 | 17 | LL | #![doc(html_logo_url)] |
| 13 | | ^^^^^^^-------------^^ | |
| 14 | | | | |
| 15 | | expected this to be of the form `html_logo_url = "..."` | |
| 18 | | ^^^^^^^^^^^^^ | |
| 19 | | | |
| 20 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 16 | 21 | |
| 17 | error[E0539]: malformed `doc` attribute input | |
| 18 | --> $DIR/bad-render-options.rs:9:1 | |
| 22 | error: expected this to be of the form `... = "..."` | |
| 23 | --> $DIR/bad-render-options.rs:10:8 | |
| 19 | 24 | | |
| 20 | 25 | LL | #![doc(html_playground_url)] |
| 21 | | ^^^^^^^-------------------^^ | |
| 22 | | | | |
| 23 | | expected this to be of the form `html_playground_url = "..."` | |
| 26 | | ^^^^^^^^^^^^^^^^^^^ | |
| 27 | | | |
| 28 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 24 | 29 | |
| 25 | error[E0539]: malformed `doc` attribute input | |
| 26 | --> $DIR/bad-render-options.rs:12:1 | |
| 30 | error: expected this to be of the form `... = "..."` | |
| 31 | --> $DIR/bad-render-options.rs:13:8 | |
| 27 | 32 | | |
| 28 | 33 | LL | #![doc(issue_tracker_base_url)] |
| 29 | | ^^^^^^^----------------------^^ | |
| 30 | | | | |
| 31 | | expected this to be of the form `issue_tracker_base_url = "..."` | |
| 34 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 35 | | | |
| 36 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 32 | 37 | |
| 33 | error[E0539]: malformed `doc` attribute input | |
| 34 | --> $DIR/bad-render-options.rs:15:1 | |
| 38 | error: malformed `doc` attribute input | |
| 39 | --> $DIR/bad-render-options.rs:16:27 | |
| 35 | 40 | | |
| 36 | 41 | LL | #![doc(html_favicon_url = 1)] |
| 37 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^-^^ | |
| 38 | | | | |
| 39 | | expected a string literal here | |
| 42 | | ^ | |
| 43 | | | |
| 44 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 40 | 45 | |
| 41 | error[E0539]: malformed `doc` attribute input | |
| 42 | --> $DIR/bad-render-options.rs:18:1 | |
| 46 | error: malformed `doc` attribute input | |
| 47 | --> $DIR/bad-render-options.rs:19:24 | |
| 43 | 48 | | |
| 44 | 49 | LL | #![doc(html_logo_url = 2)] |
| 45 | | ^^^^^^^^^^^^^^^^^^^^^^^-^^ | |
| 46 | | | | |
| 47 | | expected a string literal here | |
| 50 | | ^ | |
| 51 | | | |
| 52 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 48 | 53 | |
| 49 | error[E0539]: malformed `doc` attribute input | |
| 50 | --> $DIR/bad-render-options.rs:21:1 | |
| 54 | error: malformed `doc` attribute input | |
| 55 | --> $DIR/bad-render-options.rs:22:30 | |
| 51 | 56 | | |
| 52 | 57 | LL | #![doc(html_playground_url = 3)] |
| 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^ | |
| 54 | | | | |
| 55 | | expected a string literal here | |
| 58 | | ^ | |
| 59 | | | |
| 60 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 56 | 61 | |
| 57 | error[E0539]: malformed `doc` attribute input | |
| 58 | --> $DIR/bad-render-options.rs:24:1 | |
| 62 | error: malformed `doc` attribute input | |
| 63 | --> $DIR/bad-render-options.rs:25:33 | |
| 59 | 64 | | |
| 60 | 65 | LL | #![doc(issue_tracker_base_url = 4)] |
| 61 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^ | |
| 62 | | | | |
| 63 | | expected a string literal here | |
| 66 | | ^ | |
| 67 | | | |
| 68 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 64 | 69 | |
| 65 | error[E0565]: malformed `doc` attribute input | |
| 66 | --> $DIR/bad-render-options.rs:27:1 | |
| 70 | error: didn't expect any arguments here | |
| 71 | --> $DIR/bad-render-options.rs:28:23 | |
| 67 | 72 | | |
| 68 | 73 | LL | #![doc(html_no_source = "asdf")] |
| 69 | | ^^^^^^^^^^^^^^^^^^^^^^--------^^ | |
| 70 | | | | |
| 71 | | didn't expect any arguments here | |
| 74 | | ^^^^^^^^ | |
| 75 | | | |
| 76 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 72 | 77 | |
| 73 | 78 | error: aborting due to 9 previous errors |
| 74 | 79 | |
| 75 | Some errors have detailed explanations: E0539, E0565. | |
| 76 | For more information about an error, try `rustc --explain E0539`. |
tests/rustdoc-ui/deprecated-attrs.rs+3-1| ... | ... | @@ -1,11 +1,13 @@ |
| 1 | 1 | //@ compile-flags: --passes unknown-pass |
| 2 | 2 | |
| 3 | #![deny(invalid_doc_attributes)] | |
| 4 | //~^ NOTE | |
| 5 | ||
| 3 | 6 | #![doc(no_default_passes)] |
| 4 | 7 | //~^ ERROR unknown `doc` attribute `no_default_passes` |
| 5 | 8 | //~| NOTE no longer functions |
| 6 | 9 | //~| NOTE see issue #44136 |
| 7 | 10 | //~| NOTE `doc(no_default_passes)` is now a no-op |
| 8 | //~| NOTE `#[deny(invalid_doc_attributes)]` on by default | |
| 9 | 11 | #![doc(passes = "collapse-docs unindent-comments")] |
| 10 | 12 | //~^ ERROR unknown `doc` attribute `passes` |
| 11 | 13 | //~| NOTE no longer functions |
tests/rustdoc-ui/deprecated-attrs.stderr+8-4| ... | ... | @@ -4,17 +4,21 @@ warning: the `passes` flag no longer functions |
| 4 | 4 | = help: you may want to use --document-private-items |
| 5 | 5 | |
| 6 | 6 | error: unknown `doc` attribute `no_default_passes` |
| 7 | --> $DIR/deprecated-attrs.rs:3:8 | |
| 7 | --> $DIR/deprecated-attrs.rs:6:8 | |
| 8 | 8 | | |
| 9 | 9 | LL | #![doc(no_default_passes)] |
| 10 | 10 | | ^^^^^^^^^^^^^^^^^ no longer functions |
| 11 | 11 | | |
| 12 | 12 | = note: `doc` attribute `no_default_passes` no longer functions; see issue #44136 <https://github.com/rust-lang/rust/issues/44136> |
| 13 | 13 | = note: `doc(no_default_passes)` is now a no-op |
| 14 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 14 | note: the lint level is defined here | |
| 15 | --> $DIR/deprecated-attrs.rs:3:9 | |
| 16 | | | |
| 17 | LL | #![deny(invalid_doc_attributes)] | |
| 18 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 15 | 19 | |
| 16 | 20 | error: unknown `doc` attribute `passes` |
| 17 | --> $DIR/deprecated-attrs.rs:9:8 | |
| 21 | --> $DIR/deprecated-attrs.rs:11:8 | |
| 18 | 22 | | |
| 19 | 23 | LL | #![doc(passes = "collapse-docs unindent-comments")] |
| 20 | 24 | | ^^^^^^ no longer functions |
| ... | ... | @@ -23,7 +27,7 @@ LL | #![doc(passes = "collapse-docs unindent-comments")] |
| 23 | 27 | = note: `doc(passes)` is now a no-op |
| 24 | 28 | |
| 25 | 29 | error: unknown `doc` attribute `plugins` |
| 26 | --> $DIR/deprecated-attrs.rs:14:8 | |
| 30 | --> $DIR/deprecated-attrs.rs:16:8 | |
| 27 | 31 | | |
| 28 | 32 | LL | #![doc(plugins = "xxx")] |
| 29 | 33 | | ^^^^^^^ no longer functions |
tests/rustdoc-ui/doc-cfg-2.rs+1| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![feature(doc_cfg)] |
| 2 | 3 | |
| 3 | 4 | #[doc(cfg(foo), cfg(bar))] |
tests/rustdoc-ui/doc-cfg-2.stderr+15-11| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | warning: unexpected `cfg` condition name: `foo` |
| 2 | --> $DIR/doc-cfg-2.rs:3:11 | |
| 2 | --> $DIR/doc-cfg-2.rs:4:11 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[doc(cfg(foo), cfg(bar))] |
| 5 | 5 | | ^^^ |
| ... | ... | @@ -10,7 +10,7 @@ LL | #[doc(cfg(foo), cfg(bar))] |
| 10 | 10 | = note: `#[warn(unexpected_cfgs)]` on by default |
| 11 | 11 | |
| 12 | 12 | warning: unexpected `cfg` condition name: `bar` |
| 13 | --> $DIR/doc-cfg-2.rs:3:21 | |
| 13 | --> $DIR/doc-cfg-2.rs:4:21 | |
| 14 | 14 | | |
| 15 | 15 | LL | #[doc(cfg(foo), cfg(bar))] |
| 16 | 16 | | ^^^ |
| ... | ... | @@ -19,45 +19,49 @@ LL | #[doc(cfg(foo), cfg(bar))] |
| 19 | 19 | = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration |
| 20 | 20 | |
| 21 | 21 | error: only `hide` or `show` are allowed in `#[doc(auto_cfg(...))]` |
| 22 | --> $DIR/doc-cfg-2.rs:6:16 | |
| 22 | --> $DIR/doc-cfg-2.rs:7:16 | |
| 23 | 23 | | |
| 24 | 24 | LL | #[doc(auto_cfg(42))] |
| 25 | 25 | | ^^ |
| 26 | 26 | | |
| 27 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 27 | note: the lint level is defined here | |
| 28 | --> $DIR/doc-cfg-2.rs:1:9 | |
| 29 | | | |
| 30 | LL | #![deny(invalid_doc_attributes)] | |
| 31 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 28 | 32 | |
| 29 | 33 | error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value items |
| 30 | --> $DIR/doc-cfg-2.rs:7:21 | |
| 34 | --> $DIR/doc-cfg-2.rs:8:21 | |
| 31 | 35 | | |
| 32 | 36 | LL | #[doc(auto_cfg(hide(true)))] |
| 33 | 37 | | ^^^^ |
| 34 | 38 | |
| 35 | 39 | error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value items |
| 36 | --> $DIR/doc-cfg-2.rs:8:21 | |
| 40 | --> $DIR/doc-cfg-2.rs:9:21 | |
| 37 | 41 | | |
| 38 | 42 | LL | #[doc(auto_cfg(hide(42)))] |
| 39 | 43 | | ^^ |
| 40 | 44 | |
| 41 | 45 | error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value items |
| 42 | --> $DIR/doc-cfg-2.rs:9:21 | |
| 46 | --> $DIR/doc-cfg-2.rs:10:21 | |
| 43 | 47 | | |
| 44 | 48 | LL | #[doc(auto_cfg(hide("a")))] |
| 45 | 49 | | ^^^ |
| 46 | 50 | |
| 47 | 51 | error: expected boolean for `#[doc(auto_cfg = ...)]` |
| 48 | --> $DIR/doc-cfg-2.rs:10:18 | |
| 52 | --> $DIR/doc-cfg-2.rs:11:18 | |
| 49 | 53 | | |
| 50 | 54 | LL | #[doc(auto_cfg = 42)] |
| 51 | 55 | | ^^ |
| 52 | 56 | |
| 53 | 57 | error: expected boolean for `#[doc(auto_cfg = ...)]` |
| 54 | --> $DIR/doc-cfg-2.rs:11:18 | |
| 58 | --> $DIR/doc-cfg-2.rs:12:18 | |
| 55 | 59 | | |
| 56 | 60 | LL | #[doc(auto_cfg = "a")] |
| 57 | 61 | | ^^^ |
| 58 | 62 | |
| 59 | 63 | warning: unexpected `cfg` condition name: `feature` |
| 60 | --> $DIR/doc-cfg-2.rs:14:21 | |
| 64 | --> $DIR/doc-cfg-2.rs:15:21 | |
| 61 | 65 | | |
| 62 | 66 | LL | #[doc(auto_cfg(hide(feature = "windows")))] |
| 63 | 67 | | ^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -66,7 +70,7 @@ LL | #[doc(auto_cfg(hide(feature = "windows")))] |
| 66 | 70 | = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration |
| 67 | 71 | |
| 68 | 72 | warning: unexpected `cfg` condition name: `foo` |
| 69 | --> $DIR/doc-cfg-2.rs:16:21 | |
| 73 | --> $DIR/doc-cfg-2.rs:17:21 | |
| 70 | 74 | | |
| 71 | 75 | LL | #[doc(auto_cfg(hide(foo)))] |
| 72 | 76 | | ^^^ |
tests/rustdoc-ui/doc-cfg.rs+4-3| ... | ... | @@ -1,9 +1,10 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![feature(doc_cfg)] |
| 2 | 3 | |
| 3 | 4 | #[doc(cfg(), cfg(foo, bar))] |
| 4 | //~^ ERROR malformed `doc` attribute input | |
| 5 | //~| ERROR malformed `doc` attribute input | |
| 5 | //~^ ERROR | |
| 6 | //~| ERROR | |
| 6 | 7 | #[doc(cfg())] //~ ERROR |
| 7 | 8 | #[doc(cfg(foo, bar))] //~ ERROR |
| 8 | #[doc(auto_cfg(hide(foo::bar)))] //~ ERROR | |
| 9 | #[doc(auto_cfg(hide(foo::bar)))] | |
| 9 | 10 | pub fn foo() {} |
tests/rustdoc-ui/doc-cfg.stderr+6-15| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error[E0805]: malformed `doc` attribute input |
| 2 | --> $DIR/doc-cfg.rs:3:1 | |
| 2 | --> $DIR/doc-cfg.rs:4:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[doc(cfg(), cfg(foo, bar))] |
| 5 | 5 | | ^^^^^^^^^--^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -7,7 +7,7 @@ LL | #[doc(cfg(), cfg(foo, bar))] |
| 7 | 7 | | expected a single argument here |
| 8 | 8 | |
| 9 | 9 | error[E0805]: malformed `doc` attribute input |
| 10 | --> $DIR/doc-cfg.rs:3:1 | |
| 10 | --> $DIR/doc-cfg.rs:4:1 | |
| 11 | 11 | | |
| 12 | 12 | LL | #[doc(cfg(), cfg(foo, bar))] |
| 13 | 13 | | ^^^^^^^^^^^^^^^^----------^^ |
| ... | ... | @@ -15,7 +15,7 @@ LL | #[doc(cfg(), cfg(foo, bar))] |
| 15 | 15 | | expected a single argument here |
| 16 | 16 | |
| 17 | 17 | error[E0805]: malformed `doc` attribute input |
| 18 | --> $DIR/doc-cfg.rs:6:1 | |
| 18 | --> $DIR/doc-cfg.rs:7:1 | |
| 19 | 19 | | |
| 20 | 20 | LL | #[doc(cfg())] |
| 21 | 21 | | ^^^^^^^^^--^^ |
| ... | ... | @@ -23,22 +23,13 @@ LL | #[doc(cfg())] |
| 23 | 23 | | expected a single argument here |
| 24 | 24 | |
| 25 | 25 | error[E0805]: malformed `doc` attribute input |
| 26 | --> $DIR/doc-cfg.rs:7:1 | |
| 26 | --> $DIR/doc-cfg.rs:8:1 | |
| 27 | 27 | | |
| 28 | 28 | LL | #[doc(cfg(foo, bar))] |
| 29 | 29 | | ^^^^^^^^^----------^^ |
| 30 | 30 | | | |
| 31 | 31 | | expected a single argument here |
| 32 | 32 | |
| 33 | error[E0539]: malformed `doc` attribute input | |
| 34 | --> $DIR/doc-cfg.rs:8:1 | |
| 35 | | | |
| 36 | LL | #[doc(auto_cfg(hide(foo::bar)))] | |
| 37 | | ^^^^^^^^^^^^^^^^^^^^--------^^^^ | |
| 38 | | | | |
| 39 | | expected a valid identifier here | |
| 40 | ||
| 41 | error: aborting due to 5 previous errors | |
| 33 | error: aborting due to 4 previous errors | |
| 42 | 34 | |
| 43 | Some errors have detailed explanations: E0539, E0805. | |
| 44 | For more information about an error, try `rustc --explain E0539`. | |
| 35 | For more information about this error, try `rustc --explain E0805`. |
tests/rustdoc-ui/doc-include-suggestion.rs+3-1| ... | ... | @@ -1,6 +1,8 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 2 | //~^ NOTE | |
| 3 | ||
| 1 | 4 | #[doc(include = "external-cross-doc.md")] |
| 2 | 5 | //~^ ERROR unknown `doc` attribute `include` |
| 3 | 6 | //~| HELP use `doc = include_str!` instead |
| 4 | 7 | // FIXME(#85497): make this a deny instead so it's more clear what's happening |
| 5 | //~| NOTE on by default | |
| 6 | 8 | pub struct NeedMoreDocs; |
tests/rustdoc-ui/doc-include-suggestion.stderr+6-2| ... | ... | @@ -1,10 +1,14 @@ |
| 1 | 1 | error: unknown `doc` attribute `include` |
| 2 | --> $DIR/doc-include-suggestion.rs:1:7 | |
| 2 | --> $DIR/doc-include-suggestion.rs:4:7 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[doc(include = "external-cross-doc.md")] |
| 5 | 5 | | ^^^^^^^ help: use `doc = include_str!` instead: `#[doc = include_str!("external-cross-doc.md")]` |
| 6 | 6 | | |
| 7 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/doc-include-suggestion.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(invalid_doc_attributes)] | |
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 8 | 12 | |
| 9 | 13 | error: aborting due to 1 previous error |
| 10 | 14 |
tests/rustdoc-ui/doctest/doc-test-attr.rs+1| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![crate_type = "lib"] |
| 2 | 3 | |
| 3 | 4 | #![doc(test)] |
tests/rustdoc-ui/doctest/doc-test-attr.stderr+8-4| ... | ... | @@ -1,19 +1,23 @@ |
| 1 | 1 | error: `#[doc(test(...)]` takes a list of attributes |
| 2 | --> $DIR/doc-test-attr.rs:3:8 | |
| 2 | --> $DIR/doc-test-attr.rs:4:8 | |
| 3 | 3 | | |
| 4 | 4 | LL | #![doc(test)] |
| 5 | 5 | | ^^^^ |
| 6 | 6 | | |
| 7 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/doc-test-attr.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(invalid_doc_attributes)] | |
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 8 | 12 | |
| 9 | 13 | error: `#[doc(test(...)]` takes a list of attributes |
| 10 | --> $DIR/doc-test-attr.rs:5:13 | |
| 14 | --> $DIR/doc-test-attr.rs:6:13 | |
| 11 | 15 | | |
| 12 | 16 | LL | #![doc(test = "hello")] |
| 13 | 17 | | ^^^^^^^^^ |
| 14 | 18 | |
| 15 | 19 | error: unknown `doc(test)` attribute `a` |
| 16 | --> $DIR/doc-test-attr.rs:7:13 | |
| 20 | --> $DIR/doc-test-attr.rs:8:13 | |
| 17 | 21 | | |
| 18 | 22 | LL | #![doc(test(a))] |
| 19 | 23 | | ^ |
tests/rustdoc-ui/lints/doc-attr-2.rs+1| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![doc(as_ptr)] |
| 2 | 3 | //~^ ERROR unknown `doc` attribute `as_ptr` |
| 3 | 4 |
tests/rustdoc-ui/lints/doc-attr-2.stderr+9-5| ... | ... | @@ -1,25 +1,29 @@ |
| 1 | 1 | error: unknown `doc` attribute `as_ptr` |
| 2 | --> $DIR/doc-attr-2.rs:4:7 | |
| 2 | --> $DIR/doc-attr-2.rs:5:7 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[doc(as_ptr)] |
| 5 | 5 | | ^^^^^^ |
| 6 | 6 | | |
| 7 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/doc-attr-2.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(invalid_doc_attributes)] | |
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 8 | 12 | |
| 9 | 13 | error: unknown `doc` attribute `foo::bar` |
| 10 | --> $DIR/doc-attr-2.rs:8:7 | |
| 14 | --> $DIR/doc-attr-2.rs:9:7 | |
| 11 | 15 | | |
| 12 | 16 | LL | #[doc(foo::bar, crate::bar::baz = "bye")] |
| 13 | 17 | | ^^^^^^^^ |
| 14 | 18 | |
| 15 | 19 | error: unknown `doc` attribute `crate::bar::baz` |
| 16 | --> $DIR/doc-attr-2.rs:8:17 | |
| 20 | --> $DIR/doc-attr-2.rs:9:17 | |
| 17 | 21 | | |
| 18 | 22 | LL | #[doc(foo::bar, crate::bar::baz = "bye")] |
| 19 | 23 | | ^^^^^^^^^^^^^^^ |
| 20 | 24 | |
| 21 | 25 | error: unknown `doc` attribute `as_ptr` |
| 22 | --> $DIR/doc-attr-2.rs:1:8 | |
| 26 | --> $DIR/doc-attr-2.rs:2:8 | |
| 23 | 27 | | |
| 24 | 28 | LL | #![doc(as_ptr)] |
| 25 | 29 | | ^^^^^^ |
tests/rustdoc-ui/lints/doc-attr.rs+7-3| ... | ... | @@ -1,8 +1,12 @@ |
| 1 | 1 | #![crate_type = "lib"] |
| 2 | #![deny(invalid_doc_attributes)] | |
| 2 | 3 | |
| 3 | 4 | #[doc(123)] |
| 4 | //~^ ERROR malformed `doc` attribute | |
| 5 | //~^ ERROR | |
| 6 | //~| WARN | |
| 5 | 7 | #[doc("hello", "bar")] |
| 6 | //~^ ERROR malformed `doc` attribute | |
| 7 | //~| ERROR malformed `doc` attribute | |
| 8 | //~^ ERROR | |
| 9 | //~| ERROR | |
| 10 | //~| WARN | |
| 11 | //~| WARN | |
| 8 | 12 | fn bar() {} |
tests/rustdoc-ui/lints/doc-attr.stderr+20-16| ... | ... | @@ -1,27 +1,31 @@ |
| 1 | error[E0539]: malformed `doc` attribute input | |
| 2 | --> $DIR/doc-attr.rs:3:1 | |
| 1 | error: expected this to be of the form `... = "..."` | |
| 2 | --> $DIR/doc-attr.rs:4:7 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[doc(123)] |
| 5 | | ^^^^^^---^^ | |
| 6 | | | | |
| 7 | | expected this to be of the form `... = "..."` | |
| 5 | | ^^^ | |
| 6 | | | |
| 7 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 8 | note: the lint level is defined here | |
| 9 | --> $DIR/doc-attr.rs:2:9 | |
| 10 | | | |
| 11 | LL | #![deny(invalid_doc_attributes)] | |
| 12 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 8 | 13 | |
| 9 | error[E0539]: malformed `doc` attribute input | |
| 10 | --> $DIR/doc-attr.rs:5:1 | |
| 14 | error: expected this to be of the form `... = "..."` | |
| 15 | --> $DIR/doc-attr.rs:7:7 | |
| 11 | 16 | | |
| 12 | 17 | LL | #[doc("hello", "bar")] |
| 13 | | ^^^^^^-------^^^^^^^^^ | |
| 14 | | | | |
| 15 | | expected this to be of the form `... = "..."` | |
| 18 | | ^^^^^^^ | |
| 19 | | | |
| 20 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 16 | 21 | |
| 17 | error[E0539]: malformed `doc` attribute input | |
| 18 | --> $DIR/doc-attr.rs:5:1 | |
| 22 | error: expected this to be of the form `... = "..."` | |
| 23 | --> $DIR/doc-attr.rs:7:16 | |
| 19 | 24 | | |
| 20 | 25 | LL | #[doc("hello", "bar")] |
| 21 | | ^^^^^^^^^^^^^^^-----^^ | |
| 22 | | | | |
| 23 | | expected this to be of the form `... = "..."` | |
| 26 | | ^^^^^ | |
| 27 | | | |
| 28 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 24 | 29 | |
| 25 | 30 | error: aborting due to 3 previous errors |
| 26 | 31 | |
| 27 | For more information about this error, try `rustc --explain E0539`. |
tests/rustdoc-ui/lints/doc-spotlight.fixed+1| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | //@ run-rustfix |
| 2 | 2 | #![feature(doc_notable_trait)] |
| 3 | #![deny(invalid_doc_attributes)] | |
| 3 | 4 | |
| 4 | 5 | #[doc(notable_trait)] |
| 5 | 6 | //~^ ERROR unknown `doc` attribute `spotlight` |
tests/rustdoc-ui/lints/doc-spotlight.rs+1| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | //@ run-rustfix |
| 2 | 2 | #![feature(doc_notable_trait)] |
| 3 | #![deny(invalid_doc_attributes)] | |
| 3 | 4 | |
| 4 | 5 | #[doc(spotlight)] |
| 5 | 6 | //~^ ERROR unknown `doc` attribute `spotlight` |
tests/rustdoc-ui/lints/doc-spotlight.stderr+6-2| ... | ... | @@ -1,12 +1,16 @@ |
| 1 | 1 | error: unknown `doc` attribute `spotlight` |
| 2 | --> $DIR/doc-spotlight.rs:4:7 | |
| 2 | --> $DIR/doc-spotlight.rs:5:7 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[doc(spotlight)] |
| 5 | 5 | | ^^^^^^^^^ help: use `notable_trait` instead |
| 6 | 6 | | |
| 7 | 7 | = note: `doc(spotlight)` was renamed to `doc(notable_trait)` |
| 8 | 8 | = note: `doc(spotlight)` is now a no-op |
| 9 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 9 | note: the lint level is defined here | |
| 10 | --> $DIR/doc-spotlight.rs:3:9 | |
| 11 | | | |
| 12 | LL | #![deny(invalid_doc_attributes)] | |
| 13 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 10 | 14 | |
| 11 | 15 | error: aborting due to 1 previous error |
| 12 | 16 |
tests/rustdoc-ui/lints/doc_cfg_hide.rs+1| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![feature(doc_cfg)] |
| 2 | 3 | #![doc(auto_cfg(hide = "test"))] //~ ERROR |
| 3 | 4 | #![doc(auto_cfg(hide))] //~ ERROR |
tests/rustdoc-ui/lints/doc_cfg_hide.stderr+8-4| ... | ... | @@ -1,19 +1,23 @@ |
| 1 | 1 | error: `#![doc(auto_cfg(hide(...)))]` expects a list of items |
| 2 | --> $DIR/doc_cfg_hide.rs:2:17 | |
| 2 | --> $DIR/doc_cfg_hide.rs:3:17 | |
| 3 | 3 | | |
| 4 | 4 | LL | #![doc(auto_cfg(hide = "test"))] |
| 5 | 5 | | ^^^^^^^^^^^^^ |
| 6 | 6 | | |
| 7 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/doc_cfg_hide.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(invalid_doc_attributes)] | |
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 8 | 12 | |
| 9 | 13 | error: `#![doc(auto_cfg(hide(...)))]` expects a list of items |
| 10 | --> $DIR/doc_cfg_hide.rs:3:17 | |
| 14 | --> $DIR/doc_cfg_hide.rs:4:17 | |
| 11 | 15 | | |
| 12 | 16 | LL | #![doc(auto_cfg(hide))] |
| 13 | 17 | | ^^^^ |
| 14 | 18 | |
| 15 | 19 | error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value items |
| 16 | --> $DIR/doc_cfg_hide.rs:4:22 | |
| 20 | --> $DIR/doc_cfg_hide.rs:5:22 | |
| 17 | 21 | | |
| 18 | 22 | LL | #![doc(auto_cfg(hide(not(windows))))] |
| 19 | 23 | | ^^^^^^^^^^^^ |
tests/rustdoc-ui/lints/duplicated-attr.rs created+6| ... | ... | @@ -0,0 +1,6 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 2 | #![expect(unused_attributes)] | |
| 3 | #![doc(test(no_crate_inject))] | |
| 4 | #![doc(test(no_crate_inject))] | |
| 5 | //~^ ERROR | |
| 6 | //~| WARN |
tests/rustdoc-ui/lints/duplicated-attr.stderr created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | error: unused attribute | |
| 2 | --> $DIR/duplicated-attr.rs:4:13 | |
| 3 | | | |
| 4 | LL | #![doc(test(no_crate_inject))] | |
| 5 | | ^^^^^^^^^^^^^^^ help: remove this attribute | |
| 6 | | | |
| 7 | note: attribute also specified here | |
| 8 | --> $DIR/duplicated-attr.rs:3:13 | |
| 9 | | | |
| 10 | LL | #![doc(test(no_crate_inject))] | |
| 11 | | ^^^^^^^^^^^^^^^ | |
| 12 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 13 | note: the lint level is defined here | |
| 14 | --> $DIR/duplicated-attr.rs:1:9 | |
| 15 | | | |
| 16 | LL | #![deny(invalid_doc_attributes)] | |
| 17 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 18 | ||
| 19 | error: aborting due to 1 previous error | |
| 20 |
tests/rustdoc-ui/lints/invalid-crate-level-lint.rs+1| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![crate_type = "lib"] |
| 2 | 3 | |
| 3 | 4 | #[doc(test(no_crate_inject))] |
tests/rustdoc-ui/lints/invalid-crate-level-lint.stderr+8-4| ... | ... | @@ -1,14 +1,18 @@ |
| 1 | 1 | error: this attribute can only be applied at the crate level |
| 2 | --> $DIR/invalid-crate-level-lint.rs:3:12 | |
| 2 | --> $DIR/invalid-crate-level-lint.rs:4:12 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[doc(test(no_crate_inject))] |
| 5 | 5 | | ^^^^^^^^^^^^^^^ |
| 6 | 6 | | |
| 7 | 7 | = note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information |
| 8 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 8 | note: the lint level is defined here | |
| 9 | --> $DIR/invalid-crate-level-lint.rs:1:9 | |
| 10 | | | |
| 11 | LL | #![deny(invalid_doc_attributes)] | |
| 12 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 9 | 13 | |
| 10 | 14 | error: this attribute can only be applied at the crate level |
| 11 | --> $DIR/invalid-crate-level-lint.rs:7:17 | |
| 15 | --> $DIR/invalid-crate-level-lint.rs:8:17 | |
| 12 | 16 | | |
| 13 | 17 | LL | #![doc(test(no_crate_inject))] |
| 14 | 18 | | ^^^^^^^^^^^^^^^ |
| ... | ... | @@ -16,7 +20,7 @@ LL | #![doc(test(no_crate_inject))] |
| 16 | 20 | = note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information |
| 17 | 21 | |
| 18 | 22 | error: this attribute can only be applied at the crate level |
| 19 | --> $DIR/invalid-crate-level-lint.rs:10:16 | |
| 23 | --> $DIR/invalid-crate-level-lint.rs:11:16 | |
| 20 | 24 | | |
| 21 | 25 | LL | #[doc(test(no_crate_inject))] |
| 22 | 26 | | ^^^^^^^^^^^^^^^ |
tests/rustdoc-ui/lints/invalid-doc-attr-2.rs created+7| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 2 | ||
| 3 | #![doc("other attribute")] | |
| 4 | //~^ ERROR | |
| 5 | //~| WARN | |
| 6 | #![doc] | |
| 7 | //~^ ERROR |
tests/rustdoc-ui/lints/invalid-doc-attr-2.stderr created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | error: expected this to be of the form `... = "..."` | |
| 2 | --> $DIR/invalid-doc-attr-2.rs:3:8 | |
| 3 | | | |
| 4 | LL | #![doc("other attribute")] | |
| 5 | | ^^^^^^^^^^^^^^^^^ | |
| 6 | | | |
| 7 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 8 | note: the lint level is defined here | |
| 9 | --> $DIR/invalid-doc-attr-2.rs:1:9 | |
| 10 | | | |
| 11 | LL | #![deny(invalid_doc_attributes)] | |
| 12 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 13 | ||
| 14 | error: valid forms for the attribute are `#![doc = "string"]`, `#![doc(alias)]`, `#![doc(attribute)]`, `#![doc(auto_cfg)]`, `#![doc(cfg)]`, `#![doc(fake_variadic)]`, `#![doc(hidden)]`, `#![doc(html_favicon_url)]`, `#![doc(html_logo_url)]`, `#![doc(html_no_source)]`, `#![doc(html_playground_url)]`, `#![doc(html_root_url)]`, `#![doc(include)]`, `#![doc(inline)]`, `#![doc(issue_tracker_base_url)]`, `#![doc(keyword)]`, `#![doc(masked)]`, `#![doc(no_default_passes)]`, `#![doc(no_inline)]`, `#![doc(notable_trait)]`, `#![doc(passes)]`, `#![doc(plugins)]`, `#![doc(rust_logo)]`, `#![doc(search_unbox)]`, `#![doc(spotlight)]`, and `#![doc(test)]` | |
| 15 | --> $DIR/invalid-doc-attr-2.rs:6:1 | |
| 16 | | | |
| 17 | LL | #![doc] | |
| 18 | | ^^^^^^^ | |
| 19 | ||
| 20 | error: aborting due to 2 previous errors | |
| 21 |
tests/rustdoc-ui/lints/invalid-doc-attr-3.rs created+22| ... | ... | @@ -0,0 +1,22 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 2 | ||
| 3 | #![doc(test(no_crate_inject = 1))] | |
| 4 | //~^ ERROR | |
| 5 | //~| WARN | |
| 6 | #![doc(test(attr = 1))] | |
| 7 | //~^ ERROR | |
| 8 | //~| WARN | |
| 9 | ||
| 10 | #[doc(hidden = true)] | |
| 11 | //~^ ERROR | |
| 12 | //~| WARN | |
| 13 | #[doc(hidden("or you will be fired"))] | |
| 14 | //~^ ERROR | |
| 15 | //~| WARN | |
| 16 | #[doc(hidden = "handled transparently by codegen")] | |
| 17 | //~^ ERROR | |
| 18 | //~| WARN | |
| 19 | #[doc = 1] | |
| 20 | //~^ ERROR | |
| 21 | //~| WARN | |
| 22 | pub struct X; |
tests/rustdoc-ui/lints/invalid-doc-attr-3.stderr created+55| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | error: didn't expect any arguments here | |
| 2 | --> $DIR/invalid-doc-attr-3.rs:10:14 | |
| 3 | | | |
| 4 | LL | #[doc(hidden = true)] | |
| 5 | | ^^^^^^ | |
| 6 | | | |
| 7 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 8 | note: the lint level is defined here | |
| 9 | --> $DIR/invalid-doc-attr-3.rs:1:9 | |
| 10 | | | |
| 11 | LL | #![deny(invalid_doc_attributes)] | |
| 12 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 13 | ||
| 14 | error: didn't expect any arguments here | |
| 15 | --> $DIR/invalid-doc-attr-3.rs:13:13 | |
| 16 | | | |
| 17 | LL | #[doc(hidden("or you will be fired"))] | |
| 18 | | ^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 19 | | | |
| 20 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 21 | ||
| 22 | error: didn't expect any arguments here | |
| 23 | --> $DIR/invalid-doc-attr-3.rs:16:14 | |
| 24 | | | |
| 25 | LL | #[doc(hidden = "handled transparently by codegen")] | |
| 26 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 27 | | | |
| 28 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 29 | ||
| 30 | error: malformed `doc` attribute input | |
| 31 | --> $DIR/invalid-doc-attr-3.rs:19:9 | |
| 32 | | | |
| 33 | LL | #[doc = 1] | |
| 34 | | ^ | |
| 35 | | | |
| 36 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 37 | ||
| 38 | error: didn't expect any arguments here | |
| 39 | --> $DIR/invalid-doc-attr-3.rs:3:29 | |
| 40 | | | |
| 41 | LL | #![doc(test(no_crate_inject = 1))] | |
| 42 | | ^^^ | |
| 43 | | | |
| 44 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 45 | ||
| 46 | error: malformed `doc` attribute input | |
| 47 | --> $DIR/invalid-doc-attr-3.rs:6:1 | |
| 48 | | | |
| 49 | LL | #![doc(test(attr = 1))] | |
| 50 | | ^^^^^^^^^^^^^^^^^^^^^^^ | |
| 51 | | | |
| 52 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 53 | ||
| 54 | error: aborting due to 6 previous errors | |
| 55 |
tests/rustdoc-ui/lints/invalid-doc-attr.rs+1| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![crate_type = "lib"] |
| 2 | 3 | #![feature(doc_masked)] |
| 3 | 4 |
tests/rustdoc-ui/lints/invalid-doc-attr.stderr+13-8| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error: this attribute can only be applied to a `use` item |
| 2 | --> $DIR/invalid-doc-attr.rs:7:7 | |
| 2 | --> $DIR/invalid-doc-attr.rs:8:7 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[doc(inline)] |
| 5 | 5 | | ^^^^^^ only applicable on `use` items |
| ... | ... | @@ -8,10 +8,14 @@ LL | pub fn foo() {} |
| 8 | 8 | | ------------ not a `use` item |
| 9 | 9 | | |
| 10 | 10 | = note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline> for more information |
| 11 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 11 | note: the lint level is defined here | |
| 12 | --> $DIR/invalid-doc-attr.rs:1:9 | |
| 13 | | | |
| 14 | LL | #![deny(invalid_doc_attributes)] | |
| 15 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 12 | 16 | |
| 13 | 17 | error: conflicting doc inlining attributes |
| 14 | --> $DIR/invalid-doc-attr.rs:17:7 | |
| 18 | --> $DIR/invalid-doc-attr.rs:18:7 | |
| 15 | 19 | | |
| 16 | 20 | LL | #[doc(inline)] |
| 17 | 21 | | ^^^^^^ this attribute... |
| ... | ... | @@ -21,7 +25,7 @@ LL | #[doc(no_inline)] |
| 21 | 25 | = help: remove one of the conflicting attributes |
| 22 | 26 | |
| 23 | 27 | error: this attribute can only be applied to an `extern crate` item |
| 24 | --> $DIR/invalid-doc-attr.rs:23:7 | |
| 28 | --> $DIR/invalid-doc-attr.rs:24:7 | |
| 25 | 29 | | |
| 26 | 30 | LL | #[doc(masked)] |
| 27 | 31 | | ^^^^^^ only applicable on `extern crate` items |
| ... | ... | @@ -32,7 +36,7 @@ LL | pub struct Masked; |
| 32 | 36 | = note: read <https://doc.rust-lang.org/unstable-book/language-features/doc-masked.html> for more information |
| 33 | 37 | |
| 34 | 38 | error: this attribute cannot be applied to an `extern crate self` item |
| 35 | --> $DIR/invalid-doc-attr.rs:27:7 | |
| 39 | --> $DIR/invalid-doc-attr.rs:28:7 | |
| 36 | 40 | | |
| 37 | 41 | LL | #[doc(masked)] |
| 38 | 42 | | ^^^^^^ not applicable on `extern crate self` items |
| ... | ... | @@ -41,9 +45,10 @@ LL | pub extern crate self as reexport; |
| 41 | 45 | | --------------------------------- `extern crate self` defined here |
| 42 | 46 | |
| 43 | 47 | error: this attribute can only be applied to an `extern crate` item |
| 44 | --> $DIR/invalid-doc-attr.rs:4:8 | |
| 48 | --> $DIR/invalid-doc-attr.rs:5:8 | |
| 45 | 49 | | |
| 46 | LL | / #![crate_type = "lib"] | |
| 50 | LL | / #![deny(invalid_doc_attributes)] | |
| 51 | LL | | #![crate_type = "lib"] | |
| 47 | 52 | LL | | #![feature(doc_masked)] |
| 48 | 53 | LL | | |
| 49 | 54 | LL | | #![doc(masked)] |
| ... | ... | @@ -55,7 +60,7 @@ LL | | pub extern crate self as reexport; |
| 55 | 60 | = note: read <https://doc.rust-lang.org/unstable-book/language-features/doc-masked.html> for more information |
| 56 | 61 | |
| 57 | 62 | error: this attribute can only be applied to a `use` item |
| 58 | --> $DIR/invalid-doc-attr.rs:12:11 | |
| 63 | --> $DIR/invalid-doc-attr.rs:13:11 | |
| 59 | 64 | | |
| 60 | 65 | LL | #[doc(inline)] |
| 61 | 66 | | ^^^^^^ only applicable on `use` items |
tests/ui-fulldeps/codegen-backend/auxiliary/the_backend.rs-4| ... | ... | @@ -29,10 +29,6 @@ use rustc_session::config::OutputFilenames; |
| 29 | 29 | struct TheBackend; |
| 30 | 30 | |
| 31 | 31 | impl CodegenBackend for TheBackend { |
| 32 | fn locale_resource(&self) -> &'static str { | |
| 33 | "" | |
| 34 | } | |
| 35 | ||
| 36 | 32 | fn name(&self) -> &'static str { |
| 37 | 33 | "the-backend" |
| 38 | 34 | } |
tests/ui/attributes/doc-attr.rs+7-3| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![crate_type = "lib"] |
| 2 | 3 | #![doc(as_ptr)] |
| 3 | 4 | //~^ ERROR unknown `doc` attribute |
| ... | ... | @@ -7,10 +8,13 @@ |
| 7 | 8 | pub fn foo() {} |
| 8 | 9 | |
| 9 | 10 | #[doc(123)] |
| 10 | //~^ ERROR malformed `doc` attribute | |
| 11 | //~^ ERROR | |
| 12 | //~| WARN | |
| 11 | 13 | #[doc("hello", "bar")] |
| 12 | //~^ ERROR malformed `doc` attribute | |
| 13 | //~| ERROR malformed `doc` attribute | |
| 14 | //~^ ERROR | |
| 15 | //~| ERROR | |
| 16 | //~| WARN | |
| 17 | //~| WARN | |
| 14 | 18 | #[doc(foo::bar, crate::bar::baz = "bye")] |
| 15 | 19 | //~^ ERROR unknown `doc` attribute |
| 16 | 20 | //~| ERROR unknown `doc` attribute |
tests/ui/attributes/doc-attr.stderr+29-26| ... | ... | @@ -1,53 +1,56 @@ |
| 1 | error[E0539]: malformed `doc` attribute input | |
| 2 | --> $DIR/doc-attr.rs:9:1 | |
| 1 | error: unknown `doc` attribute `as_ptr` | |
| 2 | --> $DIR/doc-attr.rs:6:7 | |
| 3 | 3 | | |
| 4 | LL | #[doc(123)] | |
| 5 | | ^^^^^^---^^ | |
| 6 | | | | |
| 7 | | expected this to be of the form `... = "..."` | |
| 4 | LL | #[doc(as_ptr)] | |
| 5 | | ^^^^^^ | |
| 6 | | | |
| 7 | note: the lint level is defined here | |
| 8 | --> $DIR/doc-attr.rs:1:9 | |
| 9 | | | |
| 10 | LL | #![deny(invalid_doc_attributes)] | |
| 11 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 8 | 12 | |
| 9 | error[E0539]: malformed `doc` attribute input | |
| 10 | --> $DIR/doc-attr.rs:11:1 | |
| 13 | error: expected this to be of the form `... = "..."` | |
| 14 | --> $DIR/doc-attr.rs:10:7 | |
| 11 | 15 | | |
| 12 | LL | #[doc("hello", "bar")] | |
| 13 | | ^^^^^^-------^^^^^^^^^ | |
| 14 | | | | |
| 15 | | expected this to be of the form `... = "..."` | |
| 16 | LL | #[doc(123)] | |
| 17 | | ^^^ | |
| 18 | | | |
| 19 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 16 | 20 | |
| 17 | error[E0539]: malformed `doc` attribute input | |
| 18 | --> $DIR/doc-attr.rs:11:1 | |
| 21 | error: expected this to be of the form `... = "..."` | |
| 22 | --> $DIR/doc-attr.rs:13:7 | |
| 19 | 23 | | |
| 20 | 24 | LL | #[doc("hello", "bar")] |
| 21 | | ^^^^^^^^^^^^^^^-----^^ | |
| 22 | | | | |
| 23 | | expected this to be of the form `... = "..."` | |
| 25 | | ^^^^^^^ | |
| 26 | | | |
| 27 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 24 | 28 | |
| 25 | error: unknown `doc` attribute `as_ptr` | |
| 26 | --> $DIR/doc-attr.rs:5:7 | |
| 29 | error: expected this to be of the form `... = "..."` | |
| 30 | --> $DIR/doc-attr.rs:13:16 | |
| 27 | 31 | | |
| 28 | LL | #[doc(as_ptr)] | |
| 29 | | ^^^^^^ | |
| 32 | LL | #[doc("hello", "bar")] | |
| 33 | | ^^^^^ | |
| 30 | 34 | | |
| 31 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 35 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 32 | 36 | |
| 33 | 37 | error: unknown `doc` attribute `foo::bar` |
| 34 | --> $DIR/doc-attr.rs:14:7 | |
| 38 | --> $DIR/doc-attr.rs:18:7 | |
| 35 | 39 | | |
| 36 | 40 | LL | #[doc(foo::bar, crate::bar::baz = "bye")] |
| 37 | 41 | | ^^^^^^^^ |
| 38 | 42 | |
| 39 | 43 | error: unknown `doc` attribute `crate::bar::baz` |
| 40 | --> $DIR/doc-attr.rs:14:17 | |
| 44 | --> $DIR/doc-attr.rs:18:17 | |
| 41 | 45 | | |
| 42 | 46 | LL | #[doc(foo::bar, crate::bar::baz = "bye")] |
| 43 | 47 | | ^^^^^^^^^^^^^^^ |
| 44 | 48 | |
| 45 | 49 | error: unknown `doc` attribute `as_ptr` |
| 46 | --> $DIR/doc-attr.rs:2:8 | |
| 50 | --> $DIR/doc-attr.rs:3:8 | |
| 47 | 51 | | |
| 48 | 52 | LL | #![doc(as_ptr)] |
| 49 | 53 | | ^^^^^^ |
| 50 | 54 | |
| 51 | 55 | error: aborting due to 7 previous errors |
| 52 | 56 | |
| 53 | For more information about this error, try `rustc --explain E0539`. |
tests/ui/attributes/doc-test-literal.rs+4-1| ... | ... | @@ -1,4 +1,7 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 2 | ||
| 1 | 3 | #![doc(test(""))] |
| 2 | //~^ ERROR malformed `doc` attribute input | |
| 4 | //~^ ERROR | |
| 5 | //~| WARN | |
| 3 | 6 | |
| 4 | 7 | fn main() {} |
tests/ui/attributes/doc-test-literal.stderr+10-6| ... | ... | @@ -1,11 +1,15 @@ |
| 1 | error[E0565]: malformed `doc` attribute input | |
| 2 | --> $DIR/doc-test-literal.rs:1:1 | |
| 1 | error: malformed `doc` attribute input | |
| 2 | --> $DIR/doc-test-literal.rs:3:13 | |
| 3 | 3 | | |
| 4 | 4 | LL | #![doc(test(""))] |
| 5 | | ^^^^^^^^^^^^--^^^ | |
| 6 | | | | |
| 7 | | didn't expect a literal here | |
| 5 | | ^^ | |
| 6 | | | |
| 7 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 8 | note: the lint level is defined here | |
| 9 | --> $DIR/doc-test-literal.rs:1:9 | |
| 10 | | | |
| 11 | LL | #![deny(invalid_doc_attributes)] | |
| 12 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 8 | 13 | |
| 9 | 14 | error: aborting due to 1 previous error |
| 10 | 15 | |
| 11 | For more information about this error, try `rustc --explain E0565`. |
tests/ui/attributes/malformed-attrs.rs+3-4| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | // This file contains a bunch of malformed attributes. |
| 2 | 2 | // We enable a bunch of features to not get feature-gate errs in this test. |
| 3 | #![deny(invalid_doc_attributes)] | |
| 3 | 4 | #![feature(rustc_attrs)] |
| 4 | 5 | #![feature(rustc_allow_const_fn_unstable)] |
| 5 | 6 | #![feature(allow_internal_unstable)] |
| ... | ... | @@ -39,8 +40,7 @@ |
| 39 | 40 | #[deprecated = 5] |
| 40 | 41 | //~^ ERROR malformed |
| 41 | 42 | #[doc] |
| 42 | //~^ ERROR valid forms for the attribute are | |
| 43 | //~| WARN this was previously accepted by the compiler | |
| 43 | //~^ ERROR | |
| 44 | 44 | #[rustc_macro_transparency] |
| 45 | 45 | //~^ ERROR malformed |
| 46 | 46 | //~| ERROR attribute cannot be used on |
| ... | ... | @@ -75,8 +75,7 @@ |
| 75 | 75 | //~^ ERROR malformed |
| 76 | 76 | //~| WARN crate-level attribute should be an inner attribute |
| 77 | 77 | #[doc] |
| 78 | //~^ ERROR valid forms for the attribute are | |
| 79 | //~| WARN this was previously accepted by the compiler | |
| 78 | //~^ ERROR | |
| 80 | 79 | #[target_feature] |
| 81 | 80 | //~^ ERROR malformed |
| 82 | 81 | #[export_stable = 1] |
tests/ui/attributes/malformed-attrs.stderr+75-97| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error[E0539]: malformed `cfg` attribute input |
| 2 | --> $DIR/malformed-attrs.rs:108:1 | |
| 2 | --> $DIR/malformed-attrs.rs:107:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[cfg] |
| 5 | 5 | | ^^^^^^ |
| ... | ... | @@ -10,7 +10,7 @@ LL | #[cfg] |
| 10 | 10 | = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> |
| 11 | 11 | |
| 12 | 12 | error[E0539]: malformed `cfg_attr` attribute input |
| 13 | --> $DIR/malformed-attrs.rs:110:1 | |
| 13 | --> $DIR/malformed-attrs.rs:109:1 | |
| 14 | 14 | | |
| 15 | 15 | LL | #[cfg_attr] |
| 16 | 16 | | ^^^^^^^^^^^ |
| ... | ... | @@ -21,13 +21,13 @@ LL | #[cfg_attr] |
| 21 | 21 | = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> |
| 22 | 22 | |
| 23 | 23 | error[E0463]: can't find crate for `wloop` |
| 24 | --> $DIR/malformed-attrs.rs:218:1 | |
| 24 | --> $DIR/malformed-attrs.rs:217:1 | |
| 25 | 25 | | |
| 26 | 26 | LL | extern crate wloop; |
| 27 | 27 | | ^^^^^^^^^^^^^^^^^^^ can't find crate |
| 28 | 28 | |
| 29 | 29 | error: malformed `allow` attribute input |
| 30 | --> $DIR/malformed-attrs.rs:184:1 | |
| 30 | --> $DIR/malformed-attrs.rs:183:1 | |
| 31 | 31 | | |
| 32 | 32 | LL | #[allow] |
| 33 | 33 | | ^^^^^^^^ |
| ... | ... | @@ -43,7 +43,7 @@ LL | #[allow(lint1, lint2, lint3, reason = "...")] |
| 43 | 43 | | +++++++++++++++++++++++++++++++++++++ |
| 44 | 44 | |
| 45 | 45 | error: malformed `expect` attribute input |
| 46 | --> $DIR/malformed-attrs.rs:186:1 | |
| 46 | --> $DIR/malformed-attrs.rs:185:1 | |
| 47 | 47 | | |
| 48 | 48 | LL | #[expect] |
| 49 | 49 | | ^^^^^^^^^ |
| ... | ... | @@ -59,7 +59,7 @@ LL | #[expect(lint1, lint2, lint3, reason = "...")] |
| 59 | 59 | | +++++++++++++++++++++++++++++++++++++ |
| 60 | 60 | |
| 61 | 61 | error: malformed `warn` attribute input |
| 62 | --> $DIR/malformed-attrs.rs:188:1 | |
| 62 | --> $DIR/malformed-attrs.rs:187:1 | |
| 63 | 63 | | |
| 64 | 64 | LL | #[warn] |
| 65 | 65 | | ^^^^^^^ |
| ... | ... | @@ -75,7 +75,7 @@ LL | #[warn(lint1, lint2, lint3, reason = "...")] |
| 75 | 75 | | +++++++++++++++++++++++++++++++++++++ |
| 76 | 76 | |
| 77 | 77 | error: malformed `deny` attribute input |
| 78 | --> $DIR/malformed-attrs.rs:190:1 | |
| 78 | --> $DIR/malformed-attrs.rs:189:1 | |
| 79 | 79 | | |
| 80 | 80 | LL | #[deny] |
| 81 | 81 | | ^^^^^^^ |
| ... | ... | @@ -91,7 +91,7 @@ LL | #[deny(lint1, lint2, lint3, reason = "...")] |
| 91 | 91 | | +++++++++++++++++++++++++++++++++++++ |
| 92 | 92 | |
| 93 | 93 | error: malformed `forbid` attribute input |
| 94 | --> $DIR/malformed-attrs.rs:192:1 | |
| 94 | --> $DIR/malformed-attrs.rs:191:1 | |
| 95 | 95 | | |
| 96 | 96 | LL | #[forbid] |
| 97 | 97 | | ^^^^^^^^^ |
| ... | ... | @@ -107,25 +107,25 @@ LL | #[forbid(lint1, lint2, lint3, reason = "...")] |
| 107 | 107 | | +++++++++++++++++++++++++++++++++++++ |
| 108 | 108 | |
| 109 | 109 | error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type |
| 110 | --> $DIR/malformed-attrs.rs:105:1 | |
| 110 | --> $DIR/malformed-attrs.rs:104:1 | |
| 111 | 111 | | |
| 112 | 112 | LL | #[proc_macro = 18] |
| 113 | 113 | | ^^^^^^^^^^^^^^^^^^ |
| 114 | 114 | |
| 115 | 115 | error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type |
| 116 | --> $DIR/malformed-attrs.rs:122:1 | |
| 116 | --> $DIR/malformed-attrs.rs:121:1 | |
| 117 | 117 | | |
| 118 | 118 | LL | #[proc_macro_attribute = 19] |
| 119 | 119 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 120 | 120 | |
| 121 | 121 | error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type |
| 122 | --> $DIR/malformed-attrs.rs:129:1 | |
| 122 | --> $DIR/malformed-attrs.rs:128:1 | |
| 123 | 123 | | |
| 124 | 124 | LL | #[proc_macro_derive] |
| 125 | 125 | | ^^^^^^^^^^^^^^^^^^^^ |
| 126 | 126 | |
| 127 | 127 | error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint |
| 128 | --> $DIR/malformed-attrs.rs:223:1 | |
| 128 | --> $DIR/malformed-attrs.rs:222:1 | |
| 129 | 129 | | |
| 130 | 130 | LL | #[allow_internal_unsafe = 1] |
| 131 | 131 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -134,7 +134,7 @@ LL | #[allow_internal_unsafe = 1] |
| 134 | 134 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 135 | 135 | |
| 136 | 136 | error[E0539]: malformed `windows_subsystem` attribute input |
| 137 | --> $DIR/malformed-attrs.rs:26:1 | |
| 137 | --> $DIR/malformed-attrs.rs:27:1 | |
| 138 | 138 | | |
| 139 | 139 | LL | #![windows_subsystem] |
| 140 | 140 | | ^^^-----------------^ |
| ... | ... | @@ -150,25 +150,25 @@ LL | #![windows_subsystem = "windows"] |
| 150 | 150 | | +++++++++++ |
| 151 | 151 | |
| 152 | 152 | error[E0539]: malformed `export_name` attribute input |
| 153 | --> $DIR/malformed-attrs.rs:29:1 | |
| 153 | --> $DIR/malformed-attrs.rs:30:1 | |
| 154 | 154 | | |
| 155 | 155 | LL | #[unsafe(export_name)] |
| 156 | 156 | | ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]` |
| 157 | 157 | |
| 158 | 158 | error: `rustc_allow_const_fn_unstable` expects a list of feature names |
| 159 | --> $DIR/malformed-attrs.rs:31:1 | |
| 159 | --> $DIR/malformed-attrs.rs:32:1 | |
| 160 | 160 | | |
| 161 | 161 | LL | #[rustc_allow_const_fn_unstable] |
| 162 | 162 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 163 | 163 | |
| 164 | 164 | error: `allow_internal_unstable` expects a list of feature names |
| 165 | --> $DIR/malformed-attrs.rs:34:1 | |
| 165 | --> $DIR/malformed-attrs.rs:35:1 | |
| 166 | 166 | | |
| 167 | 167 | LL | #[allow_internal_unstable] |
| 168 | 168 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 169 | 169 | |
| 170 | 170 | error[E0539]: malformed `rustc_confusables` attribute input |
| 171 | --> $DIR/malformed-attrs.rs:36:1 | |
| 171 | --> $DIR/malformed-attrs.rs:37:1 | |
| 172 | 172 | | |
| 173 | 173 | LL | #[rustc_confusables] |
| 174 | 174 | | ^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -177,7 +177,7 @@ LL | #[rustc_confusables] |
| 177 | 177 | | help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]` |
| 178 | 178 | |
| 179 | 179 | error: `#[rustc_confusables]` attribute cannot be used on functions |
| 180 | --> $DIR/malformed-attrs.rs:36:1 | |
| 180 | --> $DIR/malformed-attrs.rs:37:1 | |
| 181 | 181 | | |
| 182 | 182 | LL | #[rustc_confusables] |
| 183 | 183 | | ^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -185,7 +185,7 @@ LL | #[rustc_confusables] |
| 185 | 185 | = help: `#[rustc_confusables]` can only be applied to inherent methods |
| 186 | 186 | |
| 187 | 187 | error[E0539]: malformed `deprecated` attribute input |
| 188 | --> $DIR/malformed-attrs.rs:39:1 | |
| 188 | --> $DIR/malformed-attrs.rs:40:1 | |
| 189 | 189 | | |
| 190 | 190 | LL | #[deprecated = 5] |
| 191 | 191 | | ^^^^^^^^^^^^^^^-^ |
| ... | ... | @@ -349,7 +349,7 @@ LL | #[crate_name] |
| 349 | 349 | | ^^^^^^^^^^^^^ help: must be of the form: `#[crate_name = "name"]` |
| 350 | 350 | |
| 351 | 351 | error[E0539]: malformed `target_feature` attribute input |
| 352 | --> $DIR/malformed-attrs.rs:80:1 | |
| 352 | --> $DIR/malformed-attrs.rs:79:1 | |
| 353 | 353 | | |
| 354 | 354 | LL | #[target_feature] |
| 355 | 355 | | ^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -358,7 +358,7 @@ LL | #[target_feature] |
| 358 | 358 | | help: must be of the form: `#[target_feature(enable = "feat1, feat2")]` |
| 359 | 359 | |
| 360 | 360 | error[E0565]: malformed `export_stable` attribute input |
| 361 | --> $DIR/malformed-attrs.rs:82:1 | |
| 361 | --> $DIR/malformed-attrs.rs:81:1 | |
| 362 | 362 | | |
| 363 | 363 | LL | #[export_stable = 1] |
| 364 | 364 | | ^^^^^^^^^^^^^^^^---^ |
| ... | ... | @@ -367,7 +367,7 @@ LL | #[export_stable = 1] |
| 367 | 367 | | help: must be of the form: `#[export_stable]` |
| 368 | 368 | |
| 369 | 369 | error[E0539]: malformed `link` attribute input |
| 370 | --> $DIR/malformed-attrs.rs:84:1 | |
| 370 | --> $DIR/malformed-attrs.rs:83:1 | |
| 371 | 371 | | |
| 372 | 372 | LL | #[link] |
| 373 | 373 | | ^^^^^^^ expected this to be a list |
| ... | ... | @@ -375,7 +375,7 @@ LL | #[link] |
| 375 | 375 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute> |
| 376 | 376 | |
| 377 | 377 | error[E0539]: malformed `link_name` attribute input |
| 378 | --> $DIR/malformed-attrs.rs:88:1 | |
| 378 | --> $DIR/malformed-attrs.rs:87:1 | |
| 379 | 379 | | |
| 380 | 380 | LL | #[link_name] |
| 381 | 381 | | ^^^^^^^^^^^^ help: must be of the form: `#[link_name = "name"]` |
| ... | ... | @@ -383,7 +383,7 @@ LL | #[link_name] |
| 383 | 383 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_name-attribute> |
| 384 | 384 | |
| 385 | 385 | error[E0539]: malformed `link_section` attribute input |
| 386 | --> $DIR/malformed-attrs.rs:92:1 | |
| 386 | --> $DIR/malformed-attrs.rs:91:1 | |
| 387 | 387 | | |
| 388 | 388 | LL | #[link_section] |
| 389 | 389 | | ^^^^^^^^^^^^^^^ help: must be of the form: `#[link_section = "name"]` |
| ... | ... | @@ -391,7 +391,7 @@ LL | #[link_section] |
| 391 | 391 | = note: for more information, visit <https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute> |
| 392 | 392 | |
| 393 | 393 | error[E0539]: malformed `coverage` attribute input |
| 394 | --> $DIR/malformed-attrs.rs:94:1 | |
| 394 | --> $DIR/malformed-attrs.rs:93:1 | |
| 395 | 395 | | |
| 396 | 396 | LL | #[coverage] |
| 397 | 397 | | ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument |
| ... | ... | @@ -404,13 +404,13 @@ LL | #[coverage(on)] |
| 404 | 404 | | ++++ |
| 405 | 405 | |
| 406 | 406 | error[E0539]: malformed `sanitize` attribute input |
| 407 | --> $DIR/malformed-attrs.rs:96:1 | |
| 407 | --> $DIR/malformed-attrs.rs:95:1 | |
| 408 | 408 | | |
| 409 | 409 | LL | #[sanitize] |
| 410 | 410 | | ^^^^^^^^^^^ expected this to be a list |
| 411 | 411 | |
| 412 | 412 | error[E0565]: malformed `no_implicit_prelude` attribute input |
| 413 | --> $DIR/malformed-attrs.rs:101:1 | |
| 413 | --> $DIR/malformed-attrs.rs:100:1 | |
| 414 | 414 | | |
| 415 | 415 | LL | #[no_implicit_prelude = 23] |
| 416 | 416 | | ^^^^^^^^^^^^^^^^^^^^^^----^ |
| ... | ... | @@ -419,7 +419,7 @@ LL | #[no_implicit_prelude = 23] |
| 419 | 419 | | help: must be of the form: `#[no_implicit_prelude]` |
| 420 | 420 | |
| 421 | 421 | error[E0565]: malformed `proc_macro` attribute input |
| 422 | --> $DIR/malformed-attrs.rs:105:1 | |
| 422 | --> $DIR/malformed-attrs.rs:104:1 | |
| 423 | 423 | | |
| 424 | 424 | LL | #[proc_macro = 18] |
| 425 | 425 | | ^^^^^^^^^^^^^----^ |
| ... | ... | @@ -428,7 +428,7 @@ LL | #[proc_macro = 18] |
| 428 | 428 | | help: must be of the form: `#[proc_macro]` |
| 429 | 429 | |
| 430 | 430 | error[E0539]: malformed `instruction_set` attribute input |
| 431 | --> $DIR/malformed-attrs.rs:112:1 | |
| 431 | --> $DIR/malformed-attrs.rs:111:1 | |
| 432 | 432 | | |
| 433 | 433 | LL | #[instruction_set] |
| 434 | 434 | | ^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -439,7 +439,7 @@ LL | #[instruction_set] |
| 439 | 439 | = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-instruction_set-attribute> |
| 440 | 440 | |
| 441 | 441 | error[E0539]: malformed `patchable_function_entry` attribute input |
| 442 | --> $DIR/malformed-attrs.rs:114:1 | |
| 442 | --> $DIR/malformed-attrs.rs:113:1 | |
| 443 | 443 | | |
| 444 | 444 | LL | #[patchable_function_entry] |
| 445 | 445 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -448,7 +448,7 @@ LL | #[patchable_function_entry] |
| 448 | 448 | | help: must be of the form: `#[patchable_function_entry(prefix_nops = m, entry_nops = n)]` |
| 449 | 449 | |
| 450 | 450 | error[E0565]: malformed `coroutine` attribute input |
| 451 | --> $DIR/malformed-attrs.rs:117:5 | |
| 451 | --> $DIR/malformed-attrs.rs:116:5 | |
| 452 | 452 | | |
| 453 | 453 | LL | #[coroutine = 63] || {} |
| 454 | 454 | | ^^^^^^^^^^^^----^ |
| ... | ... | @@ -457,7 +457,7 @@ LL | #[coroutine = 63] || {} |
| 457 | 457 | | help: must be of the form: `#[coroutine]` |
| 458 | 458 | |
| 459 | 459 | error[E0565]: malformed `proc_macro_attribute` attribute input |
| 460 | --> $DIR/malformed-attrs.rs:122:1 | |
| 460 | --> $DIR/malformed-attrs.rs:121:1 | |
| 461 | 461 | | |
| 462 | 462 | LL | #[proc_macro_attribute = 19] |
| 463 | 463 | | ^^^^^^^^^^^^^^^^^^^^^^^----^ |
| ... | ... | @@ -466,7 +466,7 @@ LL | #[proc_macro_attribute = 19] |
| 466 | 466 | | help: must be of the form: `#[proc_macro_attribute]` |
| 467 | 467 | |
| 468 | 468 | error[E0539]: malformed `must_use` attribute input |
| 469 | --> $DIR/malformed-attrs.rs:125:1 | |
| 469 | --> $DIR/malformed-attrs.rs:124:1 | |
| 470 | 470 | | |
| 471 | 471 | LL | #[must_use = 1] |
| 472 | 472 | | ^^^^^^^^^^^^^-^ |
| ... | ... | @@ -484,7 +484,7 @@ LL + #[must_use] |
| 484 | 484 | | |
| 485 | 485 | |
| 486 | 486 | error[E0539]: malformed `proc_macro_derive` attribute input |
| 487 | --> $DIR/malformed-attrs.rs:129:1 | |
| 487 | --> $DIR/malformed-attrs.rs:128:1 | |
| 488 | 488 | | |
| 489 | 489 | LL | #[proc_macro_derive] |
| 490 | 490 | | ^^^^^^^^^^^^^^^^^^^^ expected this to be a list |
| ... | ... | @@ -498,7 +498,7 @@ LL | #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] |
| 498 | 498 | | ++++++++++++++++++++++++++++++++++++++++++ |
| 499 | 499 | |
| 500 | 500 | error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input |
| 501 | --> $DIR/malformed-attrs.rs:134:1 | |
| 501 | --> $DIR/malformed-attrs.rs:133:1 | |
| 502 | 502 | | |
| 503 | 503 | LL | #[rustc_layout_scalar_valid_range_start] |
| 504 | 504 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -507,7 +507,7 @@ LL | #[rustc_layout_scalar_valid_range_start] |
| 507 | 507 | | help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]` |
| 508 | 508 | |
| 509 | 509 | error[E0539]: malformed `rustc_layout_scalar_valid_range_end` attribute input |
| 510 | --> $DIR/malformed-attrs.rs:136:1 | |
| 510 | --> $DIR/malformed-attrs.rs:135:1 | |
| 511 | 511 | | |
| 512 | 512 | LL | #[rustc_layout_scalar_valid_range_end] |
| 513 | 513 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -516,7 +516,7 @@ LL | #[rustc_layout_scalar_valid_range_end] |
| 516 | 516 | | help: must be of the form: `#[rustc_layout_scalar_valid_range_end(end)]` |
| 517 | 517 | |
| 518 | 518 | error[E0539]: malformed `must_not_suspend` attribute input |
| 519 | --> $DIR/malformed-attrs.rs:138:1 | |
| 519 | --> $DIR/malformed-attrs.rs:137:1 | |
| 520 | 520 | | |
| 521 | 521 | LL | #[must_not_suspend()] |
| 522 | 522 | | ^^^^^^^^^^^^^^^^^^--^ |
| ... | ... | @@ -532,7 +532,7 @@ LL + #[must_not_suspend] |
| 532 | 532 | | |
| 533 | 533 | |
| 534 | 534 | error[E0539]: malformed `cfi_encoding` attribute input |
| 535 | --> $DIR/malformed-attrs.rs:140:1 | |
| 535 | --> $DIR/malformed-attrs.rs:139:1 | |
| 536 | 536 | | |
| 537 | 537 | LL | #[cfi_encoding = ""] |
| 538 | 538 | | ^^^^^^^^^^^^^^^^^--^ |
| ... | ... | @@ -541,7 +541,7 @@ LL | #[cfi_encoding = ""] |
| 541 | 541 | | help: must be of the form: `#[cfi_encoding = "encoding"]` |
| 542 | 542 | |
| 543 | 543 | error[E0565]: malformed `marker` attribute input |
| 544 | --> $DIR/malformed-attrs.rs:161:1 | |
| 544 | --> $DIR/malformed-attrs.rs:160:1 | |
| 545 | 545 | | |
| 546 | 546 | LL | #[marker = 3] |
| 547 | 547 | | ^^^^^^^^^---^ |
| ... | ... | @@ -550,7 +550,7 @@ LL | #[marker = 3] |
| 550 | 550 | | help: must be of the form: `#[marker]` |
| 551 | 551 | |
| 552 | 552 | error[E0565]: malformed `fundamental` attribute input |
| 553 | --> $DIR/malformed-attrs.rs:163:1 | |
| 553 | --> $DIR/malformed-attrs.rs:162:1 | |
| 554 | 554 | | |
| 555 | 555 | LL | #[fundamental()] |
| 556 | 556 | | ^^^^^^^^^^^^^--^ |
| ... | ... | @@ -559,7 +559,7 @@ LL | #[fundamental()] |
| 559 | 559 | | help: must be of the form: `#[fundamental]` |
| 560 | 560 | |
| 561 | 561 | error[E0565]: malformed `ffi_pure` attribute input |
| 562 | --> $DIR/malformed-attrs.rs:171:5 | |
| 562 | --> $DIR/malformed-attrs.rs:170:5 | |
| 563 | 563 | | |
| 564 | 564 | LL | #[unsafe(ffi_pure = 1)] |
| 565 | 565 | | ^^^^^^^^^^^^^^^^^^---^^ |
| ... | ... | @@ -568,7 +568,7 @@ LL | #[unsafe(ffi_pure = 1)] |
| 568 | 568 | | help: must be of the form: `#[ffi_pure]` |
| 569 | 569 | |
| 570 | 570 | error[E0539]: malformed `link_ordinal` attribute input |
| 571 | --> $DIR/malformed-attrs.rs:173:5 | |
| 571 | --> $DIR/malformed-attrs.rs:172:5 | |
| 572 | 572 | | |
| 573 | 573 | LL | #[link_ordinal] |
| 574 | 574 | | ^^^^^^^^^^^^^^^ |
| ... | ... | @@ -579,7 +579,7 @@ LL | #[link_ordinal] |
| 579 | 579 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute> |
| 580 | 580 | |
| 581 | 581 | error[E0565]: malformed `ffi_const` attribute input |
| 582 | --> $DIR/malformed-attrs.rs:177:5 | |
| 582 | --> $DIR/malformed-attrs.rs:176:5 | |
| 583 | 583 | | |
| 584 | 584 | LL | #[unsafe(ffi_const = 1)] |
| 585 | 585 | | ^^^^^^^^^^^^^^^^^^^---^^ |
| ... | ... | @@ -588,13 +588,13 @@ LL | #[unsafe(ffi_const = 1)] |
| 588 | 588 | | help: must be of the form: `#[ffi_const]` |
| 589 | 589 | |
| 590 | 590 | error[E0539]: malformed `linkage` attribute input |
| 591 | --> $DIR/malformed-attrs.rs:179:5 | |
| 591 | --> $DIR/malformed-attrs.rs:178:5 | |
| 592 | 592 | | |
| 593 | 593 | LL | #[linkage] |
| 594 | 594 | | ^^^^^^^^^^ expected this to be of the form `linkage = "..."` |
| 595 | 595 | |
| 596 | 596 | error[E0539]: malformed `debugger_visualizer` attribute input |
| 597 | --> $DIR/malformed-attrs.rs:194:1 | |
| 597 | --> $DIR/malformed-attrs.rs:193:1 | |
| 598 | 598 | | |
| 599 | 599 | LL | #[debugger_visualizer] |
| 600 | 600 | | ^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -605,7 +605,7 @@ LL | #[debugger_visualizer] |
| 605 | 605 | = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/debugger.html#the-debugger_visualizer-attribute> |
| 606 | 606 | |
| 607 | 607 | error[E0565]: malformed `automatically_derived` attribute input |
| 608 | --> $DIR/malformed-attrs.rs:196:1 | |
| 608 | --> $DIR/malformed-attrs.rs:195:1 | |
| 609 | 609 | | |
| 610 | 610 | LL | #[automatically_derived = 18] |
| 611 | 611 | | ^^^^^^^^^^^^^^^^^^^^^^^^----^ |
| ... | ... | @@ -614,7 +614,7 @@ LL | #[automatically_derived = 18] |
| 614 | 614 | | help: must be of the form: `#[automatically_derived]` |
| 615 | 615 | |
| 616 | 616 | error[E0565]: malformed `non_exhaustive` attribute input |
| 617 | --> $DIR/malformed-attrs.rs:204:1 | |
| 617 | --> $DIR/malformed-attrs.rs:203:1 | |
| 618 | 618 | | |
| 619 | 619 | LL | #[non_exhaustive = 1] |
| 620 | 620 | | ^^^^^^^^^^^^^^^^^---^ |
| ... | ... | @@ -623,7 +623,7 @@ LL | #[non_exhaustive = 1] |
| 623 | 623 | | help: must be of the form: `#[non_exhaustive]` |
| 624 | 624 | |
| 625 | 625 | error[E0565]: malformed `thread_local` attribute input |
| 626 | --> $DIR/malformed-attrs.rs:210:1 | |
| 626 | --> $DIR/malformed-attrs.rs:209:1 | |
| 627 | 627 | | |
| 628 | 628 | LL | #[thread_local()] |
| 629 | 629 | | ^^^^^^^^^^^^^^--^ |
| ... | ... | @@ -632,7 +632,7 @@ LL | #[thread_local()] |
| 632 | 632 | | help: must be of the form: `#[thread_local]` |
| 633 | 633 | |
| 634 | 634 | error[E0565]: malformed `no_link` attribute input |
| 635 | --> $DIR/malformed-attrs.rs:214:1 | |
| 635 | --> $DIR/malformed-attrs.rs:213:1 | |
| 636 | 636 | | |
| 637 | 637 | LL | #[no_link()] |
| 638 | 638 | | ^^^^^^^^^--^ |
| ... | ... | @@ -641,7 +641,7 @@ LL | #[no_link()] |
| 641 | 641 | | help: must be of the form: `#[no_link]` |
| 642 | 642 | |
| 643 | 643 | error[E0539]: malformed `macro_use` attribute input |
| 644 | --> $DIR/malformed-attrs.rs:216:1 | |
| 644 | --> $DIR/malformed-attrs.rs:215:1 | |
| 645 | 645 | | |
| 646 | 646 | LL | #[macro_use = 1] |
| 647 | 647 | | ^^^^^^^^^^^^---^ |
| ... | ... | @@ -659,7 +659,7 @@ LL + #[macro_use] |
| 659 | 659 | | |
| 660 | 660 | |
| 661 | 661 | error[E0539]: malformed `macro_export` attribute input |
| 662 | --> $DIR/malformed-attrs.rs:221:1 | |
| 662 | --> $DIR/malformed-attrs.rs:220:1 | |
| 663 | 663 | | |
| 664 | 664 | LL | #[macro_export = 18] |
| 665 | 665 | | ^^^^^^^^^^^^^^^----^ |
| ... | ... | @@ -676,7 +676,7 @@ LL + #[macro_export] |
| 676 | 676 | | |
| 677 | 677 | |
| 678 | 678 | error[E0565]: malformed `allow_internal_unsafe` attribute input |
| 679 | --> $DIR/malformed-attrs.rs:223:1 | |
| 679 | --> $DIR/malformed-attrs.rs:222:1 | |
| 680 | 680 | | |
| 681 | 681 | LL | #[allow_internal_unsafe = 1] |
| 682 | 682 | | ^^^^^^^^^^^^^^^^^^^^^^^^---^ |
| ... | ... | @@ -685,7 +685,7 @@ LL | #[allow_internal_unsafe = 1] |
| 685 | 685 | | help: must be of the form: `#[allow_internal_unsafe]` |
| 686 | 686 | |
| 687 | 687 | error[E0565]: malformed `type_const` attribute input |
| 688 | --> $DIR/malformed-attrs.rs:149:5 | |
| 688 | --> $DIR/malformed-attrs.rs:148:5 | |
| 689 | 689 | | |
| 690 | 690 | LL | #[type_const = 1] |
| 691 | 691 | | ^^^^^^^^^^^^^---^ |
| ... | ... | @@ -694,7 +694,7 @@ LL | #[type_const = 1] |
| 694 | 694 | | help: must be of the form: `#[type_const]` |
| 695 | 695 | |
| 696 | 696 | error: attribute should be applied to `const fn` |
| 697 | --> $DIR/malformed-attrs.rs:31:1 | |
| 697 | --> $DIR/malformed-attrs.rs:32:1 | |
| 698 | 698 | | |
| 699 | 699 | LL | #[rustc_allow_const_fn_unstable] |
| 700 | 700 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -706,7 +706,7 @@ LL | | } |
| 706 | 706 | | |_- not a `const fn` |
| 707 | 707 | |
| 708 | 708 | warning: attribute should be applied to an `extern` block with non-Rust ABI |
| 709 | --> $DIR/malformed-attrs.rs:84:1 | |
| 709 | --> $DIR/malformed-attrs.rs:83:1 | |
| 710 | 710 | | |
| 711 | 711 | LL | #[link] |
| 712 | 712 | | ^^^^^^^ |
| ... | ... | @@ -733,7 +733,7 @@ LL | #[repr] |
| 733 | 733 | | ^^^^^^^ |
| 734 | 734 | |
| 735 | 735 | warning: missing options for `on_unimplemented` attribute |
| 736 | --> $DIR/malformed-attrs.rs:144:1 | |
| 736 | --> $DIR/malformed-attrs.rs:143:1 | |
| 737 | 737 | | |
| 738 | 738 | LL | #[diagnostic::on_unimplemented] |
| 739 | 739 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -742,7 +742,7 @@ LL | #[diagnostic::on_unimplemented] |
| 742 | 742 | = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default |
| 743 | 743 | |
| 744 | 744 | warning: malformed `on_unimplemented` attribute |
| 745 | --> $DIR/malformed-attrs.rs:146:1 | |
| 745 | --> $DIR/malformed-attrs.rs:145:1 | |
| 746 | 746 | | |
| 747 | 747 | LL | #[diagnostic::on_unimplemented = 1] |
| 748 | 748 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here |
| ... | ... | @@ -750,14 +750,16 @@ LL | #[diagnostic::on_unimplemented = 1] |
| 750 | 750 | = help: only `message`, `note` and `label` are allowed as options |
| 751 | 751 | |
| 752 | 752 | error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, `#[doc(attribute)]`, `#[doc(auto_cfg)]`, `#[doc(cfg)]`, `#[doc(fake_variadic)]`, `#[doc(hidden)]`, `#[doc(html_favicon_url)]`, `#[doc(html_logo_url)]`, `#[doc(html_no_source)]`, `#[doc(html_playground_url)]`, `#[doc(html_root_url)]`, `#[doc(include)]`, `#[doc(inline)]`, `#[doc(issue_tracker_base_url)]`, `#[doc(keyword)]`, `#[doc(masked)]`, `#[doc(no_default_passes)]`, `#[doc(no_inline)]`, `#[doc(notable_trait)]`, `#[doc(passes)]`, `#[doc(plugins)]`, `#[doc(rust_logo)]`, `#[doc(search_unbox)]`, `#[doc(spotlight)]`, and `#[doc(test)]` |
| 753 | --> $DIR/malformed-attrs.rs:41:1 | |
| 753 | --> $DIR/malformed-attrs.rs:42:1 | |
| 754 | 754 | | |
| 755 | 755 | LL | #[doc] |
| 756 | 756 | | ^^^^^^ |
| 757 | 757 | | |
| 758 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 759 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> | |
| 760 | = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default | |
| 758 | note: the lint level is defined here | |
| 759 | --> $DIR/malformed-attrs.rs:3:9 | |
| 760 | | | |
| 761 | LL | #![deny(invalid_doc_attributes)] | |
| 762 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 761 | 763 | |
| 762 | 764 | error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]` |
| 763 | 765 | --> $DIR/malformed-attrs.rs:52:1 |
| ... | ... | @@ -767,6 +769,7 @@ LL | #[inline = 5] |
| 767 | 769 | | |
| 768 | 770 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 769 | 771 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> |
| 772 | = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default | |
| 770 | 773 | |
| 771 | 774 | warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` |
| 772 | 775 | --> $DIR/malformed-attrs.rs:74:1 |
| ... | ... | @@ -775,7 +778,7 @@ LL | #[crate_name] |
| 775 | 778 | | ^^^^^^^^^^^^^ |
| 776 | 779 | | |
| 777 | 780 | note: this attribute does not have an `!`, which means it is applied to this function |
| 778 | --> $DIR/malformed-attrs.rs:116:1 | |
| 781 | --> $DIR/malformed-attrs.rs:115:1 | |
| 779 | 782 | | |
| 780 | 783 | LL | / fn test() { |
| 781 | 784 | LL | | #[coroutine = 63] || {} |
| ... | ... | @@ -788,12 +791,9 @@ error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, ` |
| 788 | 791 | | |
| 789 | 792 | LL | #[doc] |
| 790 | 793 | | ^^^^^^ |
| 791 | | | |
| 792 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 793 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> | |
| 794 | 794 | |
| 795 | 795 | warning: `#[link_name]` attribute cannot be used on functions |
| 796 | --> $DIR/malformed-attrs.rs:88:1 | |
| 796 | --> $DIR/malformed-attrs.rs:87:1 | |
| 797 | 797 | | |
| 798 | 798 | LL | #[link_name] |
| 799 | 799 | | ^^^^^^^^^^^^ |
| ... | ... | @@ -802,7 +802,7 @@ LL | #[link_name] |
| 802 | 802 | = help: `#[link_name]` can be applied to foreign functions and foreign statics |
| 803 | 803 | |
| 804 | 804 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 805 | --> $DIR/malformed-attrs.rs:98:1 | |
| 805 | --> $DIR/malformed-attrs.rs:97:1 | |
| 806 | 806 | | |
| 807 | 807 | LL | #[ignore()] |
| 808 | 808 | | ^^^^^^^^^^^ |
| ... | ... | @@ -811,7 +811,7 @@ LL | #[ignore()] |
| 811 | 811 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> |
| 812 | 812 | |
| 813 | 813 | warning: `#[no_implicit_prelude]` attribute cannot be used on functions |
| 814 | --> $DIR/malformed-attrs.rs:101:1 | |
| 814 | --> $DIR/malformed-attrs.rs:100:1 | |
| 815 | 815 | | |
| 816 | 816 | LL | #[no_implicit_prelude = 23] |
| 817 | 817 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -820,13 +820,13 @@ LL | #[no_implicit_prelude = 23] |
| 820 | 820 | = help: `#[no_implicit_prelude]` can be applied to crates and modules |
| 821 | 821 | |
| 822 | 822 | warning: `#[diagnostic::do_not_recommend]` does not expect any arguments |
| 823 | --> $DIR/malformed-attrs.rs:155:1 | |
| 823 | --> $DIR/malformed-attrs.rs:154:1 | |
| 824 | 824 | | |
| 825 | 825 | LL | #[diagnostic::do_not_recommend()] |
| 826 | 826 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 827 | 827 | |
| 828 | 828 | warning: `#[automatically_derived]` attribute cannot be used on modules |
| 829 | --> $DIR/malformed-attrs.rs:196:1 | |
| 829 | --> $DIR/malformed-attrs.rs:195:1 | |
| 830 | 830 | | |
| 831 | 831 | LL | #[automatically_derived = 18] |
| 832 | 832 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -835,7 +835,7 @@ LL | #[automatically_derived = 18] |
| 835 | 835 | = help: `#[automatically_derived]` can only be applied to trait impl blocks |
| 836 | 836 | |
| 837 | 837 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 838 | --> $DIR/malformed-attrs.rs:230:1 | |
| 838 | --> $DIR/malformed-attrs.rs:229:1 | |
| 839 | 839 | | |
| 840 | 840 | LL | #[ignore = 1] |
| 841 | 841 | | ^^^^^^^^^^^^^ |
| ... | ... | @@ -844,7 +844,7 @@ LL | #[ignore = 1] |
| 844 | 844 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> |
| 845 | 845 | |
| 846 | 846 | error[E0308]: mismatched types |
| 847 | --> $DIR/malformed-attrs.rs:117:23 | |
| 847 | --> $DIR/malformed-attrs.rs:116:23 | |
| 848 | 848 | | |
| 849 | 849 | LL | fn test() { |
| 850 | 850 | | - help: a return type might be missing here: `-> _` |
| ... | ... | @@ -852,24 +852,13 @@ LL | #[coroutine = 63] || {} |
| 852 | 852 | | ^^^^^ expected `()`, found coroutine |
| 853 | 853 | | |
| 854 | 854 | = note: expected unit type `()` |
| 855 | found coroutine `{coroutine@$DIR/malformed-attrs.rs:117:23: 117:25}` | |
| 855 | found coroutine `{coroutine@$DIR/malformed-attrs.rs:116:23: 116:25}` | |
| 856 | 856 | |
| 857 | 857 | error: aborting due to 76 previous errors; 8 warnings emitted |
| 858 | 858 | |
| 859 | 859 | Some errors have detailed explanations: E0308, E0463, E0539, E0565, E0658, E0805. |
| 860 | 860 | For more information about an error, try `rustc --explain E0308`. |
| 861 | 861 | Future incompatibility report: Future breakage diagnostic: |
| 862 | error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, `#[doc(attribute)]`, `#[doc(auto_cfg)]`, `#[doc(cfg)]`, `#[doc(fake_variadic)]`, `#[doc(hidden)]`, `#[doc(html_favicon_url)]`, `#[doc(html_logo_url)]`, `#[doc(html_no_source)]`, `#[doc(html_playground_url)]`, `#[doc(html_root_url)]`, `#[doc(include)]`, `#[doc(inline)]`, `#[doc(issue_tracker_base_url)]`, `#[doc(keyword)]`, `#[doc(masked)]`, `#[doc(no_default_passes)]`, `#[doc(no_inline)]`, `#[doc(notable_trait)]`, `#[doc(passes)]`, `#[doc(plugins)]`, `#[doc(rust_logo)]`, `#[doc(search_unbox)]`, `#[doc(spotlight)]`, and `#[doc(test)]` | |
| 863 | --> $DIR/malformed-attrs.rs:41:1 | |
| 864 | | | |
| 865 | LL | #[doc] | |
| 866 | | ^^^^^^ | |
| 867 | | | |
| 868 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 869 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> | |
| 870 | = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default | |
| 871 | ||
| 872 | Future breakage diagnostic: | |
| 873 | 862 | error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]` |
| 874 | 863 | --> $DIR/malformed-attrs.rs:52:1 |
| 875 | 864 | | |
| ... | ... | @@ -880,20 +869,9 @@ LL | #[inline = 5] |
| 880 | 869 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> |
| 881 | 870 | = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default |
| 882 | 871 | |
| 883 | Future breakage diagnostic: | |
| 884 | error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, `#[doc(attribute)]`, `#[doc(auto_cfg)]`, `#[doc(cfg)]`, `#[doc(fake_variadic)]`, `#[doc(hidden)]`, `#[doc(html_favicon_url)]`, `#[doc(html_logo_url)]`, `#[doc(html_no_source)]`, `#[doc(html_playground_url)]`, `#[doc(html_root_url)]`, `#[doc(include)]`, `#[doc(inline)]`, `#[doc(issue_tracker_base_url)]`, `#[doc(keyword)]`, `#[doc(masked)]`, `#[doc(no_default_passes)]`, `#[doc(no_inline)]`, `#[doc(notable_trait)]`, `#[doc(passes)]`, `#[doc(plugins)]`, `#[doc(rust_logo)]`, `#[doc(search_unbox)]`, `#[doc(spotlight)]`, and `#[doc(test)]` | |
| 885 | --> $DIR/malformed-attrs.rs:77:1 | |
| 886 | | | |
| 887 | LL | #[doc] | |
| 888 | | ^^^^^^ | |
| 889 | | | |
| 890 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 891 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> | |
| 892 | = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default | |
| 893 | ||
| 894 | 872 | Future breakage diagnostic: |
| 895 | 873 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 896 | --> $DIR/malformed-attrs.rs:98:1 | |
| 874 | --> $DIR/malformed-attrs.rs:97:1 | |
| 897 | 875 | | |
| 898 | 876 | LL | #[ignore()] |
| 899 | 877 | | ^^^^^^^^^^^ |
| ... | ... | @@ -904,7 +882,7 @@ LL | #[ignore()] |
| 904 | 882 | |
| 905 | 883 | Future breakage diagnostic: |
| 906 | 884 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 907 | --> $DIR/malformed-attrs.rs:230:1 | |
| 885 | --> $DIR/malformed-attrs.rs:229:1 | |
| 908 | 886 | | |
| 909 | 887 | LL | #[ignore = 1] |
| 910 | 888 | | ^^^^^^^^^^^^^ |
tests/ui/check-cfg/values-target-json.rs+2-1| ... | ... | @@ -4,7 +4,8 @@ |
| 4 | 4 | //@ check-pass |
| 5 | 5 | //@ no-auto-check-cfg |
| 6 | 6 | //@ needs-llvm-components: x86 |
| 7 | //@ compile-flags: --crate-type=lib --check-cfg=cfg() --target={{src-base}}/check-cfg/my-awesome-platform.json | |
| 7 | //@ compile-flags: --crate-type=lib --check-cfg=cfg() | |
| 8 | //@ compile-flags: -Zunstable-options --target={{src-base}}/check-cfg/my-awesome-platform.json | |
| 8 | 9 | //@ ignore-backends: gcc |
| 9 | 10 | |
| 10 | 11 | #![feature(lang_items, no_core, auto_traits, rustc_attrs)] |
tests/ui/feature-gates/feature-gate-link-arg-attribute.in_flag.stderr+1-1| ... | ... | @@ -1,2 +1,2 @@ |
| 1 | error: unknown linking modifier `link-arg`, expected one of: bundle, verbatim, whole-archive, as-needed | |
| 1 | error: unknown linking modifier `link-arg`, expected one of: bundle, verbatim, whole-archive, as-needed, export-symbols | |
| 2 | 2 |
tests/ui/feature-gates/removed-features-note-version-and-pr-issue-141619.rs+1| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![feature(external_doc)] //~ ERROR feature has been removed |
| 2 | 3 | #![doc(include("README.md"))] //~ ERROR unknown `doc` attribute `include` |
| 3 | 4 |
tests/ui/feature-gates/removed-features-note-version-and-pr-issue-141619.stderr+7-3| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error[E0557]: feature has been removed |
| 2 | --> $DIR/removed-features-note-version-and-pr-issue-141619.rs:1:12 | |
| 2 | --> $DIR/removed-features-note-version-and-pr-issue-141619.rs:2:12 | |
| 3 | 3 | | |
| 4 | 4 | LL | #![feature(external_doc)] |
| 5 | 5 | | ^^^^^^^^^^^^ feature has been removed |
| ... | ... | @@ -8,12 +8,16 @@ LL | #![feature(external_doc)] |
| 8 | 8 | = note: use #[doc = include_str!("filename")] instead, which handles macro invocations |
| 9 | 9 | |
| 10 | 10 | error: unknown `doc` attribute `include` |
| 11 | --> $DIR/removed-features-note-version-and-pr-issue-141619.rs:2:8 | |
| 11 | --> $DIR/removed-features-note-version-and-pr-issue-141619.rs:3:8 | |
| 12 | 12 | | |
| 13 | 13 | LL | #![doc(include("README.md"))] |
| 14 | 14 | | ^^^^^^^ |
| 15 | 15 | | |
| 16 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 16 | note: the lint level is defined here | |
| 17 | --> $DIR/removed-features-note-version-and-pr-issue-141619.rs:1:9 | |
| 18 | | | |
| 19 | LL | #![deny(invalid_doc_attributes)] | |
| 20 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 17 | 21 | |
| 18 | 22 | error: aborting due to 2 previous errors |
| 19 | 23 |
tests/ui/link-native-libs/link-arg-error2.rs created+5| ... | ... | @@ -0,0 +1,5 @@ |
| 1 | //@ compile-flags: -l link-arg:+export-symbols=arg -Z unstable-options | |
| 2 | ||
| 3 | fn main() {} | |
| 4 | ||
| 5 | //~? ERROR linking modifier `export-symbols` is only compatible with `static` linking kind |
tests/ui/link-native-libs/link-arg-error2.stderr created+2| ... | ... | @@ -0,0 +1,2 @@ |
| 1 | error: linking modifier `export-symbols` is only compatible with `static` linking kind | |
| 2 |
tests/ui/link-native-libs/link-arg-from-rs2.rs created+7| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | #![feature(link_arg_attribute)] | |
| 2 | ||
| 3 | #[link(kind = "link-arg", name = "arg", modifiers = "+export-symbols")] | |
| 4 | //~^ ERROR linking modifier `export-symbols` is only compatible with `static` linking kind | |
| 5 | extern "C" {} | |
| 6 | ||
| 7 | pub fn main() {} |
tests/ui/link-native-libs/link-arg-from-rs2.stderr created+8| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | error: linking modifier `export-symbols` is only compatible with `static` linking kind | |
| 2 | --> $DIR/link-arg-from-rs2.rs:3:53 | |
| 3 | | | |
| 4 | LL | #[link(kind = "link-arg", name = "arg", modifiers = "+export-symbols")] | |
| 5 | | ^^^^^^^^^^^^^^^^^ | |
| 6 | ||
| 7 | error: aborting due to 1 previous error | |
| 8 |
tests/ui/link-native-libs/link-attr-validation-late.stderr+3-3| ... | ... | @@ -178,13 +178,13 @@ LL | #[link(name = "...", wasm_import_module())] |
| 178 | 178 | | |
| 179 | 179 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute> |
| 180 | 180 | |
| 181 | error: invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed | |
| 181 | error: invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed, export-symbols | |
| 182 | 182 | --> $DIR/link-attr-validation-late.rs:31:34 |
| 183 | 183 | | |
| 184 | 184 | LL | #[link(name = "...", modifiers = "")] |
| 185 | 185 | | ^^ |
| 186 | 186 | |
| 187 | error: invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed | |
| 187 | error: invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed, export-symbols | |
| 188 | 188 | --> $DIR/link-attr-validation-late.rs:32:34 |
| 189 | 189 | | |
| 190 | 190 | LL | #[link(name = "...", modifiers = "no-plus-minus")] |
| ... | ... | @@ -196,7 +196,7 @@ error[E0539]: malformed `link` attribute input |
| 196 | 196 | LL | #[link(name = "...", modifiers = "+unknown")] |
| 197 | 197 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------^^ |
| 198 | 198 | | | |
| 199 | | valid arguments are "bundle", "verbatim", "whole-archive" or "as-needed" | |
| 199 | | valid arguments are "bundle", "export-symbols", "verbatim", "whole-archive" or "as-needed" | |
| 200 | 200 | | |
| 201 | 201 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute> |
| 202 | 202 |
tests/ui/link-native-libs/modifiers-bad.blank.stderr+1-1| ... | ... | @@ -1,2 +1,2 @@ |
| 1 | error: invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed | |
| 1 | error: invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed, export-symbols | |
| 2 | 2 |
tests/ui/link-native-libs/modifiers-bad.no-prefix.stderr+1-1| ... | ... | @@ -1,2 +1,2 @@ |
| 1 | error: invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed | |
| 1 | error: invalid linking modifier syntax, expected '+' or '-' prefix before one of: bundle, verbatim, whole-archive, as-needed, export-symbols | |
| 2 | 2 |
tests/ui/link-native-libs/modifiers-bad.prefix-only.stderr+1-1| ... | ... | @@ -1,2 +1,2 @@ |
| 1 | error: unknown linking modifier ``, expected one of: bundle, verbatim, whole-archive, as-needed | |
| 1 | error: unknown linking modifier ``, expected one of: bundle, verbatim, whole-archive, as-needed, export-symbols | |
| 2 | 2 |
tests/ui/link-native-libs/modifiers-bad.unknown.stderr+1-1| ... | ... | @@ -1,2 +1,2 @@ |
| 1 | error: unknown linking modifier `ferris`, expected one of: bundle, verbatim, whole-archive, as-needed | |
| 1 | error: unknown linking modifier `ferris`, expected one of: bundle, verbatim, whole-archive, as-needed, export-symbols | |
| 2 | 2 |
tests/ui/malformed/malformed-regressions.rs+2-1| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 2 | ||
| 1 | 3 | #[doc] //~ ERROR valid forms for the attribute are |
| 2 | //~^ WARN this was previously accepted | |
| 3 | 4 | #[ignore()] //~ ERROR valid forms for the attribute are |
| 4 | 5 | //~^ WARN this was previously accepted |
| 5 | 6 | #[inline = ""] //~ ERROR valid forms for the attribute are |
tests/ui/malformed/malformed-regressions.stderr+14-22| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error[E0539]: malformed `link` attribute input |
| 2 | --> $DIR/malformed-regressions.rs:7:1 | |
| 2 | --> $DIR/malformed-regressions.rs:8:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[link] |
| 5 | 5 | | ^^^^^^^ expected this to be a list |
| ... | ... | @@ -7,7 +7,7 @@ LL | #[link] |
| 7 | 7 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute> |
| 8 | 8 | |
| 9 | 9 | error[E0539]: malformed `link` attribute input |
| 10 | --> $DIR/malformed-regressions.rs:10:1 | |
| 10 | --> $DIR/malformed-regressions.rs:11:1 | |
| 11 | 11 | | |
| 12 | 12 | LL | #[link = ""] |
| 13 | 13 | | ^^^^^^^----^ |
| ... | ... | @@ -17,7 +17,7 @@ LL | #[link = ""] |
| 17 | 17 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute> |
| 18 | 18 | |
| 19 | 19 | warning: attribute should be applied to an `extern` block with non-Rust ABI |
| 20 | --> $DIR/malformed-regressions.rs:7:1 | |
| 20 | --> $DIR/malformed-regressions.rs:8:1 | |
| 21 | 21 | | |
| 22 | 22 | LL | #[link] |
| 23 | 23 | | ^^^^^^^ |
| ... | ... | @@ -29,26 +29,29 @@ LL | fn main() {} |
| 29 | 29 | = note: requested on the command line with `-W unused-attributes` |
| 30 | 30 | |
| 31 | 31 | error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, `#[doc(attribute)]`, `#[doc(auto_cfg)]`, `#[doc(cfg)]`, `#[doc(fake_variadic)]`, `#[doc(hidden)]`, `#[doc(html_favicon_url)]`, `#[doc(html_logo_url)]`, `#[doc(html_no_source)]`, `#[doc(html_playground_url)]`, `#[doc(html_root_url)]`, `#[doc(include)]`, `#[doc(inline)]`, `#[doc(issue_tracker_base_url)]`, `#[doc(keyword)]`, `#[doc(masked)]`, `#[doc(no_default_passes)]`, `#[doc(no_inline)]`, `#[doc(notable_trait)]`, `#[doc(passes)]`, `#[doc(plugins)]`, `#[doc(rust_logo)]`, `#[doc(search_unbox)]`, `#[doc(spotlight)]`, and `#[doc(test)]` |
| 32 | --> $DIR/malformed-regressions.rs:1:1 | |
| 32 | --> $DIR/malformed-regressions.rs:3:1 | |
| 33 | 33 | | |
| 34 | 34 | LL | #[doc] |
| 35 | 35 | | ^^^^^^ |
| 36 | 36 | | |
| 37 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 38 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> | |
| 39 | = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default | |
| 37 | note: the lint level is defined here | |
| 38 | --> $DIR/malformed-regressions.rs:1:9 | |
| 39 | | | |
| 40 | LL | #![deny(invalid_doc_attributes)] | |
| 41 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 40 | 42 | |
| 41 | 43 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 42 | --> $DIR/malformed-regressions.rs:3:1 | |
| 44 | --> $DIR/malformed-regressions.rs:4:1 | |
| 43 | 45 | | |
| 44 | 46 | LL | #[ignore()] |
| 45 | 47 | | ^^^^^^^^^^^ |
| 46 | 48 | | |
| 47 | 49 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 48 | 50 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> |
| 51 | = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default | |
| 49 | 52 | |
| 50 | 53 | error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]` |
| 51 | --> $DIR/malformed-regressions.rs:5:1 | |
| 54 | --> $DIR/malformed-regressions.rs:6:1 | |
| 52 | 55 | | |
| 53 | 56 | LL | #[inline = ""] |
| 54 | 57 | | ^^^^^^^^^^^^^^ |
| ... | ... | @@ -60,19 +63,8 @@ error: aborting due to 5 previous errors; 1 warning emitted |
| 60 | 63 | |
| 61 | 64 | For more information about this error, try `rustc --explain E0539`. |
| 62 | 65 | Future incompatibility report: Future breakage diagnostic: |
| 63 | error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, `#[doc(attribute)]`, `#[doc(auto_cfg)]`, `#[doc(cfg)]`, `#[doc(fake_variadic)]`, `#[doc(hidden)]`, `#[doc(html_favicon_url)]`, `#[doc(html_logo_url)]`, `#[doc(html_no_source)]`, `#[doc(html_playground_url)]`, `#[doc(html_root_url)]`, `#[doc(include)]`, `#[doc(inline)]`, `#[doc(issue_tracker_base_url)]`, `#[doc(keyword)]`, `#[doc(masked)]`, `#[doc(no_default_passes)]`, `#[doc(no_inline)]`, `#[doc(notable_trait)]`, `#[doc(passes)]`, `#[doc(plugins)]`, `#[doc(rust_logo)]`, `#[doc(search_unbox)]`, `#[doc(spotlight)]`, and `#[doc(test)]` | |
| 64 | --> $DIR/malformed-regressions.rs:1:1 | |
| 65 | | | |
| 66 | LL | #[doc] | |
| 67 | | ^^^^^^ | |
| 68 | | | |
| 69 | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | |
| 70 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> | |
| 71 | = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default | |
| 72 | ||
| 73 | Future breakage diagnostic: | |
| 74 | 66 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 75 | --> $DIR/malformed-regressions.rs:3:1 | |
| 67 | --> $DIR/malformed-regressions.rs:4:1 | |
| 76 | 68 | | |
| 77 | 69 | LL | #[ignore()] |
| 78 | 70 | | ^^^^^^^^^^^ |
| ... | ... | @@ -83,7 +75,7 @@ LL | #[ignore()] |
| 83 | 75 | |
| 84 | 76 | Future breakage diagnostic: |
| 85 | 77 | error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]` |
| 86 | --> $DIR/malformed-regressions.rs:5:1 | |
| 78 | --> $DIR/malformed-regressions.rs:6:1 | |
| 87 | 79 | | |
| 88 | 80 | LL | #[inline = ""] |
| 89 | 81 | | ^^^^^^^^^^^^^^ |
tests/ui/malformed/malformed-special-attrs.rs+2| ... | ... | @@ -1,3 +1,5 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 2 | ||
| 1 | 3 | #[cfg_attr] //~ ERROR malformed `cfg_attr` attribute |
| 2 | 4 | struct S1; |
| 3 | 5 |
tests/ui/malformed/malformed-special-attrs.stderr+4-4| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error[E0539]: malformed `cfg_attr` attribute input |
| 2 | --> $DIR/malformed-special-attrs.rs:1:1 | |
| 2 | --> $DIR/malformed-special-attrs.rs:3:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[cfg_attr] |
| 5 | 5 | | ^^^^^^^^^^^ |
| ... | ... | @@ -10,7 +10,7 @@ LL | #[cfg_attr] |
| 10 | 10 | = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> |
| 11 | 11 | |
| 12 | 12 | error[E0539]: malformed `cfg_attr` attribute input |
| 13 | --> $DIR/malformed-special-attrs.rs:4:1 | |
| 13 | --> $DIR/malformed-special-attrs.rs:6:1 | |
| 14 | 14 | | |
| 15 | 15 | LL | #[cfg_attr = ""] |
| 16 | 16 | | ^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -21,13 +21,13 @@ LL | #[cfg_attr = ""] |
| 21 | 21 | = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> |
| 22 | 22 | |
| 23 | 23 | error: malformed `derive` attribute input |
| 24 | --> $DIR/malformed-special-attrs.rs:7:1 | |
| 24 | --> $DIR/malformed-special-attrs.rs:9:1 | |
| 25 | 25 | | |
| 26 | 26 | LL | #[derive] |
| 27 | 27 | | ^^^^^^^^^ help: must be of the form: `#[derive(Trait1, Trait2, ...)]` |
| 28 | 28 | |
| 29 | 29 | error: malformed `derive` attribute input |
| 30 | --> $DIR/malformed-special-attrs.rs:10:1 | |
| 30 | --> $DIR/malformed-special-attrs.rs:12:1 | |
| 31 | 31 | | |
| 32 | 32 | LL | #[derive = ""] |
| 33 | 33 | | ^^^^^^^^^^^^^^ help: must be of the form: `#[derive(Trait1, Trait2, ...)]` |
tests/ui/repr/invalid_repr_list_help.rs+1| ... | ... | @@ -1,3 +1,4 @@ |
| 1 | #![deny(invalid_doc_attributes)] | |
| 1 | 2 | #![crate_type = "lib"] |
| 2 | 3 | |
| 3 | 4 | #[repr(uwu)] //~ERROR: unrecognized representation hint |
tests/ui/repr/invalid_repr_list_help.stderr+11-7| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error[E0552]: unrecognized representation hint |
| 2 | --> $DIR/invalid_repr_list_help.rs:3:8 | |
| 2 | --> $DIR/invalid_repr_list_help.rs:4:8 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[repr(uwu)] |
| 5 | 5 | | ^^^ |
| ... | ... | @@ -8,7 +8,7 @@ LL | #[repr(uwu)] |
| 8 | 8 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> |
| 9 | 9 | |
| 10 | 10 | error[E0552]: unrecognized representation hint |
| 11 | --> $DIR/invalid_repr_list_help.rs:6:8 | |
| 11 | --> $DIR/invalid_repr_list_help.rs:7:8 | |
| 12 | 12 | | |
| 13 | 13 | LL | #[repr(uwu = "a")] |
| 14 | 14 | | ^^^^^^^^^ |
| ... | ... | @@ -17,7 +17,7 @@ LL | #[repr(uwu = "a")] |
| 17 | 17 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> |
| 18 | 18 | |
| 19 | 19 | error[E0552]: unrecognized representation hint |
| 20 | --> $DIR/invalid_repr_list_help.rs:9:8 | |
| 20 | --> $DIR/invalid_repr_list_help.rs:10:8 | |
| 21 | 21 | | |
| 22 | 22 | LL | #[repr(uwu(4))] |
| 23 | 23 | | ^^^^^^ |
| ... | ... | @@ -26,7 +26,7 @@ LL | #[repr(uwu(4))] |
| 26 | 26 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> |
| 27 | 27 | |
| 28 | 28 | error[E0552]: unrecognized representation hint |
| 29 | --> $DIR/invalid_repr_list_help.rs:14:8 | |
| 29 | --> $DIR/invalid_repr_list_help.rs:15:8 | |
| 30 | 30 | | |
| 31 | 31 | LL | #[repr(uwu, u8)] |
| 32 | 32 | | ^^^ |
| ... | ... | @@ -35,7 +35,7 @@ LL | #[repr(uwu, u8)] |
| 35 | 35 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> |
| 36 | 36 | |
| 37 | 37 | error[E0552]: unrecognized representation hint |
| 38 | --> $DIR/invalid_repr_list_help.rs:19:8 | |
| 38 | --> $DIR/invalid_repr_list_help.rs:20:8 | |
| 39 | 39 | | |
| 40 | 40 | LL | #[repr(uwu)] |
| 41 | 41 | | ^^^ |
| ... | ... | @@ -44,12 +44,16 @@ LL | #[repr(uwu)] |
| 44 | 44 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html?highlight=repr#representations> |
| 45 | 45 | |
| 46 | 46 | error: unknown `doc` attribute `owo` |
| 47 | --> $DIR/invalid_repr_list_help.rs:20:7 | |
| 47 | --> $DIR/invalid_repr_list_help.rs:21:7 | |
| 48 | 48 | | |
| 49 | 49 | LL | #[doc(owo)] |
| 50 | 50 | | ^^^ |
| 51 | 51 | | |
| 52 | = note: `#[deny(invalid_doc_attributes)]` on by default | |
| 52 | note: the lint level is defined here | |
| 53 | --> $DIR/invalid_repr_list_help.rs:1:9 | |
| 54 | | | |
| 55 | LL | #![deny(invalid_doc_attributes)] | |
| 56 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
| 53 | 57 | |
| 54 | 58 | error: aborting due to 6 previous errors |
| 55 | 59 |