Skip to content

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 2 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/source/issue-2947.rs
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,
)
}
}
}
}
11 changes: 11 additions & 0 deletions tests/source/issue-2978.rs
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
};
}
35 changes: 35 additions & 0 deletions tests/source/issue-3206.rs
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",
))
}
}
16 changes: 16 additions & 0 deletions tests/target/issue-1762.rs
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());
}
Copy link
Member

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

let a = b.iter()
         .map(|m| {
             m.hi()
});

3 changes: 3 additions & 0 deletions tests/target/issue-2388.rs
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,)*)))
}
64 changes: 64 additions & 0 deletions tests/target/issue-2672.rs
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,
) {
}
}
Copy link
Member

Choose a reason for hiding this comment

The 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>
{
}
}
}
}
}
}
}
}
}
}
}
}
}
}
41 changes: 41 additions & 0 deletions tests/target/issue-2755.rs
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);
};
}
28 changes: 28 additions & 0 deletions tests/target/issue-2947.rs
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,
)
}
}
}
}
12 changes: 12 additions & 0 deletions tests/target/issue-2978.rs
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
};
}
14 changes: 14 additions & 0 deletions tests/target/issue-3148.rs
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,
}
25 changes: 25 additions & 0 deletions tests/target/issue-3206.rs
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",
));
}
}
}