Skip to content

Commit 398b57a

Browse files
committed
Removed TODOs and code that didn't turn out to be necessary
1 parent 7eafdd7 commit 398b57a

File tree

3 files changed

+0
-49
lines changed

3 files changed

+0
-49
lines changed

gdnative-derive/src/extend_bounds.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ impl<'ast> Visit<'ast> for BoundsVisitor<'ast> {
2424
if self.all_type_params.contains(&seg.ident) {
2525
// if the first segment of the type path is a known type variable, then this
2626
// is likely an associated type
27-
// TODO: what about cases like <Foo<T> as Trait>::A? Maybe too fringe to be
28-
// useful? serde_derive can't seem to parse these either. Probably good enough.
2927
self.used.insert(type_path);
3028
}
3129
}

impl/proc-macros/src/doc.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,6 @@
11
use syn::visit_mut::VisitMut;
22
use syn::{Attribute, ItemFn, ItemImpl};
33

4-
/*
5-
Leaving code commented-out, as this might be very useful elsewhere
6-
7-
use proc_macro2::TokenStream;
8-
use quote::ToTokens;
9-
use syn::{Item};
10-
pub fn variant_collection_safety(
11-
_attr: proc_macro::TokenStream,
12-
item: proc_macro::TokenStream,
13-
) -> Result<TokenStream, syn::Error> {
14-
let mut item = syn::parse::<Item>(item)?;
15-
let mut visit = IncludeDocs {
16-
docs: &[
17-
"# Safety",
18-
"",
19-
"Generally, it's not recommended to mutate variant collections that may be shared. Prefer",
20-
"`ThreadLocal` or `Unique` collections instead. If you're sure that the current reference",
21-
"is unique, you may use [`assume_unique`](#method.assume_unique) to convert it to a `Unique`",
22-
"collection. You may subsequently use [`into_thread_local`](#method.into_thread_local) to",
23-
"convert it to a `ThreadLocal` one.",
24-
"",
25-
"It is only safe to perform operations that may allocate on a shared collection when no",
26-
"other thread may access the underlying collection during the call.",
27-
],
28-
deprecated: Some(concat!(
29-
"Care should be used when mutating shared variant collections. Prefer `ThreadLocal` ",
30-
"or `Unique` collections unless you're absolutely sure that you want this. ",
31-
"You may use [assume_unique](#method.assume_unique) to convert this to a `Unique` ",
32-
"collection if you are sure that this is in fact the only reference."
33-
)),
34-
};
35-
visit.visit_item_mut(&mut item);
36-
Ok(item.to_token_stream())
37-
}
38-
*/
39-
404
struct IncludeDocs<'a> {
415
docs: &'a [&'a str],
426
deprecated: Option<&'a str>,

impl/proc-macros/src/lib.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,6 @@ pub fn decl_typed_array_element(input: TokenStream) -> TokenStream {
2424
.into()
2525
}
2626

27-
/*
28-
Leaving code commented-out, as this might be very useful elsewhere
29-
30-
#[proc_macro_attribute]
31-
pub fn doc_variant_collection_safety(attr: TokenStream, item: TokenStream) -> TokenStream {
32-
self::doc::variant_collection_safety(attr, item)
33-
.unwrap_or_else(to_compile_errors)
34-
.into()
35-
}
36-
*/
37-
3827
fn to_compile_errors(error: syn::Error) -> proc_macro2::TokenStream {
3928
let compile_error = error.to_compile_error();
4029
quote!(#compile_error)

0 commit comments

Comments
 (0)