Remove a back compat warning
This commit is contained in:
parent
b869e84e58
commit
5965948ba1
@ -11,10 +11,6 @@ interface_mixed_bin_crate =
|
|||||||
interface_mixed_proc_macro_crate =
|
interface_mixed_proc_macro_crate =
|
||||||
cannot mix `proc-macro` crate type with others
|
cannot mix `proc-macro` crate type with others
|
||||||
|
|
||||||
interface_proc_macro_doc_without_arg =
|
|
||||||
Trying to document proc macro crate without passing '--crate-type proc-macro to rustdoc
|
|
||||||
.warn = The generated documentation may be incorrect
|
|
||||||
|
|
||||||
interface_error_writing_dependencies =
|
interface_error_writing_dependencies =
|
||||||
error writing dependencies to `{$path}`: {$error}
|
error writing dependencies to `{$path}`: {$error}
|
||||||
|
|
||||||
|
@ -31,10 +31,6 @@ pub struct MixedBinCrate;
|
|||||||
#[diag(interface_mixed_proc_macro_crate)]
|
#[diag(interface_mixed_proc_macro_crate)]
|
||||||
pub struct MixedProcMacroCrate;
|
pub struct MixedProcMacroCrate;
|
||||||
|
|
||||||
#[derive(Diagnostic)]
|
|
||||||
#[diag(interface_proc_macro_doc_without_arg)]
|
|
||||||
pub struct ProcMacroDocWithoutArg;
|
|
||||||
|
|
||||||
#[derive(Diagnostic)]
|
#[derive(Diagnostic)]
|
||||||
#[diag(interface_error_writing_dependencies)]
|
#[diag(interface_error_writing_dependencies)]
|
||||||
pub struct ErrorWritingDependencies<'a> {
|
pub struct ErrorWritingDependencies<'a> {
|
||||||
|
@ -287,28 +287,18 @@ fn configure_and_expand(mut krate: ast::Crate, resolver: &mut Resolver<'_, '_>)
|
|||||||
sess.emit_warning(errors::ProcMacroCratePanicAbort);
|
sess.emit_warning(errors::ProcMacroCratePanicAbort);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For backwards compatibility, we don't try to run proc macro injection
|
krate = sess.time("maybe_create_a_macro_crate", || {
|
||||||
// if rustdoc is run on a proc macro crate without '--crate-type proc-macro' being
|
let is_test_crate = sess.opts.test;
|
||||||
// specified. This should only affect users who manually invoke 'rustdoc', as
|
rustc_builtin_macros::proc_macro_harness::inject(
|
||||||
// 'cargo doc' will automatically pass the proper '--crate-type' flags.
|
sess,
|
||||||
// However, we do emit a warning, to let such users know that they should
|
resolver,
|
||||||
// start passing '--crate-type proc-macro'
|
krate,
|
||||||
if has_proc_macro_decls && sess.opts.actually_rustdoc && !is_proc_macro_crate {
|
is_proc_macro_crate,
|
||||||
sess.emit_warning(errors::ProcMacroDocWithoutArg);
|
has_proc_macro_decls,
|
||||||
} else {
|
is_test_crate,
|
||||||
krate = sess.time("maybe_create_a_macro_crate", || {
|
sess.diagnostic(),
|
||||||
let is_test_crate = sess.opts.test;
|
)
|
||||||
rustc_builtin_macros::proc_macro_harness::inject(
|
});
|
||||||
sess,
|
|
||||||
resolver,
|
|
||||||
krate,
|
|
||||||
is_proc_macro_crate,
|
|
||||||
has_proc_macro_decls,
|
|
||||||
is_test_crate,
|
|
||||||
sess.diagnostic(),
|
|
||||||
)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Done with macro expansion!
|
// Done with macro expansion!
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user