Skip to content

Commit

Permalink
Auto merge of rust-lang#97372 - JohnTitor:rollup-6owv1v0, r=JohnTitor
Browse files Browse the repository at this point in the history
Rollup of 6 pull requests

Successful merges:

 - rust-lang#93966 (document expectations for Waker::wake)
 - rust-lang#97266 (Make weird name lints trigger behind cfg_attr)
 - rust-lang#97355 (Remove unused brush image)
 - rust-lang#97358 (Update minifier-rs version to 0.1.0)
 - rust-lang#97363 (Fix a small mistake in `SliceIndex`'s documentation)
 - rust-lang#97364 (Fix weird indentation in continue_keyword docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed May 24, 2022
2 parents 76761db + c3fea09 commit f80e454
Show file tree
Hide file tree
Showing 14 changed files with 236 additions and 68 deletions.
13 changes: 2 additions & 11 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2224,12 +2224,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"

[[package]]
name = "macro-utils"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e72f7deb758fea9ea7d290aebfa788763d0bffae12caa6406a25baaf8fa68a8"

[[package]]
name = "maplit"
version = "1.0.2"
Expand Down Expand Up @@ -2361,12 +2355,9 @@ dependencies = [

[[package]]
name = "minifier"
version = "0.0.43"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d81352bda6f4d04af1720afaa762054f66e16caffd93c1f86461a1c0ac4e695e"
dependencies = [
"macro-utils",
]
checksum = "7071d17e2898e134cabf624f43cdefa0cedf57c739e964df3d0df9d028701a72"

[[package]]
name = "minimal-lexical"
Expand Down
34 changes: 17 additions & 17 deletions compiler/rustc_lint/src/early.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,25 @@ pub fn check_ast_node<'a>(
let mut passes: Vec<_> = passes.iter().map(|p| (p)()).collect();
let mut buffered = lint_buffer.unwrap_or_default();

if !sess.opts.debugging_opts.no_interleave_lints {
if sess.opts.debugging_opts.no_interleave_lints {
for (i, pass) in passes.iter_mut().enumerate() {
buffered =
sess.prof.extra_verbose_generic_activity("run_lint", pass.name()).run(|| {
early_lint_node(
sess,
!pre_expansion && i == 0,
lint_store,
registered_tools,
buffered,
EarlyLintPassObjects { lints: slice::from_mut(pass) },
check_node,
)
});
}
} else {
buffered = early_lint_node(
sess,
pre_expansion,
!pre_expansion,
lint_store,
registered_tools,
buffered,
Expand All @@ -446,21 +461,6 @@ pub fn check_ast_node<'a>(
check_node,
);
}
} else {
for (i, pass) in passes.iter_mut().enumerate() {
buffered =
sess.prof.extra_verbose_generic_activity("run_lint", pass.name()).run(|| {
early_lint_node(
sess,
pre_expansion && i == 0,
lint_store,
registered_tools,
buffered,
EarlyLintPassObjects { lints: slice::from_mut(pass) },
check_node,
)
});
}
}

// All of the buffered lints should have been emitted at this point.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ declare_lint! {
}

