8000 Rollup of 8 pull requests by matthiaskrgr · Pull Request #117135 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 8 pull requests #117135

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

Merged
merged 22 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
963131e
Derive `Ord`, `PartialOrd` and `Hash` for `SocketAddr*`
WaffleLapkin Oct 14, 2023
5c13c69
Add tests for `SocketAddrV6` ordering with scope_id and flowinfo
WaffleLapkin Oct 15, 2023
2bba98b
Avoid unnecessary renumbering
JonasAlaif Oct 16, 2023
66a554b
Add method to convert internal to stable constructs
celinval Oct 21, 2023
f613b26
Add `internal()` method counterpart to `stable()`
celinval Oct 23, 2023
421631a
Remove unsafe and `Rc`
celinval Oct 23, 2023
cb61816
compiler: Add target features for LoongArch
heiher Oct 19, 2023
6cf9423
tests: Add features-gate for LoongArch
heiher Oct 19, 2023
300d04d
tests/ui/abi/compatibility: Set min-llvm-version to 17 for LoongArch64
heiher Oct 24, 2023
ae86f59
Add test and remove double ref
celinval Oct 24, 2023
2b36547
Introduce `-C instrument-coverage=branch` to gate branch coverage
Swatinem Aug 21, 2023
68f5536
Migrate diagnostics in `rustc_hir_analysis/src/coherence/orphan.rs`
obeis Oct 3, 2023
90e3aae
Remove incomplete features from RPITIT/AFIT tests
compiler-errors Oct 24, 2023
f3d20be
suggest unwrap/expect for let binding type mismatch
chenyukang Oct 17, 2023
c07ff9c
Rollup merge of #116094 - Swatinem:coverage-branch-gate, r=wesleywiser
matthiaskrgr Oct 24, 2023 8000
f3e18e4
Rollup merge of #116396 - obeis:hir-analysis-migrate-diagnostics-7, r…
matthiaskrgr Oct 24, 2023
845c414
Rollup merge of #116714 - WaffleLapkin:order-the-order, r=joshtriplett
matthiaskrgr Oct 24, 2023
61ff4db
Rollup merge of #116792 - JonasAlaif:renumber-fix, r=b-naber
matthiaskrgr Oct 24, 2023
7a0a2d2
Rollup merge of #116841 - chenyukang:yukang-suggest-unwrap-expect, r=…
matthiaskrgr Oct 24, 2023
84f0bef
Rollup merge of #116943 - heiher:target-features, r=wesleywiser
matthiaskrgr Oct 24, 2023
f131a0a
Rollup merge of #117010 - celinval:smir-internal, r=oli-obk
matthiaskrgr Oct 24, 2023
060bdfd
Rollup merge of #117127 - compiler-errors:incomplete, r=lqd
matthiaskrgr Oct 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ pub enum MirSpanview {
pub enum InstrumentCoverage {
/// Default `-C instrument-coverage` or `-C instrument-coverage=statement`
All,
/// Additionally, instrument branches and output branch coverage.
/// `-Zunstable-options -C instrument-coverage=branch`
Branch,
/// `-Zunstable-options -C instrument-coverage=except-unused-generics`
ExceptUnusedGenerics,
/// `-Zunstable-options -C instrument-coverage=except-unused-functions`
Expand Down Expand Up @@ -2747,7 +2750,10 @@ pub fn build_session_options(
}
(Some(InstrumentCoverage::Off | InstrumentCoverage::All), _) => {}
(Some(_), _) if !unstable_opts.unstable_options => {
handler.early_error("`-C instrument-coverage=except-*` requires `-Z unstable-options`");
handler.early_error(
"`-C instrument-coverage=branch` and `-C instrument-coverage=except-*` \
require `-Z unstable-options`",
);
}
(None, None) => {}
(None, ic) => {
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ mod desc {
pub const parse_mir_spanview: &str = "`statement` (default), `terminator`, or `block`";
pub const parse_dump_mono_stats: &str = "`markdown` (default) or `json`";
pub const parse_instrument_coverage: &str =
"`all` (default), `except-unused-generics`, `except-unused-functions`, or `off`";
"`all` (default), `branch`, `except-unused-generics`, `except-unused-functions`, or `off`";
pub const parse_instrument_xray: &str = "either a boolean (`yes`, `no`, `on`, `off`, etc), or a comma separated list of settings: `always` or `never` (mutually exclusive), `ignore-loops`, `instruction-threshold=N`, `skip-entry`, `skip-exit`";
pub const parse_unpretty: &str = "`string` or `string=string`";
pub const parse_treat_err_as_bug: &str = "either no value or a non-negative number";
Expand Down Expand Up @@ -931,6 +931,7 @@ mod parse {

*slot = Some(match v {
"all" => InstrumentCoverage::All,
"branch" => InstrumentCoverage::Branch,
"except-unused-generics" | "except_unused_generics" => {
InstrumentCoverage::ExceptUnusedGenerics
}
Expand Down Expand Up @@ -1356,6 +1357,7 @@ options! {
reports (note, the compiler build config must include `profiler = true`); \
implies `-C symbol-mangling-version=v0`. Optional values are:
`=all` (implicit value)
`=branch`
`=except-unused-generics`
`=except-unused-functions`
`=off` (default)"),
Expand Down Expand Up @@ -1597,6 +1599,7 @@ options! {
reports (note, the compiler build config must include `profiler = true`); \
implies `-C symbol-mangling-version=v0`. Optional values are:
`=all` (implicit value)
`=branch`
`=except-unused-generics`
`=except-unused-functions`
`=off` (default)"),
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@ impl Session {
self.opts.cg.instrument_coverage() != InstrumentCoverage::Off
}

pub fn instrument_coverage_branch(&self) -> bool {
self.opts.cg.instrument_coverage() == InstrumentCoverage::Branch
}

pub fn instrument_coverage_except_unused_generics(&self) -> bool {
self.opts.cg.instrument_coverage() == InstrumentCoverage::ExceptUnusedGenerics
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/instrument-coverage/bad-value.bad.stderr
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
error: incorrect value `bad-value` for codegen option `instrument-coverage` - `all` (default), `except-unused-generics`, `except-unused-functions`, or `off` was expected
error: incorrect value `bad-value` for codegen option `instrument-coverage` - `all` (default), `branch`, `except-unused-generics`, `except-unused-functions`, or `off` was expected

2 changes: 1 addition & 1 deletion tests/ui/instrument-coverage/bad-value.blank.stderr
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
error: incorrect value `` for codegen option `instrument-coverage` - `all` (default), `except-unused-generics`, `except-unused-functions`, or `off` was expected
error: incorrect value `` for codegen option `instrument-coverage` - `all` (default), `branch`, `except-unused-generics`, `except-unused-functions`, or `off` was expected

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
error: `-C instrument-coverage=except-*` requires `-Z unstable-options`
error: `-C instrument-coverage=branch` and `-C instrument-coverage=except-*` require `-Z unstable-options`

2 changes: 1 addition & 1 deletion tests/ui/instrument-coverage/except-unused-generics.stderr
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
error: `-C instrument-coverage=except-*` requires `-Z unstable-options`
error: `-C instrument-coverage=branch` and `-C instrument-coverage=except-*` require `-Z unstable-options`

0