Auto merge of #53662 - kennytm:rollup, r=kennytm
Rollup of 16 pull requests Successful merges: - #53311 (Window Mutex: Document that we properly initialize the SRWLock) - #53503 (Discourage overuse of mem::forget) - #53545 (Fix #50865: ICE on impl-trait returning functions reaching private items) - #53559 (add macro check for lint) - #53562 (Lament the invincibility of the Turbofish) - #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()) - #53592 (docs: minor stylistic changes to str/string docs) - #53594 (Update RELEASES.md to include clippy-preview) - #53600 (Fix a grammatical mistake in "expected generic arguments" errors) - #53614 (update nomicon and book) - #53617 (tidy: Stop requiring a license header) - #53618 (Add missing fmt examples) - #53636 (Prefer `.nth(n)` over `.skip(n).next()`.) - #53644 (Use SmallVec for SmallCStr) - #53664 (Remove unnecessary closure in rustc_mir/build/mod.rs) - #53666 (Added rustc_codegen_llvm to compiler documentation.)
This commit is contained in:
commit
727eabd681
114 changed files with 382 additions and 305 deletions
|
|
@ -36,6 +36,10 @@
|
|||
// My heart aches in sorrow, for I know I am defeated. Let this be a warning
|
||||
// to all those who come after. Here stands the bastion of the Turbofish.
|
||||
|
||||
// See https://github.com/rust-lang/rust/pull/53562
|
||||
// and https://github.com/rust-lang/rfcs/pull/2527
|
||||
// for context.
|
||||
|
||||
fn main() {
|
||||
let (oh, woe, is, me) = ("the", "Turbofish", "remains", "undefeated");
|
||||
let _: (bool, bool) = (oh<woe, is>(me));
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0244]: wrong number of type arguments: expected at most 2, found 3
|
|||
--> $DIR/generic-impl-more-params-with-defaults.rs:23:5
|
||||
|
|
||||
LL | Vec::<isize, Heap, bool>::new();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type argument
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type arguments
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0244]: wrong number of type arguments: expected at most 2, found 3
|
|||
--> $DIR/generic-type-more-params-with-defaults.rs:19:12
|
||||
|
|
||||
LL | let _: Vec<isize, Heap, bool>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type argument
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type arguments
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@
|
|||
// aux-build:lints-in-foreign-macros.rs
|
||||
// compile-pass
|
||||
|
||||
#![warn(unused_imports)]
|
||||
#![warn(unused_imports)] //~ missing documentation for crate [missing_docs]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate lints_in_foreign_macros;
|
||||
|
|
@ -24,5 +25,7 @@ mod a { foo!(); }
|
|||
mod b { bar!(); }
|
||||
mod c { baz!(use std::string::ToString;); } //~ WARN: unused import
|
||||
mod d { baz2!(use std::string::ToString;); } //~ WARN: unused import
|
||||
baz!(pub fn undocumented() {}); //~ WARN: missing documentation for a function
|
||||
baz2!(pub fn undocumented2() {}); //~ WARN: missing documentation for a function
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
warning: unused import: `std::string::ToString`
|
||||
--> $DIR/lints-in-foreign-macros.rs:20:16
|
||||
--> $DIR/lints-in-foreign-macros.rs:21:16
|
||||
|
|
||||
LL | () => {use std::string::ToString;} //~ WARN: unused import
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
@ -10,18 +10,48 @@ LL | mod a { foo!(); }
|
|||
note: lint level defined here
|
||||
--> $DIR/lints-in-foreign-macros.rs:14:9
|
||||
|
|
||||
LL | #![warn(unused_imports)]
|
||||
LL | #![warn(unused_imports)] //~ missing documentation for crate [missing_docs]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused import: `std::string::ToString`
|
||||
--> $DIR/lints-in-foreign-macros.rs:25:18
|
||||
--> $DIR/lints-in-foreign-macros.rs:26:18
|
||||
|
|
||||
LL | mod c { baz!(use std::string::ToString;); } //~ WARN: unused import
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused import: `std::string::ToString`
|
||||
--> $DIR/lints-in-foreign-macros.rs:26:19
|
||||
--> $DIR/lints-in-foreign-macros.rs:27:19
|
||||
|
|
||||
LL | mod d { baz2!(use std::string::ToString;); } //~ WARN: unused import
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: missing documentation for crate
|
||||
--> $DIR/lints-in-foreign-macros.rs:14:1
|
||||
|
|
||||
LL | / #![warn(unused_imports)] //~ missing documentation for crate [missing_docs]
|
||||
LL | | #![warn(missing_docs)]
|
||||
LL | |
|
||||
LL | | #[macro_use]
|
||||
... |
|
||||
LL | |
|
||||
LL | | fn main() {}
|
||||
| |____________^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/lints-in-foreign-macros.rs:15:9
|
||||
|
|
||||
LL | #![warn(missing_docs)]
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
warning: missing documentation for a function
|
||||
--> $DIR/lints-in-foreign-macros.rs:28:6
|
||||
|
|
||||
LL | baz!(pub fn undocumented() {}); //~ WARN: missing documentation for a function
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: missing documentation for a function
|
||||
--> $DIR/lints-in-foreign-macros.rs:29:7
|
||||
|
|
||||
LL | baz2!(pub fn undocumented2() {}); //~ WARN: missing documentation for a function
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue