forked from dtolnay/thiserror
-
Notifications
You must be signed in to change notification settings - Fork 2
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
[pull] master from dtolnay:master #1
Open
pull
wants to merge
619
commits into
mesalock-linux:master
Choose a base branch
from
dtolnay:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78a3e69
to
305b57a
Compare
Remove option_if_let_else clippy suppression
Make CI verify that error_generic_member_access works in latest nightly
Make env-dep:RUSTC_BOOTSTRAP get listed in probe's dep-info
Emit dep-info for probe.rs in case sccache needs it
Compiler is unable to generate as efficient code for `write!(f, "text")` as it does for `f.write_str("text")`. This PR checks if the `#[error("text")]` uses a simple string literal without the `{` and `}` characters, and without arguments, and uses `write_str` if so.
Optimize performance for string literals in Display::fmt
warning: unnecessary hashes around raw string literal --> tests/test_display.rs:354:12 | 354 | assert(r#"raw brace left {"#, Error::BraceLeft); | ^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes = note: `-W clippy::needless-raw-string-hashes` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::needless_raw_string_hashes)]` help: remove all the hashes around the string literal | 354 - assert(r#"raw brace left {"#, Error::BraceLeft); 354 + assert(r"raw brace left {", Error::BraceLeft); | warning: unnecessary hashes around raw string literal --> tests/test_display.rs:355:12 | 355 | assert(r#"raw brace left 2 \x7B"#, Error::BraceLeft2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes help: remove all the hashes around the string literal | 355 - assert(r#"raw brace left 2 \x7B"#, Error::BraceLeft2); 355 + assert(r"raw brace left 2 \x7B", Error::BraceLeft2); | warning: unnecessary hashes around raw string literal --> tests/test_display.rs:356:12 | 356 | assert(r#"raw brace right }"#, Error::BraceRight); | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes help: remove all the hashes around the string literal | 356 - assert(r#"raw brace right }"#, Error::BraceRight); 356 + assert(r"raw brace right }", Error::BraceRight); | warning: unnecessary hashes around raw string literal --> tests/test_display.rs:357:12 | 357 | assert(r#"raw brace right 2 \x7D"#, Error::BraceRight2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes help: remove all the hashes around the string literal | 357 - assert(r#"raw brace right 2 \x7D"#, Error::BraceRight2); 357 + assert(r"raw brace right 2 \x7D", Error::BraceRight2); |
warning: assigning the result of `Clone::clone()` may be inefficient --> impl/src/ast.rs:85:21 | 85 | *display = attrs.display.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `display.clone_from(&attrs.display)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `#[warn(clippy::assigning_clones)]` on by default warning: assigning the result of `Clone::clone()` may be inefficient --> impl/src/expand.rs:158:9 | 158 | display_implied_bounds = display.implied_bounds.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `display_implied_bounds.clone_from(&display.implied_bounds)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones warning: assigning the result of `Clone::clone()` may be inefficient --> impl/src/expand.rs:402:21 | 402 | display_implied_bounds = display.implied_bounds.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `display_implied_bounds.clone_from(&display.implied_bounds)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
error: use of deprecated struct `test_deprecated::DeprecatedStruct` --> tests/test_lints.rs:73:13 | 73 | DeprecatedStruct, | ^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> tests/test_lints.rs:39:13 | 39 | #![deny(deprecated)] | ^^^^^^^^^^
Suppress deprecation warning on generated From impls
error[E0425]: cannot find value `_0` in this scope --> tests/test_display.rs:308:17 | 308 | #[error("{0}")] | ^^^^^ not found in this scope error[E0425]: cannot find value `__display_x` in this scope --> tests/test_display.rs:310:17 | 310 | #[error("{x}")] | ^^^^^ not found in this scope
Fix spans on macro-generated bindings and format variables
Unspan From impl contents
error[E0599]: the method `as_display` exists for reference `&<T as FromStr>::Err`, but its trait bounds were not satisfied --> tests/test_generics.rs:178:13 | 178 | #[error("couldn't parse entry: {0}")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `&<T as FromStr>::Err` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `<T as FromStr>::Err: std::fmt::Display` which is required by `&<T as FromStr>::Err: AsDisplay<'_>`
Generate trait bounds on associated types
Add feature gate to tests that use std
warning: unused import: `std::path::PathBuf` --> tests/test_expr.rs:4:5 | 4 | use std::path::PathBuf; | ^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
Add CI step to test with "std" disabled
Cargo stopped generating this in its project template 5 years ago. It would belong in a global gitignore instead.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )