Skip to content

Commit b8c3bea

Browse files
bors[bot]MarwesMarkus Westerlind
authored
Merge #841
841: Updates necessary for the language server r=Marwes a=Marwes Co-authored-by: Markus Westerlind <[email protected]> Co-authored-by: Markus Westerlind <[email protected]>
2 parents b605ea8 + 2528876 commit b8c3bea

File tree

29 files changed

+350
-182
lines changed

29 files changed

+350
-182
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
<a name="v0.15.1"></a>
2+
### v0.15.1 (2020-06-20)
3+
4+
5+
#### Bug Fixes
6+
7+
* Allow find_type etc to work without calling global ([6e469b9a](https://github.com/gluon-lang/gluon/commit/6e469b9a311d1bdb7b5e4fc62688fc7d4d08ceea))
8+
9+
#### Features
10+
11+
* Make the query code compatible with the language server ([14e8f1de](https://github.com/gluon-lang/gluon/commit/14e8f1ded3f4e02d6b8ab9c50dbd29b35b534996))
12+
* Add Default for Root/OwnedExpr ([fedb7322](https://github.com/gluon-lang/gluon/commit/fedb732270eb24e544b047e19e5a7533028a2f5b))
13+
14+
15+
116
<a name="v0.15.0"></a>
217
## v0.15.0 (2020-06-06)
318

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gluon"
3-
version = "0.15.0" # GLUON
3+
version = "0.15.1" # GLUON
44
authors = ["Markus <[email protected]>"]
55
keywords = ["script", "scripting", "language"]
66
build = "build.rs"
@@ -26,12 +26,12 @@ name = "gluon"
2626
path = "src/lib.rs"
2727

2828
[dependencies]
29-
gluon_base = { path = "base", version = "0.15.0" } # GLUON
30-
gluon_check = { path = "check", version = "0.15.0" } # GLUON
31-
gluon_parser = { path = "parser", version = "0.15.0" } # GLUON
32-
gluon_codegen = { path = "codegen", version = "0.15.0" } # GLUON
33-
gluon_vm = { path = "vm", version = "0.15.0", default-features = false } # GLUON
34-
gluon_format = { path = "format", version = "0.15.0", default-features = false } # GLUON
29+
gluon_base = { path = "base", version = "0.15.1" } # GLUON
30+
gluon_check = { path = "check", version = "0.15.1" } # GLUON
31+
gluon_parser = { path = "parser", version = "0.15.1" } # GLUON
32+
gluon_codegen = { path = "codegen", version = "0.15.1" } # GLUON
33+
gluon_vm = { path = "vm", version = "0.15.1", default-features = false } # GLUON
34+
gluon_format = { path = "format", version = "0.15.1", default-features = false } # GLUON
3535

3636
async-trait = "0.1"
3737
log = "0.4"
@@ -68,7 +68,7 @@ rand = { version = "0.7", optional = true }
6868
rand_xorshift = { version = "0.2", optional = true }
6969

7070
[build-dependencies]
71-
gluon_base = { path = "base", version = "0.15.0" } # GLUON
71+
gluon_base = { path = "base", version = "0.15.1" } # GLUON
7272

7373
itertools = "0.8"
7474
little-skeptic = { version = "0.15.0", optional = true }
@@ -95,8 +95,8 @@ bincode = "1"
9595

9696
pulldown-cmark = "0.6"
9797

98-
gluon_completion = { path = "completion", version = "0.15.0" } # GLUON
99-
gluon_codegen = { path = "codegen", version = "0.15.0" } # GLUON
98+
gluon_completion = { path = "completion", version = "0.15.1" } # GLUON
99+
gluon_codegen = { path = "codegen", version = "0.15.1" } # GLUON
100100

101101
[features]
102102
default = ["regex", "random"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ Gluon requires a recent Rust compiler to build (1.9.0 or later) and is available
303303

304304
```toml
305305
[dependencies]
306-
gluon = "0.15.0"
306+
gluon = "0.15.1"
307307
```
308308

309309
### Other languages

base/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gluon_base"
3-
version = "0.15.0" # GLUON
3+
version = "0.15.1" # GLUON
44
authors = ["Markus <[email protected]>"]
55
edition = "2018"
66

@@ -33,7 +33,7 @@ either = "1"
3333
vec_map = "0.8"
3434
typed-arena = "1"
3535

36-
gluon_codegen = { version = "0.15.0", path = "../codegen" } # GLUON
36+
gluon_codegen = { version = "0.15.1", path = "../codegen" } # GLUON
3737

3838
serde = { version = "1.0.0", features = ["rc"], optional = true }
3939
serde_state = { version = "0.4.0", features = ["rc"], optional = true }

base/src/ast.rs

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,13 +1287,45 @@ impl_ast_arena! {
12871287
Metadata => metadata,
12881288
}
12891289

1290+
#[doc(hidden)]
1291+
#[derive(Default)]
1292+
pub struct InvariantLifetime<'a>(std::marker::PhantomData<fn(&'a ()) -> &'a ()>);
1293+
1294+
// Copied from the compact_arena crate
1295+
#[macro_export]
1296+
macro_rules! mk_ast_arena {
1297+
($name: ident) => {
1298+
let tag = $crate::ast::InvariantLifetime::default();
1299+
let $name = unsafe { std::sync::Arc::new($crate::ast::Arena::new(&tag)) };
1300+
let _guard;
1301+
// this doesn't make it to MIR, but ensures that borrowck will not
1302+
// unify the lifetimes of two macro calls by binding the lifetime to
1303+
// drop scope
1304+
if false {
1305+
struct Guard<'tag>(&'tag $crate::ast::InvariantLifetime<'tag>);
1306+
impl<'tag> ::core::ops::Drop for Guard<'tag> {
1307+
fn drop(&mut self) {}
1308+
}
1309+
_guard = Guard(&tag);
1310+
}
1311+
};
1312+
}
1313+
12901314
pub struct RootExpr<Id: 'static> {
12911315
// Only used to keep `expr` alive
12921316
#[allow(dead_code)]
12931317
arena: Arc<Arena<'static, Id>>,
12941318
expr: *mut SpannedExpr<'static, Id>,
12951319
}
12961320

1321+
impl<Id: 'static> Default for RootExpr<Id> {
1322+
fn default() -> Self {
1323+
mk_ast_arena!(arena);
1324+
let expr = arena.alloc(SpannedExpr::default());
1325+
RootExpr::new(arena.clone(), expr)
1326+
}
1327+
}
1328+
12971329
impl<Id: Eq> Eq for RootExpr<Id> {}
12981330
impl<Id: PartialEq> PartialEq for RootExpr<Id> {
12991331
fn eq(&self, other: &Self) -> bool {
@@ -1393,6 +1425,12 @@ pub struct OwnedExpr<Id: 'static> {
13931425
expr: *mut SpannedExpr<'static, Id>,
13941426
}
13951427

1428+
impl<Id: 'static> Default for OwnedExpr<Id> {
1429+
fn default() -> Self {
1430+
RootExpr::default().try_into_send().ok().unwrap_or_default()
1431+
}
1432+
}
1433+
13961434
impl<Id: Eq> Eq for OwnedExpr<Id> {}
13971435
impl<Id: PartialEq> PartialEq for OwnedExpr<Id> {
13981436
fn eq(&self, other: &Self) -> bool {
@@ -1449,30 +1487,6 @@ impl<Id> OwnedExpr<Id> {
14491487
}
14501488
}
14511489

1452-
#[doc(hidden)]
1453-
#[derive(Default)]
1454-
pub struct InvariantLifetime<'a>(std::marker::PhantomData<fn(&'a ()) -> &'a ()>);
1455-
1456-
// Copied from the compact_arena crate
1457-
#[macro_export]
1458-
macro_rules! mk_ast_arena {
1459-
($name: ident) => {
1460-
let tag = $crate::ast::InvariantLifetime::default();
1461-
let $name = unsafe { std::sync::Arc::new($crate::ast::Arena::new(&tag)) };
1462-
let _guard;
1463-
// this doesn't make it to MIR, but ensures that borrowck will not
1464-
// unify the lifetimes of two macro calls by binding the lifetime to
1465-
// drop scope
1466-
if false {
1467-
struct Guard<'tag>(&'tag $crate::ast::InvariantLifetime<'tag>);
1468-
impl<'tag> ::core::ops::Drop for Guard<'tag> {
1469-
fn drop(&mut self) {}
1470-
}
1471-
_guard = Guard(&tag);
1472-
}
1473-
};
1474-
}
1475-
14761490
pub trait AstClone<'ast, Id> {
14771491
fn ast_clone(&self, arena: ArenaRef<'_, 'ast, Id>) -> Self;
14781492
}

base/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc(html_root_url = "https://docs.rs/gluon_base/0.15.0")] // # GLUON
1+
#![doc(html_root_url = "https://docs.rs/gluon_base/0.15.1")] // # GLUON
22
#![allow(unknown_lints)]
33
//! The base crate contains pervasive types used in the compiler such as type representations, the
44
//! AST and some basic containers.

c-api/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gluon_c-api"
3-
version = "0.15.0" # GLUON
3+
version = "0.15.1" # GLUON
44
authors = ["Markus Westerlind <[email protected]>"]
55
edition = "2018"
66

@@ -19,7 +19,7 @@ travis-ci = { repository = "gluon-lang/gluon" }
1919
crate-type = ["cdylib"]
2020

2121
[dependencies]
22-
gluon = { version = "0.15.0", path = ".." } # GLUON
22+
gluon = { version = "0.15.1", path = ".." } # GLUON
2323
futures = "0.3"
2424

2525
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

c-api/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! A (WIP) C API allowing use of gluon in other langauges than Rust.
2-
#![doc(html_root_url = "https://docs.rs/gluon_c-api/0.15.0")] // # GLUON
2+
#![doc(html_root_url = "https://docs.rs/gluon_c-api/0.15.1")] // # GLUON
33

44
use std::{slice, str};
55

check/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "gluon_check"
3-
version = "0.15.0" # GLUON
3+
version = "0.15.1" # GLUON
44
authors = ["Markus <[email protected]>"]
55
edition = "2018"
66

@@ -30,13 +30,13 @@ codespan-reporting = "0.3"
3030

3131
strsim = "0.9.0"
3232

33-
gluon_base = { path = "../base", version = "0.15.0" } # GLUON
34-
gluon_codegen = { path = "../codegen", version = "0.15.0" } # GLUON
33+
gluon_base = { path = "../base", version = "0.15.1" } # GLUON
34+
gluon_codegen = { path = "../codegen", version = "0.15.1" } # GLUON
3535

3636
[dev-dependencies]
3737
env_logger = "0.7"
3838

39-
gluon_parser = { path = "../parser", version = "0.15.0" } # GLUON
39+
gluon_parser = { path = "../parser", version = "0.15.1" } # GLUON
4040
gluon_format = { path = "../format", version = ">=0.9" }
4141

4242
collect-mac = "0.1.0"

0 commit comments

Comments
 (0)