8000 Rollup of 5 pull requests by Dylan-DPC-zz · Pull Request #72097 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 5 pull requests #72097

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

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Emit a warning when optimization fuel runs out
`eprintln!` gets swallowed by Cargo too easily.
  • Loading branch information
jonas-schievink committed May 10, 2020
commit 62116c31cd863c8aab35e5c7acfb8ded41ca28a1
2 changes: 1 addition & 1 deletion src/librustc_session/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ impl Session {
let mut fuel = self.optimization_fuel.lock();
ret = fuel.remaining != 0;
if fuel.remaining == 0 && !fuel.out_of_fuel {
eprintln!("optimization-fuel-exhausted: {}", msg());
self.warn(&format!("optimization-fuel-exhausted: {}", msg()));
fuel.out_of_fuel = true;
} else if fuel.remaining > 0 {
fuel.remaining -= 1;
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/optimization-fuel-0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

use std::mem::size_of;

// (#55495: The --error-format is to sidestep an issue in our test harness)
// compile-flags: --error-format human -Z fuel=foo=0
// compile-flags: -Z fuel=foo=0

struct S1(u8, u16, u8);
struct S2(u8, u16, u8);
Expand Down
5 changes: 4 additions & 1 deletion src/test/ui/optimization-fuel-0.stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
optimization-fuel-exhausted: Reorder fields of "S1"
warning: optimization-fuel-exhausted: Reorder fields of "S1"

warning: 1 warning emitted

3 changes: 1 addition & 2 deletions src/test/ui/optimization-fuel-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

use std::mem::size_of;

// (#55495: The --error-format is to sidestep an issue in our test harness)
// compile-flags: --error-format human -Z fuel=foo=1
// compile-flags: -Z fuel=foo=1

struct S1(u8, u16, u8);
struct S2(u8, u16, u8);
Expand Down
5 changes: 4 additions & 1 deletion src/test/ui/optimization-fuel-1.stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
optimization-fuel-exhausted: Reorder fields of "S2"
warning: optimization-fuel-exhausted: Reorder fields of "S2"

warning: 1 warning emitted

0