-
Notifications
You must be signed in to change notification settings - Fork 933
Prune stale issues #4246
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
Merged
Merged
Prune stale issues #4246
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,25 @@ | ||
// rustfmt-force_multiline_blocks: true | ||
|
||
impl fmt::Display for DeriveError { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
match self { | ||
DeriveError::UnionUnsupported(name) => { | ||
write!(f, "Cannot derive `Spaned` for `union {}`", name) | ||
} | ||
DeriveError::UnitStructUnsupported(name) => { | ||
write!(f, "Cannot derive `Spanned` for `struct {};`", name) | ||
} | ||
DeriveError::NamedStructLacksSpan(name) => write!( | ||
f, | ||
"Cannot derive `Spanned` for `struct {}` as it lacks a field `span`", | ||
name | ||
), | ||
DeriveError::TupleStructNotNewtype(name) => { | ||
write!(f, | ||
"Cannot derive `Spanned` for `struct {}` as it does not have a single tuple member", | ||
name, | ||
) | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or 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,11 @@ | ||
// rustfmt-control_brace_style: ClosingNextLine | ||
|
||
pub fn test() { | ||
let xxxxxxxxxxxxxxxxxxxxxxxxxxxx = yyyyyyyyyyyyyyyy | zzzzzzzzzzzzzzzzzzzzzzzz | if for_writing | ||
{ | ||
fffffffffffffffffffff | ||
} | ||
else { | ||
g | ||
}; | ||
} |
This file contains hidden or 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,35 @@ | ||
fn apply_arithmetic_operation<'a>(op: ArithmeticOperation, state: &mut State) -> Result<'a, ()> { | ||
match ( state.stack.pop (), state.stack.pop () ) | ||
|
||
|
||
|
||
|
||
|
||
{ | ||
(Some(value1), Some(value2)) => { | ||
|
||
|
||
|
||
match (value1, value2) { | ||
(Value::Number(num1), Value::Number(num2)) => { | ||
let result = match op { | ||
ArithmeticOperation::Addition => num1 + num2, | ||
ArithmeticOperation::Subtraction => num1 - num2, | ||
ArithmeticOperation::Multiplication => num1 * num2, | ||
ArithmeticOperation::Division => num1 /num2, | ||
ArithmeticOperation::Remainder => num1 % num2, | ||
}; | ||
state.stack.push(Value::Number(result)); | ||
Ok(()) | ||
} | ||
_ => | ||
Err(Error::RuntimeError( | ||
"cannot sum values on top of stack: the two topmost values on the stack should be numbers", | ||
)) | ||
}} | ||
_ => | ||
return Err(Error::RuntimeError( | ||
"cannot sum values on top of stack: there must be at least two values on the stack", | ||
)) | ||
} | ||
} |
This file contains hidden or 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 @@ | ||
// rustfmt-indent_style: Visual | ||
// rustfmt-max_width: 30 | ||
|
||
fn main() { | ||
let grammar: Vec<_> = ast | ||
.attrs | ||
.iter() | ||
.filter(|attr| match attr.value { | ||
MetaItem::NameValue(ref ident, _) => format!("{}", ident) == "grammar", | ||
_ => false, | ||
}) | ||
.collect(); | ||
|
||
let a = b.iter() | ||
.map(|m| m.hi()); | ||
} | ||
This file contains hidden or 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,3 @@ | ||
macro lex_err($kind: ident $(, $body: expr)*) { | ||
Err(QlError::LexError(LexError::$kind($($body,)*))) | ||
} |
This file contains hidden or 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,64 @@ | ||
fn main() { | ||
fn test( | ||
averylongname_asdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdsffffffffffffffffffffffffffffffffffffffffffffffff: i32, | ||
) { | ||
} | ||
fn test( | ||
shortname: i32, | ||
averylongname_asdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdsffffffffffffffffffffffffffffffffffffffffffffffff: i32, | ||
) { | ||
} | ||
|
||
let averylongname_asdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff = | ||
0; | ||
} | ||
|
||
mod asdf { | ||
fn test( | ||
averylongname_asdfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdsffffffffffffffffffffffffffffffffffffffffffffffff: i32, | ||
) { | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we include the other snippets posted in #2672 (comment) on that thread? |
||
|
||
impl Something { | ||
fn my_function_name_is_way_to_long_but_used_as_a_case_study_or_an_example_its_fine() | ||
-> Result<(), String> { | ||
} | ||
} | ||
|
||
impl Something { | ||
fn my_function_name() | ||
-> HashMap<(String, String, (String, String)), (String, String, String, String)> { | ||
} | ||
} | ||
|
||
mod A { | ||
mod B { | ||
mod C { | ||
mod D { | ||
mod E { | ||
mod F { | ||
mod G { | ||
mod H { | ||
mod I { | ||
mod J { | ||
mod K { | ||
mod L { | ||
mod M { | ||
fn setup_happy_path() | ||
-> Result<String, CustomTypeA> | ||
{ | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or 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,41 @@ | ||
macro_rules! __diesel_operator_to_sql { | ||
( | ||
notation = infix, | ||
operator_expr = $op:expr, | ||
field_exprs = ($left:expr, $right:expr), | ||
) => { | ||
$left; | ||
$op; | ||
$right; | ||
}; | ||
|
||
( | ||
notation = postfix, | ||
operator_expr = $op:expr, | ||
field_exprs = ($expr:expr), | ||
) => { | ||
$expr; | ||
$op; | ||
}; | ||
|
||
( | ||
notation = prefix, | ||
operator_expr = $op:expr, | ||
field_exprs = ($expr:expr), | ||
) => { | ||
$op; | ||
$expr; | ||
}; | ||
|
||
($name:ident, $operator:expr, backend: $backend:ty) => { | ||
diesel_postfix_operator!($name, $operator, $crate::sql_types::Bool, backend: $backend); | ||
}; | ||
|
||
($name:ident, $operator:expr, $return_ty:ty, backend: $backend:ty) => { | ||
__diesel_operator_body!(notation = postfix, struct_name = $name,) | ||
}; | ||
|
||
($name:ident, $operator:expr, backend: $backend:ty) => { | ||
diesel_prefix_operator!($name, $operator, $crate::sql_types::Bool, backend: $backend); | ||
}; | ||
} |
This file contains hidden or 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,28 @@ | ||
// rustfmt-force_multiline_blocks: true | ||
|
||
impl fmt::Display for DeriveError { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
match self { | ||
DeriveError::UnionUnsupported(name) => { | ||
write!(f, "Cannot derive `Spaned` for `union {}`", name) | ||
} | ||
DeriveError::UnitStructUnsupported(name) => { | ||
write!(f, "Cannot derive `Spanned` for `struct {};`", name) | ||
} | ||
DeriveError::NamedStructLacksSpan(name) => { | ||
write!( | ||
f, | ||
"Cannot derive `Spanned` for `struct {}` as it lacks a field `span`", | ||
name | ||
) | ||
} | ||
DeriveError::TupleStructNotNewtype(name) => { | ||
write!( | ||
f, | ||
"Cannot derive `Spanned` for `struct {}` as it does not have a single tuple member", | ||
name, | ||
) | ||
} | ||
} | ||
} | ||
} |
This file contains hidden or 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,12 @@ | ||
// rustfmt-control_brace_style: ClosingNextLine | ||
|
||
pub fn test() { | ||
let xxxxxxxxxxxxxxxxxxxxxxxxxxxx = yyyyyyyyyyyyyyyy | ||
| zzzzzzzzzzzzzzzzzzzzzzzz | ||
| if for_writing { | ||
fffffffffffffffffffff | ||
} | ||
else { | ||
g | ||
}; | ||
} |
This file contains hidden or 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,14 @@ | ||
// rustfmt-hard_tabs: true | ||
// rustfmt-normalize_comments: true | ||
|
||
/// ``` | ||
/// Data { | ||
/// a: "some text data", | ||
/// ..Default::default() | ||
/// }; | ||
/// ``` | ||
#[derive(Default)] | ||
pub struct Data { | ||
a: &str, | ||
b: u32, | ||
} |
This file contains hidden or 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,25 @@ | ||
fn apply_arithmetic_operation<'a>(op: ArithmeticOperation, state: &mut State) -> Result<'a, ()> { | ||
match (state.stack.pop(), state.stack.pop()) { | ||
(Some(value1), Some(value2)) => match (value1, value2) { | ||
(Value::Number(num1), Value::Number(num2)) => { | ||
let result = match op { | ||
ArithmeticOperation::Addition => num1 + num2, | ||
ArithmeticOperation::Subtraction => num1 - num2, | ||
ArithmeticOperation::Multiplication => num1 * num2, | ||
ArithmeticOperation::Division => num1 / num2, | ||
ArithmeticOperation::Remainder => num1 % num2, | ||
}; | ||
state.stack.push(Value::Number(result)); | ||
Ok(()) | ||
} | ||
_ => Err(Error::RuntimeError( | ||
"cannot sum values on top of stack: the two topmost values on the stack should be numbers", | ||
)), | ||
}, | ||
_ => { | ||
return Err(Error::RuntimeError( | ||
"cannot sum values on top of stack: there must be at least two values on the stack", | ||
)); | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we also include the snippet from the OP in the referenced iss