Skip to content

Commit 5965948

Browse files
committed
Remove a back compat warning
1 parent b869e84 commit 5965948

File tree

3 files changed

+12
-30
lines changed

3 files changed

+12
-30
lines changed

compiler/rustc_interface/locales/en-US.ftl

-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ interface_mixed_bin_crate =
1111
interface_mixed_proc_macro_crate =
1212
cannot mix `proc-macro` crate type with others
1313
14-
interface_proc_macro_doc_without_arg =
15-
Trying to document proc macro crate without passing '--crate-type proc-macro to rustdoc
16-
.warn = The generated documentation may be incorrect
17-
1814
interface_error_writing_dependencies =
1915
error writing dependencies to `{$path}`: {$error}
2016

compiler/rustc_interface/src/errors.rs

-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ pub struct MixedBinCrate;
3131
#[diag(interface_mixed_proc_macro_crate)]
3232
pub struct MixedProcMacroCrate;
3333

34-
#[derive(Diagnostic)]
35-
#[diag(interface_proc_macro_doc_without_arg)]
36-
pub struct ProcMacroDocWithoutArg;
37-
3834
#[derive(Diagnostic)]
3935
#[diag(interface_error_writing_dependencies)]
4036
pub struct ErrorWritingDependencies<'a> {

compiler/rustc_interface/src/passes.rs

+12-22
Original file line numberDiff line numberDiff line change
@@ -287,28 +287,18 @@ fn configure_and_expand(mut krate: ast::Crate, resolver: &mut Resolver<'_, '_>)
287287
sess.emit_warning(errors::ProcMacroCratePanicAbort);
288288
}
289289

290-
// For backwards compatibility, we don't try to run proc macro injection
291-
// if rustdoc is run on a proc macro crate without '--crate-type proc-macro' being
292-
// specified. This should only affect users who manually invoke 'rustdoc', as
293-
// 'cargo doc' will automatically pass the proper '--crate-type' flags.
294-
// However, we do emit a warning, to let such users know that they should
295-
// start passing '--crate-type proc-macro'
296-
if has_proc_macro_decls && sess.opts.actually_rustdoc && !is_proc_macro_crate {
297-
sess.emit_warning(errors::ProcMacroDocWithoutArg);
298-
} else {
299-
krate = sess.time("maybe_create_a_macro_crate", || {
300-
let is_test_crate = sess.opts.test;
301-
rustc_builtin_macros::proc_macro_harness::inject(
302-
sess,
303-
resolver,
304-
krate,
305-
is_proc_macro_crate,
306-
has_proc_macro_decls,
307-
is_test_crate,
308-
sess.diagnostic(),
309-
)
310-
});
311-
}
290+
krate = sess.time("maybe_create_a_macro_crate", || {
291+
let is_test_crate = sess.opts.test;
292+
rustc_builtin_macros::proc_macro_harness::inject(
293+
sess,
294+
resolver,
295+
krate,
296+
is_proc_macro_crate,
297+
has_proc_macro_decls,
298+
is_test_crate,
299+
sess.diagnostic(),
300+
)
301+
});
312302

313303
// Done with macro expansion!
314304

0 commit comments

Comments
 (0)