-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rollup of 11 pull requests #76582
Merged
Merged
Rollup of 11 pull requests #76582
+1,320
−301
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
Those statements are removed by CleanupNonCodegenStatements pass in drop lowering phase, and should not occur afterwards.
The current description of the trivial casts lint under the "allowed by default" listing in the rustc book indicates the lint is for lints which may be removed, which is less clear than saying it's for lints which may be replaced by coercion (which is the wording used by the error message included in the doc). This commit changes the wording slightly to better describe what the lint does.
…lace> clippy::borrowed_box
clippy::single-char-push-str
This commit adjusts the missing field diagnostic logic for struct expressions in typeck to improve the diagnostic when the missing fields are inaccessible. Signed-off-by: David Wood <david@davidtw.co>
This commit adjusts the missing field diagnostic logic for struct patterns in typeck to improve the diagnostic when the missing fields are inaccessible. Signed-off-by: David Wood <david@davidtw.co>
Syntactically permit unsafety on mods Similar to rust-lang#66183; we will accept these constructs syntactically but reject with a semantic check after macro expansion if a proc macro hasn't replaced it with something else meaningful to Rust. ```rust #[mymacro] unsafe mod m { ... } #[mymacro] unsafe extern "C++" { ... } ``` The intention is that this might be used as a kind of "item-level unsafe" in attribute macro DSLs -- holding things which are unsafe to declare but potentially safe to use. For example I look forward to using this in https://github.com/dtolnay/cxx. In the absence of a procedural macro rewriting them to something else, they'll continue to be rejected at compile time though with a better error message than before. ### Before: ```console error: expected item, found keyword `unsafe` --> src/main.rs:1:1 | 1 | unsafe mod m { | ^^^^^^ expected item ``` ### After: ```console error: module cannot be declared unsafe --> src/main.rs:1:1 | 1 | unsafe mod m { | ^^^^^^ error: extern block cannot be declared unsafe --> src/main.rs:4:1 | 4 | unsafe extern "C++" { | ^^^^^^ ``` Closes rust-lang#68048.
Add docs about crate level documentation support Wrote information about how to write documentation on the crate level in rhe rustdoc book
…=lcnr Add revisions to const generic issue UI tests. Fixes rust-lang#75279. I have gotten into the flow, so I can do more of these if requested. I'm looking for feedback as to whether my work is on the right track so far.
…private-fields, r=estebank typeck: don't suggest inaccessible private fields Fixes rust-lang#76077. This PR adjusts the missing field diagnostic logic in typeck so that when none of the missing fields in a struct expr are accessible then the error is less confusing. r? @estebank
Validate removal of AscribeUserType, FakeRead, and Shallow borrow Those statements are removed by CleanupNonCodegenStatements pass in drop lowering phase, and should not occur afterwards.
…_lint_doc, r=steveklabnik Reword `trivial_casts` lint in rustc book to better explain what it does. The current description of the trivial casts lint under the "allowed by default" listing in the rustc book indicates the lint is for casts which may be removed, which is less clear than saying it's for casts which may be replaced by coercion (which is the wording used by the error message included in the doc). This commit changes the wording slightly to better describe what the lint does. This issue bit me in some recent code where I was attempting to convert a `Vec<SomeType>` to a `Vec<SomeTraitObject>`, and hit my project-wide `#![deny(trivial_casts)]` with `map(|o| Box::new(o) as TraitObject)`. I'd read the book docs for `trivial_casts` and was surprised by the error, as I took it to mean the cast ought to be removed (rather than replaced by ascription in this case). Removing the cast meant other code didn't compile, and I then found issues like rust-lang#23742 and realized my misunderstanding.
add the `const_evaluatable_checked` feature Implements a rather small subset of rust-lang/compiler-team#340 Unlike the MCP, this does not try to compare different constant, but instead only adds the constants found in where clauses to the predicates of a function. This PR adds the feature gate `const_evaluatable_checked`, without which nothing should change. r? @oli-obk @eddyb
small typo fix in rustc_parse docs small typo in rustc_parse::new_parser_from_file's documentation I'm not sure a PR is the way to do this though.
take reference to Place directly instead of taking reference to Box<Place> clippy::borrowed_box
use push(char) to add chars (single-char &strs) to strings instead of push_str(&str)
…, r=jyn514 Add missing examples on core traits' method Linked to rust-lang#76450. r? @jyn514
📌 Commit 044f717 has been approved by |
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Sep 10, 2020
☀️ Test successful - checks-actions, checks-azure |
This was referenced Sep 10, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merged-by-bors
This PR was explicitly merged by bors.
rollup
A PR which is a rollup
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
Successful merges:
trivial_casts
lint in rustc book to better explain what it does. #76555 (Rewordtrivial_casts
lint in rustc book to better explain what it does.)const_evaluatable_checked
feature #76559 (add theconst_evaluatable_checked
feature)Failed merges:
r? @ghost