Skip to content

Commit

Permalink
Rollup merge of #91349 - tmiasko:accumulate-remark-args, r=nikic
Browse files Browse the repository at this point in the history
Accumulate all values of `-C remark` option

When `-C remark=...` option is specified multiple times,
accumulate all values instead of using only the last one.

r? `@nikic`
  • Loading branch information
matthiaskrgr authored Nov 29, 2021
2 parents b8a4a4c + e74e39a commit e15e0ba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
7 changes: 7 additions & 0 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,13 @@ impl Passes {
Passes::All => false,
}
}

pub fn extend(&mut self, passes: impl IntoIterator<Item = String>) {
match *self {
Passes::Some(ref mut v) => v.extend(passes),
Passes::All => {}
}
}
}

pub const fn default_lib_output() -> CrateType {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ mod parse {
v => {
let mut passes = vec![];
if parse_list(&mut passes, v) {
*slot = Passes::Some(passes);
slot.extend(passes);
true
} else {
false
Expand Down
13 changes: 11 additions & 2 deletions src/test/ui/optimization-remark.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
// build-pass
// ignore-pass
// no-system-llvm
// revisions: all inline
// compile-flags: --crate-type=lib -Cdebuginfo=1 -Copt-level=2
// revisions: all inline merge1 merge2
// compile-flags: --crate-type=lib -Cdebuginfo=1 -Copt-level=2
//
// Check that remarks can be enabled individually or with "all":
//
// [all] compile-flags: -Cremark=all
// [inline] compile-flags: -Cremark=inline
//
// Check that values of -Cremark flag are accumulated:
//
// [merge1] compile-flags: -Cremark=all -Cremark=giraffe
// [merge2] compile-flags: -Cremark=inline -Cremark=giraffe
//
// error-pattern: inline: f not inlined into g
// dont-check-compiler-stderr

Expand Down

1 comment on commit e15e0ba

@elvismunyikiiru
Copy link

@elvismunyikiiru elvismunyikiiru commented on e15e0ba Nov 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0=PENTAGRAM HEXAGRAM=1
RUN THIS ALGORYTHM

glyphs
SOLVE FOR gon

Please sign in to comment.