-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in rustdoc -Whelp
#98799
Fix bug in rustdoc -Whelp
#98799
Conversation
@@ -3245,7 +3246,7 @@ impl<'test> TestCx<'test> { | |||
|
|||
if !self.props.error_patterns.is_empty() { | |||
// "// error-pattern" comments | |||
self.check_error_patterns(&proc_res.stderr, &proc_res, pm); | |||
self.check_error_patterns(&output_to_check, &proc_res, pm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before, // check-stdout
was broken and did nothing for UI tests
This comment has been minimized.
This comment has been minimized.
564518d
to
fa39bd4
Compare
let mut lint_store = rustc_lint::new_lint_store( | ||
sess.opts.debugging_opts.no_interleave_lints, | ||
sess.unstable_options(), | ||
); | ||
let registered_lints = if let Some(register_lints) = compiler.register_lints() { | ||
register_lints(sess, &mut lint_store); | ||
true | ||
} else { | ||
false | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can't just be register_plugins()
because that ends up trying to parse the source file, which fails because it's an empty string. this code is taken from
rust/compiler/rustc_driver/src/lib.rs
Lines 249 to 263 in e1b6f16
if sopts.describe_lints { | |
let mut lint_store = rustc_lint::new_lint_store( | |
sopts.debugging_opts.no_interleave_lints, | |
compiler.session().unstable_options(), | |
); | |
let registered_lints = | |
if let Some(register_lints) = compiler.register_lints() { | |
register_lints(compiler.session(), &mut lint_store); | |
true | |
} else { | |
false | |
}; | |
describe_lints(compiler.session(), &lint_store, registered_lints); | |
return; | |
} |
|
||
Lint checks provided by plugins loaded by this crate: | ||
|
||
$NAMES $LEVELS $MEANINGS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this ended up fixing my original complaint in #98533 (comment) :)
Previously, this printed the debugging options, not the lint options, and only handled `-Whelp`, not `-A/-D/-F`. This also fixes a few other misc issues: - Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests - Add lint headers for tool lints, not just builtin lints - Remove duplicate run-make test
Just to be sure: there are other UI tests that check the output you removed? |
Yes, you can see them in the diff: src/test/rustdoc-ui/issue-83883-describe-lints.rs |
Thanks! @bors r+ rollup |
📌 Commit 17da4e0 has been approved by |
…meGomez Fix bug in `rustdoc -Whelp` Previously, this printed the debugging options, not the lint options, and only handled `-Whelp`, not `-A/-D/-F`. This also fixes a few other misc issues: - Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests - Add lint headers for tool lints, not just builtin lints rust-lang#98533 (comment) r? `@GuillaumeGomez`
…meGomez Fix bug in `rustdoc -Whelp` Previously, this printed the debugging options, not the lint options, and only handled `-Whelp`, not `-A/-D/-F`. This also fixes a few other misc issues: - Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests - Add lint headers for tool lints, not just builtin lints rust-lang#98533 (comment) r? ``@GuillaumeGomez``
Rollup of 4 pull requests Successful merges: - rust-lang#94831 (Link to stabilization section in std-dev-guide for library tracking issue template) - rust-lang#98764 (add Miri to the nightly docs) - rust-lang#98773 (rustdoc: use <details> tag for the source code sidebar) - rust-lang#98799 (Fix bug in `rustdoc -Whelp`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Previously, this printed the debugging options, not the lint options,
and only handled
-Whelp
, not-A/-D/-F
.This also fixes a few other misc issues:
// check-stdout
for UI tests; previously it only worked for run-fail and compile-fail tests#98533 (comment)
r? @GuillaumeGomez