-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gccrs: remove bad type checking diagnostic
This was a bad diagnostic added when I was working on slices and iterators also the name of the function is also bad. This is all about setting up associated types based on the current context of the bounds assocated with the associated trait bounds on this function. The tell tale is that this didnt have an associated rust error code so this is most definetly not the correct error diagnostic. Fixes #3403 gcc/rust/ChangeLog: * typecheck/rust-tyty-subst.cc (SubstitutionRef::monomorphize): remove diagnostic gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3403.rs: New test. Signed-off-by: Philip Herron <[email protected]>
- Loading branch information
Showing
3 changed files
with
40 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
pub struct Foo { | ||
a: i32, | ||
// { dg-warning "field is never read" "" { target *-*-* } .-1 } | ||
} | ||
pub struct Bar(i32); | ||
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
pub mod core { | ||
pub mod default { | ||
pub trait Default: Sized { | ||
fn default() -> Self; | ||
} | ||
|
||
impl Default for i32 { | ||
fn default() -> Self { | ||
0 | ||
} | ||
} | ||
} | ||
} | ||
|
||
impl ::core::default::Default for Bar { | ||
#[inline] | ||
fn default() -> Bar { | ||
Bar(core::default::Default::default()) | ||
} | ||
} | ||
|
||
impl ::core::default::Default for Foo { | ||
#[inline] | ||
fn default() -> Foo { | ||
Foo { | ||
a: core::default::Default::default(), | ||
} | ||
} | ||
} |
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