Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 15.5k
Move tests in the statics category#154090
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| //! Regression test for https://github.com/rust-lang/rust/issues/3521 | ||
| //! | ||
| //@ run-rustfix | ||
| fn main() { | ||
| let foo = 100; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| //! Regression test for https://github.com/rust-lang/rust/issues/3521 | ||
| //! | ||
| //@ run-rustfix | ||
| fn main() { | ||
| let foo = 100; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| //! Regression test for https://github.com/rust-lang/rust/issues/3668 | ||
| //! | ||
| struct P { | ||
| child: Option<Box<P>>, | ||
| } | ||
| trait PTrait { | ||
| fn getChildOption(&self) -> Option<Box<P>>; | ||
| } | ||
| impl PTrait for P { | ||
| fn getChildOption(&self) -> Option<Box<P>> { | ||
| static childVal: Box<P> = self.child.get(); | ||
| //~^ ERROR attempt to use a non-constant value in a constant | ||
| panic!(); | ||
| } | ||
| } | ||
| fn main() {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| error[E0435]: attempt to use a non-constant value in a constant | ||
| --> $DIR/static-in-method-cannot-use-self.rs:12:35 | ||
| | | ||
| LL | static childVal: Box<P> = self.child.get(); | ||
| | ^^^^ non-constant value | ||
| | | ||
| help: consider using `let` instead of `static` | ||
| | | ||
| LL - static childVal: Box<P> = self.child.get(); | ||
| LL + let childVal: Box<P> = self.child.get(); | ||
| | | ||
| error: aborting due to 1 previous error | ||
| For more information about this error, try `rustc --explain E0435`. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove all such comments except this one