Skip to content
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

Returning Box<T> #5

Closed
pythonesque opened this issue Nov 19, 2014 · 3 comments · Fixed by #9102
Closed

Returning Box<T> #5

pythonesque opened this issue Nov 19, 2014 · 3 comments · Fixed by #9102
Assignees
Labels
A-lint Area: New lints E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-middle Type: Probably requires verifiying types

Comments

@pythonesque
Copy link
Contributor

pythonesque commented Nov 19, 2014

We explicitly say in the pointer guide that you usually shouldn't do this, return T instead and box it.

@pythonesque
Copy link
Contributor Author

This doesn't (yet) apply to other smart pointer types like Rc and Arc, but will when placement box works.

@Manishearth Manishearth added E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-middle Type: Probably requires verifiying types A-lint Area: New lints labels Aug 11, 2015
@Stebalien
Copy link

When T is Sized.

camsteffen added a commit to camsteffen/rust-clippy that referenced this issue Jan 15, 2021
# This is the 1st commit message:

Split filter_map into manual_filter_map

# The commit message rust-lang#2 will be skipped:

# fixup! Split filter_map into manual_filter_map

# The commit message rust-lang#3 will be skipped:

# fixup! Split filter_map into manual_filter_map

# The commit message rust-lang#4 will be skipped:

# fixup! Split filter_map into manual_filter_map

# The commit message rust-lang#5 will be skipped:

# fixup! Split filter_map into manual_filter_map

# The commit message rust-lang#6 will be skipped:

# fixup! Split filter_map into manual_filter_map
@botahamec
Copy link
Contributor

@rustbot claim

@bors bors closed this as completed in ef3867f Mar 30, 2023
surechen added a commit to surechen/rust-clippy that referenced this issue Jun 26, 2023
commit 3a413b7
Merge: d5a1eff 4d8af6f
Author: surechen <chenshuo17@huawei.com>
Date:   Mon Jun 26 11:32:14 2023 +0800

    Merge pull request rust-lang#5 from mojave2/lint_loop_exit

    new_lint loop_without_break_or_return

commit 4d8af6f
Author: mojave2 <0109chenchen@gmail.com>
Date:   Sun Jun 25 19:21:11 2023 +0800

    new_line loop_without_break_or_return

    Signed-off-by: mojave2 <0109chenchen@gmail.com>

commit d5a1eff
Merge: af6c9d4 9cd4b13
Author: surechen <chenshuo17@huawei.com>
Date:   Mon Jun 26 11:23:44 2023 +0800

    Merge pull request rust-lang#2 from mojave2/dev_stable

    new_lint non_reentrant_functions

commit 9cd4b13
Author: mojave2 <0109chenchen@gmail.com>
Date:   Wed Jun 21 17:44:12 2023 +0800

    update_lint non_reentrant_functions

    Signed-off-by: mojave2 <0109chenchen@gmail.com>

commit c900d4a
Author: mojave2 <0109chenchen@gmail.com>
Date:   Mon Jun 19 18:37:16 2023 +0800

    update_lint non_reentrant_functions

    Signed-off-by: mojave2 <0109chenchen@gmail.com>

commit 9845b3a
Author: mojave2 <0109chenchen@gmail.com>
Date:   Sat Jun 17 16:32:10 2023 +0800

    improve implementation by dogfood

    Signed-off-by: mojave2 <0109chenchen@gmail.com>

commit a3a1415
Author: mojave2 <0109chenchen@gmail.com>
Date:   Sat Jun 17 15:29:11 2023 +0800

    doc-comment non_reentrant_functions

    Signed-off-by: mojave2 <0109chenchen@gmail.com>

commit eb80bb0
Author: mojave2 <0109chenchen@gmail.com>
Date:   Sat Jun 17 15:14:34 2023 +0800

    new_lint non_reentrant_functions

    Signed-off-by: mojave2 <0109chenchen@gmail.com>

commit af6c9d4
Merge: 38ab3a3 33ddd19
Author: surechen <chenshuo17@huawei.com>
Date:   Mon Jun 26 10:54:08 2023 +0800

    Merge pull request rust-lang#7 from J-ZhengLi/dev_stable

    fix test fail after dev fmt of [`implicit_abi`]

commit 33ddd19
Author: J-ZhengLi <lizheng135@huawei.com>
Date:   Mon Jun 26 10:15:26 2023 +0800

    fix test fail after dev fmt of [`implicit_abi`]

    Signed-off-by: J-ZhengLi <lizheng135@huawei.com>

commit 38ab3a3
Merge: 83e42a2 5ce5313
Author: surechen <chenshuo17@huawei.com>
Date:   Mon Jun 26 09:47:22 2023 +0800

    Merge pull request rust-lang#1 from J-ZhengLi/dev_stable

    add new lints: [`mem_unsafe_functions`], [`unsafe_block_in_proc_macro`] and [`implicit_abi`]

commit 5ce5313
Author: J-ZhengLi <lizheng135@huawei.com>
Date:   Wed Jun 21 11:24:29 2023 +0800

    add new lint [`implicit_abi`]
    that detects external block without explicit label "C"

    Signed-off-by: J-ZhengLi <lizheng135@huawei.com>

commit cc5ab4a
Author: J-ZhengLi <lizheng135@huawei.com>
Date:   Tue Jun 20 12:44:02 2023 +0800

    add new lint [`unsafe_block_in_proc_macro`]
    that detects unsafe block in `quote!`

    Signed-off-by: J-ZhengLi <lizheng135@huawei.com>

commit c091b77
Author: J-ZhengLi <lizheng135@huawei.com>
Date:   Sat Jun 17 15:59:56 2023 +0800

    add configuration for lint [`mem_unsafe_functions`];
    finish implement lint [`mem_unsafe_functions`];
    add simple description for unimplemented lints;

    Signed-off-by: J-ZhengLi <lizheng135@huawei.com>

commit a50f308
Author: J-ZhengLi <lizheng135@huawei.com>
Date:   Fri Jun 16 17:45:56 2023 +0800

    init following new lints:

    [`passing_string_to_c_functions`]
    [`untrusted_lib_loading`]
    [`falliable_memory_allocation`]

    Signed-off-by: J-ZhengLi <lizheng135@huawei.com>

commit da3cc15
Author: J-ZhengLi <lizheng135@huawei.com>
Date:   Fri Jun 16 14:11:59 2023 +0800

    add `guidelines` type and barebone for [`mem_unsafe_functions`] lint

    Signed-off-by: J-ZhengLi <lizheng135@huawei.com>

# Conflicts:
#	clippy_lints/src/lib.rs
surechen added a commit to surechen/rust-clippy that referenced this issue Jun 26, 2023
new_lint loop_without_break_or_return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints E-medium Call for participation: Medium difficulty level problem and requires some initial experience. T-middle Type: Probably requires verifiying types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants