Update to Rust 1.74 and use new clippy lints table (#8722)

Update to [Rust
1.74](https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html) and use
the new clippy lints table.

The update itself introduced a new clippy lint about superfluous hashes
in raw strings, which got removed.

I moved our lint config from `rustflags` to the newly stabilized
[workspace.lints](https://doc.rust-lang.org/stable/cargo/reference/workspaces.html#the-lints-table).
One consequence is that we have to `unsafe_code = "warn"` instead of
"forbid" because the latter now actually bans unsafe code:

```
error[E0453]: allow(unsafe_code) incompatible with previous forbid
  --> crates/ruff_source_file/src/newlines.rs:62:17
   |
62 |         #[allow(unsafe_code)]
   |                 ^^^^^^^^^^^ overruled by previous forbid
   |
   = note: `forbid` lint level was set on command line
```

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
konsti 2023-11-17 00:12:46 +01:00 committed by GitHub
parent 6d5d079a18
commit 14e65afdc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 1124 additions and 1054 deletions

View file

@ -1184,9 +1184,9 @@ mod tests {
#[test]
fn tokenize_slash() {
let source = r#" # trailing positional comment
let source = r" # trailing positional comment
# Positional arguments only after here
,/"#;
,/";
let test_case = tokenize(source);
@ -1229,8 +1229,8 @@ mod tests {
#[test]
fn triple_quoted_multiline_string_containing_comment() {
let test_case = tokenize(
r#"'''This string contains a hash looking like a comment
# This is not a comment'''"#,
r"'''This string contains a hash looking like a comment
# This is not a comment'''",
);
assert_debug_snapshot!(test_case.tokenize_reverse());
@ -1274,7 +1274,7 @@ mod tests {
#[test]
fn empty_string_literal() {
let test_case = tokenize(r#"'' # a comment '"#);
let test_case = tokenize(r"'' # a comment '");
assert_debug_snapshot!(test_case.tokenize_reverse());
}