mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Use rustc_fluent_macro::fluent_messages!
directly.
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
This commit is contained in:
parent
1a4219da43
commit
57cd5e6551
@ -56,7 +56,6 @@ use rustc_data_structures::sorted_map::SortedMap;
|
||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_errors::{DiagnosticArgFromDisplay, Handler, StashKey};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res};
|
||||
use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID, LOCAL_CRATE};
|
||||
@ -92,7 +91,7 @@ mod lifetime_collector;
|
||||
mod pat;
|
||||
mod path;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
struct LoweringContext<'a, 'hir> {
|
||||
tcx: TyCtxt<'hir>,
|
||||
|
@ -15,12 +15,10 @@
|
||||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
pub mod ast_validation;
|
||||
mod errors;
|
||||
pub mod feature_gate;
|
||||
pub mod node_count;
|
||||
pub mod show_span;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -14,8 +14,6 @@
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
mod builtin;
|
||||
mod session_diagnostics;
|
||||
|
||||
@ -28,4 +26,4 @@ pub use rustc_ast::attr::*;
|
||||
|
||||
pub(crate) use rustc_session::HashStableContext;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -23,7 +23,6 @@ extern crate tracing;
|
||||
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
|
||||
use rustc_data_structures::graph::dominators::Dominators;
|
||||
use rustc_errors::{Diagnostic, DiagnosticBuilder};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def_id::LocalDefId;
|
||||
use rustc_index::bit_set::{BitSet, ChunkedBitSet};
|
||||
@ -98,7 +97,7 @@ use places_conflict::{places_conflict, PlaceConflictBias};
|
||||
use region_infer::RegionInferenceContext;
|
||||
use renumber::RegionCtxt;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
// FIXME(eddyb) perhaps move this somewhere more centrally.
|
||||
#[derive(Debug)]
|
||||
|
@ -25,7 +25,6 @@ use crate::deriving::*;
|
||||
|
||||
use rustc_expand::base::{MacroExpanderFn, ResolverExpand, SyntaxExtensionKind};
|
||||
use rustc_expand::proc_macro::BangProcMacro;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_span::symbol::sym;
|
||||
|
||||
mod alloc_error_handler;
|
||||
@ -58,7 +57,7 @@ pub mod proc_macro_harness;
|
||||
pub mod standard_library_imports;
|
||||
pub mod test_harness;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
|
||||
let mut register = |name, kind| resolver.register_builtin_macro(name, kind);
|
||||
|
@ -102,7 +102,6 @@ use rustc_data_structures::fx::FxIndexMap;
|
||||
use rustc_data_structures::sync::IntoDynSyncSend;
|
||||
use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, ThinBufferMethods, WriteBackendMethods};
|
||||
use rustc_errors::{ErrorGuaranteed, Handler};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_metadata::EncodedMetadata;
|
||||
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
|
||||
use rustc_middle::util::Providers;
|
||||
@ -116,7 +115,7 @@ use tempfile::TempDir;
|
||||
use crate::back::lto::ModuleBuffer;
|
||||
use crate::gcc_util::target_cpu;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub struct PrintOnPanic<F: Fn() -> String>(pub F);
|
||||
|
||||
|
@ -41,7 +41,6 @@ use rustc_codegen_ssa::ModuleCodegen;
|
||||
use rustc_codegen_ssa::{CodegenResults, CompiledModule};
|
||||
use rustc_data_structures::fx::FxIndexMap;
|
||||
use rustc_errors::{ErrorGuaranteed, FatalError, Handler};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_metadata::EncodedMetadata;
|
||||
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
@ -92,7 +91,7 @@ mod type_of;
|
||||
mod va_arg;
|
||||
mod value;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct LlvmCodegenBackend(());
|
||||
|
@ -27,7 +27,6 @@ extern crate rustc_middle;
|
||||
use rustc_ast as ast;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir::def_id::CrateNum;
|
||||
use rustc_middle::dep_graph::WorkProduct;
|
||||
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
|
||||
@ -59,7 +58,7 @@ pub mod mono_item;
|
||||
pub mod target_features;
|
||||
pub mod traits;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub struct ModuleCodegen<M> {
|
||||
/// The name of the module. When the crate may be saved between
|
||||
|
@ -39,10 +39,9 @@ pub mod util;
|
||||
|
||||
pub use errors::ReportErrorExt;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_middle::{ty, util::Providers};
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
const_eval::provide(providers);
|
||||
|
@ -30,7 +30,6 @@ use rustc_errors::registry::{InvalidErrorCode, Registry};
|
||||
use rustc_errors::{markdown, ColorConfig};
|
||||
use rustc_errors::{ErrorGuaranteed, Handler, PResult};
|
||||
use rustc_feature::find_gated_cfg;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_interface::util::{self, collect_crate_types, get_codegen_backend};
|
||||
use rustc_interface::{interface, Queries};
|
||||
use rustc_lint::unerased_lint_store;
|
||||
@ -102,7 +101,7 @@ use crate::session_diagnostics::{
|
||||
RLinkWrongFileType, RlinkNotAFile, RlinkUnableToRead,
|
||||
};
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
|
||||
// tidy-alphabetical-start
|
||||
|
@ -41,7 +41,6 @@ pub use rustc_error_messages::{
|
||||
fallback_fluent_bundle, fluent_bundle, DelayDm, DiagnosticMessage, FluentBundle,
|
||||
LanguageIdentifier, LazyFallbackBundle, MultiSpan, SpanLabel, SubdiagnosticMessage,
|
||||
};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
pub use rustc_lint_defs::{pluralize, Applicability};
|
||||
use rustc_span::source_map::SourceMap;
|
||||
pub use rustc_span::ErrorGuaranteed;
|
||||
@ -82,7 +81,7 @@ pub use snippet::Style;
|
||||
pub type PErr<'a> = DiagnosticBuilder<'a, ErrorGuaranteed>;
|
||||
pub type PResult<'a, T> = Result<T, PErr<'a>>;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger.
|
||||
// (See also the comment on `DiagnosticBuilderInner`'s `diagnostic` field.)
|
||||
|
@ -23,8 +23,6 @@ extern crate tracing;
|
||||
|
||||
extern crate proc_macro as pm;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
mod placeholders;
|
||||
mod proc_macro_server;
|
||||
|
||||
@ -66,4 +64,4 @@ mod mut_visit {
|
||||
mod tests;
|
||||
}
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -99,7 +99,6 @@ pub mod structured_errors;
|
||||
mod variance;
|
||||
|
||||
use rustc_errors::ErrorGuaranteed;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir as hir;
|
||||
use rustc_middle::middle;
|
||||
use rustc_middle::query::Providers;
|
||||
@ -114,7 +113,7 @@ use astconv::{AstConv, OnlySelfBounds};
|
||||
use bounds::Bounds;
|
||||
use rustc_hir::def::DefKind;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
fn require_c_abi_if_c_variadic(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: Abi, span: Span) {
|
||||
const CONVENTIONS_UNSTABLE: &str = "`C`, `cdecl`, `aapcs`, `win64`, `sysv64` or `efiapi`";
|
||||
|
@ -53,7 +53,6 @@ use crate::fn_ctxt::RawTy;
|
||||
use crate::gather_locals::GatherLocalsVisitor;
|
||||
use rustc_data_structures::unord::UnordSet;
|
||||
use rustc_errors::{struct_span_err, DiagnosticId, ErrorGuaranteed, MultiSpan};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def::{DefKind, Res};
|
||||
use rustc_hir::intravisit::Visitor;
|
||||
@ -68,7 +67,7 @@ use rustc_session::config;
|
||||
use rustc_span::def_id::{DefId, LocalDefId};
|
||||
use rustc_span::Span;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! type_error_struct {
|
||||
|
@ -28,6 +28,4 @@ pub use persist::save_work_product_index;
|
||||
pub use persist::setup_dep_graph;
|
||||
pub use persist::LoadResult;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -37,10 +37,8 @@ extern crate tracing;
|
||||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
mod errors;
|
||||
pub mod infer;
|
||||
pub mod traits;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -13,8 +13,6 @@
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
mod callbacks;
|
||||
mod errors;
|
||||
pub mod interface;
|
||||
@ -31,4 +29,4 @@ pub use queries::Queries;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -90,7 +90,6 @@ mod unused;
|
||||
|
||||
pub use array_into_iter::ARRAY_INTO_ITER;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir::def_id::LocalModDefId;
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::ty::TyCtxt;
|
||||
@ -137,7 +136,7 @@ pub use rustc_session::lint::Level::{self, *};
|
||||
pub use rustc_session::lint::{BufferedEarlyLint, FutureIncompatibleInfo, Lint, LintId};
|
||||
pub use rustc_session::lint::{LintPass, LintVec};
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
levels::provide(providers);
|
||||
|
@ -31,7 +31,6 @@ extern crate rustc_middle;
|
||||
extern crate tracing;
|
||||
|
||||
pub use rmeta::provide;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
mod dependency_format;
|
||||
mod foreign_modules;
|
||||
@ -47,4 +46,4 @@ pub use fs::{emit_wrapper_file, METADATA_FILENAME};
|
||||
pub use native_libs::find_native_static_library;
|
||||
pub use rmeta::{encode_metadata, rendered_const, EncodedMetadata, METADATA_HEADER};
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -77,8 +77,6 @@ extern crate tracing;
|
||||
#[macro_use]
|
||||
extern crate smallvec;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
@ -109,4 +107,4 @@ pub mod dep_graph;
|
||||
// Allows macros to refer to this crate as `::rustc_middle`
|
||||
extern crate self as rustc_middle;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -24,9 +24,7 @@ mod thir;
|
||||
|
||||
use rustc_middle::query::Providers;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
providers.check_match = thir::pattern::check_match;
|
||||
|
@ -13,7 +13,6 @@ extern crate tracing;
|
||||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_middle::ty;
|
||||
|
||||
pub use self::drop_flag_effects::{
|
||||
@ -39,7 +38,7 @@ pub mod storage;
|
||||
pub mod un_derefer;
|
||||
pub mod value_analysis;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub struct MoveDataParamEnv<'tcx> {
|
||||
pub move_data: MoveData<'tcx>,
|
||||
|
@ -118,9 +118,7 @@ use rustc_const_eval::transform::promote_consts;
|
||||
use rustc_const_eval::transform::validate;
|
||||
use rustc_mir_dataflow::rustc_peek;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
check_unsafety::provide(providers);
|
||||
|
@ -10,7 +10,6 @@ extern crate tracing;
|
||||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
use rustc_middle::query::{Providers, TyCtxtAt};
|
||||
use rustc_middle::traits;
|
||||
@ -23,7 +22,7 @@ mod partitioning;
|
||||
mod polymorphize;
|
||||
mod util;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
fn custom_coerce_unsize_info<'tcx>(
|
||||
tcx: TyCtxtAt<'tcx>,
|
||||
|
@ -20,7 +20,6 @@ use rustc_ast::{AttrItem, Attribute, MetaItem};
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_errors::{Diagnostic, FatalError, Level, PResult};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_session::parse::ParseSess;
|
||||
use rustc_span::{FileName, SourceFile, Span};
|
||||
|
||||
@ -36,7 +35,7 @@ pub mod validate_attr;
|
||||
|
||||
mod errors;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
// A bunch of utility functions of the form `parse_<thing>_from_<source>`
|
||||
// where <thing> includes crate, expr, item, stmt, tts, and one that
|
||||
|
@ -23,7 +23,6 @@ extern crate rustc_middle;
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_middle::query::Providers;
|
||||
|
||||
pub mod abi_test;
|
||||
@ -47,7 +46,7 @@ pub mod stability;
|
||||
mod upvars;
|
||||
mod weak_lang_items;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
check_attr::provide(providers);
|
||||
|
@ -19,7 +19,6 @@ use rustc_ast::MacroDef;
|
||||
use rustc_attr as attr;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_data_structures::intern::Interned;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def::{DefKind, Res};
|
||||
use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId, CRATE_DEF_ID};
|
||||
@ -48,7 +47,7 @@ use errors::{
|
||||
UnnamedItemIsPrivate,
|
||||
};
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Generic infrastructure used to implement specific visitors below.
|
||||
|
@ -14,8 +14,6 @@ extern crate rustc_data_structures;
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
pub mod cache;
|
||||
pub mod dep_graph;
|
||||
mod error;
|
||||
@ -28,4 +26,4 @@ pub use error::LayoutOfDepth;
|
||||
pub use error::QueryOverflow;
|
||||
pub use values::Value;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -40,7 +40,6 @@ use rustc_data_structures::sync::{FreezeReadGuard, Lrc};
|
||||
use rustc_errors::{Applicability, DiagnosticBuilder, ErrorGuaranteed};
|
||||
use rustc_expand::base::{DeriveResolutions, SyntaxExtension, SyntaxExtensionKind};
|
||||
use rustc_feature::BUILTIN_ATTRIBUTES;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_hir::def::Namespace::{self, *};
|
||||
use rustc_hir::def::NonMacroAttrKind;
|
||||
use rustc_hir::def::{self, CtorOf, DefKind, DocLinkResMap, LifetimeRes, PartialRes, PerNS};
|
||||
@ -88,7 +87,7 @@ mod late;
|
||||
mod macros;
|
||||
pub mod rustdoc;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
#[derive(Debug)]
|
||||
enum Weak {
|
||||
|
@ -20,8 +20,6 @@ pub mod errors;
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
pub mod utils;
|
||||
pub use lint::{declare_lint, declare_lint_pass, declare_tool_lint, impl_lint_pass};
|
||||
pub use rustc_lint_defs as lint;
|
||||
@ -45,7 +43,7 @@ pub use getopts;
|
||||
mod version;
|
||||
pub use version::RustcVersion;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
/// Requirements for a `StableHashingContext` to be used in this crate.
|
||||
/// This is a hack to allow using the `HashStable_Generic` derive macro
|
||||
|
@ -37,11 +37,9 @@ extern crate rustc_middle;
|
||||
#[macro_use]
|
||||
extern crate smallvec;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
pub mod errors;
|
||||
pub mod infer;
|
||||
pub mod solve;
|
||||
pub mod traits;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
@ -24,7 +24,6 @@ extern crate rustc_middle;
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_middle::query::Providers;
|
||||
|
||||
mod abi;
|
||||
@ -43,7 +42,7 @@ mod sig_types;
|
||||
mod structural_match;
|
||||
mod ty;
|
||||
|
||||
fluent_messages! { "../messages.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
|
||||
|
||||
pub fn provide(providers: &mut Providers) {
|
||||
abi::provide(providers);
|
||||
|
@ -4,7 +4,6 @@
|
||||
#![crate_type = "lib"]
|
||||
extern crate rustc_errors;
|
||||
extern crate rustc_fluent_macro;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
|
||||
/// Copy of the relevant `DiagnosticMessage` variant constructed by `fluent_messages` as it
|
||||
/// expects `crate::DiagnosticMessage` to exist.
|
||||
@ -19,51 +18,37 @@ pub enum SubdiagnosticMessage {
|
||||
}
|
||||
|
||||
mod missing_absolute {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "/definitely_does_not_exist.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "/definitely_does_not_exist.ftl" }
|
||||
//~^ ERROR could not open Fluent resource
|
||||
}
|
||||
|
||||
mod missing_relative {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "../definitely_does_not_exist.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "../definitely_does_not_exist.ftl" }
|
||||
//~^ ERROR could not open Fluent resource
|
||||
}
|
||||
|
||||
mod missing_message {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "./missing-message.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./missing-message.ftl" }
|
||||
//~^ ERROR could not parse Fluent resource
|
||||
}
|
||||
|
||||
mod duplicate {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "./duplicate.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./duplicate.ftl" }
|
||||
//~^ ERROR overrides existing message: `no_crate_a_b_key`
|
||||
}
|
||||
|
||||
mod slug_with_hyphens {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "./slug-with-hyphens.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./slug-with-hyphens.ftl" }
|
||||
//~^ ERROR name `no_crate_this-slug-has-hyphens` contains a '-' character
|
||||
}
|
||||
|
||||
mod label_with_hyphens {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "./label-with-hyphens.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./label-with-hyphens.ftl" }
|
||||
//~^ ERROR attribute `label-has-hyphens` contains a '-' character
|
||||
}
|
||||
|
||||
mod valid {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "./valid.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./valid.ftl" }
|
||||
|
||||
mod test_generated {
|
||||
use super::{fluent_generated::no_crate_key, DEFAULT_LOCALE_RESOURCE};
|
||||
@ -71,9 +56,7 @@ mod valid {
|
||||
}
|
||||
|
||||
mod missing_crate_name {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "./missing-crate-name.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./missing-crate-name.ftl" }
|
||||
//~^ ERROR name `no-crate_foo` contains a '-' character
|
||||
//~| ERROR name `with-hyphens` contains a '-' character
|
||||
//~| ERROR name `with-hyphens` does not start with the crate name
|
||||
@ -87,16 +70,12 @@ mod missing_crate_name {
|
||||
}
|
||||
|
||||
mod missing_message_ref {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "./missing-message-ref.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./missing-message-ref.ftl" }
|
||||
//~^ ERROR referenced message `message` does not exist
|
||||
}
|
||||
|
||||
mod bad_escape {
|
||||
use super::fluent_messages;
|
||||
|
||||
fluent_messages! { "./invalid-escape.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./invalid-escape.ftl" }
|
||||
//~^ ERROR invalid escape `\n`
|
||||
//~| ERROR invalid escape `\"`
|
||||
//~| ERROR invalid escape `\'`
|
||||
|
@ -1,20 +1,20 @@
|
||||
error: could not open Fluent resource: os-specific message
|
||||
--> $DIR/test.rs:24:24
|
||||
--> $DIR/test.rs:21:44
|
||||
|
|
||||
LL | fluent_messages! { "/definitely_does_not_exist.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "/definitely_does_not_exist.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: could not open Fluent resource: os-specific message
|
||||
--> $DIR/test.rs:31:24
|
||||
--> $DIR/test.rs:26:44
|
||||
|
|
||||
LL | fluent_messages! { "../definitely_does_not_exist.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "../definitely_does_not_exist.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: could not parse Fluent resource
|
||||
--> $DIR/test.rs:38:24
|
||||
--> $DIR/test.rs:31:44
|
||||
|
|
||||
LL | fluent_messages! { "./missing-message.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./missing-message.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: see additional errors emitted
|
||||
|
||||
@ -26,80 +26,80 @@ error: expected a message field for "no_crate_missing_message"
|
||||
|
|
||||
|
||||
error: overrides existing message: `no_crate_a_b_key`
|
||||
--> $DIR/test.rs:45:24
|
||||
--> $DIR/test.rs:36:44
|
||||
|
|
||||
LL | fluent_messages! { "./duplicate.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./duplicate.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: name `no_crate_this-slug-has-hyphens` contains a '-' character
|
||||
--> $DIR/test.rs:52:24
|
||||
--> $DIR/test.rs:41:44
|
||||
|
|
||||
LL | fluent_messages! { "./slug-with-hyphens.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./slug-with-hyphens.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: replace any '-'s with '_'s
|
||||
|
||||
error: attribute `label-has-hyphens` contains a '-' character
|
||||
--> $DIR/test.rs:59:24
|
||||
--> $DIR/test.rs:46:44
|
||||
|
|
||||
LL | fluent_messages! { "./label-with-hyphens.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./label-with-hyphens.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: replace any '-'s with '_'s
|
||||
|
||||
error: name `with-hyphens` contains a '-' character
|
||||
--> $DIR/test.rs:76:24
|
||||
--> $DIR/test.rs:59:44
|
||||
|
|
||||
LL | fluent_messages! { "./missing-crate-name.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./missing-crate-name.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: replace any '-'s with '_'s
|
||||
|
||||
error: name `with-hyphens` does not start with the crate name
|
||||
--> $DIR/test.rs:76:24
|
||||
--> $DIR/test.rs:59:44
|
||||
|
|
||||
LL | fluent_messages! { "./missing-crate-name.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./missing-crate-name.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: prepend `no_crate_` to the slug name: `no_crate_with_hyphens`
|
||||
|
||||
error: name `no-crate_foo` contains a '-' character
|
||||
--> $DIR/test.rs:76:24
|
||||
--> $DIR/test.rs:59:44
|
||||
|
|
||||
LL | fluent_messages! { "./missing-crate-name.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./missing-crate-name.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: replace any '-'s with '_'s
|
||||
|
||||
error: referenced message `message` does not exist (in message `no_crate_missing_message_ref`)
|
||||
--> $DIR/test.rs:92:24
|
||||
--> $DIR/test.rs:73:44
|
||||
|
|
||||
LL | fluent_messages! { "./missing-message-ref.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./missing-message-ref.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: you may have meant to use a variable reference (`{$message}`)
|
||||
|
||||
error: invalid escape `\n` in Fluent resource
|
||||
--> $DIR/test.rs:99:24
|
||||
--> $DIR/test.rs:78:44
|
||||
|
|
||||
LL | fluent_messages! { "./invalid-escape.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./invalid-escape.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: Fluent does not interpret these escape sequences (<https://projectfluent.org/fluent/guide/special.html>)
|
||||
|
||||
error: invalid escape `\"` in Fluent resource
|
||||
--> $DIR/test.rs:99:24
|
||||
--> $DIR/test.rs:78:44
|
||||
|
|
||||
LL | fluent_messages! { "./invalid-escape.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./invalid-escape.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: Fluent does not interpret these escape sequences (<https://projectfluent.org/fluent/guide/special.html>)
|
||||
|
||||
error: invalid escape `\'` in Fluent resource
|
||||
--> $DIR/test.rs:99:24
|
||||
--> $DIR/test.rs:78:44
|
||||
|
|
||||
LL | fluent_messages! { "./invalid-escape.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | rustc_fluent_macro::fluent_messages! { "./invalid-escape.ftl" }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: Fluent does not interpret these escape sequences (<https://projectfluent.org/fluent/guide/special.html>)
|
||||
|
||||
|
@ -16,11 +16,10 @@ use rustc_errors::{
|
||||
AddToDiagnostic, Diagnostic, DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed, Handler,
|
||||
IntoDiagnostic, SubdiagnosticMessage,
|
||||
};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_macros::{Diagnostic, Subdiagnostic};
|
||||
use rustc_span::Span;
|
||||
|
||||
fluent_messages! { "./diagnostics.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./diagnostics.ftl" }
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(no_crate_example)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: diagnostics should be created using translatable messages
|
||||
--> $DIR/diagnostics.rs:43:17
|
||||
--> $DIR/diagnostics.rs:42:17
|
||||
|
|
||||
LL | handler.struct_err("untranslatable diagnostic")
|
||||
| ^^^^^^^^^^
|
||||
@ -11,13 +11,13 @@ LL | #![deny(rustc::untranslatable_diagnostic)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: diagnostics should be created using translatable messages
|
||||
--> $DIR/diagnostics.rs:63:14
|
||||
--> $DIR/diagnostics.rs:62:14
|
||||
|
|
||||
LL | diag.note("untranslatable diagnostic");
|
||||
| ^^^^
|
||||
|
||||
error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
|
||||
--> $DIR/diagnostics.rs:80:25
|
||||
--> $DIR/diagnostics.rs:79:25
|
||||
|
|
||||
LL | let _diag = handler.struct_err(crate::fluent_generated::no_crate_example);
|
||||
| ^^^^^^^^^^
|
||||
@ -29,13 +29,13 @@ LL | #![deny(rustc::diagnostic_outside_of_impl)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
|
||||
--> $DIR/diagnostics.rs:83:25
|
||||
--> $DIR/diagnostics.rs:82:25
|
||||
|
|
||||
LL | let _diag = handler.struct_err("untranslatable diagnostic");
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: diagnostics should be created using translatable messages
|
||||
--> $DIR/diagnostics.rs:83:25
|
||||
--> $DIR/diagnostics.rs:82:25
|
||||
|
|
||||
LL | let _diag = handler.struct_err("untranslatable diagnostic");
|
||||
| ^^^^^^^^^^
|
||||
|
@ -20,11 +20,10 @@ extern crate rustc_session;
|
||||
extern crate rustc_span;
|
||||
|
||||
use rustc_errors::{Applicability, DiagnosticMessage, SubdiagnosticMessage};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_macros::{Diagnostic, Subdiagnostic};
|
||||
use rustc_span::Span;
|
||||
|
||||
fluent_messages! { "./example.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./example.ftl" }
|
||||
|
||||
struct NotIntoDiagnosticArg;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0277]: the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
|
||||
--> $DIR/diagnostic-derive-doc-comment-field.rs:37:10
|
||||
--> $DIR/diagnostic-derive-doc-comment-field.rs:36:10
|
||||
|
|
||||
LL | #[derive(Diagnostic)]
|
||||
| ---------- required by a bound introduced by this call
|
||||
@ -13,7 +13,7 @@ note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
|
||||
= note: this error originates in the macro `forward` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0277]: the trait bound `NotIntoDiagnosticArg: IntoDiagnosticArg` is not satisfied
|
||||
--> $DIR/diagnostic-derive-doc-comment-field.rs:47:10
|
||||
--> $DIR/diagnostic-derive-doc-comment-field.rs:46:10
|
||||
|
|
||||
LL | #[derive(Subdiagnostic)]
|
||||
| ------------- required by a bound introduced by this call
|
||||
|
@ -19,7 +19,6 @@ use rustc_span::Span;
|
||||
|
||||
extern crate rustc_fluent_macro;
|
||||
extern crate rustc_macros;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
|
||||
|
||||
extern crate rustc_middle;
|
||||
@ -30,7 +29,7 @@ use rustc_errors::{Applicability, DiagnosticMessage, MultiSpan, SubdiagnosticMes
|
||||
|
||||
extern crate rustc_session;
|
||||
|
||||
fluent_messages! { "./example.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./example.ftl" }
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(no_crate_example, code = "E0123")]
|
||||
|
@ -1,11 +1,11 @@
|
||||
error: unsupported type attribute for diagnostic derive enum
|
||||
--> $DIR/diagnostic-derive.rs:44:1
|
||||
--> $DIR/diagnostic-derive.rs:43:1
|
||||
|
|
||||
LL | #[diag(no_crate_example, code = "E0123")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:47:5
|
||||
--> $DIR/diagnostic-derive.rs:46:5
|
||||
|
|
||||
LL | Foo,
|
||||
| ^^^
|
||||
@ -13,7 +13,7 @@ LL | Foo,
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:49:5
|
||||
--> $DIR/diagnostic-derive.rs:48:5
|
||||
|
|
||||
LL | Bar,
|
||||
| ^^^
|
||||
@ -21,13 +21,13 @@ LL | Bar,
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: `#[nonsense(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:60:1
|
||||
--> $DIR/diagnostic-derive.rs:59:1
|
||||
|
|
||||
LL | #[nonsense(no_crate_example, code = "E0123")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:60:1
|
||||
--> $DIR/diagnostic-derive.rs:59:1
|
||||
|
|
||||
LL | / #[nonsense(no_crate_example, code = "E0123")]
|
||||
LL | |
|
||||
@ -39,7 +39,7 @@ LL | | struct InvalidStructAttr {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:67:1
|
||||
--> $DIR/diagnostic-derive.rs:66:1
|
||||
|
|
||||
LL | / #[diag("E0123")]
|
||||
LL | |
|
||||
@ -49,13 +49,13 @@ LL | | struct InvalidLitNestedAttr {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: diagnostic slug must be the first argument
|
||||
--> $DIR/diagnostic-derive.rs:77:16
|
||||
--> $DIR/diagnostic-derive.rs:76:16
|
||||
|
|
||||
LL | #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
|
||||
| ^
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:77:1
|
||||
--> $DIR/diagnostic-derive.rs:76:1
|
||||
|
|
||||
LL | / #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
|
||||
LL | |
|
||||
@ -66,7 +66,7 @@ LL | | struct InvalidNestedStructAttr1 {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: unknown argument
|
||||
--> $DIR/diagnostic-derive.rs:83:8
|
||||
--> $DIR/diagnostic-derive.rs:82:8
|
||||
|
|
||||
LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
|
||||
| ^^^^^^^^
|
||||
@ -74,7 +74,7 @@ LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
|
||||
= note: only the `code` parameter is valid after the slug
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:83:1
|
||||
--> $DIR/diagnostic-derive.rs:82:1
|
||||
|
|
||||
LL | / #[diag(nonsense = "...", code = "E0123", slug = "foo")]
|
||||
LL | |
|
||||
@ -85,7 +85,7 @@ LL | | struct InvalidNestedStructAttr2 {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: unknown argument
|
||||
--> $DIR/diagnostic-derive.rs:89:8
|
||||
--> $DIR/diagnostic-derive.rs:88:8
|
||||
|
|
||||
LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
|
||||
| ^^^^^^^^
|
||||
@ -93,7 +93,7 @@ LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
|
||||
= note: only the `code` parameter is valid after the slug
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:89:1
|
||||
--> $DIR/diagnostic-derive.rs:88:1
|
||||
|
|
||||
LL | / #[diag(nonsense = 4, code = "E0123", slug = "foo")]
|
||||
LL | |
|
||||
@ -104,7 +104,7 @@ LL | | struct InvalidNestedStructAttr3 {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: unknown argument
|
||||
--> $DIR/diagnostic-derive.rs:95:42
|
||||
--> $DIR/diagnostic-derive.rs:94:42
|
||||
|
|
||||
LL | #[diag(no_crate_example, code = "E0123", slug = "foo")]
|
||||
| ^^^^
|
||||
@ -112,55 +112,55 @@ LL | #[diag(no_crate_example, code = "E0123", slug = "foo")]
|
||||
= note: only the `code` parameter is valid after the slug
|
||||
|
||||
error: `#[suggestion = ...]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:102:5
|
||||
--> $DIR/diagnostic-derive.rs:101:5
|
||||
|
|
||||
LL | #[suggestion = "bar"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/diagnostic-derive.rs:109:8
|
||||
|
|
||||
LL | #[diag(no_crate_example, code = "E0456")]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/diagnostic-derive.rs:108:8
|
||||
|
|
||||
LL | #[diag(no_crate_example, code = "E0456")]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/diagnostic-derive.rs:107:8
|
||||
|
|
||||
LL | #[diag(no_crate_example, code = "E0123")]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/diagnostic-derive.rs:109:26
|
||||
--> $DIR/diagnostic-derive.rs:108:26
|
||||
|
|
||||
LL | #[diag(no_crate_example, code = "E0456")]
|
||||
| ^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/diagnostic-derive.rs:108:26
|
||||
--> $DIR/diagnostic-derive.rs:107:26
|
||||
|
|
||||
LL | #[diag(no_crate_example, code = "E0123")]
|
||||
| ^^^^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/diagnostic-derive.rs:115:42
|
||||
--> $DIR/diagnostic-derive.rs:114:42
|
||||
|
|
||||
LL | #[diag(no_crate_example, code = "E0456", code = "E0457")]
|
||||
| ^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/diagnostic-derive.rs:115:26
|
||||
--> $DIR/diagnostic-derive.rs:114:26
|
||||
|
|
||||
LL | #[diag(no_crate_example, code = "E0456", code = "E0457")]
|
||||
| ^^^^
|
||||
|
||||
error: diagnostic slug must be the first argument
|
||||
--> $DIR/diagnostic-derive.rs:120:43
|
||||
--> $DIR/diagnostic-derive.rs:119:43
|
||||
|
|
||||
LL | #[diag(no_crate_example, no_crate::example, code = "E0456")]
|
||||
| ^
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:125:1
|
||||
--> $DIR/diagnostic-derive.rs:124:1
|
||||
|
|
||||
LL | struct KindNotProvided {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -168,7 +168,7 @@ LL | struct KindNotProvided {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:128:1
|
||||
--> $DIR/diagnostic-derive.rs:127:1
|
||||
|
|
||||
LL | / #[diag(code = "E0456")]
|
||||
LL | |
|
||||
@ -178,31 +178,31 @@ LL | | struct SlugNotProvided {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
|
||||
--> $DIR/diagnostic-derive.rs:139:5
|
||||
--> $DIR/diagnostic-derive.rs:138:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[nonsense]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:147:5
|
||||
--> $DIR/diagnostic-derive.rs:146:5
|
||||
|
|
||||
LL | #[nonsense]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
|
||||
--> $DIR/diagnostic-derive.rs:164:5
|
||||
--> $DIR/diagnostic-derive.rs:163:5
|
||||
|
|
||||
LL | #[label(no_crate_label)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `name` doesn't refer to a field on this type
|
||||
--> $DIR/diagnostic-derive.rs:172:46
|
||||
--> $DIR/diagnostic-derive.rs:171:46
|
||||
|
|
||||
LL | #[suggestion(no_crate_suggestion, code = "{name}")]
|
||||
| ^^^^^^^^
|
||||
|
||||
error: invalid format string: expected `'}'` but string was terminated
|
||||
--> $DIR/diagnostic-derive.rs:177:10
|
||||
--> $DIR/diagnostic-derive.rs:176:10
|
||||
|
|
||||
LL | #[derive(Diagnostic)]
|
||||
| ^^^^^^^^^^ expected `'}'` in format string
|
||||
@ -211,7 +211,7 @@ LL | #[derive(Diagnostic)]
|
||||
= note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: invalid format string: unmatched `}` found
|
||||
--> $DIR/diagnostic-derive.rs:187:10
|
||||
--> $DIR/diagnostic-derive.rs:186:10
|
||||
|
|
||||
LL | #[derive(Diagnostic)]
|
||||
| ^^^^^^^^^^ unmatched `}` in format string
|
||||
@ -220,19 +220,19 @@ LL | #[derive(Diagnostic)]
|
||||
= note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
|
||||
--> $DIR/diagnostic-derive.rs:207:5
|
||||
--> $DIR/diagnostic-derive.rs:206:5
|
||||
|
|
||||
LL | #[label(no_crate_label)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: suggestion without `code = "..."`
|
||||
--> $DIR/diagnostic-derive.rs:226:5
|
||||
--> $DIR/diagnostic-derive.rs:225:5
|
||||
|
|
||||
LL | #[suggestion(no_crate_suggestion)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: invalid nested attribute
|
||||
--> $DIR/diagnostic-derive.rs:234:18
|
||||
--> $DIR/diagnostic-derive.rs:233:18
|
||||
|
|
||||
LL | #[suggestion(nonsense = "bar")]
|
||||
| ^^^^^^^^
|
||||
@ -240,13 +240,13 @@ LL | #[suggestion(nonsense = "bar")]
|
||||
= help: only `no_span`, `style`, `code` and `applicability` are valid nested attributes
|
||||
|
||||
error: suggestion without `code = "..."`
|
||||
--> $DIR/diagnostic-derive.rs:234:5
|
||||
--> $DIR/diagnostic-derive.rs:233:5
|
||||
|
|
||||
LL | #[suggestion(nonsense = "bar")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: invalid nested attribute
|
||||
--> $DIR/diagnostic-derive.rs:243:18
|
||||
--> $DIR/diagnostic-derive.rs:242:18
|
||||
|
|
||||
LL | #[suggestion(msg = "bar")]
|
||||
| ^^^
|
||||
@ -254,13 +254,13 @@ LL | #[suggestion(msg = "bar")]
|
||||
= help: only `no_span`, `style`, `code` and `applicability` are valid nested attributes
|
||||
|
||||
error: suggestion without `code = "..."`
|
||||
--> $DIR/diagnostic-derive.rs:243:5
|
||||
--> $DIR/diagnostic-derive.rs:242:5
|
||||
|
|
||||
LL | #[suggestion(msg = "bar")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: wrong field type for suggestion
|
||||
--> $DIR/diagnostic-derive.rs:266:5
|
||||
--> $DIR/diagnostic-derive.rs:265:5
|
||||
|
|
||||
LL | / #[suggestion(no_crate_suggestion, code = "This is suggested code")]
|
||||
LL | |
|
||||
@ -270,79 +270,79 @@ LL | | suggestion: Applicability,
|
||||
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/diagnostic-derive.rs:282:24
|
||||
--> $DIR/diagnostic-derive.rs:281:24
|
||||
|
|
||||
LL | suggestion: (Span, Span, Applicability),
|
||||
| ^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/diagnostic-derive.rs:282:18
|
||||
--> $DIR/diagnostic-derive.rs:281:18
|
||||
|
|
||||
LL | suggestion: (Span, Span, Applicability),
|
||||
| ^^^^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/diagnostic-derive.rs:290:33
|
||||
--> $DIR/diagnostic-derive.rs:289:33
|
||||
|
|
||||
LL | suggestion: (Applicability, Applicability, Span),
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/diagnostic-derive.rs:290:18
|
||||
--> $DIR/diagnostic-derive.rs:289:18
|
||||
|
|
||||
LL | suggestion: (Applicability, Applicability, Span),
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: `#[label = ...]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:297:5
|
||||
--> $DIR/diagnostic-derive.rs:296:5
|
||||
|
|
||||
LL | #[label = "bar"]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/diagnostic-derive.rs:448:5
|
||||
--> $DIR/diagnostic-derive.rs:447:5
|
||||
|
|
||||
LL | #[suggestion(no_crate_suggestion, code = "...", applicability = "maybe-incorrect")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/diagnostic-derive.rs:450:24
|
||||
--> $DIR/diagnostic-derive.rs:449:24
|
||||
|
|
||||
LL | suggestion: (Span, Applicability),
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: invalid applicability
|
||||
--> $DIR/diagnostic-derive.rs:456:69
|
||||
--> $DIR/diagnostic-derive.rs:455:69
|
||||
|
|
||||
LL | #[suggestion(no_crate_suggestion, code = "...", applicability = "batman")]
|
||||
| ^^^^^^^^
|
||||
|
||||
error: the `#[help(...)]` attribute can only be applied to fields of type `Span`, `MultiSpan`, `bool` or `()`
|
||||
--> $DIR/diagnostic-derive.rs:523:5
|
||||
--> $DIR/diagnostic-derive.rs:522:5
|
||||
|
|
||||
LL | #[help(no_crate_help)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: a diagnostic slug must be the first argument to the attribute
|
||||
--> $DIR/diagnostic-derive.rs:532:32
|
||||
--> $DIR/diagnostic-derive.rs:531:32
|
||||
|
|
||||
LL | #[label(no_crate_label, foo)]
|
||||
| ^
|
||||
|
||||
error: only `no_span` is a valid nested attribute
|
||||
--> $DIR/diagnostic-derive.rs:540:29
|
||||
--> $DIR/diagnostic-derive.rs:539:29
|
||||
|
|
||||
LL | #[label(no_crate_label, foo = "...")]
|
||||
| ^^^
|
||||
|
||||
error: only `no_span` is a valid nested attribute
|
||||
--> $DIR/diagnostic-derive.rs:548:29
|
||||
--> $DIR/diagnostic-derive.rs:547:29
|
||||
|
|
||||
LL | #[label(no_crate_label, foo("..."))]
|
||||
| ^^^
|
||||
|
||||
error: `#[primary_span]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:560:5
|
||||
--> $DIR/diagnostic-derive.rs:559:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
@ -350,13 +350,13 @@ LL | #[primary_span]
|
||||
= help: the `primary_span` field attribute is not valid for lint diagnostics
|
||||
|
||||
error: `#[error(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:580:1
|
||||
--> $DIR/diagnostic-derive.rs:579:1
|
||||
|
|
||||
LL | #[error(no_crate_example, code = "E0123")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:580:1
|
||||
--> $DIR/diagnostic-derive.rs:579:1
|
||||
|
|
||||
LL | / #[error(no_crate_example, code = "E0123")]
|
||||
LL | |
|
||||
@ -368,13 +368,13 @@ LL | | struct ErrorAttribute {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: `#[warn_(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:587:1
|
||||
--> $DIR/diagnostic-derive.rs:586:1
|
||||
|
|
||||
LL | #[warn_(no_crate_example, code = "E0123")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:587:1
|
||||
--> $DIR/diagnostic-derive.rs:586:1
|
||||
|
|
||||
LL | / #[warn_(no_crate_example, code = "E0123")]
|
||||
LL | |
|
||||
@ -386,13 +386,13 @@ LL | | struct WarnAttribute {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: `#[lint(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:594:1
|
||||
--> $DIR/diagnostic-derive.rs:593:1
|
||||
|
|
||||
LL | #[lint(no_crate_example, code = "E0123")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:594:1
|
||||
--> $DIR/diagnostic-derive.rs:593:1
|
||||
|
|
||||
LL | / #[lint(no_crate_example, code = "E0123")]
|
||||
LL | |
|
||||
@ -404,13 +404,13 @@ LL | | struct LintAttributeOnSessionDiag {}
|
||||
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
|
||||
|
||||
error: `#[lint(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:601:1
|
||||
--> $DIR/diagnostic-derive.rs:600:1
|
||||
|
|
||||
LL | #[lint(no_crate_example, code = "E0123")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[lint(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:601:1
|
||||
--> $DIR/diagnostic-derive.rs:600:1
|
||||
|
|
||||
LL | #[lint(no_crate_example, code = "E0123")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -418,7 +418,7 @@ LL | #[lint(no_crate_example, code = "E0123")]
|
||||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
||||
|
||||
error: diagnostic slug not specified
|
||||
--> $DIR/diagnostic-derive.rs:601:1
|
||||
--> $DIR/diagnostic-derive.rs:600:1
|
||||
|
|
||||
LL | / #[lint(no_crate_example, code = "E0123")]
|
||||
LL | |
|
||||
@ -431,19 +431,19 @@ LL | | struct LintAttributeOnLintDiag {}
|
||||
= help: specify the slug as the first argument to the attribute, such as `#[diag(compiletest_example)]`
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/diagnostic-derive.rs:611:53
|
||||
--> $DIR/diagnostic-derive.rs:610:53
|
||||
|
|
||||
LL | #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
|
||||
| ^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/diagnostic-derive.rs:611:39
|
||||
--> $DIR/diagnostic-derive.rs:610:39
|
||||
|
|
||||
LL | #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
|
||||
| ^^^^
|
||||
|
||||
error: wrong types for suggestion
|
||||
--> $DIR/diagnostic-derive.rs:620:24
|
||||
--> $DIR/diagnostic-derive.rs:619:24
|
||||
|
|
||||
LL | suggestion: (Span, usize),
|
||||
| ^^^^^
|
||||
@ -451,7 +451,7 @@ LL | suggestion: (Span, usize),
|
||||
= help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
|
||||
|
||||
error: wrong types for suggestion
|
||||
--> $DIR/diagnostic-derive.rs:628:17
|
||||
--> $DIR/diagnostic-derive.rs:627:17
|
||||
|
|
||||
LL | suggestion: (Span,),
|
||||
| ^^^^^^^
|
||||
@ -459,13 +459,13 @@ LL | suggestion: (Span,),
|
||||
= help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`
|
||||
|
||||
error: suggestion without `code = "..."`
|
||||
--> $DIR/diagnostic-derive.rs:635:5
|
||||
--> $DIR/diagnostic-derive.rs:634:5
|
||||
|
|
||||
LL | #[suggestion(no_crate_suggestion)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[multipart_suggestion(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:642:1
|
||||
--> $DIR/diagnostic-derive.rs:641:1
|
||||
|
|
||||
LL | #[multipart_suggestion(no_crate_suggestion)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -473,7 +473,7 @@ LL | #[multipart_suggestion(no_crate_suggestion)]
|
||||
= help: consider creating a `Subdiagnostic` instead
|
||||
|
||||
error: `#[multipart_suggestion(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:645:1
|
||||
--> $DIR/diagnostic-derive.rs:644:1
|
||||
|
|
||||
LL | #[multipart_suggestion()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -481,7 +481,7 @@ LL | #[multipart_suggestion()]
|
||||
= help: consider creating a `Subdiagnostic` instead
|
||||
|
||||
error: `#[multipart_suggestion(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:649:5
|
||||
--> $DIR/diagnostic-derive.rs:648:5
|
||||
|
|
||||
LL | #[multipart_suggestion(no_crate_suggestion)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -489,7 +489,7 @@ LL | #[multipart_suggestion(no_crate_suggestion)]
|
||||
= help: consider creating a `Subdiagnostic` instead
|
||||
|
||||
error: `#[suggestion(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:657:1
|
||||
--> $DIR/diagnostic-derive.rs:656:1
|
||||
|
|
||||
LL | #[suggestion(no_crate_suggestion, code = "...")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -497,7 +497,7 @@ LL | #[suggestion(no_crate_suggestion, code = "...")]
|
||||
= help: `#[label]` and `#[suggestion]` can only be applied to fields
|
||||
|
||||
error: `#[label]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:666:1
|
||||
--> $DIR/diagnostic-derive.rs:665:1
|
||||
|
|
||||
LL | #[label]
|
||||
| ^^^^^^^^
|
||||
@ -505,31 +505,31 @@ LL | #[label]
|
||||
= help: `#[label]` and `#[suggestion]` can only be applied to fields
|
||||
|
||||
error: `eager` is the only supported nested attribute for `subdiagnostic`
|
||||
--> $DIR/diagnostic-derive.rs:700:7
|
||||
--> $DIR/diagnostic-derive.rs:699:7
|
||||
|
|
||||
LL | #[subdiagnostic(bad)]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[subdiagnostic = ...]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:708:5
|
||||
--> $DIR/diagnostic-derive.rs:707:5
|
||||
|
|
||||
LL | #[subdiagnostic = "bad"]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `eager` is the only supported nested attribute for `subdiagnostic`
|
||||
--> $DIR/diagnostic-derive.rs:716:7
|
||||
--> $DIR/diagnostic-derive.rs:715:7
|
||||
|
|
||||
LL | #[subdiagnostic(bad, bad)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `eager` is the only supported nested attribute for `subdiagnostic`
|
||||
--> $DIR/diagnostic-derive.rs:724:7
|
||||
--> $DIR/diagnostic-derive.rs:723:7
|
||||
|
|
||||
LL | #[subdiagnostic("bad")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[subdiagnostic(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:732:5
|
||||
--> $DIR/diagnostic-derive.rs:731:5
|
||||
|
|
||||
LL | #[subdiagnostic(eager)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -537,19 +537,19 @@ LL | #[subdiagnostic(eager)]
|
||||
= help: eager subdiagnostics are not supported on lints
|
||||
|
||||
error: expected at least one string literal for `code(...)`
|
||||
--> $DIR/diagnostic-derive.rs:790:23
|
||||
--> $DIR/diagnostic-derive.rs:789:23
|
||||
|
|
||||
LL | #[suggestion(code())]
|
||||
| ^
|
||||
|
||||
error: `code(...)` must contain only string literals
|
||||
--> $DIR/diagnostic-derive.rs:798:23
|
||||
--> $DIR/diagnostic-derive.rs:797:23
|
||||
|
|
||||
LL | #[suggestion(code(foo))]
|
||||
| ^^^
|
||||
|
||||
error: `#[suggestion(...)]` is not a valid attribute
|
||||
--> $DIR/diagnostic-derive.rs:822:5
|
||||
--> $DIR/diagnostic-derive.rs:821:5
|
||||
|
|
||||
LL | #[suggestion(no_crate_suggestion, code = "")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -559,85 +559,85 @@ LL | #[suggestion(no_crate_suggestion, code = "")]
|
||||
= help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]`
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/diagnostic-derive.rs:55:8
|
||||
--> $DIR/diagnostic-derive.rs:54:8
|
||||
|
|
||||
LL | #[diag = "E0123"]
|
||||
| ^ maybe a missing crate `core`?
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/diagnostic-derive.rs:798:23
|
||||
--> $DIR/diagnostic-derive.rs:797:23
|
||||
|
|
||||
LL | #[suggestion(code(foo))]
|
||||
| ^^^ maybe a missing crate `core`?
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/diagnostic-derive.rs:807:25
|
||||
--> $DIR/diagnostic-derive.rs:806:25
|
||||
|
|
||||
LL | #[suggestion(code = 3)]
|
||||
| ^ maybe a missing crate `core`?
|
||||
|
||||
error: cannot find attribute `nonsense` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:60:3
|
||||
--> $DIR/diagnostic-derive.rs:59:3
|
||||
|
|
||||
LL | #[nonsense(no_crate_example, code = "E0123")]
|
||||
| ^^^^^^^^
|
||||
|
||||
error: cannot find attribute `nonsense` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:147:7
|
||||
--> $DIR/diagnostic-derive.rs:146:7
|
||||
|
|
||||
LL | #[nonsense]
|
||||
| ^^^^^^^^
|
||||
|
||||
error: cannot find attribute `error` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:580:3
|
||||
--> $DIR/diagnostic-derive.rs:579:3
|
||||
|
|
||||
LL | #[error(no_crate_example, code = "E0123")]
|
||||
| ^^^^^
|
||||
|
||||
error: cannot find attribute `warn_` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:587:3
|
||||
--> $DIR/diagnostic-derive.rs:586:3
|
||||
|
|
||||
LL | #[warn_(no_crate_example, code = "E0123")]
|
||||
| ^^^^^ help: a built-in attribute with a similar name exists: `warn`
|
||||
|
||||
error: cannot find attribute `lint` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:594:3
|
||||
--> $DIR/diagnostic-derive.rs:593:3
|
||||
|
|
||||
LL | #[lint(no_crate_example, code = "E0123")]
|
||||
| ^^^^ help: a built-in attribute with a similar name exists: `link`
|
||||
|
||||
error: cannot find attribute `lint` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:601:3
|
||||
--> $DIR/diagnostic-derive.rs:600:3
|
||||
|
|
||||
LL | #[lint(no_crate_example, code = "E0123")]
|
||||
| ^^^^ help: a built-in attribute with a similar name exists: `link`
|
||||
|
||||
error: cannot find attribute `multipart_suggestion` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:642:3
|
||||
--> $DIR/diagnostic-derive.rs:641:3
|
||||
|
|
||||
LL | #[multipart_suggestion(no_crate_suggestion)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: cannot find attribute `multipart_suggestion` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:645:3
|
||||
--> $DIR/diagnostic-derive.rs:644:3
|
||||
|
|
||||
LL | #[multipart_suggestion()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: cannot find attribute `multipart_suggestion` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:649:7
|
||||
--> $DIR/diagnostic-derive.rs:648:7
|
||||
|
|
||||
LL | #[multipart_suggestion(no_crate_suggestion)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0425]: cannot find value `nonsense` in module `crate::fluent_generated`
|
||||
--> $DIR/diagnostic-derive.rs:72:8
|
||||
--> $DIR/diagnostic-derive.rs:71:8
|
||||
|
|
||||
LL | #[diag(nonsense, code = "E0123")]
|
||||
| ^^^^^^^^ not found in `crate::fluent_generated`
|
||||
|
||||
error[E0425]: cannot find value `__code_34` in this scope
|
||||
--> $DIR/diagnostic-derive.rs:804:10
|
||||
--> $DIR/diagnostic-derive.rs:803:10
|
||||
|
|
||||
LL | #[derive(Diagnostic)]
|
||||
| ^^^^^^^^^^ not found in this scope
|
||||
@ -645,7 +645,7 @@ LL | #[derive(Diagnostic)]
|
||||
= note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
|
||||
--> $DIR/diagnostic-derive.rs:346:12
|
||||
--> $DIR/diagnostic-derive.rs:345:12
|
||||
|
|
||||
LL | #[derive(Diagnostic)]
|
||||
| ---------- required by a bound introduced by this call
|
||||
|
@ -9,12 +9,11 @@ extern crate rustc_driver;
|
||||
extern crate rustc_fluent_macro;
|
||||
extern crate rustc_macros;
|
||||
extern crate rustc_errors;
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_macros::Diagnostic;
|
||||
use rustc_errors::{SubdiagnosticMessage, DiagnosticMessage};
|
||||
extern crate rustc_session;
|
||||
|
||||
fluent_messages! { "./example.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./example.ftl" }
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(no_crate_bad_reference)]
|
||||
|
@ -18,11 +18,10 @@ extern crate rustc_session;
|
||||
extern crate rustc_span;
|
||||
|
||||
use rustc_errors::{Applicability, DiagnosticMessage, SubdiagnosticMessage};
|
||||
use rustc_fluent_macro::fluent_messages;
|
||||
use rustc_macros::Subdiagnostic;
|
||||
use rustc_span::Span;
|
||||
|
||||
fluent_messages! { "./example.ftl" }
|
||||
rustc_fluent_macro::fluent_messages! { "./example.ftl" }
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(no_crate_example)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: label without `#[primary_span]` field
|
||||
--> $DIR/subdiagnostic-derive.rs:52:1
|
||||
--> $DIR/subdiagnostic-derive.rs:51:1
|
||||
|
|
||||
LL | / #[label(no_crate_example)]
|
||||
LL | |
|
||||
@ -9,127 +9,127 @@ LL | | }
|
||||
| |_^
|
||||
|
||||
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:59:1
|
||||
--> $DIR/subdiagnostic-derive.rs:58:1
|
||||
|
|
||||
LL | #[label]
|
||||
| ^^^^^^^^
|
||||
|
||||
error: `#[foo]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:68:1
|
||||
--> $DIR/subdiagnostic-derive.rs:67:1
|
||||
|
|
||||
LL | #[foo]
|
||||
| ^^^^^^
|
||||
|
||||
error: `#[label = ...]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:78:1
|
||||
--> $DIR/subdiagnostic-derive.rs:77:1
|
||||
|
|
||||
LL | #[label = "..."]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: only `no_span` is a valid nested attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:87:9
|
||||
--> $DIR/subdiagnostic-derive.rs:86:9
|
||||
|
|
||||
LL | #[label(bug = "...")]
|
||||
| ^^^
|
||||
|
||||
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:87:1
|
||||
--> $DIR/subdiagnostic-derive.rs:86:1
|
||||
|
|
||||
LL | #[label(bug = "...")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: only `no_span` is a valid nested attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:107:9
|
||||
--> $DIR/subdiagnostic-derive.rs:106:9
|
||||
|
|
||||
LL | #[label(slug = 4)]
|
||||
| ^^^^
|
||||
|
||||
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:107:1
|
||||
--> $DIR/subdiagnostic-derive.rs:106:1
|
||||
|
|
||||
LL | #[label(slug = 4)]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: only `no_span` is a valid nested attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:117:9
|
||||
--> $DIR/subdiagnostic-derive.rs:116:9
|
||||
|
|
||||
LL | #[label(slug("..."))]
|
||||
| ^^^^
|
||||
|
||||
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:117:1
|
||||
--> $DIR/subdiagnostic-derive.rs:116:1
|
||||
|
|
||||
LL | #[label(slug("..."))]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:137:1
|
||||
--> $DIR/subdiagnostic-derive.rs:136:1
|
||||
|
|
||||
LL | #[label()]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: only `no_span` is a valid nested attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:146:27
|
||||
--> $DIR/subdiagnostic-derive.rs:145:27
|
||||
|
|
||||
LL | #[label(no_crate_example, code = "...")]
|
||||
| ^^^^
|
||||
|
||||
error: only `no_span` is a valid nested attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:155:27
|
||||
--> $DIR/subdiagnostic-derive.rs:154:27
|
||||
|
|
||||
LL | #[label(no_crate_example, applicability = "machine-applicable")]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unsupported type attribute for subdiagnostic enum
|
||||
--> $DIR/subdiagnostic-derive.rs:164:1
|
||||
--> $DIR/subdiagnostic-derive.rs:163:1
|
||||
|
|
||||
LL | #[foo]
|
||||
| ^^^^^^
|
||||
|
||||
error: `#[bar]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:178:5
|
||||
--> $DIR/subdiagnostic-derive.rs:177:5
|
||||
|
|
||||
LL | #[bar]
|
||||
| ^^^^^^
|
||||
|
||||
error: `#[bar = ...]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:190:5
|
||||
--> $DIR/subdiagnostic-derive.rs:189:5
|
||||
|
|
||||
LL | #[bar = "..."]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[bar = ...]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:202:5
|
||||
--> $DIR/subdiagnostic-derive.rs:201:5
|
||||
|
|
||||
LL | #[bar = 4]
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: `#[bar(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:214:5
|
||||
--> $DIR/subdiagnostic-derive.rs:213:5
|
||||
|
|
||||
LL | #[bar("...")]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: only `no_span` is a valid nested attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:226:13
|
||||
--> $DIR/subdiagnostic-derive.rs:225:13
|
||||
|
|
||||
LL | #[label(code = "...")]
|
||||
| ^^^^
|
||||
|
||||
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:226:5
|
||||
--> $DIR/subdiagnostic-derive.rs:225:5
|
||||
|
|
||||
LL | #[label(code = "...")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
|
||||
--> $DIR/subdiagnostic-derive.rs:255:5
|
||||
--> $DIR/subdiagnostic-derive.rs:254:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: label without `#[primary_span]` field
|
||||
--> $DIR/subdiagnostic-derive.rs:252:1
|
||||
--> $DIR/subdiagnostic-derive.rs:251:1
|
||||
|
|
||||
LL | / #[label(no_crate_example)]
|
||||
LL | |
|
||||
@ -141,13 +141,13 @@ LL | | }
|
||||
| |_^
|
||||
|
||||
error: `#[applicability]` is only valid on suggestions
|
||||
--> $DIR/subdiagnostic-derive.rs:265:5
|
||||
--> $DIR/subdiagnostic-derive.rs:264:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[bar]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:275:5
|
||||
--> $DIR/subdiagnostic-derive.rs:274:5
|
||||
|
|
||||
LL | #[bar]
|
||||
| ^^^^^^
|
||||
@ -155,13 +155,13 @@ LL | #[bar]
|
||||
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
|
||||
|
||||
error: `#[bar = ...]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:286:5
|
||||
--> $DIR/subdiagnostic-derive.rs:285:5
|
||||
|
|
||||
LL | #[bar = "..."]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[bar(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:297:5
|
||||
--> $DIR/subdiagnostic-derive.rs:296:5
|
||||
|
|
||||
LL | #[bar("...")]
|
||||
| ^^^^^^^^^^^^^
|
||||
@ -169,73 +169,73 @@ LL | #[bar("...")]
|
||||
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
|
||||
|
||||
error: a diagnostic slug must be the first argument to the attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:329:44
|
||||
--> $DIR/subdiagnostic-derive.rs:328:44
|
||||
|
|
||||
LL | #[label(no_crate_example, no_crate::example)]
|
||||
| ^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/subdiagnostic-derive.rs:342:5
|
||||
--> $DIR/subdiagnostic-derive.rs:341:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive.rs:339:5
|
||||
--> $DIR/subdiagnostic-derive.rs:338:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error: subdiagnostic kind not specified
|
||||
--> $DIR/subdiagnostic-derive.rs:348:8
|
||||
--> $DIR/subdiagnostic-derive.rs:347:8
|
||||
|
|
||||
LL | struct AG {
|
||||
| ^^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/subdiagnostic-derive.rs:385:46
|
||||
--> $DIR/subdiagnostic-derive.rs:384:46
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
|
||||
| ^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive.rs:385:32
|
||||
--> $DIR/subdiagnostic-derive.rs:384:32
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
|
||||
| ^^^^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/subdiagnostic-derive.rs:403:5
|
||||
--> $DIR/subdiagnostic-derive.rs:402:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive.rs:400:5
|
||||
--> $DIR/subdiagnostic-derive.rs:399:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[applicability]` attribute can only be applied to fields of type `Applicability`
|
||||
--> $DIR/subdiagnostic-derive.rs:413:5
|
||||
--> $DIR/subdiagnostic-derive.rs:412:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: suggestion without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive.rs:426:1
|
||||
--> $DIR/subdiagnostic-derive.rs:425:1
|
||||
|
|
||||
LL | #[suggestion(no_crate_example)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: invalid applicability
|
||||
--> $DIR/subdiagnostic-derive.rs:436:62
|
||||
--> $DIR/subdiagnostic-derive.rs:435:62
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "...", applicability = "foo")]
|
||||
| ^^^^^
|
||||
|
||||
error: suggestion without `#[primary_span]` field
|
||||
--> $DIR/subdiagnostic-derive.rs:454:1
|
||||
--> $DIR/subdiagnostic-derive.rs:453:1
|
||||
|
|
||||
LL | / #[suggestion(no_crate_example, code = "...")]
|
||||
LL | |
|
||||
@ -245,25 +245,25 @@ LL | | }
|
||||
| |_^
|
||||
|
||||
error: unsupported type attribute for subdiagnostic enum
|
||||
--> $DIR/subdiagnostic-derive.rs:468:1
|
||||
--> $DIR/subdiagnostic-derive.rs:467:1
|
||||
|
|
||||
LL | #[label]
|
||||
| ^^^^^^^^
|
||||
|
||||
error: `var` doesn't refer to a field on this type
|
||||
--> $DIR/subdiagnostic-derive.rs:488:39
|
||||
--> $DIR/subdiagnostic-derive.rs:487:39
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
|
||||
| ^^^^^^^
|
||||
|
||||
error: `var` doesn't refer to a field on this type
|
||||
--> $DIR/subdiagnostic-derive.rs:507:43
|
||||
--> $DIR/subdiagnostic-derive.rs:506:43
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
|
||||
| ^^^^^^^
|
||||
|
||||
error: `#[suggestion_part]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:530:5
|
||||
--> $DIR/subdiagnostic-derive.rs:529:5
|
||||
|
|
||||
LL | #[suggestion_part]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
@ -271,7 +271,7 @@ LL | #[suggestion_part]
|
||||
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead
|
||||
|
||||
error: `#[suggestion_part(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:533:5
|
||||
--> $DIR/subdiagnostic-derive.rs:532:5
|
||||
|
|
||||
LL | #[suggestion_part(code = "...")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -279,7 +279,7 @@ LL | #[suggestion_part(code = "...")]
|
||||
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions
|
||||
|
||||
error: suggestion without `#[primary_span]` field
|
||||
--> $DIR/subdiagnostic-derive.rs:527:1
|
||||
--> $DIR/subdiagnostic-derive.rs:526:1
|
||||
|
|
||||
LL | / #[suggestion(no_crate_example, code = "...")]
|
||||
LL | |
|
||||
@ -291,7 +291,7 @@ LL | | }
|
||||
| |_^
|
||||
|
||||
error: invalid nested attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:542:42
|
||||
--> $DIR/subdiagnostic-derive.rs:541:42
|
||||
|
|
||||
LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
|
||||
| ^^^^
|
||||
@ -299,7 +299,7 @@ LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "mac
|
||||
= help: only `no_span`, `style` and `applicability` are valid nested attributes
|
||||
|
||||
error: multipart suggestion without any `#[suggestion_part(...)]` fields
|
||||
--> $DIR/subdiagnostic-derive.rs:542:1
|
||||
--> $DIR/subdiagnostic-derive.rs:541:1
|
||||
|
|
||||
LL | / #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
|
||||
LL | |
|
||||
@ -310,19 +310,19 @@ LL | | }
|
||||
| |_^
|
||||
|
||||
error: `#[suggestion_part(...)]` attribute without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive.rs:552:5
|
||||
--> $DIR/subdiagnostic-derive.rs:551:5
|
||||
|
|
||||
LL | #[suggestion_part]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[suggestion_part(...)]` attribute without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive.rs:560:5
|
||||
--> $DIR/subdiagnostic-derive.rs:559:5
|
||||
|
|
||||
LL | #[suggestion_part()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[primary_span]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:569:5
|
||||
--> $DIR/subdiagnostic-derive.rs:568:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
@ -330,7 +330,7 @@ LL | #[primary_span]
|
||||
= help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]`
|
||||
|
||||
error: multipart suggestion without any `#[suggestion_part(...)]` fields
|
||||
--> $DIR/subdiagnostic-derive.rs:566:1
|
||||
--> $DIR/subdiagnostic-derive.rs:565:1
|
||||
|
|
||||
LL | / #[multipart_suggestion(no_crate_example)]
|
||||
LL | |
|
||||
@ -342,91 +342,91 @@ LL | | }
|
||||
| |_^
|
||||
|
||||
error: `#[suggestion_part(...)]` attribute without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive.rs:577:5
|
||||
--> $DIR/subdiagnostic-derive.rs:576:5
|
||||
|
|
||||
LL | #[suggestion_part]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[suggestion_part(...)]` attribute without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive.rs:580:5
|
||||
--> $DIR/subdiagnostic-derive.rs:579:5
|
||||
|
|
||||
LL | #[suggestion_part()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `code` is the only valid nested attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:583:23
|
||||
--> $DIR/subdiagnostic-derive.rs:582:23
|
||||
|
|
||||
LL | #[suggestion_part(foo = "bar")]
|
||||
| ^^^
|
||||
|
||||
error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
|
||||
--> $DIR/subdiagnostic-derive.rs:588:5
|
||||
--> $DIR/subdiagnostic-derive.rs:587:5
|
||||
|
|
||||
LL | #[suggestion_part(code = "...")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
|
||||
--> $DIR/subdiagnostic-derive.rs:591:5
|
||||
--> $DIR/subdiagnostic-derive.rs:590:5
|
||||
|
|
||||
LL | #[suggestion_part()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/subdiagnostic-derive.rs:599:37
|
||||
--> $DIR/subdiagnostic-derive.rs:598:37
|
||||
|
|
||||
LL | #[suggestion_part(code = "...", code = ",,,")]
|
||||
| ^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive.rs:599:23
|
||||
--> $DIR/subdiagnostic-derive.rs:598:23
|
||||
|
|
||||
LL | #[suggestion_part(code = "...", code = ",,,")]
|
||||
| ^^^^
|
||||
|
||||
error: `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."`
|
||||
--> $DIR/subdiagnostic-derive.rs:628:5
|
||||
--> $DIR/subdiagnostic-derive.rs:627:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: expected exactly one string literal for `code = ...`
|
||||
--> $DIR/subdiagnostic-derive.rs:676:34
|
||||
--> $DIR/subdiagnostic-derive.rs:675:34
|
||||
|
|
||||
LL | #[suggestion_part(code("foo"))]
|
||||
| ^
|
||||
|
||||
error: expected exactly one string literal for `code = ...`
|
||||
--> $DIR/subdiagnostic-derive.rs:687:41
|
||||
--> $DIR/subdiagnostic-derive.rs:686:41
|
||||
|
|
||||
LL | #[suggestion_part(code("foo", "bar"))]
|
||||
| ^
|
||||
|
||||
error: expected exactly one string literal for `code = ...`
|
||||
--> $DIR/subdiagnostic-derive.rs:698:30
|
||||
--> $DIR/subdiagnostic-derive.rs:697:30
|
||||
|
|
||||
LL | #[suggestion_part(code(3))]
|
||||
| ^
|
||||
|
||||
error: expected exactly one string literal for `code = ...`
|
||||
--> $DIR/subdiagnostic-derive.rs:709:29
|
||||
--> $DIR/subdiagnostic-derive.rs:708:29
|
||||
|
|
||||
LL | #[suggestion_part(code())]
|
||||
| ^
|
||||
|
||||
error: specified multiple times
|
||||
--> $DIR/subdiagnostic-derive.rs:764:1
|
||||
--> $DIR/subdiagnostic-derive.rs:763:1
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive.rs:764:1
|
||||
--> $DIR/subdiagnostic-derive.rs:763:1
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `#[suggestion_hidden(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:773:1
|
||||
--> $DIR/subdiagnostic-derive.rs:772:1
|
||||
|
|
||||
LL | #[suggestion_hidden(no_crate_example, code = "")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -434,7 +434,7 @@ LL | #[suggestion_hidden(no_crate_example, code = "")]
|
||||
= help: Use `#[suggestion(..., style = "hidden")]` instead
|
||||
|
||||
error: `#[suggestion_hidden(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:781:1
|
||||
--> $DIR/subdiagnostic-derive.rs:780:1
|
||||
|
|
||||
LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -442,7 +442,7 @@ LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
|
||||
= help: Use `#[suggestion(..., style = "hidden")]` instead
|
||||
|
||||
error: invalid suggestion style
|
||||
--> $DIR/subdiagnostic-derive.rs:789:51
|
||||
--> $DIR/subdiagnostic-derive.rs:788:51
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "", style = "foo")]
|
||||
| ^^^^^
|
||||
@ -450,25 +450,25 @@ LL | #[suggestion(no_crate_example, code = "", style = "foo")]
|
||||
= help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only`
|
||||
|
||||
error: expected `= "xxx"`
|
||||
--> $DIR/subdiagnostic-derive.rs:797:49
|
||||
--> $DIR/subdiagnostic-derive.rs:796:49
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "", style = 42)]
|
||||
| ^
|
||||
|
||||
error: a diagnostic slug must be the first argument to the attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:805:48
|
||||
--> $DIR/subdiagnostic-derive.rs:804:48
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "", style)]
|
||||
| ^
|
||||
|
||||
error: expected `= "xxx"`
|
||||
--> $DIR/subdiagnostic-derive.rs:813:48
|
||||
--> $DIR/subdiagnostic-derive.rs:812:48
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "", style("foo"))]
|
||||
| ^
|
||||
|
||||
error: `#[primary_span]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive.rs:826:5
|
||||
--> $DIR/subdiagnostic-derive.rs:825:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
@ -477,7 +477,7 @@ LL | #[primary_span]
|
||||
= help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead
|
||||
|
||||
error: suggestion without `#[primary_span]` field
|
||||
--> $DIR/subdiagnostic-derive.rs:823:1
|
||||
--> $DIR/subdiagnostic-derive.rs:822:1
|
||||
|
|
||||
LL | / #[suggestion(no_crate_example, code = "")]
|
||||
LL | |
|
||||
@ -489,115 +489,115 @@ LL | | }
|
||||
| |_^
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/subdiagnostic-derive.rs:97:9
|
||||
--> $DIR/subdiagnostic-derive.rs:96:9
|
||||
|
|
||||
LL | #[label("...")]
|
||||
| ^^^^^ maybe a missing crate `core`?
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/subdiagnostic-derive.rs:313:1
|
||||
--> $DIR/subdiagnostic-derive.rs:312:1
|
||||
|
|
||||
LL | union AC {
|
||||
| ^^^^^ maybe a missing crate `core`?
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/subdiagnostic-derive.rs:583:27
|
||||
--> $DIR/subdiagnostic-derive.rs:582:27
|
||||
|
|
||||
LL | #[suggestion_part(foo = "bar")]
|
||||
| ^ maybe a missing crate `core`?
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/subdiagnostic-derive.rs:676:28
|
||||
--> $DIR/subdiagnostic-derive.rs:675:28
|
||||
|
|
||||
LL | #[suggestion_part(code("foo"))]
|
||||
| ^^^^^ maybe a missing crate `core`?
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/subdiagnostic-derive.rs:687:28
|
||||
--> $DIR/subdiagnostic-derive.rs:686:28
|
||||
|
|
||||
LL | #[suggestion_part(code("foo", "bar"))]
|
||||
| ^^^^^ maybe a missing crate `core`?
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/subdiagnostic-derive.rs:698:28
|
||||
--> $DIR/subdiagnostic-derive.rs:697:28
|
||||
|
|
||||
LL | #[suggestion_part(code(3))]
|
||||
| ^ maybe a missing crate `core`?
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/subdiagnostic-derive.rs:721:30
|
||||
--> $DIR/subdiagnostic-derive.rs:720:30
|
||||
|
|
||||
LL | #[suggestion_part(code = 3)]
|
||||
| ^ maybe a missing crate `core`?
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `core`?
|
||||
--> $DIR/subdiagnostic-derive.rs:813:48
|
||||
--> $DIR/subdiagnostic-derive.rs:812:48
|
||||
|
|
||||
LL | #[suggestion(no_crate_example, code = "", style("foo"))]
|
||||
| ^ maybe a missing crate `core`?
|
||||
|
||||
error: cannot find attribute `foo` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:68:3
|
||||
--> $DIR/subdiagnostic-derive.rs:67:3
|
||||
|
|
||||
LL | #[foo]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `foo` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:164:3
|
||||
--> $DIR/subdiagnostic-derive.rs:163:3
|
||||
|
|
||||
LL | #[foo]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:178:7
|
||||
--> $DIR/subdiagnostic-derive.rs:177:7
|
||||
|
|
||||
LL | #[bar]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:190:7
|
||||
--> $DIR/subdiagnostic-derive.rs:189:7
|
||||
|
|
||||
LL | #[bar = "..."]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:202:7
|
||||
--> $DIR/subdiagnostic-derive.rs:201:7
|
||||
|
|
||||
LL | #[bar = 4]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:214:7
|
||||
--> $DIR/subdiagnostic-derive.rs:213:7
|
||||
|
|
||||
LL | #[bar("...")]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:275:7
|
||||
--> $DIR/subdiagnostic-derive.rs:274:7
|
||||
|
|
||||
LL | #[bar]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:286:7
|
||||
--> $DIR/subdiagnostic-derive.rs:285:7
|
||||
|
|
||||
LL | #[bar = "..."]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:297:7
|
||||
--> $DIR/subdiagnostic-derive.rs:296:7
|
||||
|
|
||||
LL | #[bar("...")]
|
||||
| ^^^
|
||||
|
||||
error[E0425]: cannot find value `slug` in module `crate::fluent_generated`
|
||||
--> $DIR/subdiagnostic-derive.rs:127:9
|
||||
--> $DIR/subdiagnostic-derive.rs:126:9
|
||||
|
|
||||
LL | #[label(slug)]
|
||||
| ^^^^ not found in `crate::fluent_generated`
|
||||
|
||||
error[E0425]: cannot find value `__code_29` in this scope
|
||||
--> $DIR/subdiagnostic-derive.rs:715:10
|
||||
--> $DIR/subdiagnostic-derive.rs:714:10
|
||||
|
|
||||
LL | #[derive(Subdiagnostic)]
|
||||
| ^^^^^^^^^^^^^ not found in this scope
|
||||
|
Loading…
Reference in New Issue
Block a user