Skip to content
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 9 pull requests #101244

Closed
wants to merge 188 commits into from
Closed

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

aldhsu and others added 30 commits August 2, 2022 22:00
- only compare where predicates to trait bounds when generating where
  clause specific message to fix rust-lang#9151
- use comparable_trait_ref to account for trait bound generics to fix rust-lang#8757
…repr(C)` type is compatible with the other type
This enables more thorough checking of types to avoid triggering on
custom Some and None enum variants
It is passed an argument that is never used.
…jgillot

Simplify visitors

By removing some unused arguments.

r? `@cjgillot`
Extend `if_then_some_else_none` to also suggest `bool::then_some`

Closes rust-lang#9094.

changelog: Extend `if_then_some_else_none` to also suggest `bool::then_some`
evopen and others added 18 commits August 31, 2022 19:33
with manual impl SessionDiagnostic
fixes `SessionSubdiagnostic` to accept multiple attributes
emitting list of fluent message remains unresolved
Functions annotated with `#[rustc_lint_diagnostics]` are used by the
diagnostic migration lints to know when to lint, but functions that are
annotated with this attribute shouldn't themselves be linted.

Signed-off-by: David Wood <[email protected]>
…henkov

Add warning against unexpected --cfg with --check-cfg

This PR adds a warning when an unexpected `--cfg` is specified but not in the specified list of `--check-cfg`.

This is the follow-up PR I mentioned in rust-lang#99519.

r? `@petrochenkov`
…, r=petrochenkov

Pretty printing give proper error message without panic

Fixes rust-lang#100770
…iser

Simplify MIR opt tests

This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized.

Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the end to end effect of the optimization pipeline on the example code is.

r? `@wesleywiser`
…-when-appropriate, r=davidtwco

Suggest moving redundant generic args of an assoc fn to its trait

Closes rust-lang#89064
migrate rustc_query_system to use SessionDiagnostic

issues:
* variable list is not supported in fluent
* ~~cannot have two sub diagnostic with the same tag (eg. 2 .note or 2 .help)~~

allow multiple tag with SessionSubdiagnostic derive
Link “? operator” to relevant chapter in The Book

Before, the text simply asked people to use a symbol which is hard to
search for. Now the text links back to the chapter on error
propagation in The Book. That should help people find the relevant
keywords for further searches.
…t-no-self-lint, r=fee1-dead

lint: avoid linting diag functions with diag lints

Functions annotated with `#[rustc_lint_diagnostics]` are used by the diagnostic migration lints to know when to lint, but functions that are annotated with this attribute shouldn't themselves be linted.

cc rust-lang#100717 rust-lang#101041 (comment)
@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Aug 31, 2022
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Aug 31, 2022

📌 Commit 998a950 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 31, 2022
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

---- [ui] src/test/ui/check-cfg/mix.rs stdout ----
diff of stderr:

28 LL | #[cfg_attr(uu, test)]
30 
30 
- warning: unexpected condition value `bar` for condition name `feature`
-    |
-    = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
35 warning: unexpected `unknown_name` as condition name
36    |
36    |
37    = help: was set with `--cfg` but isn't in the `--check-cfg` expected names
+ 
+ 
+ warning: unexpected condition value `bar` for condition name `feature`
+    |
+    = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
39 warning: unexpected `cfg` condition name
40   --> $DIR/mix.rs:35:10



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/check-cfg/mix/mix.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args check-cfg/mix.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/check-cfg/mix.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/check-cfg/mix" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--check-cfg=names()" "--check-cfg=values(feature,\"foo\")" "--cfg" "feature=\"bar\"" "--cfg" "unknown_name" "-Z" "unstable-options" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/check-cfg/mix/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/check-cfg/mix.rs:11:7
   |
   |
LL | #[cfg(widnows)]
   |       ^^^^^^^ help: did you mean: `windows`
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:18:7
---

warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:22:7
   |
LL | #[cfg(feature = "zebra")]
   |
   = note: expected values for `feature` are: foo

warning: unexpected `cfg` condition name
warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:26:12
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
   |
LL | #[cfg_attr(uu, test)]

warning: unexpected `unknown_name` as condition name
   |
   |
   = help: was set with `--cfg` but isn't in the `--check-cfg` expected names

warning: unexpected condition value `bar` for condition name `feature`
   |
   = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:35:10
   |
   |
LL |     cfg!(widnows);
   |          ^^^^^^^ help: did you mean: `windows`
warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:38:10
   |
   |
LL |     cfg!(feature = "bar");
   |
   = note: expected values for `feature` are: foo

warning: unexpected `cfg` condition value
warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:40:10
   |
LL |     cfg!(feature = "zebra");
   |
   = note: expected values for `feature` are: foo

warning: unexpected `cfg` condition name
warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:42:10
   |
LL |     cfg!(xxx = "foo");

warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:44:10
   |
   |
LL |     cfg!(xxx);

warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:46:14
   |
   |
LL |     cfg!(any(xxx, windows));

warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:48:14
   |
   |
LL |     cfg!(any(feature = "bad", windows));
   |
   = note: expected values for `feature` are: foo

warning: unexpected `cfg` condition name
warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:50:23
   |
LL |     cfg!(any(windows, xxx));

warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:52:20
   |
   |
LL |     cfg!(all(unix, xxx));

warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:54:14
   |
   |
LL |     cfg!(all(aa, bb));

warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:54:18
   |
   |
LL |     cfg!(all(aa, bb));

warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:57:14
   |
   |
LL |     cfg!(any(aa, bb));

warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:57:18
   |
   |
LL |     cfg!(any(aa, bb));

warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:60:20
   |
   |
LL |     cfg!(any(unix, feature = "zebra"));
   |
   = note: expected values for `feature` are: foo

warning: unexpected `cfg` condition name
warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:62:14
   |
LL |     cfg!(any(xxx, feature = "zebra"));

warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:62:19
   |
   |
LL |     cfg!(any(xxx, feature = "zebra"));
   |
   = note: expected values for `feature` are: foo

warning: unexpected `cfg` condition name
warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:65:14
   |
LL |     cfg!(any(xxx, unix, xxx));

warning: unexpected `cfg` condition name
  --> /checkout/src/test/ui/check-cfg/mix.rs:65:25
   |
   |
LL |     cfg!(any(xxx, unix, xxx));

warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:68:14
   |
   |
LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
   |
   = note: expected values for `feature` are: foo

warning: unexpected `cfg` condition value
warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:68:33
   |
LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
   |
   = note: expected values for `feature` are: foo

warning: unexpected `cfg` condition value
warning: unexpected `cfg` condition value
  --> /checkout/src/test/ui/check-cfg/mix.rs:68:52
   |
LL |     cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
   |
   = note: expected values for `feature` are: foo

warning: 27 warnings emitted

@davidtwco davidtwco removed the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Oct 4, 2022
@matthiaskrgr matthiaskrgr deleted the rollup-e7xsl8j branch October 9, 2022 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.