forked from Rust-GCC/gccrs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature-gate: Cleanup visitor and constructor
This commit turns a few of the fields into `tl::optional<T>` and cleanups the constructor with a couple default parameters. We can also reuse the variable that we are `switch`ing on, instead of repeating the enum variants each time. Most importantly, the `FeatureGate` visitor now uses the `DefaultAstVisitor` correctly, and will now visit nested items. This means that we have to fix a bunch of the testsuite as some feature attributes were missing. gcc/rust/ChangeLog: * checks/errors/rust-feature.cc (Feature::create): Reuse variable, remove now optional parameters from constructor. * checks/errors/rust-feature.h: Cleanup class definition. * checks/errors/rust-feature-gate.cc (FeatureGate::gate): Use optional. * checks/errors/rust-feature-gate.h: Cleanup visitor implementation. gcc/testsuite/ChangeLog: * rust/compile/assume.rs: Add missing feature attribute. * rust/compile/issue-1901.rs: Likewise. * rust/compile/issue-1981.rs: Likewise. * rust/compile/sizeof-stray-infer-var-bug.rs: Likewise. * rust/compile/torture/intrinsics-8.rs: Likewise. * rust/compile/torture/transmute-size-check-1.rs: Likewise. * rust/compile/torture/transmute1.rs: Likewise. * rust/compile/torture/uninit-intrinsic-1.rs: Likewise. * rust/execute/torture/issue-1436.rs: Likewise. * rust/execute/torture/issue-2583.rs: Likewise.
- Loading branch information
1 parent
06e8b82
commit 084789e
Showing
15 changed files
with
90 additions
and
169 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(intrinsics)] | ||
|
||
mod intrinsics { | ||
extern "rust-intrinsic" { | ||
pub fn assume(value: bool); | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(intrinsics)] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(intrinsics)] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(intrinsics)] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(intrinsics)] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(intrinsics)] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(intrinsics)] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(intrinsics)] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
// { dg-options "-w" } | ||
|
||
#![feature(intrinsics)] | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
|
||
|
Oops, something went wrong.