forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#136837 - compiler-errors:contracts-body-lowering, r=celinval Overhaul how contracts are lowered on fn-like bodies Consolidates all of the contracts lowering logic into `lower_fn_body`, rather than having it be split between `lower_item_kind` and `lower_fn_body`. This should fix rust-lang#136683. r? celinval
- Loading branch information
Showing
5 changed files
with
124 additions
and
113 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Ensure we don't ICE when lowering contracts on an associated item. | ||
|
||
//@ compile-flags: --crate-type=lib | ||
//@ check-pass | ||
|
||
#![feature(contracts)] | ||
//~^ WARN the feature `contracts` is incomplete and may not be safe to use | ||
|
||
extern crate core; | ||
|
||
use core::contracts::requires; | ||
|
||
struct Foo; | ||
|
||
impl Foo { | ||
#[requires(align > 0 && (align & (align - 1)) == 0)] | ||
pub fn foo(align: i32) {} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
warning: the feature `contracts` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/associated-item.rs:6:12 | ||
| | ||
LL | #![feature(contracts)] | ||
| ^^^^^^^^^ | ||
| | ||
= note: see issue #128044 <https://github.com/rust-lang/rust/issues/128044> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|