declare_lint! {
/// The `unknown_lints` lint detects unrecognized lint attribute.
/// The `unknown_lints` lint detects unrecognized lint attributes.
///
/// ### Example
///
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/slice/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ mod private_slice_index {
/// A helper trait used for indexing operations.
///
/// Implementations of this trait have to promise that if the argument
/// to `get_(mut_)unchecked` is a safe reference, then so is the result.
/// to `get_unchecked(_mut)` is a safe reference, then so is the result.
#[stable(feature = "slice_get_slice", since = "1.28.0")]
#[rustc_diagnostic_item = "SliceIndex"]
#[rustc_on_unimplemented(
Expand Down
13 changes: 13 additions & 0 deletions library/core/src/task/wake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,19 @@ unsafe impl Sync for Waker {}

impl Waker {
/// Wake up the task associated with this `Waker`.
///
/// As long as the runtime keeps running and the task is not finished, it is
/// guaranteed that each invocation of `wake` (or `wake_by_ref`) will be followed
/// by at least one `poll` of the task to which this `Waker` belongs. This makes
/// it possible to temporarily yield to other tasks while running potentially
/// unbounded processing loops.
///
/// Note that the above implies that multiple wake-ups may be coalesced into a
/// single `poll` invocation by the runtime.
///
/// Also note that yielding to competing tasks is not guaranteed: it is the
/// executor’s choice which task to run and the executor may choose to run the
/// current task again.
#[inline]
#[stable(feature = "futures_api", since = "1.36.0")]
pub fn wake(self) {
Expand Down
12 changes: 6 additions & 6 deletions library/std/src/keyword_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ mod as_keyword {}
/// A break expression is normally associated with the innermost loop enclosing the
/// `break` but a label can be used to specify which enclosing loop is affected.
///
///```rust
/// ```rust
/// 'outer: for i in 1..=5 {
/// println!("outer iteration (i): {i}");
///
Expand All @@ -87,7 +87,7 @@ mod as_keyword {}
/// }
/// }
/// println!("Bye.");
///```
/// ```
///
/// When associated with `loop`, a break expression may be used to return a value from that loop.
/// This is only valid with `loop` and not with any other type of loop.
Expand Down Expand Up @@ -194,20 +194,20 @@ mod const_keyword {}
/// When `continue` is encountered, the current iteration is terminated, returning control to the
/// loop head, typically continuing with the next iteration.
///
///```rust
/// ```rust
/// // Printing odd numbers by skipping even ones
/// for number in 1..=10 {
/// if number % 2 == 0 {
/// continue;
/// }
/// println!("{number}");
/// }
///```
/// ```
///
/// Like `break`, `continue` is normally associated with the innermost enclosing loop, but labels
/// may be used to specify the affected loop.
///
///```rust
/// ```rust
/// // Print Odd numbers under 30 with unit <= 5
/// 'tens: for ten in 0..3 {
/// '_units: for unit in 0..=9 {
Expand All @@ -220,7 +220,7 @@ mod const_keyword {}
/// println!("{}", ten * 10 + unit);
/// }
/// }
///```
/// ```
///
/// See [continue expressions] from the reference for more details.
///
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ arrayvec = { version = "0.7", default-features = false }
askama = { version = "0.11", default-features = false, features = ["config"] }
atty = "0.2"
pulldown-cmark = { version = "0.9", default-features = false }
minifier = "0.0.43"
minifier = "0.1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
smallvec = "1.6.1"
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/html/static/images/brush.svg

This file was deleted.

16 changes: 8 additions & 8 deletions src/test/ui-fulldeps/lint-tool-test.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ warning: lint name `test_group` is deprecated and may not have an effect in the
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`

warning: unknown lint: `this_lint_does_not_exist`
--> $DIR/lint-tool-test.rs:36:8
|
LL | #[deny(this_lint_does_not_exist)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unknown_lints)]` on by default

warning: lint name `test_lint` is deprecated and may not have an effect in the future.
--> $DIR/lint-tool-test.rs:9:23
|
Expand All @@ -44,6 +36,14 @@ warning: lint name `test_group` is deprecated and may not have an effect in the
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`

warning: unknown lint: `this_lint_does_not_exist`
--> $DIR/lint-tool-test.rs:36:8
|
LL | #[deny(this_lint_does_not_exist)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unknown_lints)]` on by default

warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-tool-test.rs:6:1
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:17
|
LL | mod inner { #![macro_escape] }
| ^^^^^^^^^^^^^^^^
|
= help: try an outer attribute: `#[macro_use]`

warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:1
|
LL | #[macro_escape]
| ^^^^^^^^^^^^^^^

warning: unknown lint: `x5400`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:46:9
|
Expand Down Expand Up @@ -172,20 +186,6 @@ warning: unknown lint: `x5100`
LL | #[deny(x5100)] impl S { }
| ^^^^^

warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:17
|
LL | mod inner { #![macro_escape] }
| ^^^^^^^^^^^^^^^^
|
= help: try an outer attribute: `#[macro_use]`

warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:1
|
LL | #[macro_escape]
| ^^^^^^^^^^^^^^^

warning: use of deprecated attribute `crate_id`: no longer used.
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:85:1
|
Expand Down
53 changes: 53 additions & 0 deletions src/test/ui/lint/issue-97094.interleaved.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
error: unknown lint: `nonex_lint_top_level`
--> $DIR/issue-97094.rs:14:26
|
LL | #![cfg_attr(all(), allow(nonex_lint_top_level))]
| ^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/issue-97094.rs:10:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(unknown_lints)]` implied by `#[deny(warnings)]`

error: lint `bare_trait_object` has been renamed to `bare_trait_objects`
--> $DIR/issue-97094.rs:16:26
|
LL | #![cfg_attr(all(), allow(bare_trait_object))]
| ^^^^^^^^^^^^^^^^^ help: use the new name: `bare_trait_objects`
|
= note: `#[deny(renamed_and_removed_lints)]` implied by `#[deny(warnings)]`

error: unknown lint: `nonex_lint_mod`
--> $DIR/issue-97094.rs:19:25
|
LL | #[cfg_attr(all(), allow(nonex_lint_mod))]
| ^^^^^^^^^^^^^^

error: unknown lint: `nonex_lint_mod_inner`
--> $DIR/issue-97094.rs:22:30
|
LL | #![cfg_attr(all(), allow(nonex_lint_mod_inner))]
| ^^^^^^^^^^^^^^^^^^^^

error: unknown lint: `nonex_lint_fn`
--> $DIR/issue-97094.rs:26:25
|
LL | #[cfg_attr(all(), allow(nonex_lint_fn))]
| ^^^^^^^^^^^^^

error: unknown lint: `nonex_lint_in_macro`
--> $DIR/issue-97094.rs:37:29
|
LL | #[cfg_attr(all(), allow(nonex_lint_in_macro))]
| ^^^^^^^^^^^^^^^^^^^

error: unknown lint: `nonex_lint_fn`
--> $DIR/issue-97094.rs:56:13
|
LL | #[allow(nonex_lint_fn)]
| ^^^^^^^^^^^^^

error: aborting due to 7 previous errors

53 changes: 53 additions & 0 deletions src/test/ui/lint/issue-97094.nointerleaved.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
error: unknown lint: `nonex_lint_top_level`
--> $DIR/issue-97094.rs:14:26
|
LL | #![cfg_attr(all(), allow(nonex_lint_top_level))]
| ^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/issue-97094.rs:10:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(unknown_lints)]` implied by `#[deny(warnings)]`

error: lint `bare_trait_object` has been renamed to `bare_trait_objects`
--> $DIR/issue-97094.rs:16:26
|
LL | #![cfg_attr(all(), allow(bare_trait_object))]
| ^^^^^^^^^^^^^^^^^ help: use the new name: `bare_trait_objects`
|
= note: `#[deny(renamed_and_removed_lints)]` implied by `#[deny(warnings)]`

error: unknown lint: `nonex_lint_mod`
--> $DIR/issue-97094.rs:19:25
|
LL | #[cfg_attr(all(), allow(nonex_lint_mod))]
| ^^^^^^^^^^^^^^

error: unknown lint: `nonex_lint_mod_inner`
--> $DIR/issue-97094.rs:22:30
|
LL | #![cfg_attr(all(), allow(nonex_lint_mod_inner))]
| ^^^^^^^^^^^^^^^^^^^^

error: unknown lint: `nonex_lint_fn`
--> $DIR/issue-97094.rs:26:25
|
LL | #[cfg_attr(all(), allow(nonex_lint_fn))]
| ^^^^^^^^^^^^^

error: unknown lint: `nonex_lint_in_macro`
--> $DIR/issue-97094.rs:37:29
|
LL | #[cfg_attr(all(), allow(nonex_lint_in_macro))]
| ^^^^^^^^^^^^^^^^^^^

error: unknown lint: `nonex_lint_fn`
--> $DIR/issue-97094.rs:56:13
|
LL | #[allow(nonex_lint_fn)]
| ^^^^^^^^^^^^^

error: aborting due to 7 previous errors

Loading

0 comments on commit f80e454

Please sign in to comment.