-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1022: attribute expansion: Fix spurious stripping of tail expression r=CohenArthur a=CohenArthur This commit fixes the issue reported in #391, but highlights another one, which will be reported. Closes #391 1033: Fix bad copy-paste in can equal interface for pointer types r=philberty a=philberty When we perform method resolution we check if the self arguments can be matched. Here the bug was that pointer types had a bad vistitor and only could ever match reference types which is wrong and was a copy paste error. Fixes #1031 Addresses #849 Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com> Co-authored-by: Philip Herron <philip.herron@embecosm.com>
- Loading branch information
Showing
5 changed files
with
29 additions
and
6 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,16 @@ | ||
extern "rust-intrinsic" { | ||
pub fn offset<T>(dst: *const T, offset: isize) -> *const T; | ||
} | ||
|
||
#[lang = "const_ptr"] | ||
impl<T> *const T { | ||
pub const unsafe fn offset(self, count: isize) -> *const T { | ||
// { dg-warning "associated function is never used" "" { target *-*-* } .-1 } | ||
unsafe { offset(self, count) } | ||
} | ||
|
||
pub const unsafe fn add(self, count: usize) -> Self { | ||
// { dg-warning "associated function is never used" "" { target *-*-* } .-1 } | ||
unsafe { self.offset(count as isize) } | ||
} | ||
} |
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 @@ | ||
fn foo (e: &str) -> &str { | ||
&"" // { dg-bogus "cannot strip expression in this position - outer attributes not allowed" "#391" { xfail *-*-* } } | ||
// { dg-additional-options "-w" } | ||
|
||
fn foo(e: &str) -> &str { // { dg-bogus "expected" "#391" { xfail *-*-* } } | ||
&"" // { dg-bogus "expected" "#391" { xfail *-*-* } } | ||
} |