-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE when using generic newtypes cross-crate #9155
Labels
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Comments
Related to #7899 (but not identical). |
sfackler
added a commit
to sfackler/rust
that referenced
this issue
Sep 13, 2013
This is a workaround for rust-lang#9155. Currently, any uses of BufferedStream outside of libstd ICE.
bors
added a commit
that referenced
this issue
Sep 14, 2013
This is a workaround for #9155. Currently, any uses of BufferedStream outside of libstd ICE.
This particular case seems to be fixed by the PR #9560 by pcwalton! However, there are compiler errors on trying to use the |
Flagging as needstest. |
sfackler
added a commit
to sfackler/rust
that referenced
this issue
Oct 3, 2013
Add a test to make sure it works and switch a private struct over to a newtype. Closes rust-lang#9155
Merged
thestinger
added a commit
that referenced
this issue
Oct 3, 2013
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Jun 30, 2023
…, r=xFrednet Add redundant type annotations lint Hello, I'm trying to add the `redundat_type_annotations` lint. It's still WIP but I'd like to start gathering some feedbacks to be sure that I'm not doing things 100% wrong :) Right now it still misses lints like: - [x] `let foo: u32 = 5_u32`, - [x] `let foo: String = STest2::func()` - [x] `let foo: String = self.func()` (`MethodCall`) - [x] refs - [ ] Generics I've some problems regarding the second example above, in the `init` part of the `Local` I have: ```rust init: Some( Expr { hir_id: HirId(DefId(0:24 ~ playground[e1bd]::main).58), kind: Call( Expr { hir_id: HirId(DefId(0:24 ~ playground[e1bd]::main).59), kind: Path( TypeRelative( Ty { hir_id: HirId(DefId(0:24 ~ playground[e1bd]::main).61), kind: Path( Resolved( None, Path { span: src/main.rs:77:21: 77:27 (#0), res: Def( Struct, DefId(0:17 ~ playground[e1bd]::STest2), ), segments: [ PathSegment { ident: STest2#0, hir_id: HirId(DefId(0:24 ~ playground[e1bd]::main).60), res: Def( Struct, DefId(0:17 ~ playground[e1bd]::STest2), ), args: None, infer_args: true, }, ], }, ), ), span: src/main.rs:77:21: 77:27 (#0), }, PathSegment { ident: get_numb#0, hir_id: HirId(DefId(0:24 ~ playground[e1bd]::main).62), res: Err, args: None, infer_args: true, }, ), ), span: src/main.rs:77:21: 77:37 (#0), }, [], ), span: src/main.rs:77:21: 77:39 (#0), }, ), ``` And I'm not sure how to get the return type of the function `STest2::func()` since the resolved path `DefId` points to the struct itself and not the function. Do you have any idea on how I could get this information in this case? Thanks! changelog: changelog: [`redundant_type_annotations`]: New lint to warn on redundant type annotations fixes rust-lang#9155
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Turns out it's impossible to use generic newtypes across crates:
test.rs:
test2.rs:
This makes it impossible to use
std::rt::io::buffered::BufferedStream
.The text was updated successfully, but these errors were encountered: