-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lower: Correctly lower parenthesized types
This is useful for handling multiple trait bounds, and required for better handling of auto traits. gcc/rust/ChangeLog: * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): Add implementation for ParenthesizedType. * hir/rust-ast-lower-type.h: Declare that new visitor. gcc/testsuite/ChangeLog: * rust/compile/auto_traits1.rs: New test.
- Loading branch information
1 parent
de8606f
commit 31d3f55
Showing
3 changed files
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// { dg-additional-options "-frust-compile-until=typecheck" } | ||
|
||
#![feature(optin_builtin_traits)] | ||
|
||
pub unsafe auto trait Send {} | ||
#[lang = "sync"] | ||
pub unsafe auto trait Sync {} | ||
|
||
trait A { | ||
fn a_method(&self) {} | ||
} | ||
|
||
fn foo(a: &(dyn A + Send + Sync)) { | ||
a.a_method(); | ||
} | ||
|
||
struct S; | ||
|
||
impl A for S { | ||
fn a_method(&self) {} | ||
} | ||
|
||
fn main() { | ||
let s = S; | ||
|
||
foo(&s); | ||
} |